:root {
    --bg: #ffffff;
    --fg: #0e1420;
    --muted: #5e6a85;
    --accent: #5170ff;
    --brand: #5170ff;
    --accent-600: #3f59d8;
    --accent-700: #3249b3;
    --card: #f5f7ff;
    --success: #12b886;
    --danger: #ef476f;
    --radius: 16px;
    --shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.w-webflow-badge {
    display: none !important;
    visibility: hidden !important;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--fg);
    /* background: var(--bg); */
    font-family: 'Poppins', Arial, sans-serif;
}
footer {
    font-family: 'Poppins', Arial, sans-serif;
}

.bg-balls {
    position: fixed; inset: -120px -120px auto auto; z-index: -1; pointer-events: none;
    width: 800px; height: 800px; filter: blur(2px) saturate(110%); opacity: .08;
    background:
    radial-gradient(circle at 18% 22%, var(--accent) 0 60px, transparent 61px),
    radial-gradient(circle at 55% 12%, #ff5170 0 46px, transparent 47px),
    radial-gradient(circle at 80% 32%, #00c2ff 0 54px, transparent 55px),
    radial-gradient(circle at 30% 70%, #00d69a 0 40px, transparent 41px),
    radial-gradient(circle at 76% 74%, #ffa51f 0 52px, transparent 53px);
    border-radius: 50%;
}

header {
    position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid #eef0ff;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
.nav { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { height: 44px; width: auto; border-radius: 10px; }
.brand strong { font-size: 18px; letter-spacing: .3px; }

.cta-btn, .cta-btn-x {
    appearance: none; border: 0; background: var(--accent); color: #fff; padding: 12px 18px; border-radius: var(--radius);
    font-weight: 700; cursor: pointer; box-shadow: var(--shadow); transition: transform .05s ease, background .2s ease;
}
.cta-btn:hover, .cta-btn-x:hover { background: var(--accent-600); }
.cta-btn:active, .cta-btn-x:active { transform: translateY(1px) scale(.99); }

.hero { padding: 0px 20px 12px; text-align: center; }
.hero h1 { margin: 0 0 0px; font-size: clamp(28px, 4vw, 44px); }
.hero p { margin: 0; color: var(--muted); }

.board {
    margin: 28px auto; max-width: 1000px; display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
    border: 1px solid #e7eaff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin: 8px;
    display: grid; gap: 10px; align-content: start;
}
.card.free { background: #fff; }
.card.paid { background: var(--accent); color: #fff; }

/* Session type differentiation - horse races (light blue background) */
.card.horse-race,
.card.free.horse-race,
.card.paid.horse-race { 
    background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
    border: 2px solid #93c5fd !important;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15) !important;
    color: var(--fg) !important;
}
.card.horse-race .badge { background: #fff !important; color: #2563eb !important; border: 1px solid #93c5fd !important; }
.card.horse-race .time { color: #1d4ed8 !important; }
.card.horse-race .cta-btn { background: linear-gradient(135deg, #2563eb, #3b82f6) !important; color: #fff !important; }
.card.horse-race .cta-btn:hover { background: linear-gradient(135deg, #1d4ed8, #2563eb) !important; }
.card img.caller {
    width: 100%; 
    aspect-ratio: 2 / 1;
    object-fit: cover;
    object-position: top;
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: #f0f4ff;
}
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 12px; margin-bottom: 6px; }
.card.free .badge { background: #eef2ff; color: var(--accent-700); border: 1px solid #dfe5ff; }

.card.paid .badge { background: #fff; color: var(--accent); }

.date-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.date { font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.time { color: var(--muted); font-weight: 600; }
.card.paid .time { color: #e0e5ff; }
.tzline { font-weight: 700; margin-top: 4px; }

.prize { /*margin-top: 10px;*/ display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px dashed #dfe5ff; padding: 10px 12px; border-radius: 12px; color: #000; }
.card.paid .prize { background: rgba(255,255,255,0.92); }
.prize b { font-weight: 800; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; align-self: flex-start;}
.card.paid .cta-btn, .card.paid .cta-btn-x { background: #fff; color: var(--accent); }
.card.paid .cta-btn:hover, .card.paid .cta-btn-x:hover { background: #f4f6ff; }

.ghost-btn {
    background: #fff; color: var(--accent);
    border: 1px solid #dfe5ff; padding: 10px 14px; border-radius: var(--radius); font-weight: 700; cursor: pointer;
}
.ghost-btn:hover { border-color: var(--accent); }

.notice, .notice-nologin { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 0 24px; }

/* Prevent fixed footer from covering content */
.board + .notice,
.board ~ .notice {
    margin-bottom: 60px;
}

dialog { border: none; border-radius: 20px; width: min(520px, 92vw); padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(14,20,32,.48); }
.modal { padding: 20px; display: grid; gap: 14px; background: #fff; border-radius: 20px; }
.modal header { position: sticky; top: 0; border: 0; background: transparent; backdrop-filter: none; }
.modal h3 { margin: 0; }

.field { display: grid; gap: 6px; }
.field input, .field select { padding: 12px 14px; border-radius: 12px; border: 1px solid #ced6ff; font: inherit; }
.agree { display: flex; gap: 10px; align-items: start; font-size: 14px; color: var(--muted); }
.agree input { margin-top: 3px; }

.toast { position: fixed; right: 16px; bottom: 16px; background: #fff; border-left: 6px solid var(--success); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); display: none; }

footer { text-align: center; color: var(--muted); font-size: 14px; }
.links { display: inline-flex; gap: 14px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

.nav { display:none}
.bg-balls { display:none}

/* Modal backdrop */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Modal box */
.modal {
    background: white;
    padding: 20px 30px;
    border-radius: 8px;
    position: relative;
    max-width: min(600px, 90%);
    width: 90%;
    text-align: center;
}

.modal h2 {
    margin-top: 0;
}

.modal button {
    /* margin: 10px 5px; */
    /* padding: 10px 20px; */
    font-size: 20px;
    cursor: pointer;
}

.hidden {
    display: none;
}

.modal_header {
    margin-top: 20px;
    font-size: 18px;
    line-height: 24px;
    padding-bottom: 5px;
    font-weight: bold;
}

.modal_text {
    margin-top: 20px;
    font-size: 15px;
    line-height: 20px;
    padding-bottom: 5px;
}

#signupEmail {
    margin-top:10px;
}
#realMoneyBtn {
    width: min(250px, calc(100% - 20px));
    max-width: 250px;
    margin-bottom: 15px;
}
#closeBtn,#confirmBtn,#confirmBtnGC,#closeAndRefreshBtn {
    width: min(150px, calc(100% - 20px));
    max-width: 150px;
    background-color:#787878;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

#closeBtn,#confirmBtn,#confirmBtnGC,#closeAndRefreshBtn {
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    height:36px;
}

#closeBtn,#confirmBtn,#confirmBtnGC,#closeAndRefreshBtn {
    background-color: var(--brand);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 50px;
}

#confirmBtn,#confirmBtnGC {
    margin-top:5px;
    margin-bottom:5px;
}

#closeBtn,#closeAndRefreshBtn,#confirmBtn,#confirmBtnGC {
    margin: 5px auto;
}


.cta-btn, .cta-btn-x {
    border-radius: 50px;
    font-family: Poppins;
}

.legal {
    font-size: 8px;
    padding: 3px;
}
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 3vh;
    background: #f8f9fa;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    z-index: 999;
    max-height: 5vh;
    font-size: 6px;
    line-height: 150%;
}
.hidden {
    display:none !important;
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.cta-btn.not_pv {
    opacity: 0.5;
    /* cursor: not-allowed; */
}

.card.free .badge.free{
    /*background-color:#f8f8f8;
    color:#626262;
    border:1px solid #c2c2c2;*/
    background-color:#e0fae1;
    color:#54bb65;
    border:1px solid #e4e4e4;
}
.card.free .badge.sc{
    /* background-color:#e0fae1;
    color:#54bb65;
    border:1px solid #e4e4e4; */
    background-color:#f8f8f8;
    color:#626262;
    border:1px solid #c2c2c2;
}
.card.free .badge.gc{
    /* background-color:#f9fae0;
    color:#b9b700;
    border:1px solid #f3f4b6; */
    background-color:#f8f8f8;
    color:#626262;
    border:1px solid #c2c2c2;
    margin-top: -10px;
}
.prize .sc {
    /* color:#54bb65; */
    color: black;
}
.prize .gc {
    /* color:#b9b700; */
    color: black;
}

#modal_text_body {
    padding:15px;
}
.ccy_gc, .ccy_sc {
    height:19px;
    vertical-align: middle;
    margin-top: -3px;
}
.ccy_gc_small, .ccy_sc_small {
    height:14px;
    vertical-align: middle;
    margin-top: -2px;
}

.entry {
    display: flex;
    align-items: center;
    /* justify-content: space-between; */
    gap: 10px;
}
.entry_fees {
    flex:1;
}
.badge {
    width:100%;
}

/* ===== ENTERED BADGE (shown when player has entered a session) ===== */
.entered-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: Poppins, sans-serif;
    border-radius: 50px;
    width: fit-content;
    letter-spacing: 0.3px;
}
.entered-badge .material-symbols-rounded {
    font-size: 16px;
}

/* Entered button state (replaces Enter button for free sessions) */
.cta-btn.entered-btn {
    background: #e8e8e8 !important;
    color: #888 !important;
    opacity: 1 !important;
    cursor: default !important;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    border: 1px solid #d0d0d0 !important;
    box-shadow: none !important;
    font-weight: 600;
}
.cta-btn.entered-btn:hover {
    background: #e8e8e8 !important;
    transform: none !important;
}

/* Dark mode adjustments */
[data-theme="dark"] .entered-badge {
    background: linear-gradient(135deg, #059669, #047857);
}
[data-theme="dark"] .cta-btn.entered-btn {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.4) !important;
    border-color: rgba(255,255,255,0.1) !important;
}
[data-theme="dark"] .cta-btn.entered-btn:hover {
    background: rgba(255,255,255,0.08) !important;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: max-content;
    max-width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 6px 10px;
    border-radius: 4px;

    position: absolute;
    bottom: 125%; /* position above the element */
    left: 50%;
    transform: translateX(-50%);

    transition: opacity 0.3s ease;
    z-index: 1000;

    /* Optional arrow */
    &::after {
        content: "";
        position: absolute;
        top: 100%; /* at the bottom of tooltip */
        left: 50%;
        transform: translateX(-50%);
        border-width: 5px;
        border-style: solid;
        border-color: #333 transparent transparent transparent;
    }
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.signup-btn,.refer-btn {
    margin:auto;
    display:block;
    width: 300px;
    font-size: 36px;
    font-family: 'Poppins';
}

.refer-btn {
    width: 180px;
    font-size: 18px;
}

/* ===== PROMO BANNER ===== */

.promo-banner {
    display: flex;
    align-items: stretch;
    background: #3C3CF5;
    border-radius: 16px;
    padding: 0;
    margin: 12px 8px 20px 8px;
    max-width: 1000px;
    overflow: hidden;
    position: relative;
    height: 162px;
}

@media (min-width: 768px) {
    .promo-banner {
        margin: 12px auto 20px auto;
    }
}

.promo-banner-content {
    flex: 1;
    min-width: 0;
    z-index: 1;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.promo-banner-logo {
    width: 110px;
    height: auto;
    margin-bottom: 10px;
}

.promo-banner-heading {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.promo-banner-text {
    color: #fff;
    font-size: 12.5px;
    font-weight: 400;
    margin: 0;
    line-height: 1.55;
    opacity: 0.88;
}

.promo-banner-text b {
    font-weight: 700;
    opacity: 1;
}

.promo-banner-balls {
    flex-shrink: 0;
    width: 260px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    overflow: visible;
}

.promo-banner-balls img {
    width: 280px;
    height: auto;
    object-fit: contain;
    position: relative;
    right: -5px;
}

/* Hide balls on medium and small screens */
@media (max-width: 768px) {
    .promo-banner-balls {
        display: none;
    }

    .promo-banner {
        padding: 0;
        height: auto;
    }

    .promo-banner-content {
        padding: 20px 22px;
    }

    .promo-banner-heading {
        font-size: 15px;
    }

    .promo-banner-text {
        font-size: 12px;
    }

    .promo-banner-logo {
        width: 95px;
    }
}

@media (max-width: 480px) {
    .promo-banner-content {
        padding: 16px 18px;
    }

    .promo-banner-heading {
        font-size: 14px;
    }

    .promo-banner-text {
        font-size: 11.5px;
    }

    .promo-banner-logo {
        width: 85px;
    }
}

/* ===== REFER A FRIEND BANNER ===== */

.refer-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(90deg, #DE0098 0%, #F00 100%);
    border-radius: 12px;
    padding: 12px 20px;
    margin: 0 8px 16px 8px;
    max-width: 1000px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.refer-banner:hover {
    opacity: 0.92;
}

@media (min-width: 768px) {
    .refer-banner {
        margin: 0 auto 16px auto;
    }
}

.refer-banner-text {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.refer-banner-text b {
    font-weight: 700;
}

.refer-banner-btn {
    background: #FFFFFF;
    color: #E9003A;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s ease;
}

.refer-banner-btn:hover {
    background: #f0f0f0;
}

@media (max-width: 480px) {
    .refer-banner {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
    }

    .refer-banner-text {
        font-size: 12px;
        white-space: normal;
        text-align: center;
    }

    .refer-banner-btn {
        width: 100%;
        padding: 8px 16px;
    }
}

/* ===== CATEGORISED LOBBY SECTIONS ===== */

/* Board wrapper - now a vertical container for lobby sections */
#board.lobby-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    grid-template-columns: none !important;
}

/* Each lobby section (Live Now / Upcoming Games) */
.lobby-section {
    margin-bottom: 8px;
}

.lobby-section:last-child {
    margin-bottom: 0;
}

/* Category header shared styles */
.lobby-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0 8px;
    font-family: 'Poppins', sans-serif;
}

.lobby-category-header .lobby-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fg, #0e1420);
    letter-spacing: -0.2px;
    line-height: 1.2;
}

/* Live Now header specific styles */
.live-now-header .live-now-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

/* Upcoming Games header */
.upcoming-header {
    padding-top: 16px;
}

.upcoming-header .lobby-title {
    font-size: 18px;
}

/* Sub-boards inside lobby sections - these hold the card grids */
.board-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 8px;
    margin: 0;
}

.board-grid .card {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 20px !important;
    padding: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
    margin-bottom: 0 !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    position: relative;
    z-index: 1;
}

/* Hide live now section when empty */
.lobby-section.live-now-section.hidden-section {
    display: none !important;
}

/* Dark mode header text */
[data-theme="dark"] .lobby-category-header .lobby-title {
    color: var(--theme-text, #eaeaea);
}

/* Neutral theme - light mode dark text */
[data-brand="neutral"] .lobby-category-header .lobby-title {
    color: #0e1420;
}

[data-theme="dark"][data-brand="neutral"] .lobby-category-header .lobby-title {
    color: #ffffff;
}

/* White header text for gradient backgrounds */
#sessionSection .lobby-category-header .lobby-title {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #sessionSection .lobby-category-header .lobby-title {
    color: var(--theme-text, #eaeaea);
    text-shadow: none;
}

[data-brand="neutral"] #sessionSection .lobby-category-header .lobby-title {
    color: #0e1420;
    text-shadow: none;
}

[data-theme="dark"][data-brand="neutral"] #sessionSection .lobby-category-header .lobby-title {
    color: #ffffff;
    text-shadow: none;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .board-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
        gap: 20px !important;
        max-width: 1000px;
        margin: 0 auto !important;
    }

    .lobby-category-header {
        max-width: 1000px;
        margin: 8px 0 0 8px;
        padding-left: 0;
    }
}

@media (min-width: 1024px) {
    .board-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }
}

@media (max-width: 480px) {
    .lobby-category-header .lobby-title {
        font-size: 18px;
    }

    .upcoming-header .lobby-title {
        font-size: 16px;
    }

    .lobby-category-header {
        margin: 8px 0 0 8px;
    }

    .live-now-header .live-now-icon {
        width: 24px;
        height: 24px;
    }

    .board-grid {
        gap: 10px;
    }
}