/* Neo-Brutalist Styling */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #ffffff;
    color: #000000;
    margin: 0;
    padding: 10px;
    overflow: hidden;
    height: 100vh;
}

.calculator-container {
    background: #ffff00;
    padding: 15px;
    border: 4px solid #000000;
    border-radius: 0;
    box-shadow: 8px 8px 0px 0px #000000;
    width: 100%;
    height: calc(100vh - 20px);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content-wrapper {
    display: flex;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

.cards-overview-panel {
    flex: 0 0 250px;
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 0;
    padding: 10px;
    box-shadow: 4px 4px 0px 0px #000000;
    overflow-y: auto;
    min-width: 0;
}

.cards-overview-panel h2 {
    font-size: 0.9rem;
    margin: 0 0 10px 0;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.suit-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-section {
    flex: 0 0 284px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

.results-section-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

h1, h2, h3, h4 {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-align: center;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 5px 0;
}

h1 {
    font-size: 1.5rem;
    border: 3px solid #000000;
    padding: 8px;
    background: #000000;
    color: #ffff00;
    box-shadow: 4px 4px 0px 0px #000000;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.1rem;
    border-bottom: 3px solid #000000;
    padding-bottom: 5px;
    margin: 10px 0 5px 0;
}

.cards-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

#players-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    flex-shrink: 0;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
    border: 2px solid #000000;
    background: #f0f0f0;
    box-shadow: 2px 2px 0px 0px #000000;
}

.card-group {
    background: #00ffff;
    padding: 10px;
    border: 3px solid #000000;
    border-radius: 0;
    text-align: center;
    box-shadow: 4px 4px 0px 0px #000000;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.player-group {
    flex: 0 0 auto;
    min-height: auto;
    flex-shrink: 0;
    padding: 8px;
    min-width: 0;
    width: 100%;
}

.player-group h2 {
    font-size: 0.8rem;
    margin: 0 0 5px 0;
}

.card-group h2 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.player-header h2 {
    margin: 0;
    flex: 1;
    font-size: 0.8rem;
}

.remove-player-btn {
    background-color: #ff0000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    width: 24px;
    height: 24px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: 2px 2px 0px 0px #000000;
    transition: transform 0.1s, box-shadow 0.1s;
    font-family: 'Courier New', Courier, monospace;
}

.remove-player-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px 0px #000000;
}

.add-player-btn {
    font-family: 'Courier New', Courier, monospace;
    display: block;
    width: 100%;
    padding: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #000000;
    background-color: #00ff00;
    border: 3px solid #000000;
    border-radius: 0;
    cursor: pointer;
    margin: 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 4px 4px 0px 0px #000000;
    transition: transform 0.1s, box-shadow 0.1s;
}

.add-player-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px 0px #000000;
}

.add-player-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
    box-shadow: 4px 4px 0px 0px #666666;
}

.card-slots {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    transition: background-color 0.2s;
}

#board-card-inputs, #seen-card-inputs {
    flex: 1;
}

/* Card Images */
.card-image {
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    width: 60px;
    height: 85px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    font-weight: bold;
    box-shadow: 3px 3px 0px 0px #000000;
    position: relative;
    user-select: none;
}

.card-image.small {
    width: 45px;
    height: 65px;
    padding: 3px;
    font-size: 0.7rem;
    box-shadow: 2px 2px 0px 0px #000000;
}

.card-image.clickable {
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.card-image.clickable:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px 0px #000000;
}

.card-image.draggable {
    cursor: grab;
}

.card-image.draggable:active {
    cursor: grabbing;
}

.card-image.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.card-image.selected {
    opacity: 0.3;
    filter: grayscale(100%);
    cursor: not-allowed;
}

.card-image.clickable.selected:hover {
    transform: none;
    box-shadow: 2px 2px 0px 0px #000000;
}

.card-rank-top, .card-rank-bottom {
    font-size: 1rem;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.card-image.small .card-rank-top,
.card-image.small .card-rank-bottom {
    font-size: 0.7rem;
}

.card-suit {
    font-size: 1.5rem;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.card-image.small .card-suit {
    font-size: 1.1rem;
}

.card-rank-bottom {
    transform: rotate(180deg);
}

.card-slots.drag-over {
    background-color: rgba(255, 255, 0, 0.2);
    border: 2px dashed #000000;
}

.card-slot {
    width: 45px;
    height: 65px;
    border: 3px dashed #666666;
    border-radius: 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.card-slot.active {
    border: 3px solid #000000;
    background: #ffff00;
    box-shadow: 3px 3px 0px 0px #000000;
}

.card-slot:not(.active):hover {
    border-color: #000000;
    background: #e0e0e0;
}

.card-slot.empty::after {
    content: '+';
    font-size: 2rem;
    color: #999999;
    font-weight: bold;
}

.card-slot.active.empty::after {
    color: #000000;
}

.card-slot .card-image {
    width: 100%;
    height: 100%;
    box-shadow: none;
    cursor: pointer;
}

.card-slot .card-image:hover {
    transform: scale(1.05);
}

#add-seen-card-btn, #calculate-btn {
    font-family: 'Courier New', Courier, monospace;
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #000000;
    background-color: #ffffff;
    border: 3px solid #000000;
    border-radius: 0;
    cursor: pointer;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 4px 4px 0px 0px #000000;
    transition: transform 0.1s, box-shadow 0.1s;
}

#calculate-btn {
    background-color: #000000;
    color: #ffff00;
    margin-top: 10px;
    font-size: 1rem;
    padding: 12px;
}

#add-seen-card-btn {
    background-color: #ff00ff;
    color: #000000;
    font-size: 0.8rem;
    padding: 6px;
    margin-top: 5px;
}

#add-seen-card-btn:hover, #calculate-btn:hover {
    transform: translate(4px, 4px);
    box-shadow: 2px 2px 0px 0px #000000;
}

#add-seen-card-btn:active, #calculate-btn:active {
    transform: translate(6px, 6px);
    box-shadow: 0px 0px 0px 0px #000000;
}

#calculate-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
    box-shadow: 6px 6px 0px 0px #666666;
}

.remove-seen-card-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff0000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    width: 20px;
    height: 20px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: 2px 2px 0px 0px #000000;
    transition: transform 0.1s, box-shadow 0.1s;
    font-family: 'Courier New', Courier, monospace;
    z-index: 10;
}

.remove-seen-card-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px 0px #000000;
}

.remove-seen-card-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px 0px #000000;
}

#loading-indicator {
    margin-top: 10px;
    padding: 10px;
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 0;
    text-align: center;
    box-shadow: 4px 4px 0px 0px #000000;
}

.loading-text {
    margin-bottom: 8px;
    color: #000000;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: #00ff00;
    width: 0%;
    transition: width 0.2s linear;
    border-right: 3px solid #000000;
}

#results-section {
    padding: 15px;
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 0;
    box-shadow: 6px 6px 0px 0px #000000;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#results-section h2 {
    margin-top: 0;
}

.hidden {
    display: none;
}

#win-percentage {
    margin-bottom: 10px;
}

.calculation-method {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    font-weight: bold;
    color: #000000;
    background-color: #ffff00;
    border: 2px solid #000000;
    padding: 6px 10px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 3px 3px 0px 0px #000000;
    text-align: center;
}

.win-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
}

.stat-win {
    color: #000000;
    background: #00ff00;
    padding: 8px 12px;
    border: 3px solid #000000;
    box-shadow: 4px 4px 0px 0px #000000;
}

.stat-tie {
    color: #000000;
    background: #ffff00;
    padding: 8px 12px;
    border: 3px solid #000000;
    box-shadow: 4px 4px 0px 0px #000000;
}

.stat-loss {
    color: #ffffff;
    background: #ff0000;
    padding: 8px 12px;
    border: 3px solid #000000;
    box-shadow: 4px 4px 0px 0px #000000;
}

.player-results-section {
    margin-bottom: 15px;
    padding: 10px;
    border: 3px solid #000000;
    background: #ffffff;
    box-shadow: 4px 4px 0px 0px #000000;
}

.player-results-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
    text-transform: uppercase;
    border-bottom: 2px solid #000000;
    padding-bottom: 5px;
}

.player-hand-results-section {
    margin-bottom: 20px;
    padding: 10px;
    border: 3px solid #000000;
    background: #f0f0f0;
    box-shadow: 4px 4px 0px 0px #000000;
}

.player-results-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
    text-transform: uppercase;
    border-bottom: 2px solid #000000;
    padding-bottom: 5px;
    color: #000000;
}

#best-hands-list {
    margin-top: 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.current-hand {
    background: #ffffff;
    padding: 10px;
    border: 3px solid #000000;
    border-radius: 0;
    margin-bottom: 10px;
    box-shadow: 4px 4px 0px 0px #000000;
}

.current-hand h4 {
    margin-top: 0;
    color: #000000;
    text-transform: uppercase;
    border-bottom: 2px solid #000000;
    padding-bottom: 5px;
    font-size: 0.9rem;
}

.hand-display {
    padding: 10px;
    border: 3px solid #000000;
    border-radius: 0;
    margin-top: 8px;
    box-shadow: 3px 3px 0px 0px #000000;
}

.hand-very-strong {
    background: #00ff00;
    border: 3px solid #000000;
}

.hand-strong {
    background: #00ffff;
    border: 3px solid #000000;
}

.hand-moderate {
    background: #ffff00;
    border: 3px solid #000000;
}

.hand-weak {
    background: #ffaa00;
    border: 3px solid #000000;
}

.hand-very-weak {
    background: #ff0000;
    border: 3px solid #000000;
    color: #ffffff;
}

.hand-cards {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.hand-combinations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hand-item {
    margin-bottom: 8px;
    padding: 8px;
    border: 3px solid #000000;
    border-radius: 0;
    box-shadow: 4px 4px 0px 0px #000000;
}

.hand-item.hand-very-strong {
    background: #00ff00;
    border: 3px solid #000000;
}

.hand-item.hand-strong {
    background: #00ffff;
    border: 3px solid #000000;
}

.hand-item.hand-moderate {
    background: #ffff00;
    border: 3px solid #000000;
}

.hand-item.hand-weak {
    background: #ffaa00;
    border: 3px solid #000000;
}

.hand-item.hand-very-weak {
    background: #ff0000;
    border: 3px solid #000000;
    color: #ffffff;
}

.hand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.hand-name-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hand-name {
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hand-strength {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.hand-probability {
    font-weight: bold;
    font-size: 0.8rem;
    color: #000000;
    background: #ffffff;
    padding: 4px 8px;
    border: 2px solid #000000;
}

.hand-item.hand-very-weak .hand-probability {
    color: #ffffff;
    background: #000000;
    border: 3px solid #ffffff;
}

.hand-examples {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.example-hand {
    background: #ffffff;
    padding: 4px 8px;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 3px 3px 0px 0px #000000;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

.hand-item.hand-very-weak .example-hand {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.example-hand .card-image {
    margin: 0;
}

.card-image.player-hand-card {
    position: relative;
}

.card-image.player-hand-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 6px,
        rgba(255, 255, 0, 0.5) 6px,
        rgba(255, 255, 0, 0.5) 12px
    );
    pointer-events: none;
    z-index: 1;
}

.card-image.player-hand-card.small::before {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(255, 255, 0, 0.5) 4px,
        rgba(255, 255, 0, 0.5) 8px
    );
}

#best-hands-list h4 {
    font-size: 0.9rem;
    margin: 10px 0 5px 0;
}
