:root {
    --bg: #0f172a; --surface: #1e293b; --primary: #ccff00; --secondary: #06b6d4;
    --accent: #d946ef; --danger: #ef4444; --border-color: #000000; --text: #ffffff;
    --card-face: #f1f5f9; --card-back-1: #334155; --card-back-2: #1e293b;
    --font-header: 'Archivo Black', sans-serif; --font-body: 'Space Mono', monospace;
    --border-thick: 3px solid var(--border-color);
    --shadow-hard: 5px 5px 0px var(--border-color);
    --shadow-hover: 2px 2px 0px var(--border-color);
    --dark-bg: #1a1a1d; --dark-surface: #2b2b2e; --teal: #4ecdc4;
}

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }

/* Global Reset to fix Mobile Fonts on Inputs/Buttons */
input, button, textarea, select {
    font-family: var(--font-body); /* Forces Space Mono on mobile inputs */
    font-weight: inherit;
}

body { margin: 0; font-family: var(--font-body); background-color: var(--dark-bg); color: var(--text); overflow: hidden; }

/* Squares Background Canvas */
.squares-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: all;
}

.login-page-wrapper {
  position: relative;
  z-index: 1;
}

/* Top Navigation */
.top-nav { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 20px 40px; z-index: 100; }
.nav-left { display: flex; align-items: center; gap: 40px; }
.nav-right { display: flex; align-items: center; }
.nav-brand { font-family: var(--font-header); font-size: 1.5rem; color: var(--text); }
.nav-links { display: flex; gap: 30px; }
.nav-link { background: none; border: none; color: var(--text); font-family: var(--font-body); font-size: 0.95rem; cursor: pointer; padding: 0; transition: color 0.2s; }
.nav-link:hover { color: var(--teal); }
.made-by-btn { background: var(--teal); color: #000; font-family: var(--font-body); font-size: 1rem; font-weight: 700; padding: 14px 32px; border-radius: 30px; text-decoration: none; display: inline-block; box-shadow: 5px 5px 0px #000; border: 3px solid #000; transition: all 0.1s ease; position: relative; }
.made-by-btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0px #000; }
.made-by-btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0px #000; }

/* Login Container */
.login-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(30, 41, 59, 0.85); backdrop-filter: blur(10px); border: 2px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 60px 80px; min-width: 500px; display: flex; flex-direction: column; align-items: center; gap: 25px; overflow: visible; }

/* Character Selector */
.character-selector { display: flex; align-items: center; gap: 40px; margin-bottom: 10px; overflow: visible; }
.char-arrow { background: none; border: none; color: var(--text); font-size: 3rem; cursor: pointer; padding: 10px 30px; transition: transform 0.2s; line-height: 1; min-width: 80px; overflow: visible; display: flex; align-items: center; justify-content: center; }
.char-arrow:hover { transform: scale(1.2); }
.character-display {
    font-size: 8rem;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.character-display.character-switch {
    animation: character-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes character-pop {
    0% { transform: scale(0.8) rotate(-5deg); opacity: 0.5; }
    50% { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Name Input */
.name-input-field {
    width: 100%;
    padding: 16px 20px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 8px;
    color: #000;
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: center;
    /* Fix for mobile text rendering */
    -webkit-appearance: none;
    appearance: none;
}
.name-input-field::placeholder { color: rgba(0, 0, 0, 0.4); font-size: 1rem; }
.name-input-field:focus { outline: none; border-color: #333; }

/* Login Buttons */
.login-buttons { display: flex; flex-direction: column; gap: 15px; width: 100%; }
.login-btn { padding: 16px 20px; border-radius: 8px; font-family: var(--font-body); font-size: 1rem; font-weight: 700; cursor: pointer; border: 2px solid #000; transition: all 0.2s; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; }
.primary-btn { background: #fff; color: #000; }
.primary-btn:hover { transform: translateY(-2px); border-color: #333; }
.secondary-btn { background: rgba(255, 255, 255, 0.1); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.2); }
.secondary-btn:hover { background: rgba(255, 255, 255, 0.15); }
.cancel-btn { background: rgba(255, 0, 0, 0.1); color: var(--danger); border: 1px solid var(--danger); }
.cancel-btn:hover { background: rgba(255, 0, 0, 0.2); }

/* Home Rules Link */
.home-rules-container { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: 100%; max-width: 400px; padding: 0 20px; z-index: 100; display: flex; justify-content: center; }
.home-rules-link { background: none; border: none; color: var(--text); font-family: var(--font-body); font-size: 1rem; cursor: pointer; padding: 12px 24px; transition: color 0.2s; letter-spacing: 0.5px; }
.home-rules-link:hover { color: var(--teal); }
.home-rules-link .decrypted-text { font-weight: 400; }

/* Join Code Input */
.join-code-row { position: relative; width: 100%; }

.join-code-input {
    width: 100%;
    padding: 16px 85px 16px 20px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 8px;
    color: #000;
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: center;
    text-transform: uppercase;
    /* Fix for mobile text rendering */
    -webkit-appearance: none;
    appearance: none;
}

.join-code-input::placeholder { color: rgba(0, 0, 0, 0.4); text-transform: none; font-size: 1rem; }
.join-code-input:focus { outline: none; border-color: #333; }

.join-arrow-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--teal);
    border: 3px solid #000;
    border-radius: 6px;
    color: #000;
    font-size: 1.3rem;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    box-shadow: 3px 3px 0px #000;
    font-weight: 700;
}

.join-arrow-btn:hover { transform: translateY(-50%) translate(1px, 1px); box-shadow: 2px 2px 0px #000; }
.join-arrow-btn:active { transform: translateY(-50%) translate(2px, 2px); box-shadow: 1px 1px 0px #000; }
.join-arrow-btn.valid { background: var(--teal); }

/* Game Board */
.game-sidebar-right { position: fixed; right: 15px; top: 15px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.sidebar-btn { width: 40px; height: 40px; background: var(--teal); border: 3px solid #000; border-radius: 6px; color: #000; font-size: 1.2rem; cursor: pointer; transition: all 0.1s ease; display: flex; align-items: center; justify-content: center; box-shadow: 4px 4px 0px #000; font-weight: 700; }
.sidebar-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000; }
.sidebar-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px #000; }

#game-menu { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.game-menu-content { background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 12px; padding: 20px; min-width: 250px; display: flex; flex-direction: column; gap: 12px; }
.menu-item-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; color: white; padding: 14px 20px; font-family: var(--font-body); font-size: 0.95rem; cursor: pointer; transition: all 0.2s; text-align: left; }
.menu-item-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateX(4px); }
.menu-item-btn.close-menu { background: rgba(255, 0, 0, 0.1); border-color: rgba(255, 0, 0, 0.3); }

/* 4-Player Game Board Layout */
.game-board-4p { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100vw; height: 100vh; gap: 20px; padding: 20px; }
.middle-row { display: flex; align-items: center; justify-content: center; gap: 40px; width: 100%; }
.player-section { display: flex; align-items: center; gap: 15px; }
.player-section.player-top, .player-section.player-bottom { flex-direction: column; }
.player-section.player-left { flex-direction: row; }
.player-section.player-right { flex-direction: row-reverse; }
.player-section.player-left, .player-section.player-right { min-width: 150px; }
.player-indicator { display: flex; align-items: center; gap: 8px; }
.player-top .player-indicator, .player-bottom .player-indicator { flex-direction: column; }
.player-left .player-indicator { flex-direction: column; }
.player-right .player-indicator { flex-direction: column; }
.player-char { font-size: 2rem; width: 55px; height: 55px; display: flex; align-items: center; justify-content: center; }
.player-char img { width: 100%; height: 100%; object-fit: contain; }
.player-turn-bounce { animation: subtle-bounce 2s ease-in-out infinite; }
@keyframes subtle-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.player-name-label { font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.disconnect-timer { font-size: 0.7rem; color: #ef4444; font-weight: 600; }

/* 2x2 Card Grid */
.hand-grid-4p { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); grid-auto-flow: row; gap: 10px; justify-items: center; }
.player-left .hand-grid-4p, .player-right .hand-grid-4p { grid-auto-flow: column; }

/* Desktop: top and bottom players expand horizontally when 5+ cards */
.player-top .hand-grid-4p:has(:nth-child(5)),
.player-bottom .hand-grid-4p:has(:nth-child(5)) {
    grid-template-columns: none;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: min-content;
}

/* Dynamic card sizing based on player count */
.players-2 .game-card { width: 70px; height: 95px; font-size: 2rem; }
.players-2 .game-pile { width: 75px; height: 105px; }
.players-3 .game-card { width: 50px; height: 70px; font-size: 1.5rem; }
.players-3 .game-pile { width: 60px; height: 85px; }
.players-4 .game-card { width: 45px; height: 62px; font-size: 1.3rem; }
.players-4 .game-pile { width: 50px; height: 70px; }
.players-2 .player-top .player-indicator { order: -1; }

.game-center { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 0 30px; }
.game-instruction { font-size: 1rem; color: rgba(255, 255, 255, 0.8); text-align: center; }
.center-piles { display: flex; gap: 15px; align-items: center; justify-content: center; }
.pile-wrapper { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pile-label { font-size: 0.7rem; color: rgba(255, 255, 255, 0.5); font-family: var(--font-body); font-weight: 600; letter-spacing: 1px; }
.game-pile { width: 65px; height: 90px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; transition: all 0.2s; }
.game-pile:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); }
.stock-pile { background: rgba(0, 0, 0, 0.3); }
.drawn-overlay { position: absolute; top: -5px; left: 5px; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; z-index: 10; }
.pile-action-btn { padding: 8px 16px; background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.3); border-radius: 6px; color: var(--danger); font-size: 1.2rem; cursor: pointer; transition: all 0.2s; }
.pile-action-btn:hover { background: rgba(255, 0, 0, 0.2); }
.kyro-action-btn { position: fixed; bottom: 20px; left: 20px; padding: 16px 28px; background: #ef4444; border: 4px solid #000; border-radius: 0; color: white; font-family: var(--font-body); font-size: 1rem; font-weight: 800; cursor: pointer; transition: all 0.1s ease; z-index: 700; box-shadow: 5px 5px 0px #000; text-transform: uppercase; letter-spacing: 1.5px; }
.kyro-action-btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0px #000; }
.kyro-action-btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0px #000; }
.kyro-action-btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Game Cards */
.game-card { width: 55px; height: 75px; background: white; border: 2px solid #333; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; cursor: pointer; transition: all 0.2s; font-family: var(--font-body); font-size: 1.5rem; color: white; }
.game-card:hover { transform: translateY(-4px); border-color: #000; }
.game-card.face-down { background: #2a2a2d; border-color: #444; }
.game-card .card-value { line-height: 1; font-weight: 700; color: white; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000; }
.game-card .suit { position: absolute; top: 3px; right: 4px; font-size: 0.75rem; color: white; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }
.game-card .power-icon { position: absolute; bottom: 2px; right: 2px; font-size: 0.5rem; background: rgba(0, 0, 0, 0.6); color: white; padding: 2px 3px; border-radius: 3px; }
.game-card.score-red { background: #ef4444; border-color: #991b1b; }
.game-card.score-yellow { background: #fbbf24; border-color: #b45309; }
.game-card.score-green { background: #22c55e; border-color: #15803d; }
.game-card.score-lightblue { background: #06b6d4; border-color: #0e7490; }
.game-card.score-darkblue { background: #3b82f6; border-color: #1e40af; }
.game-card.selected { transform: translateY(-10px); border-color: #000; box-shadow: 0 0 0 3px #000; }
.game-card.swapped-highlight { animation: swapPulse 3s ease-in-out; position: relative; }
@keyframes swapPulse { 0%, 100% { border-color: #333; box-shadow: 0 0 0 0 rgba(78, 205, 196, 0); } 25% { border-color: #4ecdc4; box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.4); transform: translateY(-6px) scale(1.05); } 50% { border-color: #4ecdc4; box-shadow: 0 0 0 8px rgba(78, 205, 196, 0.2); } 75% { border-color: #4ecdc4; box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.4); transform: translateY(-6px) scale(1.05); } }
.game-card.replaced-highlight { animation: replacePulse 3s ease-in-out; position: relative; }
@keyframes replacePulse { 0%, 100% { border-color: #333; box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); } 25% { border-color: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.4); transform: translateY(-6px) scale(1.05); } 50% { border-color: #fbbf24; box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.2); } 75% { border-color: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.4); transform: translateY(-6px) scale(1.05); } }
.game-card.transferred-highlight { animation: transferPulse 3s ease-in-out; position: relative; }
@keyframes transferPulse { 0%, 100% { border-color: #333; box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); } 25% { border-color: #f97316; box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.4); transform: translateY(-6px) scale(1.05); } 50% { border-color: #f97316; box-shadow: 0 0 0 8px rgba(249, 115, 22, 0.2); } 75% { border-color: #f97316; box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.4); transform: translateY(-6px) scale(1.05); } }
.card-eye-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2rem; z-index: 15; animation: eyeFadeIn 0.3s ease-out, eyeFadeOut 0.5s ease-in 2.5s forwards; pointer-events: none; filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8)); }
@keyframes eyeFadeIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes eyeFadeOut { from { opacity: 1; } to { opacity: 0; } }
.game-card.spy-glow { animation: spyGlow 1.5s ease-in-out; position: relative; }
@keyframes spyGlow { 0%, 100% { border-color: #333; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } 50% { border-color: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.4); transform: translateY(-4px) scale(1.03); } }

#app { display: flex; flex-direction: column; height: 100vh; width: 100%; align-items: center; justify-content: center; position: relative; overflow-x: hidden; }
.screen { display: none; width: 100%; height: 100%; position: relative; }
.screen.active { display: block; }
#login-screen.active { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; position: relative; }
#login-screen .squares-canvas { position: fixed; }
.login-page-wrapper { min-height: 100vh; width: 100%; display: flex; flex-direction: column; position: relative; }
#game-screen.active { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; height: 100%; position: relative; }
h1 { font-family: var(--font-header); font-size: 4.5rem; color: var(--primary); text-transform: uppercase; margin: 0; line-height: 0.9; text-shadow: 5px 5px 0px black; transform: skew(-5deg); }
.subtitle { font-size: 1.2rem; letter-spacing: 4px; color: var(--secondary); font-weight: bold; background: black; padding: 2px 10px; }
.title-stack { display: flex; flex-direction: column; align-items: center; margin: 0; }
.menu-container { width: 100%; display: flex; flex-direction: column; gap: 15px; align-items: center; }
.divider { background: #000; color: #fff; padding: 5px 10px; font-weight: bold; font-size: 0.8rem; transform: rotate(-2deg); border: 1px solid white; }
.neo-btn { width: 100%; padding: 16px; border: var(--border-thick); border-radius: 8px; font-family: var(--font-body); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; cursor: pointer; box-shadow: var(--shadow-hard); transition: all 0.1s; display: flex; align-items: center; justify-content: center; }
.neo-btn:active { transform: translate(3px, 3px); box-shadow: var(--shadow-hover); }
.neo-btn.primary { background: var(--primary); color: black; }
.neo-btn.secondary { background: var(--secondary); color: black; }
.neo-btn.outline { background: white; color: black; }
.neo-btn.small-outline { background: transparent; color: white; border: 2px solid white; padding: 10px 20px; font-size: 0.85rem; box-shadow: 3px 3px 0px rgba(255,255,255,0.3); }
.neo-btn.icon-btn { width: auto; padding: 0 20px; background: var(--accent); color: white; }
.neo-btn.small { padding: 5px 15px; font-size: 0.8rem; width: auto; background: var(--surface); color: white; border: 2px solid white; box-shadow: 3px 3px 0px black; }
#join-input-container { display: flex; gap: 10px; width: 100%; }
#room-input, #name-input { flex-grow: 1; padding: 15px; border: var(--border-thick); background: white; color: black; font-family: var(--font-body); font-weight: 700; font-size: 1.2rem; text-align: center; text-transform: uppercase; border-radius: 8px; box-shadow: var(--shadow-hard); }
#name-input { width: 100%; }
.top-bar { background: var(--surface); border: 2px solid #fff; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; box-shadow: 3px 3px 0px rgba(0,0,0,0.5); margin-bottom: 8px; }
.top-bar-buttons { display: flex; gap: 8px; align-items: center; }
#status { font-weight: bold; color: var(--primary); font-size: 0.95rem; }
#room-code-display { font-size: 0.7rem; color: #777; margin-top: 2px; }
.hand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px; min-height: 120px; justify-items: center; max-width: 200px; margin: 0 auto; }
.hand-grid.opponent { opacity: 0.85; }
.hand-grid.opponent .card { background: #e8e8e8; border-color: #555; }
.hand-grid.opponent .card.face-down { border-color: #888; }
.card { width: 75px; height: 105px; background: var(--card-face); border: 3px solid black; border-radius: 8px; display: flex; justify-content: center; align-items: center; position: relative; box-shadow: 4px 4px 0px rgba(0,0,0,1); transition: transform 0.1s; font-family: var(--font-header); font-size: 1.8rem; color: black; }
.card .card-value { line-height: 1; }
.card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0px black; }
.card.face-down { background: repeating-linear-gradient(45deg, var(--card-back-1), var(--card-back-1) 10px, var(--card-back-2) 10px, var(--card-back-2) 20px); border: 3px solid #fff; }
.card.face-down span, .card.face-down .suit { display: none; }
.suit { position: absolute; top: 4px; right: 4px; font-size: 1rem; }
.card.red { color: var(--danger); }
.power-icon { position: absolute; bottom: 4px; right: 4px; font-size: 0.65rem; background: black; color: white; padding: 2px 4px; }
.card.peek-active { z-index: 50; transform: scale(1.1) translateY(-10px); box-shadow: 0 0 0 4px var(--primary); }
.card.selected { transform: translateY(-15px) rotate(2deg); border-color: var(--secondary); }
.card.just-swapped { animation: glitchSwap 0.4s steps(5); }
@keyframes glitchSwap { 0% { transform: translate(0); filter: invert(0); } 20% { transform: translate(-2px, 2px); filter: invert(1); } 40% { transform: translate(2px, -2px); filter: invert(0); } 60% { transform: translate(-2px, -2px); filter: invert(1); } 80% { transform: translate(2px, 2px); filter: invert(0); } 100% { transform: translate(0); } }
.card.transferring { animation: flyUp 0.6s ease-in-out forwards; z-index: 100; }
@keyframes flyUp { 0% { transform: scale(1); } 50% { transform: scale(1.2) rotate(10deg); } 100% { transform: translateY(-300px) scale(0.5) rotate(45deg); opacity: 0; } }
.card.receiving { animation: dropIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes dropIn { from { transform: translateY(-100px) scale(0); } to { transform: translateY(0) scale(1); } }
.table-area { display: flex; gap: 15px; align-items: center; justify-content: center; flex-grow: 1; position: relative; width: 100%; }
.pile-container { display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.pile { width: 85px; height: 120px; border: 3px solid rgba(255,255,255,0.2); border-radius: 8px; display: flex; justify-content: center; align-items: center; position: relative; }
.stock { background: #000; border: 3px solid #fff; box-shadow: 4px 4px 0px #555; }
.stock .pile-text { position: absolute; color: white; font-weight: bold; transform: rotate(-90deg); letter-spacing: 2px; }
.discard { border: 3px dashed var(--secondary); }
.pile-label-bottom { position: absolute; bottom: -25px; font-size: 0.8rem; color: var(--secondary); font-weight: bold; }
.drawn-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.3s; pointer-events: none; z-index: 10; }
.drawn-wrapper .card { pointer-events: all; box-shadow: 8px 8px 0px black; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.trash-btn { position: absolute; bottom: -60px; left: 50%; transform: translateX(-50%); background: var(--danger); color: white; border: 3px solid black; width: 45px; height: 45px; border-radius: 50%; font-size: 1.1rem; box-shadow: 4px 4px 0px black; cursor: pointer; transition: all 0.1s; z-index: 15; }
.trash-btn:active { transform: translateX(-50%) translate(2px, 2px); box-shadow: 1px 1px 0px black; }
.kyro-btn { position: absolute; top: -60px; background: #ef4444; color: white; border: 3px solid black; padding: 8px 20px; font-family: var(--font-header); font-size: 1.1rem; box-shadow: 4px 4px 0px black; transform: rotate(-2deg); cursor: pointer; animation: wiggle 3s infinite; z-index: 20; font-weight: 800; }
@keyframes wiggle { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.my-turn-glow { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6) !important; animation: borderPulse 1s infinite; }
@keyframes borderPulse { 0% { border-color: rgba(255, 255, 255, 0.3); } 50% { border-color: rgba(255, 255, 255, 0.8); } 100% { border-color: rgba(255, 255, 255, 0.3); } }
.drawn-from-discard { box-shadow: 0 0 0 4px var(--primary) !important; transform: translateY(-8px); animation: drawnPulse 0.8s ease-out; }
@keyframes drawnPulse { 0% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 var(--primary); } 50% { transform: translateY(-12px) scale(1.05); box-shadow: 0 0 0 8px rgba(204, 255, 0, 0.4); } 100% { transform: translateY(-8px) scale(1); box-shadow: 0 0 0 4px var(--primary); } }
.pile-bounce { animation: pileBounce 1.2s ease-in-out infinite; }
@keyframes pileBounce { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.02); } }
.bounce-prompt { animation: textBounce 2s ease-in-out infinite; }
@keyframes textBounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
#instruction-toast { display: none !important; }
#game-over-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95); z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; padding: 20px; }
.game-over-content { background: #2d2d2d; border: none; border-radius: 0; padding: 50px 40px 40px 40px; max-width: 900px; width: 95%; max-height: 85vh; overflow-y: auto; display: flex; flex-direction: column; gap: 30px; }
.game-over-content::-webkit-scrollbar { width: 6px; }
.game-over-content::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }
.game-over-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.game-over-content::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
#round-title { font-family: var(--font-body); font-size: 1.8rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: #fff; margin: 0; padding: 0; background: transparent; border: none; box-shadow: none; text-align: center; }

/* Ready Status Section */
.ready-status-section { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 10px 0; }
.ready-label { font-family: var(--font-body); font-size: 1rem; color: #fff; margin: 0; font-weight: 400; }
.ready-indicators { display: flex; gap: 10px; }
.ready-indicator { width: 32px; height: 32px; border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: rgba(255, 255, 255, 0.7); }
.ready-indicator.ready { color: var(--teal); border-color: var(--teal); }

/* Result Buttons */
.game-over-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.result-btn { min-width: 200px; padding: 15px 30px; background: transparent; border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 8px; color: #fff; font-family: var(--font-body); font-size: 1rem; font-weight: 400; cursor: pointer; transition: all 0.2s; }
.result-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.7); }
.result-btn:active { transform: scale(0.98); }
.result-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.result-btn.secondary { border-color: rgba(255, 255, 255, 0.3); }
#rules-modal, #disconnect-overlay, #self-disconnect-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 1200; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; backdrop-filter: grayscale(100%) contrast(120%); gap: 20px; }
.disconnect-actions { display: flex; gap: 15px; margin-top: 10px; }

/* New Lobby Overlay */
#lobby-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--dark-bg); z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; }
.lobby-layout { display: flex; gap: 30px; width: 100%; max-width: 1200px; height: 70vh; }

/* Lobby Settings Panel */
.lobby-settings { flex: 2; background: var(--dark-surface); border: 2px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 30px; display: flex; flex-direction: column; }
.lobby-header { display: flex; align-items: center; gap: 15px; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.lobby-icon { font-size: 1.5rem; }
.lobby-code-wrapper { display: flex; align-items: center; gap: 8px; }
.lobby-code { font-size: 1rem; font-family: var(--font-body); color: rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.1); padding: 6px 12px; border-radius: 6px; letter-spacing: 2px; }
.lobby-copy-btn { padding: 6px 10px; background: var(--teal); border: 3px solid #000; border-radius: 6px; cursor: pointer; font-size: 1rem; transition: all 0.1s ease; display: none; box-shadow: 4px 4px 0px #000; color: #000; font-weight: 700; }
.lobby-copy-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000; }
.lobby-copy-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px #000; }
.lobby-title { margin: 0; font-size: 1.5rem; font-family: var(--font-body); font-weight: 400; flex: 1; }
.lobby-chat-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.lobby-chat-messages { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.lobby-chat-input-container { display: flex; gap: 8px; padding: 15px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.lobby-chat-input { flex: 1; padding: 10px 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; color: var(--text); font-family: var(--font-body); font-size: 0.85rem; }
.lobby-chat-input:focus { outline: none; border-color: var(--teal); }
.lobby-chat-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.lobby-chat-send-btn { width: 40px; height: 40px; background: var(--teal); border: 3px solid #000; border-radius: 6px; color: #000; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.1s ease; box-shadow: 4px 4px 0px #000; font-weight: 700; }
.lobby-chat-send-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000; }
.lobby-chat-send-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px #000; }
.lobby-chat-messages::-webkit-scrollbar { width: 6px; }
.lobby-chat-messages::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }
.lobby-chat-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.lobby-chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
.lobby-actions { display: flex; gap: 15px; margin-top: 15px; }
.lobby-action-btn { flex: 1; padding: 14px 24px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; color: var(--text); font-family: var(--font-body); font-size: 0.95rem; cursor: pointer; transition: all 0.2s; }
.lobby-action-btn:hover { background: rgba(255,255,255,0.1); }
.lobby-action-btn.primary { background: var(--text); color: var(--dark-bg); border: none; }
.lobby-action-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,255,255,0.2); }

/* Lobby Players Panel */
.lobby-players-panel { flex: 1; background: var(--dark-surface); border: 2px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 30px; display: flex; flex-direction: column; }
.players-header { font-size: 1rem; font-weight: 600; margin-bottom: 20px; text-align: center; color: rgba(255,255,255,0.8); }
.lobby-players-list { flex: 1; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; }
.lobby-player-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 15px; background: rgba(255,255,255,0.03); border-radius: 8px; }
.lobby-player-character { font-size: 3rem; width: 75px; height: 75px; display: flex; align-items: center; justify-content: center; }
.lobby-player-character img { width: 100%; height: 100%; object-fit: contain; }
.lobby-player-name { font-size: 0.9rem; color: rgba(255,255,255,0.9); }

/* Lobby Footer */
.lobby-footer { margin-top: 30px; width: 100%; max-width: 1200px; }
.lobby-url-container { display: flex; gap: 10px; align-items: center; }
.lobby-url-input { flex: 1; padding: 12px 16px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; color: var(--text); font-family: var(--font-body); font-size: 0.9rem; text-align: center; }
.lobby-icon-btn { padding: 12px 16px; background: var(--teal); border: 3px solid #000; border-radius: 8px; cursor: pointer; font-size: 1.2rem; transition: all 0.1s ease; box-shadow: 5px 5px 0px #000; color: #000; font-weight: 700; }
.lobby-icon-btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0px #000; }
.lobby-icon-btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0px #000; }
#countdown-overlay { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 100; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
#power-overlay { position: fixed; bottom: 180px; left: 50%; transform: translateX(-50%); z-index: 100; pointer-events: none; animation: bounceIn 0.4s ease-out; }
@keyframes bounceIn { 0% { transform: translateX(-50%) translateY(20px); opacity: 0; } 60% { transform: translateX(-50%) translateY(-5px); opacity: 1; } 100% { transform: translateX(-50%) translateY(0); } }
.power-badge { background: var(--secondary); color: black; border: 3px solid black; padding: 12px 24px; font-size: 1rem; font-weight: bold; box-shadow: 6px 6px 0px black; transform: rotate(-2deg); white-space: nowrap; }

/* Hint Overlay */
#hint-overlay { position: fixed; bottom: 180px; left: 50%; transform: translateX(-50%); z-index: 100; pointer-events: none; animation: bounceIn 0.4s ease-out; }
.hint-badge { background: white; color: black; border: 3px solid black; padding: 12px 24px; font-size: 0.95rem; font-weight: bold; box-shadow: 6px 6px 0px black; transform: rotate(-2deg); white-space: nowrap; max-width: 90vw; text-align: center; }

/* KYRO Confirmation Modal */
#kyro-confirm-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 1100; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.kyro-confirm-content { background: white; border: 4px solid #000; padding: 40px; max-width: 450px; text-align: center; box-shadow: 8px 8px 0px #000; }
.kyro-confirm-content h2 { font-family: var(--font-body); font-size: 1.8rem; font-weight: 800; color: #000; margin: 0 0 20px 0; text-transform: uppercase; letter-spacing: 2px; }
.kyro-confirm-content p { font-size: 1rem; color: #333; margin: 10px 0; line-height: 1.5; }
.kyro-warning { color: #d32f2f; font-weight: 700; font-size: 1.05rem; margin: 25px 0; padding: 20px; background: #ffebee; border: 3px solid #d32f2f; box-shadow: 4px 4px 0px #d32f2f; }
.kyro-confirm-buttons { display: flex; gap: 15px; margin-top: 30px; justify-content: center; }
.kyro-confirm-buttons .neo-btn { padding: 14px 28px; font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: all 0.1s; border-radius: 0; border: 3px solid #000; box-shadow: 4px 4px 0px #000; }
.kyro-confirm-buttons .neo-btn.primary { background: #d32f2f; color: white; border-color: #000; }
.kyro-confirm-buttons .neo-btn.primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px #000; }
.kyro-confirm-buttons .neo-btn.secondary { background: white; color: #000; border: 3px solid #000; }
.kyro-confirm-buttons .neo-btn.secondary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px #000; }
#countdown-overlay p { background: black; color: var(--teal); padding: 8px 20px; border: 2px solid var(--teal); box-shadow: 4px 4px 0px var(--teal); font-weight: bold; margin: 10px 0 0 0; }
.timer-box { width: 80px; height: 80px; background: black; border: 3px solid var(--teal); color: var(--teal); font-size: 2.5rem; font-family: var(--font-header); display: flex; justify-content: center; align-items: center; box-shadow: 6px 6px 0px var(--teal); }
#leaderboard { background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 0; padding: 0; width: 100%; overflow-x: auto; }

/* Scoreboard Table */
.scoreboard-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); }
.scoreboard-table thead th { background: transparent; padding: 16px 12px; text-align: center; font-weight: 400; font-size: 0.85rem; letter-spacing: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.3); text-transform: none; color: rgba(255, 255, 255, 0.9); }
.scoreboard-table tbody td { padding: 18px 12px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.15); font-size: 0.95rem; font-weight: 400; background: transparent; color: rgba(255, 255, 255, 0.95); }
.scoreboard-table tbody tr:last-child td { border-bottom: none; }
.scoreboard-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.scoreboard-table .rank-col { text-align: center; font-weight: 400; min-width: 60px; font-size: 0.95rem; }
.scoreboard-table .player-col { text-align: left; font-weight: 400; min-width: 150px; font-size: 0.95rem; padding-left: 16px; }
.scoreboard-table .round-col { min-width: 80px; }
.scoreboard-table .total-col { background: transparent; font-weight: 700; font-size: 1rem; color: #fff; min-width: 80px; border-left: 1px solid rgba(255, 255, 255, 0.15); }
.scoreboard-table .rank-emoji { display: none; }
.scoreboard-table .player-icon-small { font-size: 1.3rem; margin-right: 10px; }
.scoreboard-table .doubled-score { color: #ff6b85; font-weight: 400; }
.scoreboard-table .total-doubled { font-size: 0.85rem; opacity: 0.9; }

/* Legacy styles for backward compatibility */
.score-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-weight: 600; font-size: 1rem; transition: all 0.2s; }
.score-row:last-child { border-bottom: none; }
.score-row:hover { background: rgba(255, 255, 255, 0.05); padding-left: 10px; padding-right: 10px; border-radius: 6px; }
.score-row .player-name { display: flex; align-items: center; gap: 10px; }
.score-row .player-rank { font-size: 1.2rem; opacity: 0.5; min-width: 30px; }
.penalty-row .player-score { color: #ff6b6b; }
#match-toast, #swap-notification { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-header); font-size: 1.5rem; color: var(--primary); text-shadow: 3px 3px 0px black; pointer-events: none; z-index: 1000; animation: slam 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; max-width: 90vw; text-align: center; line-height: 1.3; padding: 0 10px; }
@keyframes slam { from { transform: translate(-50%, -50%) scale(3); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.rules-content { position: relative; display: flex; flex-direction: column; background: var(--dark-surface); border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 12px; padding: 35px 45px 25px 45px; max-width: 650px; max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); color: var(--text); }
.rules-content h2 { color: var(--text); font-family: var(--font-body); font-weight: 700; font-size: 1.7rem; margin-top: 0; margin-bottom: 20px; text-align: center; letter-spacing: 1.2px; text-transform: uppercase; }
.rules-content h3 { color: var(--teal); font-family: var(--font-body); font-weight: 600; font-size: 1.1rem; margin: 0 0 15px 0; border-bottom: 2px solid rgba(78, 205, 196, 0.3); padding-bottom: 8px; }
.rules-section { margin-bottom: 25px; }
.rules-section:last-child { margin-bottom: 0; }
.rules-section p { font-size: 0.9rem; line-height: 1.6; color: rgba(255, 255, 255, 0.9); margin: 0 0 12px 0; }
.rules-note { font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); font-style: italic; margin-top: 8px; text-align: center; }
.card-examples { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.card-example { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.example-card { width: 55px; height: 75px; background: white; border: 2px solid #333; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; font-family: var(--font-body); font-size: 1.5rem; color: white; }
.example-card .card-value { line-height: 1; font-weight: 700; color: white; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000; }
.example-card .suit { position: absolute; top: 3px; right: 4px; font-size: 0.75rem; color: white; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }
.example-card .power-icon { position: absolute; bottom: 2px; right: 2px; font-size: 0.5rem; background: rgba(0, 0, 0, 0.6); color: white; padding: 2px 3px; border-radius: 3px; }
.example-card.score-red { background: #ef4444; border-color: #991b1b; }
.example-card.score-yellow { background: #fbbf24; border-color: #b45309; }
.example-card.score-green { background: #22c55e; border-color: #15803d; }
.example-card.score-lightblue { background: #06b6d4; border-color: #0e7490; }
.example-card.score-darkblue { background: #3b82f6; border-color: #1e40af; }
.card-label { font-size: 0.75rem; text-align: center; color: rgba(255, 255, 255, 0.8); line-height: 1.3; }
.gameplay-steps { padding-left: 18px; margin: 12px 0; }
.gameplay-steps li { margin-bottom: 10px; font-size: 0.875rem; line-height: 1.5; color: rgba(255, 255, 255, 0.9); }
.gameplay-steps ul { margin-top: 6px; padding-left: 18px; }
.gameplay-steps ul li { margin-bottom: 4px; font-size: 0.8rem; }
.indicators-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0; }
.indicator-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.05); }
.indicator-item span { font-size: 0.75rem; text-align: center; line-height: 1.3; }
.example-card-small { width: 40px; height: 55px; background: #2a2a2d; border: 2px solid #444; border-radius: 6px; display: flex; align-items: center; justify-content: center; position: relative; }
.example-card-small.replaced-highlight { border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.4); animation: cardPulse 2s ease-in-out infinite; }
.example-card-small.transferred-highlight { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.4); animation: cardPulse 2s ease-in-out infinite; }
.example-card-small.swapped-highlight { border-color: #4ecdc4; box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.4); animation: cardPulse 2s ease-in-out infinite; }
.mini-card-value { font-size: 1.5rem; }
@keyframes cardPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.rules-close-btn { position: sticky; top: 0; right: 0; align-self: flex-end; background: rgba(0, 0, 0, 0.7); border: none; color: rgba(255, 255, 255, 0.95); font-size: 1.5rem; cursor: pointer; padding: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; z-index: 10; border-radius: 6px; margin: 0 0 -36px 0; }
.rules-close-btn:hover { color: var(--text); transform: scale(1.1); }
.rules-content::-webkit-scrollbar { width: 6px; }
.rules-content::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }
.rules-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.rules-content::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
.loader { border: 5px solid #f3f3f3; border-top: 5px solid var(--danger); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; margin: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.hidden { display: none !important; }
#modal { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.9); display:flex; flex-direction:column; justify-content:center; align-items:center; z-index:2000; backdrop-filter: blur(5px); gap: 0; }
#modal-content { position: relative; z-index: 2001; margin-bottom: 120px; }
#modal-content .game-card { transform: scale(2.5); box-shadow: 0 8px 16px rgba(0,0,0,0.3); }
#close-modal { background: var(--text); color: var(--dark-bg); padding: 12px 24px; font-size: 0.9rem; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; font-family: var(--font-body); transition: all 0.2s; width: auto; text-align: center; }
#close-modal:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2); }

/* Chat Widget */
.chat-widget { position: fixed; bottom: 20px; right: 20px; z-index: 800; }
.chat-toggle-btn { width: 40px; height: 40px; background: var(--teal); border: 3px solid #000; border-radius: 6px; color: #000; cursor: pointer; transition: all 0.1s ease; display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 4px 4px 0px #000; font-weight: 700; }
.chat-toggle-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000; }
.chat-toggle-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px #000; }
.chat-toggle-btn svg { color: #000; }
.chat-notification-dot { position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; background: #ef4444; border: 2px solid var(--dark-bg); border-radius: 50%; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.chat-panel { position: absolute; bottom: 70px; right: 0; width: 320px; height: 400px; background: var(--dark-surface); border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; z-index: 900; }
.lobby-chat .chat-panel { bottom: auto; top: 70px; }
.chat-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.chat-title { font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; color: var(--text); }
.chat-close-btn { background: none; border: none; color: rgba(255, 255, 255, 0.6); font-size: 1.2rem; cursor: pointer; padding: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.chat-close-btn:hover { color: var(--text); }
.chat-messages { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.chat-message { display: flex; flex-direction: column; gap: 4px; }
.chat-message-header { display: flex; align-items: center; gap: 8px; }
.chat-message-author { font-size: 0.75rem; font-weight: 600; color: var(--teal); }
.chat-message-time { font-size: 0.65rem; color: rgba(255, 255, 255, 0.4); }
.chat-message-text { font-size: 0.85rem; color: rgba(255, 255, 255, 0.9); line-height: 1.4; word-wrap: break-word; }
.chat-message.own .chat-message-author { color: var(--primary); }
.chat-input-container { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.chat-input { flex: 1; padding: 10px 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; color: var(--text); font-family: var(--font-body); font-size: 0.85rem; }
.chat-input:focus { outline: none; border-color: var(--teal); }
.chat-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.chat-send-btn { width: 40px; height: 40px; background: var(--teal); border: 3px solid #000; border-radius: 6px; color: #000; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.1s ease; box-shadow: 4px 4px 0px #000; font-weight: 700; }
.chat-send-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000; }
.chat-send-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px #000; }
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Leaderboard Widget */
.leaderboard-widget { position: fixed; bottom: 70px; right: 20px; z-index: 800; }
.leaderboard-toggle-btn { width: 40px; height: 40px; background: var(--teal); border: 3px solid #000; border-radius: 6px; color: #000; cursor: pointer; transition: all 0.1s ease; display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 4px 4px 0px #000; font-weight: 700; }
.leaderboard-toggle-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000; }
.leaderboard-toggle-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px #000; }
.leaderboard-toggle-btn svg { color: #000; }
.leaderboard-panel { position: absolute; bottom: 70px; right: 0; width: 320px; max-height: 400px; background: var(--dark-surface); border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; z-index: 900; }
.leaderboard-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.leaderboard-title { font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; color: var(--text); }
.leaderboard-close-btn { background: none; border: none; color: rgba(255, 255, 255, 0.6); font-size: 1.2rem; cursor: pointer; padding: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.leaderboard-close-btn:hover { color: var(--text); }
.leaderboard-panel-content { flex: 1; overflow-y: auto; padding: 15px; }
.leaderboard-panel-content::-webkit-scrollbar { width: 6px; }
.leaderboard-panel-content::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }
.leaderboard-panel-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.leaderboard-panel-content::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Inline Chat Bubbles */
.inline-chat-bubble { position: absolute; left: 50%; transform: translateX(-50%); bottom: -30px; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 4px 8px; font-size: 0.65rem; color: rgba(255, 255, 255, 0.9); white-space: nowrap; max-width: 100px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; z-index: 10; pointer-events: all; transition: all 0.2s; animation: fadeInBubble 0.3s ease-out; }
.inline-chat-bubble:hover { background: rgba(0, 0, 0, 0.85); transform: translateX(-50%) translateY(-2px); }
@keyframes fadeInBubble { from { opacity: 0; transform: translateX(-50%) translateY(5px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.player-indicator { position: relative; }

/* Responsive Layout */
@media (min-width: 600px) {
    /* Desktop: 4x1 card layout */
    .hand-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 400px;
    }
}

@media (max-width: 599px) {
    /* Mobile: adapt login container */
    .top-nav { padding: 15px 20px; }
    .nav-left { gap: 20px; }
    .nav-brand { font-size: 1.2rem; }
    .nav-links { gap: 15px; }
    .nav-link { font-size: 0.8rem; }
    #nav-rules-btn { display: none; }
    #nav-leaderboard-btn { display: block; }
    .made-by-btn { font-size: 0.85rem; padding: 10px 20px; box-shadow: 3px 3px 0px #000; }
    .made-by-btn:hover { box-shadow: 2px 2px 0px #000; }
    .made-by-btn:active { box-shadow: 1px 1px 0px #000; }
    
    /* Login Container - IMPORTANT FIXES HERE */
    .login-container {
        min-width: auto;
        width: 90%;
        max-width: 400px;
        padding: 30px 20px;
        position: relative;
        transform: none;
        top: auto;
        left: auto;
        margin: 0 auto;
        overflow: visible;
    }

    .character-selector { gap: 15px; overflow: visible; }
    .char-arrow { font-size: 1.8rem; padding: 20px 25px; line-height: 1; min-width: 60px; min-height: 60px; overflow: visible; display: flex; align-items: center; justify-content: center; }
    .character-display { font-size: 4.5rem; width: 110px; height: 110px; }

    /* Mobile: join game button sizing */
    .join-code-input { padding: 12px 60px 12px 14px; font-size: 0.9rem; }
    .join-code-input::placeholder { font-size: 0.9rem; }
    .join-arrow-btn { width: 40px; height: 40px; font-size: 1.1rem; right: 12px; box-shadow: 2px 2px 0px #000; }
    .join-arrow-btn:hover { box-shadow: 1.5px 1.5px 0px #000; }
    .join-arrow-btn:active { box-shadow: 1px 1px 0px #000; }
    .name-input-field { padding: 12px 14px; font-size: 0.9rem; }
    .name-input-field::placeholder { font-size: 0.9rem; }

    .login-buttons { gap: 12px; }
    .login-btn { padding: 12px 14px; font-size: 0.9rem; }

    /* Mobile: adapt lobby layout */
    #lobby-overlay { padding: 10px; height: 100vh; overflow: hidden; }
    .lobby-layout { flex-direction: column; height: 100%; max-height: 100%; gap: 8px; }
    .lobby-settings {
        flex: none;
        max-height: calc(100vh - 180px);
        min-height: 0;
        padding: 12px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .lobby-chat-content { flex: 1; overflow-y: auto; min-height: 0; }
    .lobby-players-panel { flex: none; height: auto; max-height: none; padding: 8px; }
    .players-header { margin-bottom: 6px; font-size: 0.8rem; }
    .lobby-header { margin-bottom: 8px; padding-bottom: 6px; }
    .lobby-chat-messages { padding: 8px; }
    .lobby-chat-input-container { padding: 8px; }
    .lobby-actions { margin-top: 8px; }

    /* Mobile: display players as horizontal row */
    .lobby-players-list {
        flex-direction: row !important;
        justify-content: center;
        gap: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        padding: 5px;
    }
    .lobby-player-item {
        flex: 0 0 auto;
        padding: 8px 6px;
        min-width: 55px;
    }
    .lobby-player-character {
        width: 45px !important;
        height: 45px !important;
    }
    .lobby-player-name { font-size: 0.7rem; }

    .lobby-footer { display: none; }
    .lobby-copy-btn { display: block; font-size: 0.9rem; padding: 4px 8px; }
    .lobby-code { font-size: 0.85rem; padding: 4px 8px; }

    /* Mobile: Game board layout optimization */
    .game-board-4p { gap: 0; padding: 5px 0; justify-content: space-between; padding-top: 25px; min-height: 100vh; min-height: 100dvh; overflow: hidden; position: relative; }
    .middle-row { gap: 0; }

    /* Mobile: prevent body scroll and ensure proper viewport */
    #game-screen.active { overflow: hidden; height: 100vh; height: 100dvh; position: fixed; top: 0; left: 0; right: 0; bottom: 0; }

    /* Mobile: ensure body doesn't scroll */
    @supports (-webkit-touch-callout: none) {
        body { position: fixed; width: 100%; }
    }

    /* Mobile: smaller game cards with dynamic sizing */
    .players-2 .game-card {
        width: 50px !important;
        height: 68px !important;
        font-size: 1.3rem !important;
    }
    .players-3 .game-card {
        width: 42px !important;
        height: 58px !important;
        font-size: 1.1rem !important;
    }
    .players-4 .game-card {
        width: 38px !important;
        height: 52px !important;
        font-size: 1rem !important;
    }
    .game-card .card-value {
        font-size: inherit;
        text-shadow:
            -1px -1px 0 #000,
            1px -1px 0 #000,
            -1px 1px 0 #000,
            1px 1px 0 #000;
    }
    .game-card .suit {
        font-size: 0.6rem;
        top: 2px;
        right: 2px;
        text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    }
    .game-card .power-icon { font-size: 0.4rem; bottom: 1px; right: 1px; padding: 1px 2px; }

    /* Mobile: smaller card grids with horizontal-first flow */
    .hand-grid-4p { gap: 5px; }

    /* Mobile: top and bottom players keep 2x2 layout, expand columns as needed */
    .player-top .hand-grid-4p,
    .player-bottom .hand-grid-4p {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        grid-auto-flow: row;
    }

    /* Mobile: when 5+ cards, expand horizontally in 2 rows */
    .player-top .hand-grid-4p:has(:nth-child(5)),
    .player-bottom .hand-grid-4p:has(:nth-child(5)) {
        grid-template-columns: none;
        grid-template-rows: repeat(2, 1fr);
        grid-auto-flow: column;
        grid-auto-columns: min-content;
    }

    /* Mobile: reduce gap when 5+ cards */
    .player-top .hand-grid-4p:has(:nth-child(5)),
    .player-bottom .hand-grid-4p:has(:nth-child(5)) {
        gap: 3px;
    }

    /* Mobile: scale down cards when 5+ cards to fit on screen */
    .hand-grid-4p:has(:nth-child(5)) .game-card {
        transform: scale(0.85);
    }
    .hand-grid-4p:has(:nth-child(7)) .game-card {
        transform: scale(0.7);
    }
    .hand-grid-4p:has(:nth-child(9)) .game-card {
        transform: scale(0.6);
    }

    /* Mobile: smaller piles with dynamic sizing */
    .players-2 .game-pile { width: 55px !important; height: 75px !important; }
    .players-3 .game-pile { width: 48px !important; height: 66px !important; }
    .players-4 .game-pile { width: 45px !important; height: 62px !important; }
    .center-piles { gap: 8px; }
    .pile-wrapper { gap: 3px; }
    .pile-label { font-size: 0.5rem; }

    /* Mobile: KYRO button position (overlay, same size as desktop) */
    .kyro-action-btn {
        bottom: 15px;
        right: 15px;
    }

    /* Mobile: player indicators */
    .player-char {
        width: 35px;
        height: 35px;
    }
    .player-name-label { font-size: 0.7rem; }

    /* Mobile: reposition player sections with fixed positions for icons */
    .player-section { gap: 3px; }
    .player-section.player-top {
        flex-direction: column;
        margin-top: 0;
        gap: 3px;
    }
    .player-section.player-bottom {
        flex-direction: column;
        margin-bottom: 10px;
        margin-top: -10px;
        gap: 3px;
    }
    .player-section.player-left,
    .player-section.player-right {
        min-width: auto;
    }

    /* Mobile: keep player indicators visible and in same location */
    .player-indicator {
        flex-shrink: 0;
    }

    /* Mobile: constrain hand grid width so it doesn't push icons */
    .player-top .hand-grid-4p,
    .player-bottom .hand-grid-4p {
        max-width: 100vw;
        justify-self: center;
    }

    /* Mobile: game center - add spacing between instruction and piles */
    .game-center { gap: 12px; padding: 0 5px; margin-bottom: 0; margin-top: -10px; }
    .game-instruction { font-size: 0.75rem; margin-bottom: 0; }

    /* Mobile: sidebar positioning - move to top left */
    .game-sidebar-right { left: 15px; right: auto; top: 15px; flex-direction: column; gap: 8px; }
    .sidebar-btn { width: 44px; height: 44px; font-size: 1.1rem; box-shadow: 3px 3px 0px #000; }
    .sidebar-btn:hover { box-shadow: 2px 2px 0px #000; }
    .sidebar-btn:active { box-shadow: 1px 1px 0px #000; }

    /* Mobile: chat widget - top right */
    .chat-widget { top: 15px; right: 15px; bottom: auto; z-index: 850; }
    .chat-toggle-btn {
        width: 44px;
        height: 44px;
        box-shadow: 3px 3px 0px #000;
    }
    .chat-toggle-btn:hover { box-shadow: 2px 2px 0px #000; }
    .chat-toggle-btn:active { box-shadow: 1px 1px 0px #000; }
    .chat-toggle-btn svg { width: 20px; height: 20px; }
    .chat-panel {
        position: fixed;
        width: calc(100vw - 20px);
        height: auto;
        min-height: 300px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 140px);
        right: 10px;
        top: 67px;
        bottom: auto;
        left: auto;
        border-radius: 12px;
        z-index: 950;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .chat-widget { z-index: 800; }
    .chat-notification-dot { width: 10px; height: 10px; top: -2px; right: -2px; }

    /* Mobile: leaderboard widget - below chat button */
    .leaderboard-widget { top: 67px; right: 15px; bottom: auto; z-index: 850; }
    .leaderboard-toggle-btn {
        width: 44px;
        height: 44px;
        box-shadow: 3px 3px 0px #000;
    }
    .leaderboard-toggle-btn:hover { box-shadow: 2px 2px 0px #000; }
    .leaderboard-toggle-btn:active { box-shadow: 1px 1px 0px #000; }
    .leaderboard-toggle-btn svg { width: 20px; height: 20px; }
    .leaderboard-panel {
        position: fixed;
        width: calc(100vw - 20px);
        height: auto;
        min-height: 300px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 180px);
        right: 10px;
        top: 119px;
        bottom: auto;
        left: auto;
        border-radius: 12px;
        z-index: 900;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* Mobile: KYRO button */
    .kyro-action-btn { position: fixed; top: auto; bottom: 15px; left: auto; right: 15px; transform: none; width: 80px; padding: 10px 8px; font-size: 0.65rem; letter-spacing: 0.5px; border-width: 3px; box-shadow: 3px 3px 0px #000; z-index: 600; }
    .kyro-action-btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0px #000; }
    .kyro-action-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0px #000; }

    /* Mobile: KYRO modal */
    .kyro-confirm-content { max-width: 90%; padding: 30px 25px; box-shadow: 6px 6px 0px #000; }
    .kyro-confirm-content h2 { font-size: 1.4rem; margin: 0 0 15px 0; letter-spacing: 1.5px; }
    .kyro-confirm-content p { font-size: 0.95rem; margin: 8px 0; }
    .kyro-warning { font-size: 0.95rem; margin: 20px 0; padding: 15px; box-shadow: 3px 3px 0px #d32f2f; }
    .kyro-confirm-buttons { margin-top: 25px; gap: 10px; flex-direction: column; }
    .kyro-confirm-buttons .neo-btn { width: 100%; padding: 13px 24px; font-size: 0.85rem; box-shadow: 3px 3px 0px #000; }
    .kyro-confirm-buttons .neo-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0px #000; }

    /* Mobile: hint and power overlays - positioned lower to not block cards */
    #hint-overlay { bottom: 60px; }
    .hint-badge { font-size: 0.85rem; padding: 10px 18px; box-shadow: 4px 4px 0px black; max-width: 85vw; white-space: normal; line-height: 1.3; }
    #power-overlay { bottom: 60px; }
    .power-badge { font-size: 0.9rem; padding: 10px 20px; box-shadow: 4px 4px 0px black; }

    .inline-chat-bubble { font-size: 0.6rem; max-width: 80px; padding: 3px 6px; bottom: -25px; }
    .chat-header { padding: 15px; background: var(--dark-bg); border-radius: 12px 12px 0 0; }
    .chat-title { font-size: 1rem; }
    .chat-close-btn { font-size: 1.3rem; width: 30px; height: 30px; }
    .chat-messages { padding: 15px; font-size: 0.9rem; }
    .chat-input-container { padding: 12px 15px; background: var(--dark-bg); border-radius: 0 0 12px 12px; }
    .chat-input { font-size: 0.95rem; padding: 10px 12px; }
    .chat-send-btn { font-size: 1.1rem; }

    .login-page-wrapper {
        min-height: 100vh;
        height: 100vh;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    /* Mobile: home rules link */
    .home-rules-container { bottom: 40px; padding: 0 15px; max-width: 90%; }
    .home-rules-link { font-size: 0.95rem; padding: 10px 20px; }

    /* Mobile: rules modal */
    .rules-content {
        max-width: calc(100vw - 20px);
        max-height: 90vh;
        padding: 35px 12px 15px 12px;
    }
    .rules-content h2 { font-size: 1.25rem; margin-bottom: 15px; letter-spacing: 1px; }
    .rules-content h3 { font-size: 0.95rem; margin-bottom: 10px; padding-bottom: 6px; }
    .rules-section { margin-bottom: 18px; }
    .rules-section p { font-size: 0.8rem; line-height: 1.5; margin-bottom: 10px; }
    .rules-note { font-size: 0.75rem; margin-top: 8px; }
    .card-examples { gap: 8px; flex-wrap: wrap; }
    .card-example { gap: 6px; }
    .example-card { width: 42px; height: 58px; font-size: 1.1rem; }
    .example-card .suit { font-size: 0.6rem; top: 2px; right: 3px; }
    .example-card .power-icon { font-size: 0.35rem; padding: 1px 2px; }
    .card-label { font-size: 0.65rem; }
    .gameplay-steps { padding-left: 18px; margin: 10px 0; }
    .gameplay-steps li { font-size: 0.8rem; margin-bottom: 8px; line-height: 1.5; }
    .gameplay-steps ul { margin-top: 6px; padding-left: 18px; }
    .gameplay-steps ul li { font-size: 0.75rem; margin-bottom: 4px; }
    .indicators-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
    .indicator-item { padding: 6px; gap: 5px; }
    .indicator-item span { font-size: 0.7rem; }
    .example-card-small { width: 32px; height: 44px; }
    .mini-card-value { font-size: 1.1rem; }
    .rules-close-btn { top: 8px; right: 8px; font-size: 1.2rem; width: 28px; height: 28px; }

    /* Mobile: notifications */
    #match-toast, #swap-notification {
        font-size: 1.1rem;
        max-width: 85vw;
        text-shadow: 2px 2px 0px black;
        line-height: 1.2;
    }

    /* Mobile: eye icon */
    .card-eye-icon {
        font-size: 1.5rem;
    }

    /* Mobile: game over content */
    .game-over-content { padding: 25px 15px 20px 15px; max-width: 100%; max-height: 90vh; gap: 20px; }

    /* Mobile: round title */
    #round-title { font-size: 1.4rem; letter-spacing: 0; margin-bottom: 5px; }

    /* Mobile: scoreboard table */
    #leaderboard { padding: 0; max-width: 100%; }
    .scoreboard-table thead th { padding: 10px 5px; font-size: 0.7rem; letter-spacing: 0; }
    .scoreboard-table tbody td { padding: 12px 5px; font-size: 0.8rem; }
    .scoreboard-table .rank-col { min-width: 40px; font-size: 0.8rem; }
    .scoreboard-table .player-col { min-width: 100px; font-size: 0.8rem; padding-left: 8px; }
    .scoreboard-table .round-col { min-width: 50px; }
    .scoreboard-table .total-col { min-width: 60px; font-size: 0.9rem; }
    .scoreboard-table .rank-emoji { font-size: 0.95rem; margin-right: 3px; }
    .scoreboard-table .player-icon-small { font-size: 1rem; margin-right: 5px; }
    .scoreboard-table .doubled-score { font-size: 0.72rem; }
    .scoreboard-table .total-doubled { font-size: 0.68rem; }

    /* Mobile: game over buttons */
    .game-over-buttons { flex-direction: column; gap: 12px; width: 100%; }
    .result-btn { min-width: auto; width: 100%; padding: 14px 20px; font-size: 0.9rem; }

    /* Mobile: ready status */
    .ready-label { font-size: 0.9rem; }
    .ready-indicator { width: 28px; height: 28px; font-size: 1rem; }
}