body {
    min-height: 100vh;
}

.game-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px;
}

.header h1 {
    color: var(--primary-color, #2c3e50);
}

.lobby-back-btn,
#back-to-modes-from-setup {
    margin-top: 14px;
}

.setup-screen {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
    margin: 20px auto;
    max-width: 480px;
    padding: 24px;
    text-align: center;
}

.input-group {
    margin: 16px auto;
    max-width: 320px;
    text-align: left;
}

.input-group label {
    color: #263445;
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.input-group input,
.input-group select {
    border: 2px solid #d8dee9;
    border-radius: 10px;
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

.game-screen {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.turn-indicator {
    align-items: center;
    background: #edf2ff;
    border: 2px solid #9db5ff;
    border-radius: 999px;
    color: #21346b;
    display: flex;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 8px 16px;
    text-align: center;
}

.turn-indicator.your-turn {
    background: #e7f8ed;
    border-color: #38a169;
    color: #14532d;
}

.turn-indicator.waiting {
    background: #fff7df;
    border-color: #f5b942;
    color: #6b4a00;
}

.game-message {
    background: #1a1a2e;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    min-height: 42px;
    padding: 11px 14px;
    text-align: center;
}

.opponents-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.opponent-pill {
    align-items: center;
    background: #ffffff;
    border: 2px solid #d7dde8;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
}

.opponent-pill.active {
    border-color: #ffb703;
    box-shadow: 0 0 0 4px rgba(255, 183, 3, 0.18);
}

.opponent-name-label {
    color: #243447;
    font-weight: 800;
}

.card-count-badge {
    background: #263445;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    padding: 4px 9px;
}

.play-area {
    align-items: center;
    background: radial-gradient(circle at center, #2fb56f 0%, #17824d 58%, #0f5e38 100%);
    border: 4px solid #0b4c2e;
    border-radius: 24px;
    box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(15, 23, 42, 0.18);
    display: grid;
    gap: 24px;
    grid-template-columns: 150px minmax(130px, 1fr) 190px;
    min-height: 245px;
    padding: 24px;
}

.discard-area,
.current-state-panel {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pile-label,
.state-label {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.current-state-panel {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;
    padding: 16px;
}

.current-suit-indicator,
.current-rank-indicator {
    background: #ffffff;
    border-radius: 12px;
    color: #172033;
    font-size: 1.08rem;
    font-weight: 900;
    margin-bottom: 12px;
    min-width: 120px;
    padding: 9px 12px;
    text-align: center;
}

.current-suit-indicator.hearts,
.current-suit-indicator.diamonds {
    color: #b91c1c;
}

.current-suit-indicator.clubs,
.current-suit-indicator.spades {
    color: #111827;
}

.ce-card {
    align-items: center;
    background: #ffffff;
    border: 3px solid #f8fafc;
    border-radius: 14px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.22);
    color: #111827;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    font-weight: 900;
    height: 132px;
    justify-content: space-between;
    padding: 9px;
    position: relative;
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    user-select: none;
    width: 92px;
}

button.ce-card {
    font: inherit;
}

.ce-card:hover:not(:disabled),
.ce-card.playable:hover {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.3);
    transform: translateY(-8px);
}

.ce-card.dimmed {
    cursor: not-allowed;
    opacity: 0.42;
}

.ce-card.playable {
    outline: 4px solid rgba(250, 204, 21, 0.85);
    outline-offset: 2px;
}

.card-corner {
    align-self: stretch;
    display: flex;
    font-size: 0.95rem;
    justify-content: space-between;
    line-height: 1;
}

.card-center {
    align-items: center;
    display: flex;
    flex-direction: column;
    font-size: 2rem;
    gap: 2px;
    justify-content: center;
    line-height: 1.05;
}

.card-rank-label {
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.ce-card.hearts,
.ce-card.diamonds {
    color: #c1121f;
}

.ce-card.clubs,
.ce-card.spades {
    color: #111827;
}

.ce-card.eight-card {
    background: linear-gradient(135deg, #fff 0%, #fff 46%, #fff4cc 47%, #ffe082 100%);
}

.card-back {
    background: linear-gradient(135deg, #1a1a2e 0%, #28345f 100%);
    border-color: #ffffff;
    color: #ffffff;
    justify-content: center;
    gap: 10px;
}

.card-back.empty {
    background: #6b7280;
    cursor: not-allowed;
}

.back-symbol {
    font-size: 2.3rem;
}

.deck-count {
    font-size: 0.82rem;
}

.discard-pile-container {
    min-height: 132px;
    min-width: 92px;
}

.hand-section {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
    padding: 16px;
}

.hand-section h2 {
    color: #263445;
    font-size: 1.05rem;
    margin: 0 0 12px;
}

.player-hand {
    display: flex;
    gap: 10px;
    min-height: 146px;
    overflow-x: auto;
    padding: 8px 4px 14px;
}

.player-hand .ce-card {
    flex: 0 0 auto;
}

.action-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.action-bar button,
.setup-screen button {
    min-width: 132px;
}

.score-summary {
    background: #f8fafc;
    border: 2px solid #dbe4f0;
    border-radius: 14px;
    color: #1f2937;
    padding: 14px;
}

.score-summary h3 {
    margin: 0 0 8px;
}

.score-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.score-list li {
    align-items: center;
    display: flex;
    justify-content: space-between;
    list-style: none;
}

.suit-picker-modal {
    align-items: center;
    background: rgba(15, 23, 42, 0.64);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 20px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
}

.suit-picker-content {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    max-width: 420px;
    padding: 24px;
    text-align: center;
    width: 100%;
}

.suit-picker-content h3 {
    color: #1f2937;
    margin-top: 0;
}

.suit-options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.suit-btn {
    align-items: center;
    background: #f8fafc;
    border: 2px solid #d8dee9;
    border-radius: 12px;
    color: #111827;
    cursor: pointer;
    display: flex;
    font-weight: 900;
    gap: 8px;
    justify-content: center;
    padding: 13px;
}

.suit-btn span {
    font-size: 1.5rem;
}

.suit-btn.hearts,
.suit-btn.diamonds {
    color: #b91c1c;
}

.suit-btn:hover,
.suit-btn:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
    outline: none;
}

.online-info {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.opponent-name {
    color: #4b5563;
    font-weight: 700;
}

.hidden {
    display: none !important;
}

@media (max-width: 760px) {
    .game-container {
        padding: 10px;
    }

    .play-area {
        gap: 14px;
        grid-template-columns: 1fr 1fr;
        padding: 16px;
    }

    .current-state-panel {
        grid-column: 1 / -1;
        width: 100%;
    }

    .ce-card {
        height: 112px;
        width: 78px;
    }

    .discard-pile-container {
        min-height: 112px;
        min-width: 78px;
    }

    .card-center {
        font-size: 1.55rem;
    }
}

@media (max-width: 480px) {
    .play-area {
        grid-template-columns: 1fr;
    }

    .ce-card {
        height: 104px;
        width: 72px;
    }

    .player-hand {
        min-height: 118px;
    }

    .action-bar button,
    .setup-screen button {
        width: 100%;
    }

    .suit-options {
        grid-template-columns: 1fr;
    }
}
