@import '../common.css';

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Purple theme (menu screens) */
    --bg-primary: #0C0D14;
    --bg-secondary: #1A1B23;
    --text-primary: #F9FAFF;
    --text-secondary: #AAADBE;
    --purple-primary: #8B5CF6;
    --purple-hover: #7C3AED;

    /* Tombola game colors */
    --tombola-red: #DC2626;
    --tombola-red-dark: #991B1B;
    --tombola-gold: #F59E0B;
    --tombola-bg: #0e0e0e;
    --tombola-surface: #1a1a1a;
    --tombola-border: #2a2a2a;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    user-select: none;
    -webkit-user-select: none;
}

/* ========================================
   Inputs
   ======================================== */
.lobby-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.lobby-input:focus {
    border-color: var(--purple-primary);
    background: rgba(139, 92, 246, 0.08);
}

.lobby-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.code-input {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.share-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    padding: 10px 14px;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
    outline: none;
    box-sizing: border-box;
}

/* ========================================
   Share code box & room code
   ======================================== */
.share-code-box {
    background: rgba(139, 92, 246, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 14px;
    padding: 16px 20px;
}

.share-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.room-code {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    color: var(--purple-primary);
    font-family: 'Courier New', monospace;
    line-height: 1;
}

.share-link-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ========================================
   Divider "oppure"
   ======================================== */
.lobby-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.lobby-divider::before,
.lobby-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* ========================================
   Social share buttons
   ======================================== */
.social-share-btns {
    display: flex;
    gap: 8px;
}

.share-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.share-btn-whatsapp {
    background: #25D366;
    color: white;
}

.share-btn-whatsapp:hover {
    background: #1da851;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.share-btn-telegram {
    background: #229ED9;
    color: white;
}

.share-btn-telegram:hover {
    background: #1a7eb0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 158, 217, 0.4);
}

/* ========================================
   Rules box
   ======================================== */
.rules-box {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px 22px;
    text-align: left;
}

.rules-box h3 {
    color: var(--purple-primary);
    font-size: 0.85rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: inherit;
}

.rules-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-box li {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding-left: 14px;
    position: relative;
    line-height: 1.5;
}

.rules-box li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--purple-primary);
    font-weight: bold;
}

/* ========================================
   Menu button overrides (Purple theme)
   ======================================== */
#start-screen .btn,
#lobby-screen .btn,
#join-screen .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
    font-family: inherit;
    text-decoration: none;
}

#start-screen .btn-primary,
#lobby-screen .btn-primary,
#join-screen .btn-primary {
    background: var(--purple-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

#start-screen .btn-primary:hover:not(:disabled),
#lobby-screen .btn-primary:hover:not(:disabled),
#join-screen .btn-primary:hover:not(:disabled) {
    background: var(--purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

#start-screen .btn-primary:disabled,
#lobby-screen .btn-primary:disabled,
#join-screen .btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#start-screen .btn-secondary,
#lobby-screen .btn-secondary,
#join-screen .btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(139, 92, 246, 0.35);
}

#start-screen .btn-secondary:hover,
#lobby-screen .btn-secondary:hover,
#join-screen .btn-secondary:hover {
    border-color: var(--purple-primary);
    background: rgba(139, 92, 246, 0.08);
}

#start-screen .btn-back,
#lobby-screen .btn-back,
#join-screen .btn-back {
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
    display: block;
    width: 100%;
    text-align: center;
}

#start-screen .btn-back:hover,
#lobby-screen .btn-back:hover,
#join-screen .btn-back:hover {
    color: var(--text-primary);
}

#start-screen .btn-icon-only,
#lobby-screen .btn-icon-only,
#join-screen .btn-icon-only {
    padding: 10px 14px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-primary);
    transition: background 0.2s;
    flex-shrink: 0;
}

#start-screen .btn-icon-only:hover,
#lobby-screen .btn-icon-only:hover,
#join-screen .btn-icon-only:hover {
    background: rgba(139, 92, 246, 0.25);
}

.btn-large {
    padding: 16px 40px !important;
    font-size: 1.05rem !important;
    width: 100%;
}

.btn-icon {
    font-size: 1.2em;
    line-height: 1;
}

/* ========================================
   START SCREEN
   ======================================== */
#start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1428 50%, var(--bg-primary) 100%);
    text-align: center;
}

.start-container {
    width: 100%;
    max-width: 440px;
}

.start-box {
    background: var(--bg-secondary);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 20px;
    padding: 28px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.form-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}

.card-count-selector {
    display: flex;
    gap: 8px;
}

.card-count-btn,
.join-card-count-btn {
    flex: 1;
    padding: 11px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.card-count-btn.active,
.join-card-count-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--purple-primary);
    color: var(--purple-primary);
}

.card-count-btn:hover:not(.active),
.join-card-count-btn:hover:not(.active) {
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--text-primary);
}

.join-inline {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.join-inline .lobby-input {
    flex: 1;
    margin-bottom: 0;
}

.join-inline .btn {
    padding: 14px 18px;
    flex-shrink: 0;
}

/* ========================================
   LOBBY SCREEN
   ======================================== */
#lobby-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1428 50%, var(--bg-primary) 100%);
}

.lobby-container {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.lobby-box {
    background: var(--bg-secondary);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 20px;
    padding: 28px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    text-align: left;
}

.players-section h3 {
    margin: 0 0 12px 0;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.player-item:last-child {
    border-bottom: none;
}

.player-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--purple-primary);
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.player-name-text {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-croupier {
    font-size: 0.72rem;
    color: var(--tombola-gold);
}

.player-cards-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.waiting-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: -10px 0 0 0;
}

.share-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-input-row .share-input {
    flex: 1;
    min-width: 0;
}

/* ========================================
   JOIN SCREEN
   ======================================== */
#join-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1428 50%, var(--bg-primary) 100%);
    text-align: center;
}

.join-container {
    width: 100%;
    max-width: 400px;
}

.join-box {
    background: var(--bg-secondary);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 20px;
    padding: 28px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: center;
}

.join-room-display {
    padding: 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.join-room-display .share-label {
    margin: 0;
    font-size: 0.75rem;
}

.join-box .form-section {
    text-align: left;
}

/* ========================================
   GAME SCREEN
   ======================================== */
#game-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--tombola-bg);
    color: var(--text-primary);
    overflow: hidden;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--tombola-surface);
    border-bottom: 2px solid var(--tombola-red);
    flex-shrink: 0;
    gap: 12px;
}

.header-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--tombola-gold);
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.number-ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--tombola-red);
    border: 3px solid var(--tombola-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 900;
    color: white;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
    flex-shrink: 0;
}

.number-ball.pop {
    animation: numberPop 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes numberPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.45); box-shadow: 0 0 35px rgba(220, 38, 38, 0.8); }
    100% { transform: scale(1); }
}

.numbers-left {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.game-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.game-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: var(--tombola-surface);
    border-right: 1px solid var(--tombola-border);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.sidebar-section {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--tombola-border);
}

.sidebar-section:last-of-type {
    border-bottom: none;
}

.sidebar-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    font-weight: 600;
}

.sidebar-controls {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Prize list */
.prize-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    font-size: 0.82rem;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.prize-item.won { opacity: 1; }
.prize-emoji { font-size: 0.7rem; min-width: 18px; }
.prize-label { flex: 1; font-weight: 600; }
.prize-winner-name { font-size: 0.72rem; color: var(--tombola-gold); font-weight: 700; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prize-status { font-size: 0.72rem; color: var(--text-secondary); }

/* Players in game */
.game-player-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.82rem;
}

.game-player-item.me { color: var(--tombola-gold); }

.game-player-initial {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.me .game-player-initial {
    background: rgba(245, 158, 11, 0.18);
    color: var(--tombola-gold);
}

.game-player-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.croupier-dot { font-size: 0.75rem; flex-shrink: 0; }

/* Extract & new game buttons */
.btn-extract {
    width: 100%;
    padding: 13px 10px;
    background: var(--tombola-red);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.btn-extract:hover:not(:disabled) {
    background: var(--tombola-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.5);
}

.btn-extract:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none;
}

.btn-new-game {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--tombola-border);
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-new-game:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Main area */
.game-main {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    font-weight: 600;
}

/* ========================================
   TOMBOLA BOARD (9 rows × 10 cols)
   ======================================== */
.tombola-board {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.board-row {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
}

.board-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 5px;
    background: var(--tombola-surface);
    border: 1px solid var(--tombola-border);
    color: var(--text-secondary);
    transition: background 0.25s, color 0.25s;
    min-width: 0;
}

.board-cell.extracted {
    background: var(--tombola-red);
    color: white;
    border-color: var(--tombola-red-dark);
    font-weight: 800;
}

.board-cell.last-extracted {
    animation: cellPop 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
}

@keyframes cellPop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* ========================================
   TOMBOLA CARDS
   ======================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 14px;
}

.tombola-card {
    background: var(--tombola-surface);
    border: 1px solid var(--tombola-border);
    border-radius: 14px;
    padding: 14px;
}

.card-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tombola-gold);
    margin-bottom: 10px;
    font-weight: 700;
}

.card-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-row {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
}

.card-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    min-width: 0;
    transition: background 0.25s, color 0.25s;
}

.card-cell.empty {
    background: transparent;
    border-color: transparent;
}

.card-cell.marked {
    background: var(--tombola-red);
    color: white;
    border-color: var(--tombola-red-dark);
    border-radius: 50%;
    font-weight: 800;
}


/* ========================================
   PRIZE OVERLAY
   ======================================== */
.prize-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.prize-content {
    text-align: center;
    padding: 44px 64px;
    background: linear-gradient(135deg, #1a1a1a 0%, #1f1400 100%);
    border: 3px solid var(--tombola-gold);
    border-radius: 24px;
    box-shadow: 0 0 80px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: prizeAppear 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    max-width: 90vw;
}

@keyframes prizeAppear {
    0%   { transform: scale(0.5) rotate(-2deg); opacity: 0; }
    70%  { transform: scale(1.06) rotate(0.5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.prize-text {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--tombola-gold);
    line-height: 1.25;
    white-space: pre-line;
}

.prize-player-name {
    font-size: 1.25rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 10px;
    font-weight: 600;
}

.prize-tap-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    margin: 16px 0 0 0;
    letter-spacing: 0.05em;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 320px;
}

.toast {
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    line-height: 1.4;
}

.toast.visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-info    { background: #1e3a5f; border-left: 3px solid #3b82f6; color: #fff; }
.toast-success { background: #14532d; border-left: 3px solid #22c55e; color: #fff; }
.toast-warning { background: #713f12; border-left: 3px solid #f59e0b; color: #fff; }
.toast-danger  { background: #7f1d1d; border-left: 3px solid #ef4444; color: #fff; }

/* ========================================
   RESPONSIVE — tablet 768px
   ======================================== */
@media (max-width: 768px) {
    .game-title { font-size: 3rem !important; }

    .game-body { flex-direction: column; }

    .game-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--tombola-border);
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 10px;
        overflow: visible;
        flex-shrink: 0;
    }

    .sidebar-section {
        border-bottom: none;
        padding-bottom: 0;
        min-width: 100px;
        flex: 1;
    }

    .sidebar-controls {
        margin-top: 0;
        width: 100%;
        flex-direction: row;
    }

    .btn-extract,
    .btn-new-game { flex: 1; }

    .game-header { padding: 8px 14px; }

    .number-ball { width: 52px; height: 52px; font-size: 1.15rem; }

    .board-cell { font-size: 0.62rem; }
    .card-cell  { font-size: 0.68rem; }

    .prize-text { font-size: 1.8rem; }
    .prize-content { padding: 28px 32px; }
}

/* ========================================
   RESPONSIVE — mobile 480px
   ======================================== */
@media (max-width: 480px) {
    .game-title { font-size: 2.5rem !important; }

    .start-box, .lobby-box, .join-box { padding: 20px 16px; }

    .number-ball { width: 46px; height: 46px; font-size: 1rem; }

    .board-cell { font-size: 0.55rem; border-radius: 3px; }
    .card-cell  { font-size: 0.6rem; }

    .prize-text { font-size: 1.5rem; }
    .prize-content { padding: 22px 20px; margin: 12px; }

    .toast-container { max-width: calc(100vw - 24px); }
    .toast { font-size: 0.82rem; padding: 10px 14px; }

    .cards-grid { grid-template-columns: 1fr; }
}
