/**
 * Persian Bingo - Styles
 * Supports RTL (Persian) and responsive design
 */

/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #f59e0b;
    --secondary-dark: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f8fafc;
    --bg-dark: #1e293b;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --font-fa: 'Vazirmatn', 'Tahoma', sans-serif;
    --font-en: 'Segoe UI', 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-fa);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* ============================================
   Home Page
   ============================================ */
.home-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.title {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.home-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    max-width: 600px;
}

.home-footer {
    margin-top: 3rem;
    color: var(--text-light);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-large {
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
    min-width: 180px;
    flex-direction: column;
}

.btn-icon {
    font-size: 2rem;
}

.btn-text small {
    font-weight: 400;
    opacity: 0.8;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-title {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-id {
    background: var(--bg);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--primary);
}

/* ============================================
   Setup Screen
   ============================================ */
.setup-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.setup-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Board Size Cards */
.board-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.board-option {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.board-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.board-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.board-option-size {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.board-option-info {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Language Selection */
.language-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.lang-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.lang-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.lang-flag {
    font-size: 2rem;
}

.lang-name {
    font-weight: 600;
}

/* ============================================
   QR Code Screen
   ============================================ */
.qr-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 2rem;
}

.qr-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.qr-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.qr-code {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.qr-code canvas, .qr-code img {
    display: block;
}

.game-url {
    font-family: monospace;
    font-size: 1.25rem;
    background: var(--bg);
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    word-break: break-all;
}

.player-count {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.player-count strong {
    color: var(--primary);
    font-size: 2rem;
}

/* ============================================
   TV Display (Host calling screen)
   ============================================ */
.tv-display {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    overflow: hidden;
}

.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.tv-game-id {
    font-size: 1.25rem;
    opacity: 0.8;
}

.tv-controls {
    display: flex;
    gap: 1rem;
}

.tv-join-panel {
    position: fixed;
    top: 4.5rem;
    inset-inline-end: 0.75rem;
    background: white;
    color: #1e293b;
    border-radius: 10px;
    padding: 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    width: 120px;
    text-align: center;
    z-index: 50;
    opacity: 0.95;
    animation: fadeInUp 0.3s ease;
}

.tv-join-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-size: 0.7rem;
}

.tv-join-qr {
    display: flex;
    justify-content: center;
    background: #fff;
    padding: 0.25rem;
    border-radius: 6px;
}

.tv-join-qr canvas,
.tv-join-qr img {
    width: 96px !important;
    height: 96px !important;
    display: block;
}

.tv-join-url {
    margin-top: 0.35rem;
    font-size: 0.6rem;
    word-break: break-all;
    color: #475569;
    direction: ltr;
}

.tv-join-count {
    margin-top: 0.4rem;
    font-size: 0.65rem;
}

.tv-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    min-height: 0;
    overflow: hidden;
}

.current-item {
    text-align: center;
    animation: fadeInUp 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    flex: 1;
    justify-content: center;
    width: 100%;
}

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

.current-item-img {
    width: clamp(120px, 28vh, 320px);
    height: clamp(120px, 28vh, 320px);
    object-fit: contain;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    flex-shrink: 1;
    min-height: 0;
}

.current-item-name {
    font-size: clamp(2rem, 5vh, 4rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

.current-item-name-en {
    font-size: clamp(0.9rem, 1.8vh, 1.5rem);
    opacity: 0.7;
    font-family: var(--font-en);
}

.call-count {
    font-size: 1rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

.waiting-message {
    font-size: 2rem;
    opacity: 0.5;
}

/* Called Items History */
.called-history {
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    max-height: 28vh;
    overflow-y: auto;
}

.called-history-title {
    font-size: 0.875rem;
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.called-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding-bottom: 0.5rem;
    justify-content: flex-start;
    align-content: flex-start;
}

.called-item {
    flex: 0 0 auto;
    text-align: center;
    opacity: 0.85;
    width: 56px;
}

.called-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.called-item-name {
    font-size: 0.7rem;
    margin-top: 0.2rem;
    line-height: 1.1;
}

/* Landscape on large screens (TV / desktop): put called-history strip to the
   right of the main area. Excludes short phone screens via min-height. */
@media (orientation: landscape) and (min-width: 768px) and (min-height: 701px) {
    .tv-display {
        display: grid;
        grid-template-columns: 1fr minmax(220px, 22vw);
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "header header"
            "main   side";
    }

    .tv-header {
        grid-area: header;
    }

    .tv-main {
        grid-area: main;
        min-width: 0;
    }

    .called-history {
        grid-area: side;
        max-height: none;
        height: 100%;
        overflow-y: auto;
        border-inline-start: 1px solid rgba(255, 255, 255, 0.08);
    }

    .called-items-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-content: flex-start;
    }

    .called-item {
        width: 64px;
    }

    .called-item img {
        width: 44px;
        height: 44px;
    }
}

/* Landscape on phones (short height): put the QR on the left and ALL the
   buttons (new game, verify, next, autoplay) in a rail on the right, leaving
   the centre free for a large called-card. */
@media (orientation: landscape) and (max-height: 700px) {
    /* Force a plain flex column even if the large-screen grid would apply */
    .tv-display {
        display: flex;
        flex-direction: column;
    }

    /* Thin header: only the game id stays, controls move to the right rail */
    .tv-header {
        position: absolute;
        top: 0;
        inset-inline: 0;
        padding: 0.2rem 0.75rem;
        background: rgba(0, 0, 0, 0.15);
        z-index: 40;
    }

    .tv-game-id {
        font-size: 0.85rem;
    }

    /* Right rail (top): New game + Verify */
    .tv-controls {
        position: fixed;
        top: 0.4rem;
        right: 0.5rem;
        left: auto;
        flex-direction: column;
        gap: 0.4rem;
        width: 124px;
        z-index: 60;
    }

    .tv-controls .btn {
        width: 100%;
        font-size: 0.75rem;
        padding: 0.45rem 0.5rem;
        background: rgba(0, 0, 0, 0.35);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: none;
    }

    .tv-controls .btn-danger {
        background: linear-gradient(135deg, var(--danger), #dc2626);
        border: none;
    }

    /* Centre card gets the room; reserve side space for the two rails */
    .tv-main {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        padding: 1.8rem 138px 0.5rem 110px;
    }

    .current-item-img {
        width: clamp(120px, 62vh, 320px);
        height: clamp(120px, 62vh, 320px);
        margin-bottom: 0.4rem;
    }

    .current-item-name {
        font-size: clamp(1.6rem, 8vh, 3.2rem);
    }

    .call-count {
        margin-top: 0.2rem;
    }

    /* Right rail (bottom): Next + Autoplay */
    .tv-action-row {
        position: fixed;
        right: 0.5rem;
        bottom: 0.5rem;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.5rem;
        width: 124px;
        margin: 0;
        z-index: 60;
    }

    .next-btn {
        width: 100%;
        font-size: 0.95rem;
        padding: 0.65rem 0.5rem;
        white-space: nowrap;
    }

    .autoplay-btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.65rem 0.5rem;
    }

    /* QR panel: small, bottom-left, out of the way */
    .tv-join-panel {
        top: auto;
        bottom: 0.5rem;
        inset-inline: auto;
        left: 0.5rem;
        right: auto;
        width: 92px;
        padding: 0.35rem;
        z-index: 60;
    }

    .tv-join-title {
        font-size: 0.6rem;
        margin-bottom: 0.25rem;
    }

    .tv-join-qr canvas,
    .tv-join-qr img {
        width: 70px !important;
        height: 70px !important;
    }

    .tv-join-url {
        font-size: 0.5rem;
    }

    /* Hide the called-history strip in this tight view to maximise the card */
    .called-history {
        display: none;
    }
}

/* Next Button */
.next-btn {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    color: white;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
}

.next-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.5);
}

.next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tv-action-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.autoplay-btn {
    background: linear-gradient(135deg, #6366f1, #4338ca);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
}

.autoplay-btn:hover {
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.55);
}

.autoplay-btn.active {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.45);
}

/* ============================================
   Bingo Card
   ============================================ */
.bingo-card {
    display: grid;
    gap: 4px;
    background: var(--border);
    padding: 4px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    margin: 0 auto;
}

.bingo-card.size-3 { grid-template-columns: repeat(3, 1fr); }
.bingo-card.size-4 { grid-template-columns: repeat(4, 1fr); }
.bingo-card.size-5 { grid-template-columns: repeat(5, 1fr); }

.bingo-cell {
    aspect-ratio: 1;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.bingo-cell:hover {
    background: rgba(99, 102, 241, 0.1);
}

.bingo-cell.marked {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.bingo-cell.marked::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 1rem;
    font-weight: bold;
}

.bingo-cell.free {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
}

.bingo-cell.winning {
    animation: pulse 0.5s ease infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.cell-img {
    width: 45%;
    height: 45%;
    object-fit: contain;
}

.cell-name {
    font-size: 0.6rem;
    margin-top: 0.15rem;
    text-align: center;
    line-height: 1.1;
}

.cell-name-en {
    font-size: 0.5rem;
    color: var(--text-light);
    font-family: var(--font-en);
    margin-bottom: 0.1rem;
}

.cell-name-fa {
    font-size: 0.6rem;
    font-weight: 600;
    margin-top: 0.1rem;
}

.bingo-cell.marked .cell-name-en {
    color: rgba(255, 255, 255, 0.7);
}

.cell-free-text {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

/* ============================================
   Player Screen
   ============================================ */
.player-screen {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.current-call {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
}

.current-call-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.current-call-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.current-call-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.current-call-name {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ============================================
   Join Screen
   ============================================ */
.join-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.join-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.join-game-id {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.join-form {
    width: 100%;
    max-width: 300px;
}

.join-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.join-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   Verify Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.verify-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

/* ============================================
   Print Styles
   ============================================ */
.print-container {
    padding: 2rem;
}

.print-options {
    max-width: 400px;
    margin: 0 auto 2rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.print-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.print-card {
    page-break-inside: avoid;
    padding: 1rem;
    border: 2px solid var(--text);
    border-radius: var(--radius);
}

.print-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.print-table-number {
    font-size: 1.5rem;
    font-weight: 700;
}

@media print {
    body {
        background: white;
    }
    
    .print-options, .no-print {
        display: none !important;
    }
    
    .print-cards {
        display: block;
    }
    
    .print-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .bingo-cell {
        border: 1px solid #000;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .home-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-large {
        width: 100%;
    }
    
    .board-options {
        grid-template-columns: 1fr;
    }
    
    .current-item-img {
        width: 220px;
        height: 220px;
    }
    
    .current-item-name {
        font-size: 2.5rem;
    }
    
    .tv-header {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .bingo-card {
        gap: 2px;
        padding: 2px;
    }
    
    .cell-name {
        font-size: 0.6rem;
    }
    
    .player-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================
   Winner Banner (host TV screen)
   ============================================ */
.winner-banner {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    animation: fadeInUp 0.4s ease;
}

.winner-banner.hidden {
    display: none;
}

.winner-banner-inner {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    border-radius: 16px;
    padding: 2.5rem 3rem;
    max-width: 720px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.winner-emoji {
    font-size: 6rem;
    line-height: 1;
    animation: pulse 0.6s ease infinite alternate;
}

.winner-label {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.winner-name {
    font-size: 4rem;
    font-weight: 900;
    margin-top: 0.5rem;
    word-break: break-word;
}

.winner-table-line {
    font-size: 1.5rem;
    margin-top: 0.75rem;
    opacity: 0.95;
}

.winner-table-line strong {
    font-size: 2rem;
    margin-inline-start: 0.5rem;
}

#winner-banner-close {
    margin-top: 1rem;
    color: white;
    border-color: white;
}
