/* =========================================================
   GLOBAL STYLES — Shared across all pages
   Theme: Dark Green + Gold
   ========================================================= */

:root {
    /* Backgrounds */
    --bg-primary: #0a2e22;
    --bg-secondary: #0f3b2c;
    --bg-tertiary: #134635;
    --bg-card: #16513d;
    --bg-hover: #1d6448;

    /* Gold accents */
    --gold: #d4af37;
    --gold-bright: #f0c14b;
    --gold-dark: #a88a2c;
    --gold-soft: rgba(212, 175, 55, 0.15);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cfdbd2;
    --text-muted: #8a9a91;
    --text-dark: #0a2e22;

    /* Status */
    --success: #4caf50;
    --danger: #ef4444;
    --live: #ff4d4d;

    /* Borders / shadows */
    --border: rgba(212, 175, 55, 0.18);
    --border-strong: rgba(212, 175, 55, 0.35);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);

    /* Layout */
    --header-height: 56px;
    --nav-height: 44px;
    --container-max: 1400px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

main {
    max-width: 100%;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

ul, ol { list-style: none; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

img { max-width: 100%; display: block; }

/* ---------- Top Bar ---------- */
.topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.topbar__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo__mark {
    color: var(--gold);
}

.logo__flag {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #e70013 50%, #ffffff 50%);
    position: relative;
    margin-left: 4px;
    overflow: hidden;
}

.logo__flag::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    background: #e70013;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset -2px 0 0 #ffffff;
}

.topbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--gold);
    position: relative;
    transition: background var(--transition);
}

.icon-btn:hover { background: var(--bg-hover); }

.icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--gold);
    color: var(--text-dark);
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.btn {
    height: 38px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn--primary {
    background: linear-gradient(to bottom, var(--gold-bright), var(--gold));
    color: var(--text-dark);
    box-shadow: 0 2px 0 var(--gold-dark);
}

.btn--primary:hover {
    background: linear-gradient(to bottom, var(--gold), var(--gold-dark));
    transform: translateY(-1px);
}

.btn--outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--gold);
}

.btn--outline:hover {
    background: var(--gold-soft);
}

.btn--ghost {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.btn--ghost:hover { background: var(--bg-hover); }

.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    height: 38px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.lang-switch__flag {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    background: linear-gradient(to right, #002395 33%, #ffffff 33% 66%, #ed2939 66%);
}

/* ---------- Main Navigation ---------- */
.mainnav {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    position: sticky;
    top: var(--header-height);
    z-index: 999;
}

.mainnav__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.mainnav__inner::-webkit-scrollbar { display: none; }

.navlink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: relative;
    transition: color var(--transition);
}

.navlink::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.navlink:hover { color: var(--gold-bright); }
.navlink:hover::after,
.navlink.is-active::after { transform: scaleX(1); }

.navlink__icon {
    color: var(--gold);
    font-size: 14px;
}

.navlink--featured {
    background: linear-gradient(to bottom, var(--gold-bright), var(--gold));
    color: var(--text-dark) !important;
    border-radius: var(--radius-sm);
    padding: 0 14px;
    height: 32px;
    margin-left: 8px;
    font-size: 12px;
}

.navlink--featured:hover {
    color: var(--text-dark) !important;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--gold);
    margin-top: 48px;
    padding: 40px 16px 20px;
}

.footer__inner {
    max-width: var(--container-max);
    margin: 0 auto;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.footer__col h4 {
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
}

.footer__col ul li {
    margin-bottom: 8px;
}

.footer__col a {
    color: var(--text-secondary);
    font-size: 13px;
    transition: color var(--transition);
}

.footer__col a:hover { color: var(--gold-bright); }

.footer__bottom {
    padding-top: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.payments {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.payments span {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.socials {
    display: flex;
    gap: 8px;
}

.socials a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.socials a:hover {
    background: var(--gold);
    color: var(--text-dark);
    transform: translateY(-2px);
}

/* ---------- Helpers ---------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 16px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h2::before {
    content: '';
    width: 4px;
    height: 22px;
    background: var(--gold);
    border-radius: 2px;
}

.section-title a {
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.section-title a:hover { color: var(--gold-bright); }

/* =========================================================
   MOBILE BOTTOM NAV (footer mobile)
   ========================================================= */
.mobnav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    z-index: 998;
    height: 64px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.mobnav__inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 100%;
    align-items: center;
}

.mobnav__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    height: 100%;
    transition: color var(--transition);
    position: relative;
}

.mobnav__btn i { font-size: 18px; }

.mobnav__btn.is-active { color: var(--gold); }

.mobnav__btn--center {
    transform: translateY(-12px);
}

.mobnav__btn--center .mobnav__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dark));
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.5);
    margin-bottom: 2px;
}

.mobnav__btn--center span { color: var(--gold); }

/* =========================================================
   SIDEBAR DRAWER (mobile menu)
   ========================================================= */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 90vw;
    height: 100%;
    background: var(--bg-secondary);
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.drawer.is-open { transform: translateX(0); }

.drawer__head {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}

.drawer__time {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.drawer__lang {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.drawer__lang .lang-switch__flag {
    width: 14px;
    height: 10px;
}

.drawer__close,
.drawer__settings {
    margin-left: auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--gold);
    transition: background var(--transition);
}

.drawer__close { margin-left: 0; }
.drawer__close:hover,
.drawer__settings:hover { background: var(--bg-hover); }

.drawer__app {
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.drawer__app-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.drawer__app-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.drawer__app-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    transition: all var(--transition);
}

.drawer__app-buttons a:hover {
    background: var(--gold);
    color: var(--text-dark);
}

.drawer__search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.drawer__search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color var(--transition);
}

.drawer__search input::placeholder { color: var(--text-muted); }
.drawer__search input:focus { outline: none; border-color: var(--gold); }

.drawer__search i {
    position: absolute;
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.drawer__menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.drawer__section {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.drawer__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    transition: background var(--transition);
    cursor: pointer;
    border-left: 3px solid transparent;
}

.drawer__item:hover {
    background: var(--bg-tertiary);
    border-left-color: var(--gold);
}

.drawer__item i:first-child {
    color: var(--gold);
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.drawer__item .chevron {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
}

/* =========================================================
   MODAL (login / register)
   ========================================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1199;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--gold-soft);
    width: 100%;
    max-width: 460px;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.is-open .modal {
    transform: translateY(0) scale(1);
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 2;
}

.modal__close:hover {
    background: var(--gold);
    color: var(--text-dark);
    transform: rotate(90deg);
}

.modal__head {
    text-align: center;
    padding: 32px 28px 16px;
}

.modal__head .logo {
    justify-content: center;
    font-size: 26px;
    margin-bottom: 12px;
}

.modal__title {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.modal__body {
    padding: 8px 28px 28px;
}

.form-group {
    margin-bottom: 14px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition);
}

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

.form-group input::placeholder { color: var(--text-muted); }

.form-group .input-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    color: var(--gold);
    cursor: pointer;
    font-size: 14px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0 18px;
    font-size: 13px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox input { display: none; }

.checkbox__box {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.checkbox input:checked + .checkbox__box {
    background: var(--gold);
    border-color: var(--gold);
}

.checkbox input:checked + .checkbox__box::after {
    content: '\2713';
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 800;
}

.form-link {
    color: var(--gold);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-link:hover { color: var(--gold-bright); }

.btn--block {
    width: 100%;
    height: 46px;
    font-size: 14px;
}

.divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 18px 0 12px;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 28%;
    height: 1px;
    background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

.socials-login {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-size: 14px;
}

.social-btn:hover {
    background: var(--gold);
    color: var(--text-dark);
    transform: translateY(-2px);
}

.modal__foot {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 14px 28px 28px;
    border-top: 1px solid var(--border);
}

.modal__foot a {
    color: var(--gold);
    font-weight: 700;
}

.modal__foot a:hover { color: var(--gold-bright); }

/* Tabs (for register modal) */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin: 0 28px 18px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab.is-active {
    background: linear-gradient(to bottom, var(--gold-bright), var(--gold));
    color: var(--text-dark);
}

.tab-pane { display: none; }
.tab-pane.is-active { display: block; }

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Phone input */
.phone-input {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.phone-input__country {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    border-right: 1px solid var(--border);
    cursor: pointer;
}

.phone-input input {
    flex: 1;
    background: transparent;
    border: none !important;
    padding: 12px 14px;
}

/* =========================================================
   THEME PANEL — Color palette switcher
   ========================================================= */
.theme-trigger {
    position: fixed;
    right: 0;
    top: 35%;
    transform: translateY(-50%);
    width: 38px;
    height: 76px;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dark));
    color: var(--text-dark);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: -4px 4px 14px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 996;
    border: none;
    transition: width 0.2s ease;
}

.theme-trigger:hover {
    width: 46px;
    box-shadow: -6px 4px 18px rgba(212, 175, 55, 0.5);
}

.theme-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.theme-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.theme-panel {
    position: fixed;
    right: -360px;
    top: 0;
    bottom: 0;
    width: 340px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-left: 2px solid var(--gold);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1050;
    transition: right 0.35s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.theme-panel.is-open {
    right: 0;
}

.theme-panel__head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
}

.theme-panel__head h3 {
    color: var(--gold-bright);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-panel__head h3 i { color: var(--gold); }

.theme-panel__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-panel__close:hover {
    background: var(--gold);
    color: var(--text-dark);
    transform: rotate(90deg);
}

.theme-panel__intro {
    padding: 16px 20px 8px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.theme-panel h4 {
    padding: 12px 20px 6px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.theme-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px 20px 12px;
}

.theme-preset {
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.theme-preset:hover {
    transform: translateY(-2px);
    border-color: var(--gold-dark);
}

.theme-preset.is-active {
    border-color: var(--gold);
    background: var(--gold-soft);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-preset.is-active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    margin-top: -2px;
}

.theme-preset__swatches {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-bottom: 4px;
}

.theme-preset__swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.theme-preset__icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.theme-preset__name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.theme-customs {
    padding: 4px 20px 12px;
}

.theme-custom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    cursor: pointer;
}

.theme-custom-row:last-child { border-bottom: none; }

.theme-custom-row__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.theme-custom-row__info strong {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.theme-custom-row__info small {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.2;
}

.theme-custom-row__hex {
    color: var(--text-muted);
    font-size: 10px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    flex-shrink: 0;
}

.theme-custom-row input[type="color"] {
    width: 36px;
    height: 28px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

.theme-custom-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.theme-custom-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }

/* ---------- Section toggles ---------- */
.theme-section-toggle {
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.theme-section-toggle__head {
    width: 100%;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: transparent;
    transition: background 0.2s;
}

.theme-section-toggle__head:hover { background: var(--bg-tertiary); }

.theme-section-toggle__head .chevron {
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 10px;
}

.theme-section-toggle.is-open .chevron { transform: rotate(180deg); }

.theme-customs,
.theme-sliders,
.theme-density {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 20px;
}

.theme-section-toggle.is-open .theme-customs { max-height: 1200px; padding: 0 20px 12px; }
.theme-section-toggle.is-open .theme-sliders { max-height: 400px; padding: 8px 20px 14px; }
.theme-section-toggle.is-open .theme-density { max-height: 200px; padding: 8px 20px 14px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }

/* ---------- Slider rows ---------- */
.theme-slider-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.theme-slider-row:last-child { border-bottom: none; }

.theme-slider-row__label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.theme-slider-row__value {
    color: var(--gold-bright);
    font-size: 12px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 50px;
    min-width: 42px;
    text-align: center;
}

.theme-slider-row input[type="range"] {
    grid-column: 1 / -1;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 50px;
    outline: none;
}

.theme-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dark));
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.theme-slider-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
}

/* ---------- Density buttons ---------- */
.density-btn {
    padding: 10px 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s;
    cursor: pointer;
}

.density-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.density-btn.is-active {
    background: linear-gradient(to bottom, var(--gold-bright), var(--gold));
    color: var(--text-dark);
}

/* Density CSS effect — apply via root data attr */
:root[data-density="compact"] {
    --header-height: 48px;
    --nav-height: 38px;
    --radius-sm: 3px;
    font-size: 13px;
}

:root[data-density="large"] {
    --header-height: 64px;
    --nav-height: 50px;
    font-size: 15px;
}

/* ---------- Actions ---------- */
.theme-export {
    width: 100%;
    height: 38px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.theme-export:hover {
    background: var(--bg-hover);
    border-color: var(--gold);
    color: var(--gold-bright);
}

.theme-actions {
    padding: 12px 20px 8px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.theme-reset {
    width: 100%;
    height: 40px;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.theme-reset:hover {
    background: var(--gold);
    color: var(--text-dark);
}

.theme-panel__note {
    padding: 10px 20px 20px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.theme-panel__note i { color: var(--gold); margin-top: 2px; }

@media (max-width: 768px) {
    .theme-trigger {
        width: 34px;
        height: 64px;
        font-size: 16px;
        top: 38%;
    }
    .theme-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        right: -100vw;
    }
    .theme-panel.is-open { right: 0 !important; }

    .theme-panel__head { padding: 14px 16px; }
    .theme-panel__head h3 { font-size: 13px; gap: 8px; }
    .theme-panel__intro { padding: 12px 16px 4px; font-size: 11px; }
    .theme-panel h4 { padding: 10px 16px 4px; font-size: 10px; }
    .theme-presets { grid-template-columns: 1fr 1fr; padding: 4px 16px 10px; gap: 6px; }
    .theme-preset { padding: 10px 6px; }
    .theme-preset__name { font-size: 10px; }

    .theme-section-toggle__head { padding: 12px 16px; font-size: 10px; }
    .theme-section-toggle.is-open .theme-customs { padding: 0 16px 12px; }
    .theme-section-toggle.is-open .theme-sliders { padding: 6px 16px 12px; }
    .theme-section-toggle.is-open .theme-density { padding: 6px 16px 12px; }

    .theme-custom-row { padding: 8px 0; gap: 8px; }
    .theme-custom-row__info strong { font-size: 12px; }
    .theme-custom-row__info small { font-size: 9px; }
    .theme-custom-row__hex { font-size: 9px; }

    .theme-actions { padding: 10px 16px 8px; }
    .theme-panel__note { padding: 8px 16px 16px; font-size: 10px; }
}

/* =========================================================
   AUTH STATE — Logged in (balance + user menu)
   ========================================================= */
body:not(.is-logged) [data-show-when="user"] { display: none !important; }
body.is-logged       [data-show-when="guest"] { display: none !important; }

.balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 38px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 0 0 0 var(--gold-soft);
    transition: box-shadow var(--transition);
}

.balance-pill:hover { box-shadow: 0 0 0 3px var(--gold-soft); }

.balance-pill__icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.balance-pill__amount {
    color: var(--gold-bright);
    font-weight: 800;
}

.balance-pill__cur {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

/* User menu (logged in) */
.user-menu {
    position: relative;
}

.user-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 38px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    transition: background var(--transition);
}

.user-menu__trigger:hover { background: var(--bg-hover); }

.user-menu__avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dark));
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
}

.user-menu__name { color: var(--text-primary); }
.user-menu__chevron { color: var(--gold); font-size: 10px; }

.user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all var(--transition);
    z-index: 1000;
}

.user-menu.is-open .user-menu__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu__balance {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 6px;
    text-align: center;
}

.user-menu__balance-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.user-menu__balance-amount {
    color: var(--gold-bright);
    font-size: 18px;
    font-weight: 800;
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    cursor: pointer;
}

.user-menu__item i {
    color: var(--gold);
    width: 16px;
    text-align: center;
}

.user-menu__item:hover {
    background: var(--bg-tertiary);
}

.user-menu__item--logout {
    color: var(--danger);
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 12px;
}

.user-menu__item--logout i { color: var(--danger); }

/* Demo helper banner */
.demo-banner {
    position: fixed;
    bottom: 80px;
    right: 16px;
    z-index: 997;
    background: var(--bg-secondary);
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-banner__label {
    font-size: 9px;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0 6px;
}

.demo-banner button {
    height: 30px;
    padding: 0 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.demo-banner button:hover {
    background: var(--gold);
    color: var(--text-dark);
}

/* Mobnav balance badge (over Profil icon) */
.mobnav__btn { position: relative; }

.mobnav__balance-badge {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dark));
    color: var(--text-dark);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 50px;
    line-height: 1.3;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
    border: 2px solid var(--bg-secondary);
    white-space: nowrap;
    min-width: 32px;
    text-align: center;
    letter-spacing: 0.2px;
}

/* Push the icon down slightly so the badge doesn't overlap it */
body.is-logged .mobnav__btn[data-show-when="user"] {
    padding-top: 8px;
}


@media (max-width: 768px) {
    .demo-banner { bottom: 80px; padding: 6px; }
    .demo-banner button { font-size: 10px; padding: 0 8px; height: 26px; }

    /* Mobile header: hide balance pill + Dépôt button */
    .balance-pill { display: none !important; }
    .topbar__actions a.btn--primary[data-show-when="user"] { display: none !important; }

    /* Logged: show useful icon-btns (Cadeaux + Mes paris) to fill space */
    body.is-logged .topbar__actions .icon-btn[title="Cadeaux"],
    body.is-logged .topbar__actions .icon-btn[title="Mes paris"] {
        display: inline-flex !important;
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    body.is-logged .topbar__actions .icon-btn[title="Cadeaux"] .badge {
        font-size: 9px;
        min-width: 14px;
        height: 14px;
        top: -2px;
        right: -2px;
    }

    /* User-menu compact: keep name visible but small */
    .user-menu__trigger {
        padding: 0 10px;
        height: 34px;
        gap: 6px;
    }
    .user-menu__avatar { width: 22px; height: 22px; font-size: 11px; }
    .user-menu__name {
        display: inline;
        font-size: 12px;
        font-weight: 700;
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .user-menu__chevron { font-size: 9px; }

    /* User dropdown: position toward right edge on mobile */
    .user-menu__dropdown { width: 220px; right: -8px; }
}

/* Hide name on very small screens */
@media (max-width: 380px) {
    .user-menu__name { display: none !important; }
    body.is-logged .topbar__actions .icon-btn[title="Mes paris"] { display: none !important; }
}

/* =========================================================
   RESPONSIVE — Tablet & Mobile
   ========================================================= */

/* Hamburger always hidden — menu access via mobile bottom-nav */
.topbar__hamburger {
    display: none !important;
}

/* ---------- Tablet (≤ 992px) ---------- */
@media (max-width: 992px) {
    :root {
        --header-height: 52px;
        --nav-height: 40px;
    }
    .topbar__actions { gap: 6px; }
    .topbar__actions .icon-btn,
    .topbar__actions .lang-switch { display: none; }
    .topbar__actions .icon-btn[title="Mon compte"],
    .topbar__actions .icon-btn[title="Dépôt"] { display: inline-flex; }
    .navlink { padding: 0 10px; font-size: 12px; }
}

/* ---------- Mobile (≤ 768px) ---------- */
@media (max-width: 768px) {
    .topbar__inner {
        gap: 8px;
        padding: 0 10px;
    }

    /* Logo compact */
    .logo { font-size: 17px; gap: 4px; }
    .logo__flag { width: 18px; height: 14px; }

    /* Show only the 2 main buttons in actions */
    .topbar__actions { gap: 6px; margin-left: auto; }
    .topbar__actions .icon-btn,
    .topbar__actions .lang-switch { display: none !important; }

    /* Both buttons visible on mobile */
    .topbar__actions .btn {
        height: 32px;
        padding: 0 10px;
        font-size: 11px;
        letter-spacing: 0.2px;
    }
    .topbar__actions .btn--outline {
        display: inline-flex;
    }

    /* Hide main nav entirely - rely on drawer (Menu button in mobnav opens it) */
    .mainnav { display: none; }

    /* Sticky offsets recalc */
    .topbar { height: 52px; }

    /* Section headers smaller */
    .section-title { margin: 18px 0 12px; }
    .section-title h2 { font-size: 15px; }
    .section-title a { font-size: 12px; }

    /* Show mobile bottom nav */
    .mobnav { display: block; }
    body { padding-bottom: 70px; }

    /* Modal compacts */
    .modal__head { padding: 24px 18px 10px; }
    .modal__head .logo { font-size: 22px; }
    .modal__body { padding: 6px 18px 18px; }
    .modal__foot { padding: 12px 18px 20px; font-size: 12px; }
    .tabs { margin: 0 18px 14px; }
    .tab { padding: 8px 4px; font-size: 11px; }
    .tab i { display: none; }
    .form-grid-2 { grid-template-columns: 1fr; gap: 0; }

    .container { padding: 0 12px; }
    .footer { padding: 28px 12px 100px; }
    .footer__grid { gap: 22px; }
}

/* ---------- Small mobile (≤ 420px) ---------- */
@media (max-width: 420px) {
    .topbar__inner { gap: 6px; padding: 0 8px; }
    .topbar__actions { gap: 4px; }
    .topbar__actions .btn {
        padding: 0 8px;
        font-size: 10px;
        height: 30px;
        letter-spacing: 0;
    }
    .logo { font-size: 15px; }
    .logo__flag { width: 16px; height: 12px; }

    .mobnav__btn span { font-size: 10px; }
    .mobnav__btn i { font-size: 16px; }
    .mobnav__btn--center .mobnav__icon {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }

    .modal__head { padding: 20px 14px 8px; }
    .modal__body { padding: 4px 14px 14px; }
    .tabs { margin: 0 14px 12px; padding: 3px; }
}
