* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --felt-dark: #0b1f16;
    --felt-mid: #123626;
    --felt-light: #1c4d36;
    --gold: #d4af37;
    --gold-soft: #c49b2b;
    --ink: #0e0e0e;
    --silver: #c7c7c7;
    --panel: #141414;
    --panel-soft: #1b1b1b;
    --accent: #0f6b3f;
    --accent-2: #7a5d1a;
    --danger: #c0392b;
    --info: #2c5d8a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(1200px 700px at 50% 20%, var(--felt-light) 0%, var(--felt-mid) 45%, var(--felt-dark) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #f2f2f2;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.container {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
    padding: 40px;
    border-radius: 18px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
    text-align: center;
    min-width: 400px;
    border: 1px solid rgba(212, 175, 55, 0.25);
}

h1 {
    color: var(--gold);
    margin-bottom: 30px;
    font-size: 2.4em;
    letter-spacing: 1px;
}

h2 {
    color: var(--silver);
    margin-bottom: 20px;
}

.subtitle {
    color: var(--gold);
    font-size: 14px;
    margin-top: -15px;
    margin-bottom: 30px;
    font-style: italic;
    letter-spacing: 0.5px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

input {
    padding: 15px;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #111;
    color: #f1f1f1;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

button {
    padding: 14px 28px;
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-soft) 100%);
    color: #1a1408;
    border: 1px solid #b98d21;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    border-color: #444;
}

.info {
    color: #9a9a9a;
    font-size: 14px;
    margin-top: 15px;
}

/* Lobby */
#playersList {
    margin: 30px 0;
}

#playersUl {
    list-style: none;
    padding: 0;
}

#playersUl li {
    background: #1a1a1a;
    padding: 14px;
    margin: 10px 0;
    border-radius: 10px;
    font-weight: 600;
    color: #e6e6e6;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Game Screen */
.game-container {
    background: radial-gradient(1000px 700px at 50% 35%, var(--felt-light) 0%, var(--felt-mid) 45%, var(--felt-dark) 100%);
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(212, 175, 55, 0.18);
}

.players-circle {
    position: relative;
    width: 100%;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    max-height: 500px;
}

.player-position {
    position: absolute;
    width: 130px;
    height: 130px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    color: #f2f2f2;
    font-weight: 600;
    backdrop-filter: blur(6px);
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.player-position.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.45);
    transform: scale(1.04);
}

.player-position.top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.player-position.right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.player-position.bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.player-position.left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.player-name {
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: bold;
}

.player-cards {
    font-size: 12px;
    color: var(--gold);
}

.player-cards.warning {
    color: #e57373;
    font-weight: 700;
    animation: pulse 0.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Game centrum */
.game-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.discard-pile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.discard-pile p {
    color: white;
    margin: 0;
    font-size: 16px;
}

.draw-button {
    padding: 14px 30px;
    font-size: 16px;
    background: linear-gradient(180deg, #b54b3a 0%, #8e3327 100%);
    color: #fff1e8;
    border: 1px solid #6c1f17;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.draw-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #c65947 0%, #9a382b 100%);
    transform: translateY(-1px);
}

.draw-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.pass-button {
    padding: 14px 30px;
    font-size: 16px;
    background: linear-gradient(180deg, #2f5f87 0%, #204666 100%);
    color: #e8f1ff;
    border: 1px solid #15324a;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.pass-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #356b96 0%, #245072 100%);
    transform: translateY(-1px);
}

.pass-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.card {
    width: 72px;
    height: 108px;
    border: 2px solid #1a1a1a;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #faf7f2;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.8);
    padding: 5px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    flex-shrink: 0;
    -webkit-user-select: none;
    user-select: none;
    font-family: 'Arial Black', sans-serif;
}

.card.empty {
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(212, 175, 55, 0.4);
    box-shadow: none;
}

.card.harten,
.card.ruiten {
    color: #d63031;
}

.card.klaver,
.card.schoppen {
    color: #0a0a0a;
}

.card:hover:not(.disabled) {
    transform: translateY(-8px) scale(1.05);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.8);
}

.card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(40%);
}

.card.disabled:hover {
    transform: none;
}

/* Kaart hoeken - top left */
.card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    line-height: 0.9;
}

.card-corner.top-left {
    position: absolute;
    top: 3px;
    left: 3px;
}

.card-corner.bottom-right {
    position: absolute;
    bottom: 3px;
    right: 3px;
    transform: rotate(180deg);
}

.corner-value {
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.corner-suit {
    font-size: 11px;
    line-height: 1;
    margin-top: 1px;
}

/* Kaart centrum */
.card-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    gap: 2px;
}

.center-suit {
    font-size: 16px;
    line-height: 1;
}

/* Voor face cards (J, Q, K, A) */
.card-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.face-value {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}

.face-suit {
    font-size: 38px;
    line-height: 1;
    margin-top: 2px;
}

.draw-button {
    padding: 20px 40px;
    font-size: 18px;
}

.bottom-section {
    text-align: center;
    background: rgba(0, 0, 0, 0.35);
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    margin-top: 20px;
}

.bottom-section h3 {
    color: white;
    margin: 0 0 12px 0;
    font-size: 16px;
}

.hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 125px;
    align-content: flex-start;
    padding: 5px;
}

.message-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #f6f2e6;
    padding: 14px 28px;
    border-radius: 10px;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.message-box.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Suits symbols */
.suit-symbol {
    font-size: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        min-width: 95vw;
        padding: 20px;
    }

    .game-container {
        padding: 8px;
        width: 100vw;
        height: 100vh;
        max-width: 100%;
    }

    .card {
        width: 56px;
        height: 84px;
        font-size: 12px;
        padding: 3px;
    }

    .corner-value {
        font-size: 10px;
        font-weight: 900;
    }

    .corner-suit {
        font-size: 8px;
        margin-top: 0px;
    }

    .center-suit {
        font-size: 12px;
    }

    .face-value {
        font-size: 24px;
    }

    .face-suit {
        font-size: 28px;
        margin-top: 1px;
    }

    .players-circle {
        min-height: 350px;
        max-height: 350px;
    }

    .player-position {
        width: 100px;
        height: 100px;
        font-size: 12px;
    }

    .player-name {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .player-cards {
        font-size: 10px;
    }

    .hand {
        gap: 6px;
        min-height: 100px;
    }

    .bottom-section {
        padding: 12px;
        margin-top: 8px;
    }

    .bottom-section h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    button {
        padding: 12px 24px;
        font-size: 15px;
    }

    .draw-button, .pass-button {
        padding: 12px 20px;
        font-size: 14px;
    }

    .game-center {
        gap: 10px;
    }

    .discard-pile p {
        font-size: 13px;
        margin-bottom: 8px;
    }

    #deckCount {
        font-size: 12px;
    }

    .card-value {
        font-size: 20px;
    }

    .card-suit {
        font-size: 28px;
    }
}

/* Suit Selector Modal */
.suit-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.suit-selector-modal {
    background: #141414;
    padding: 36px;
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.25);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.suit-selector-modal h3 {
    margin-bottom: 26px;
    color: var(--gold);
    font-size: 22px;
}

.suit-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.suit-button {
    padding: 26px 18px;
    font-size: 17px;
    border: 2px solid #2b2b2b;
    border-radius: 12px;
    background: #0f0f0f;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
    color: #e8e8e8;
}

.suit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.suit-button.harten {
    border-color: #7b2b24;
    color: #e1b4ad;
}

.suit-button.harten:hover {
    background: #7b2b24;
    color: #fff5f3;
}

.suit-button.ruiten {
    border-color: #7b2b24;
    color: #e1b4ad;
}

.suit-button.ruiten:hover {
    background: #7b2b24;
    color: #fff5f3;
}

.suit-button.klaver {
    border-color: #2f2f2f;
    color: #d6d6d6;
}

.suit-button.klaver:hover {
    background: #2f2f2f;
    color: #ffffff;
}

.suit-button.schoppen {
    border-color: #2f2f2f;
    color: #d6d6d6;
}

.suit-button.schoppen:hover {
    background: #2f2f2f;
    color: #ffffff;
}

.suit-button .suit-symbol {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}
/* Victory Modal */
.victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
}

.victory-modal.show {
    display: flex;
}

.victory-content {
    background: linear-gradient(135deg, var(--felt-light) 0%, var(--felt-mid) 100%);
    padding: 40px 50px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 95%;
    animation: slideIn 0.4s ease-out;
    border: 2px solid var(--gold);
}

.victory-title {
    font-size: 56px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    margin: 15px 0;
    letter-spacing: 2px;
}

.victory-winner {
    font-size: 36px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    margin: 20px 0;
    background: rgba(212, 175, 55, 0.15);
    padding: 15px 30px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.victory-stars {
    font-size: 0;
    display: none;
}

.victory-subtitle {
    font-size: 14px;
    color: rgba(242, 242, 242, 0.7);
    margin-top: 20px;
    font-style: italic;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .victory-content {
        padding: 30px 25px;
        border-radius: 12px;
    }

    .victory-title {
        font-size: 40px;
        margin: 10px 0;
    }

    .victory-winner {
        font-size: 28px;
        margin: 15px 0;
        padding: 12px 20px;
    }

    .victory-subtitle {
        font-size: 12px;
    }
}