/* Enhanced Settings Modal Styles */
.settings-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.square.locked {
  opacity: 0.6;
  cursor: not-allowed;
}


.settings-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #2c3e50;
    border-radius: 20px;
    padding: 40px 35px 30px;
    max-width: 480px;
    width: 95%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-modal.show .settings-content {
    transform: scale(1) translateY(0);
}

.settings-content.dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e4e6eb;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(52, 152, 219, 0.2);
}

.settings-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3498db, #2980b9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-title i {
    color: #3498db;
    animation: rotate 3s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.settings-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.settings-group {
    margin-bottom: 25px;
}

.settings-group h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-content.dark .settings-group h3 {
    color: #e4e6eb;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.setting-item:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.settings-content.dark .setting-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-content.dark .setting-item:hover {
    background: rgba(52, 152, 219, 0.15);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
    flex: 1;
}

.setting-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db;
    font-size: 1.1rem;
}

/* Custom Toggle Switch */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #bdc3c7;
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.toggle-switch.active {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::before {
    transform: translateX(30px);
}

/* Custom Select Styling */
.custom-select {
    position: relative;
    min-width: 200px;
}

.custom-select select {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 2px solid rgba(52, 152, 219, 0.2);
    border-radius: 10px;
    background: white;
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
}

.custom-select select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.custom-select::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #3498db;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.custom-select:hover::after {
    transform: translateY(-50%) rotate(180deg);
}

.settings-content.dark .custom-select select {
    background: rgba(255, 255, 255, 0.1);
    color: #e4e6eb;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Multi-select styling */
.multi-select-container {
    margin-top: 10px;
}

.purchase-locked-banner {
    background: #8b0000;
    color: #fff;
    padding: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    text-align: center;
    border-radius: 6px;
}


/* Board lifecycle observability */
.board-lifecycle-status {
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid #d8dee6;
    border-left-width: 5px;
    border-radius: 8px;
    background: #f8f9fb;
    color: #243447;
}

.board-lifecycle-header,
.board-lifecycle-meta,
.board-lifecycle-recovery {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    flex-wrap: wrap;
}

.board-lifecycle-eyebrow,
.board-lifecycle-badge {
    font-weight: 800;
    text-transform: uppercase;
}

.board-lifecycle-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.board-lifecycle-badge {
    padding: 5px 10px;
    border-radius: 999px;
    background: #e9ecef;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.board-lifecycle-message {
    margin-top: 8px;
    font-weight: 700;
}

.board-lifecycle-meta {
    justify-content: flex-start;
    margin-top: 7px;
    font-size: 0.9rem;
    font-weight: 600;
}

.board-lifecycle-status.state-open { border-left-color: #198754; }
.board-lifecycle-status.state-open .board-lifecycle-badge { background: #d1e7dd; color: #0f5132; }
.board-lifecycle-status.state-pending { border-left-color: #ffc107; }
.board-lifecycle-status.state-pending .board-lifecycle-badge { background: #fff3cd; color: #664d03; }
.board-lifecycle-status.state-frozen { border-left-color: #0d6efd; }
.board-lifecycle-status.state-frozen .board-lifecycle-badge { background: #cfe2ff; color: #084298; }
.board-lifecycle-status.state-final { border-left-color: #212529; }
.board-lifecycle-status.state-final .board-lifecycle-badge { background: #212529; color: #fff; }
.board-lifecycle-status.state-loading { border-left-color: #6c757d; }
.board-lifecycle-status.state-error { border-left-color: #dc3545; }
.board-lifecycle-status.state-error .board-lifecycle-badge { background: #f8d7da; color: #842029; }

.board-lifecycle-recovery {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.board-lifecycle-retry {
    border: 1px solid currentColor;
    border-radius: 6px;
    padding: 7px 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.board-lifecycle-retry:hover,
.board-lifecycle-retry:focus { text-decoration: underline; }

body.dark-mode .board-lifecycle-status {
    background: #20283a;
    color: #f2f4f8;
    border-color: #465169;
}

body.dark-mode .board-lifecycle-recovery {
    border-top-color: rgba(255, 255, 255, 0.16);
}



.multi-select-container select {
    height: 120px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(52, 152, 219, 0.2);
    border-radius: 10px;
    padding: 8px;
}

.multi-select-container select option {
    padding: 8px 12px;
    border-radius: 6px;
    margin: 2px 0;
    font-weight: 500;
}

.multi-select-container select option:checked {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.multi-select-hint {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 8px;
    font-style: italic;
}

.settings-content.dark .multi-select-hint {
    color: #bdc3c7;
}

/* Save Button */
.save-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

.save-button:active {
    transform: translateY(0);
}

.save-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.save-button:hover::before {
    left: 100%;
}

/* Responsive Design */
@media (max-width: 600px) {
    .settings-content {
        padding: 25px 20px 20px;
        margin: 20px;
        border-radius: 15px;
    }
    
    .settings-title {
        font-size: 1.5rem;
    }
    
    .setting-item {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .custom-select {
        min-width: 100%;
        margin-top: 8px;
    }
    
    .toggle-switch {
        margin-top: 8px;
    }
}

/* Dark mode specific adjustments */
body.dark-mode .settings-modal {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .settings-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e4e6eb;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .settings-title {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .settings-title i {
    color: #74b9ff;
}

/* ================================================================
   BLOCKGATORS MIGRATION - MEMBER / GUEST PURCHASE STATES
   ================================================================ */

#token-selection-group {
    transition: opacity 0.2s ease;
}

#payment-method,
#tokenSelect {
    cursor: pointer;
}

#purchase-btn {
    width: 100%;
}

.guest-checkout-note i {
    margin-right: 6px;
}

.purchase-message.success {
    color: #155724;
}

.purchase-message.error {
    color: #721c24;
}

.purchase-message.info {
    color: #0c5460;
}

body.dark-mode .form-control {
    background: #20283a;
    border-color: #465169;
    color: #f2f4f8;
}

body.dark-mode .form-control option {
    background: #20283a;
    color: #f2f4f8;
}

/*
 * Purchased/locked squares remain non-interactive regardless
 * of whether the buyer is a member or a guest.
 */
.square.purchased,
.square.locked {
    pointer-events: none;
}


/* ================================================================
   SPORTSCENTER SQUARE PAYMENT STATES
   ================================================================ */

/*
 * RESERVED / AWAITING PAYMENT
 *
 * A reservation is NOT a completed purchase.
 * These squares must remain visibly distinct from PURCHASED squares
 * and must not be selectable by another user.
 */
.square.reserved,
.square.awaiting-payment,
.square.awaiting_payment {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #664d03;
    border-color: #ffc107;
    cursor: not-allowed;
    opacity: 0.85;
    pointer-events: none;
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(255, 193, 7, 0.25);
}

/*
 * Prevent the generic .square:hover rule from making an unpaid
 * reservation appear interactive.
 */
.square.reserved:hover,
.square.awaiting-payment:hover,
.square.awaiting_payment:hover {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #664d03;
    border-color: #ffc107;
    cursor: not-allowed;
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(255, 193, 7, 0.25);
}

/*
 * PURCHASED / LOCKED squares are final, non-selectable grid states.
 */
.square.purchased,
.square.locked,
.square.yours {
    pointer-events: none;
    cursor: not-allowed;
}

/* Dark-mode reservation visibility. */
body.dark-mode .square.reserved,
body.dark-mode .square.awaiting-payment,
body.dark-mode .square.awaiting_payment {
    background: linear-gradient(135deg, #665200 0%, #806600 100%);
    color: #fff3cd;
    border-color: #ffc107;
}


/* ================================================================
   RESERVED SQUARE - PAYMENT PENDING LABEL
   ================================================================ */

.square.reserved .square-pending-label,
.square.payment-pending .square-pending-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 2px 5px;
    border: 1px solid #ffc107;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.72);
    color: #664d03;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}

/* Dark-mode pending label. */
body.dark-mode .square.reserved .square-pending-label,
body.dark-mode .square.payment-pending .square-pending-label {
    background: rgba(0, 0, 0, 0.28);
    color: #fff3cd;
    border-color: #ffc107;
}

/* ===== SPORTSCENTER EXACT BOARD RESPONSIVE SYSTEM ===== */

/*
 * ==========================================================
 * BGA SPORTSCENTER NFL SQUARES
 *
 * EXACT BOARD GEOMETRY
 * ==========================================================
 *
 * The 10x10 board NEVER changes structure.
 *
 * Base desktop geometry:
 *
 * Square:             70 x 70
 * Horizontal number:  70 x 45
 * Vertical number:    45 x 70
 * Grid gap:            2
 * Grid padding:       10
 *
 * On smaller devices every geometric measurement is derived
 * from the SAME --sc-cell value.
 *
 * This means the entire board shrinks proportionally instead
 * of individual components changing layout.
 */


/* ==========================================================
   GENERAL PAGE SAFETY
   ========================================================== */

html {
    width: 100%;
    max-width: 100%;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100%;

    margin: 0;

    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

.container {
    width: 100% !important;

    max-width: 1600px !important;

    margin-left: auto !important;
    margin-right: auto !important;

    padding-left:
        max(
            10px,
            env(safe-area-inset-left, 0px)
        ) !important;

    padding-right:
        max(
            10px,
            env(safe-area-inset-right, 0px)
        ) !important;
}


/* ==========================================================
   KEEP PAGE SECTIONS FROM FORCING OVERFLOW
   ========================================================== */

.main-content,
.game-area,
.sidebar,
.header,
.header-center,
.user-info,
.game-selection-section,
.game-title-section,
.scoreboard,
.grid-container,
.purchase-panel,
.game-stats,
.sc-squares-explainer,
.banner-advertisement-section {
    min-width: 0;
    max-width: 100%;
}


/* ==========================================================
   BOARD CONTAINER
   ========================================================== */

.grid-container {
    width: 100% !important;
    max-width: 100% !important;

    overflow: hidden !important;

    padding:
        clamp(
            6px,
            2.3vw,
            40px
        ) !important;
}


/*
 * ONE sizing variable controls the entire board.
 *
 * 70px = original desktop square.
 *
 * It gradually scales down for phones/tablets but never
 * independently changes rows, columns or axis proportions.
 */

.squares-grid-wrapper {

    --sc-cell:
        clamp(
            22px,
            7.5vw,
            70px
        );


    /*
     * 2 / 70
     */
    --sc-grid-gap:
        calc(
            var(--sc-cell)
            * 0.0285714286
        );


    /*
     * 10 / 70
     */
    --sc-grid-pad:
        calc(
            var(--sc-cell)
            * 0.1428571429
        );


    /*
     * 15 / 70
     *
     * Space between vertical axis and main board.
     */
    --sc-axis-gap:
        calc(
            var(--sc-cell)
            * 0.2142857143
        );


    /*
     * 12 / 70
     *
     * Space between horizontal axis and grid.
     */
    --sc-header-gap:
        calc(
            var(--sc-cell)
            * 0.1714285714
        );


    /*
     * 45 / 70
     *
     * Horizontal-number height.
     */
    --sc-header-height:
        calc(
            var(--sc-cell)
            * 0.6428571429
        );


    /*
     * 45 / 70
     *
     * Vertical-number width.
     */
    --sc-side-width:
        calc(
            var(--sc-cell)
            * 0.6428571429
        );


    display: grid !important;

    grid-template-columns:
        var(--sc-side-width)
        auto !important;

    align-items: start !important;

    column-gap:
        var(--sc-axis-gap) !important;

    row-gap: 0 !important;


    width: max-content !important;

    max-width: 100% !important;

    min-width: 0 !important;


    margin:
        0
        auto !important;


    padding: 0 !important;
}


/* ==========================================================
   RIGHT SIDE
   ========================================================== */

.grid-with-horizontal {

    display: flex !important;

    flex-direction: column !important;

    align-items: flex-start !important;


    gap:
        var(--sc-header-gap) !important;


    width: max-content !important;

    max-width: 100% !important;

    min-width: 0 !important;


    margin: 0 !important;

    padding: 0 !important;
}


/* ==========================================================
   HORIZONTAL NUMBERS
   ========================================================== */

.horizontal-numbers {

    display: grid !important;


    grid-template-columns:
        repeat(
            10,
            var(--sc-cell)
        ) !important;


    gap:
        var(--sc-grid-gap) !important;


    /*
     * Exactly the same left/right padding as the
     * 10x10 square grid.
     */
    padding:
        0
        var(--sc-grid-pad) !important;


    margin: 0 !important;


    width: max-content !important;

    min-width: 0 !important;


    height:
        var(--sc-header-height) !important;


    justify-content: start !important;

    align-items: stretch !important;
}


.horizontal-number {

    width:
        var(--sc-cell) !important;

    height:
        var(--sc-header-height) !important;


    min-width: 0 !important;

    min-height: 0 !important;


    margin: 0 !important;

    padding: 0 !important;


    display: flex !important;

    align-items: center !important;

    justify-content: center !important;


    /*
     * Original horizontal-number border = 4px at 70px.
     */
    border-width:
        max(
            1px,
            calc(
                var(--sc-cell)
                * 0.0571428571
            )
        ) !important;


    /*
     * Original radius = 12px at 70px.
     */
    border-radius:
        calc(
            var(--sc-cell)
            * 0.1714285714
        ) !important;


    font-size:
        clamp(
            0.65rem,
            calc(
                var(--sc-cell)
                * 0.32
            ),
            1.4rem
        ) !important;


    line-height: 1 !important;
}


/* ==========================================================
   10 x 10 GRID
   ========================================================== */

.squares-grid,
#squares-grid {

    display: grid !important;


    grid-template-columns:
        repeat(
            10,
            var(--sc-cell)
        ) !important;


    grid-template-rows:
        repeat(
            10,
            var(--sc-cell)
        ) !important;


    gap:
        var(--sc-grid-gap) !important;


    padding:
        var(--sc-grid-pad) !important;


    margin: 0 !important;


    width: max-content !important;

    max-width: none !important;

    min-width: 0 !important;
}


.squares-grid .square,
#squares-grid .square {

    width:
        var(--sc-cell) !important;

    height:
        var(--sc-cell) !important;


    min-width: 0 !important;

    min-height: 0 !important;

    max-width: none !important;

    max-height: none !important;


    aspect-ratio:
        1 / 1 !important;


    margin: 0 !important;

    padding: 0 !important;


    display: flex !important;

    align-items: center !important;

    justify-content: center !important;


    /*
     * Original square border = 2px at 70px.
     */
    border-width:
        max(
            1px,
            calc(
                var(--sc-cell)
                * 0.0285714286
            )
        ) !important;


    /*
     * Original square radius = 6px.
     */
    border-radius:
        calc(
            var(--sc-cell)
            * 0.0857142857
        ) !important;


    font-size:
        clamp(
            0.5rem,
            calc(
                var(--sc-cell)
                * 0.2285714286
            ),
            1rem
        ) !important;


    line-height: 1 !important;
}


/* ==========================================================
   VERTICAL NUMBERS
   ========================================================== */

.vertical-numbers {

    display: grid !important;


    grid-template-columns:
        var(--sc-side-width) !important;


    grid-template-rows:
        repeat(
            10,
            var(--sc-cell)
        ) !important;


    gap:
        var(--sc-grid-gap) !important;


    /*
     * Exact location of row #0:
     *
     * horizontal-number height
     * + horizontal/grid gap
     * + grid top padding
     */
    margin:
        calc(
            var(--sc-header-height)
            + var(--sc-header-gap)
            + var(--sc-grid-pad)
        )
        0
        0
        0 !important;


    padding: 0 !important;


    width:
        var(--sc-side-width) !important;


    min-width:
        var(--sc-side-width) !important;


    max-width:
        var(--sc-side-width) !important;


    height: auto !important;

    min-height: 0 !important;

    max-height: none !important;
}


.vertical-number {

    width:
        var(--sc-side-width) !important;


    height:
        var(--sc-cell) !important;


    min-width: 0 !important;

    min-height: 0 !important;

    max-width: none !important;

    max-height: none !important;


    margin: 0 !important;

    padding: 0 !important;


    display: flex !important;

    align-items: center !important;

    justify-content: center !important;


    /*
     * Original vertical-number border = 2px.
     */
    border-width:
        max(
            1px,
            calc(
                var(--sc-cell)
                * 0.0285714286
            )
        ) !important;


    /*
     * Original radius = 6px.
     */
    border-radius:
        calc(
            var(--sc-cell)
            * 0.0857142857
        ) !important;


    font-size:
        clamp(
            0.65rem,
            calc(
                var(--sc-cell)
                * 0.32
            ),
            1.4rem
        ) !important;


    line-height: 1 !important;
}


/* ==========================================================
   NEVER ALLOW MOBILE CSS TO CHANGE BOARD STRUCTURE
   ========================================================== */

@media (max-width: 1024px) {

    .squares-grid-wrapper {

        display: grid !important;

        grid-template-columns:
            var(--sc-side-width)
            auto !important;

        align-items: start !important;

        width: max-content !important;

        max-width: 100% !important;
    }


    .grid-with-horizontal {

        display: flex !important;

        flex-direction: column !important;

        width: max-content !important;
    }


    .horizontal-numbers {

        display: grid !important;

        grid-template-columns:
            repeat(
                10,
                var(--sc-cell)
            ) !important;

        flex-direction: unset !important;

        flex-wrap: nowrap !important;
    }


    .vertical-numbers {

        display: grid !important;

        grid-template-columns:
            var(--sc-side-width) !important;

        grid-template-rows:
            repeat(
                10,
                var(--sc-cell)
            ) !important;

        flex-direction: unset !important;
    }


    .squares-grid,
    #squares-grid {

        display: grid !important;

        grid-template-columns:
            repeat(
                10,
                var(--sc-cell)
            ) !important;

        grid-template-rows:
            repeat(
                10,
                var(--sc-cell)
            ) !important;
    }
}


/* ==========================================================
   REST OF PAGE — PHONE FIRST
   ========================================================== */

.main-content {

    display: flex !important;

    flex-direction: column !important;

    gap:
        clamp(
            12px,
            2vw,
            25px
        ) !important;
}


.sidebar {

    width: 100% !important;

    max-width: 100% !important;

    min-width: 0 !important;
}


.header {

    flex-wrap: wrap !important;

    min-width: 0 !important;
}


.header-center,
.user-info,
.auth-buttons {

    min-width: 0 !important;

    max-width: 100% !important;

    flex-wrap: wrap !important;
}


.logo,
.api-status,
#api-status {

    min-width: 0 !important;

    max-width: 100% !important;

    overflow-wrap: anywhere;
}


/* ==========================================================
   SCOREBOARD
   ========================================================== */

.scoreboard {

    width: 100% !important;

    max-width: 100% !important;

    overflow: hidden;
}


.score-header,
.score-row {

    width: 100% !important;


    grid-template-columns:
        minmax(52px, 0.95fr)
        repeat(
            4,
            minmax(0, 1fr)
        )
        minmax(48px, 0.85fr)
        !important;


    gap:
        clamp(
            3px,
            1vw,
            12px
        ) !important;
}


.team-name-score,
.quarter-score,
.final-score {

    min-width: 0 !important;

    overflow-wrap: anywhere;


    padding:
        clamp(
            5px,
            1.3vw,
            15px
        )
        clamp(
            2px,
            0.8vw,
            10px
        )
        !important;


    font-size:
        clamp(
            0.65rem,
            1.8vw,
            1.4rem
        ) !important;
}


/* ==========================================================
   GAME CARDS
   ========================================================== */

.nfl-games-grid {

    width: 100% !important;

    min-width: 0 !important;


    display: grid !important;

    grid-template-columns:
        1fr !important;


    gap:
        clamp(
            10px,
            2vw,
            20px
        ) !important;
}


.nfl-game-card {

    min-width: 0 !important;

    max-width: 100% !important;
}


/* ==========================================================
   BUTTONS / TOUCH CONTROLS
   ========================================================== */

.btn,
.sc-play-now-btn,
.save-button,
.settings-close,
.team-btn {

    min-height: 44px;

    max-width: 100%;

    touch-action: manipulation;
}


.form-control,
.input-field,
select {

    max-width: 100%;

    min-height: 44px;
}


/* ==========================================================
   SPONSOR BANNERS
   ========================================================== */

.sc-top-banner-strip {

    width: 100% !important;

    max-width: 100% !important;


    display: grid !important;


    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                468px
            )
        ) !important;


    justify-content: center !important;


    gap:
        clamp(
            8px,
            2vw,
            20px
        ) !important;
}


.sc-banner-468x60 {

    width: 100% !important;

    max-width: 468px !important;

    height: auto !important;

    aspect-ratio:
        468 / 60;

    overflow: hidden;
}


.sc-banner-468x60 img {

    display: block;

    width: 100% !important;

    height: 100% !important;

    object-fit: contain;
}


.sc-feature-banner,
.banner-ad,
.sc-feature-banner img,
.banner-ad img {

    max-width: 100% !important;
}


/* ==========================================================
   SETTINGS MODAL / SAFE AREAS
   ========================================================== */

.settings-modal {

    width: 100% !important;

    height: 100vh !important;

    height: 100dvh !important;


    padding:
        max(
            10px,
            env(safe-area-inset-top, 0px)
        )
        max(
            10px,
            env(safe-area-inset-right, 0px)
        )
        max(
            10px,
            env(safe-area-inset-bottom, 0px)
        )
        max(
            10px,
            env(safe-area-inset-left, 0px)
        )
        !important;


    overflow: hidden !important;
}


.settings-content {

    width:
        min(
            100%,
            480px
        ) !important;


    max-width:
        480px !important;


    max-height:
        100% !important;


    min-width:
        0 !important;


    min-height:
        0 !important;


    margin:
        0 !important;


    overflow-y:
        auto !important;


    -webkit-overflow-scrolling:
        touch;
}


/* ==========================================================
   PHONES
   ========================================================== */

@media (max-width: 599px) {

    .container {

        padding-left:
            max(
                6px,
                env(safe-area-inset-left, 0px)
            ) !important;


        padding-right:
            max(
                6px,
                env(safe-area-inset-right, 0px)
            ) !important;
    }


    .header {

        flex-direction:
            column !important;


        padding:
            max(
                10px,
                env(safe-area-inset-top, 0px)
            )
            10px
            12px
            !important;


        gap:
            8px !important;


        text-align:
            center !important;
    }


    .header-center,
    .user-info {

        width:
            100% !important;


        flex-direction:
            column !important;


        align-items:
            stretch !important;


        gap:
            8px !important;
    }


    .auth-buttons {

        width:
            100% !important;


        justify-content:
            center !important;
    }


    .logo {

        justify-content:
            center !important;


        font-size:
            clamp(
                1rem,
                5vw,
                1.3rem
            ) !important;
    }


    .game-area {

        padding:
            8px !important;
    }


    .grid-container {

        padding:
            6px !important;


        border-radius:
            12px !important;
    }


    .grid-header {

        margin-bottom:
            10px !important;


        gap:
            8px !important;
    }


    .grid-header h4 {

        font-size:
            clamp(
                0.9rem,
                4vw,
                1.1rem
            ) !important;
    }


    .cost-display {

        font-size:
            clamp(
                0.75rem,
                3.4vw,
                1rem
            ) !important;


        padding:
            6px
            8px !important;
    }


    .scoreboard {

        padding:
            9px !important;
    }


    .score-header,
    .score-row {

        gap:
            3px !important;


        grid-template-columns:
            minmax(
                44px,
                0.9fr
            )
            repeat(
                4,
                minmax(
                    0,
                    1fr
                )
            )
            minmax(
                42px,
                0.8fr
            )
            !important;
    }


    .team-name-score,
    .quarter-score,
    .final-score {

        padding:
            5px
            2px !important;


        font-size:
            clamp(
                0.58rem,
                2.7vw,
                0.82rem
            ) !important;
    }


    .sc-top-banner-strip {

        grid-template-columns:
            minmax(
                0,
                468px
            ) !important;
    }


    .form-control,
    .input-field,
    input,
    select,
    textarea {

        font-size:
            16px !important;
    }
}


/* ==========================================================
   LARGE PHONE / SMALL TABLET
   ========================================================== */

@media
    (min-width: 600px)
    and
    (max-width: 767px) {

    .nfl-games-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            ) !important;
    }
}


/* ==========================================================
   TABLET
   ========================================================== */

@media
    (min-width: 768px)
    and
    (max-width: 1279px) {

    /*
     * Keep SportsCenter single-column so the exact board gets
     * enough width on iPads and Android tablets.
     */

    .main-content {

        display:
            flex !important;


        flex-direction:
            column !important;
    }


    .sidebar {

        width:
            100% !important;
    }


    .nfl-games-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            ) !important;
    }
}


/* ==========================================================
   DESKTOP
   ========================================================== */

@media (min-width: 1280px) {

    .main-content {

        display:
            grid !important;


        grid-template-columns:
            minmax(
                0,
                1fr
            )
            350px
            !important;


        gap:
            25px !important;


        align-items:
            start !important;
    }


    .sidebar {

        width:
            100% !important;
    }


    .nfl-games-grid {

        grid-template-columns:
            repeat(
                auto-fit,
                minmax(
                    300px,
                    1fr
                )
            ) !important;
    }
}


/* ==========================================================
   PHONE LANDSCAPE
   ========================================================== */

@media
    (max-height: 500px)
    and
    (orientation: landscape) {

    .grid-container {

        padding:
            6px !important;
    }


    .settings-content {

        padding:
            12px !important;
    }
}


/* ==========================================================
   TOUCH DEVICES
   ========================================================== */

@media (hover: none) {

    .square:hover,
    .nfl-game-card:hover,
    .team-btn:hover,
    .btn:hover {

        transform:
            none !important;
    }
}


/* ==========================================================
   REDUCED MOTION
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        animation-duration:
            0.01ms !important;


        animation-iteration-count:
            1 !important;


        transition-duration:
            0.01ms !important;
    }
}

/* ===== END SPORTSCENTER EXACT BOARD RESPONSIVE SYSTEM ===== */
