:root {
    --primary: #111B3A;
    --secondary: #1D294D;
    --accent: #E21D3D;
    --success: #19B978;
    --warning: #F5B82E;
    --danger: #E21D3D;
    --background: #F5F7FB;
    --surface: #FFFFFF;
    --surface-soft: #F9FAFD;
    --text: #172033;
    --muted: #7A8499;
    --border: #E6EAF1;
    --focus: rgba(17, 27, 58, .16);
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 6px 18px rgba(17, 27, 58, .06);
    --shadow-md: 0 14px 34px rgba(17, 27, 58, .10);
    --shadow-lg: 0 24px 70px rgba(17, 27, 58, .18);
    --sidebar-width: 250px;
    --sidebar-collapsed: 76px;
    --topbar-height: 72px;
    --bottom-nav-height: 68px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

img,
svg {
    display: block;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.ui-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.hidden {
    display: none !important;
}

.muted {
    color: var(--muted);
}

.sidebar,
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-lg);
    transition: width .2s ease, transform .2s ease;
}

.sidebar-header {
    flex-shrink: 0;
    padding: 18px 20px 12px;
}

.sidebar-menu-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.sidebar-menu-scroll::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu-scroll::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: rgba(255, 255, 255, .18);
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 12px 20px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: var(--primary);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark,
.auth-brand span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(226, 29, 61, .24);
}

.brand-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.brand-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.brand-copy small {
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
}

.sidebar-profile {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    margin: 0 20px 16px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .08);
}

.sidebar-profile div:last-child {
    min-width: 0;
    display: grid;
}

.sidebar-profile strong,
.sidebar-profile span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile span {
    color: rgba(255, 255, 255, .70);
    font-size: 12px;
}

.avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-weight: 900;
}

.avatar-sm {
    width: 42px;
    height: 42px;
}

.avatar-xs {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.sidebar-nav {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    padding-bottom: 2px;
}

.nav-group {
    display: grid;
    gap: 7px;
}

.nav-group-toggle {
    width: 100%;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 10px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .54);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-group-toggle .chevron {
    width: 15px;
    height: 15px;
    transition: transform .18s ease;
}

.nav-group.open .nav-group-toggle .chevron {
    transform: rotate(180deg);
}

.nav-group-items {
    display: grid;
    gap: 5px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .22s ease, opacity .16s ease;
}

.nav-group.open .nav-group-items {
    max-height: 640px;
    opacity: 1;
}

.nav-link {
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .78);
    font-weight: 750;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

.nav-link.active {
    background: var(--secondary);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}

.logout-link {
    width: 100%;
    min-height: 48px;
    color: #fff;
    background: rgba(226, 29, 61, .16);
}

.logout-button {
    width: 100%;
    min-height: 48px;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 990;
    display: none;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .18s ease;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: var(--sidebar-width);
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
    transition: margin-left .2s ease;
}

.topbar-title {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 2px;
}

.topbar-title h1 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.18;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.breadcrumbs a {
    color: var(--secondary);
}

.breadcrumbs span::before {
    content: "/";
    margin-right: 8px;
    color: var(--muted);
}

.icon-button {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--secondary);
    transition: background .18s ease, transform .12s ease, border-color .18s ease;
}

.icon-button:hover {
    border-color: rgba(17, 27, 58, .24);
    background: var(--surface-soft);
}

.icon-button:active,
.primary:active,
.secondary:active,
.small:active {
    transform: scale(.98);
}

.topbar-search {
    min-width: 240px;
    max-width: 330px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--muted);
}

.topbar-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.notification-button {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--accent);
}

.topbar-wallet {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: rgba(25, 185, 120, .10);
    color: #0B7A4F;
    font-size: 13px;
}

.topbar-wallet strong {
    color: var(--text);
}

.profile-menu {
    position: relative;
}

.profile-trigger {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px 6px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-weight: 800;
}

.profile-trigger .chevron {
    width: 15px;
    transition: transform .16s ease;
}

.profile-menu.open .chevron {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 230px;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.profile-menu.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown a {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 750;
}

.profile-dropdown a:hover {
    background: var(--surface-soft);
}

.danger-link {
    color: var(--danger) !important;
}

.shell {
    width: calc(100% - var(--sidebar-width));
    max-width: 1440px;
    min-height: calc(100vh - var(--topbar-height));
    margin-left: var(--sidebar-width);
    padding: 24px;
    transition: margin-left .2s ease;
}

.auth-body {
    background: linear-gradient(rgba(17, 27, 58, .82), rgba(17, 27, 58, .94)), url("../images/pattern.svg") center / cover;
}

.auth-topbar {
    width: min(100%, 1100px);
    margin: 0 auto;
    padding: 22px 18px 0;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 900;
}

.auth-brand span {
    width: 38px;
    height: 38px;
}

.auth-body .shell {
    min-height: calc(100vh - 70px);
    width: min(100%, 1100px);
    margin: 0 auto;
    padding: 18px;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(440px, 100%);
    display: grid;
    gap: 18px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    margin: 0;
    color: var(--primary);
    font-size: 28px;
}

.login-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.hero,
.panel,
.result-card,
.history-card,
.game-card,
.stat,
.login-card {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.hero {
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    padding: 28px;
    border-radius: var(--radius-lg);
    color: #fff;
    background: linear-gradient(135deg, rgba(17, 27, 58, .88), rgba(29, 41, 77, .82)), url("../images/pattern.svg") center / cover;
}

.panel,
.result-card,
.history-card,
.game-card {
    padding: 18px;
    border-radius: var(--radius-lg);
}

.panel + .panel,
.panel + .result-card,
.result-card + .panel {
    margin-top: 16px;
}

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

.section-title h1,
.section-title h2,
.panel h1,
.panel h2,
.game-card h3,
.result-card h1,
.result-card h2,
.history-card h2,
.hero h1 {
    margin: 0;
    letter-spacing: 0;
    color: var(--text);
}

.hero h1 {
    color: #fff;
}

.section-title h1,
.panel h1,
.result-card h1 {
    font-size: clamp(24px, 4vw, 30px);
}

.panel h2,
.history-card h2 {
    margin-bottom: 12px;
    font-size: 19px;
}

.section-title a,
.primary,
.secondary,
.small {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 850;
    text-align: center;
    transition: transform .12s ease, filter .18s ease, box-shadow .18s ease;
}

.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 20px rgba(226, 29, 61, .18);
}

.secondary,
.section-title a,
.small {
    background: var(--secondary);
    color: #fff;
}

.small {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 12px;
}

.small.danger {
    background: var(--danger);
}

.primary:hover,
.secondary:hover,
.section-title a:hover,
.small:hover {
    filter: brightness(.96);
}

.stats-grid,
.history-grid,
.result-values,
.times,
.game-list,
.menu-list,
.share-grid,
.filters,
.form,
.cart {
    display: grid;
    gap: 14px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
    position: relative;
    min-height: 140px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    padding: 18px;
    border-radius: var(--radius-lg);
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat:hover,
.game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(226, 29, 61, .10);
    color: var(--accent);
}

.stat-icon .ui-icon {
    width: 22px;
    height: 22px;
}

.stat span:not(.stat-icon) {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.stat strong {
    color: var(--primary);
    font-size: 30px;
    line-height: 1;
}

.stat small {
    color: var(--success);
    font-size: 12px;
    font-weight: 750;
}

.menu-list {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-top: 18px;
}

.menu-list a {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--secondary);
    font-weight: 850;
    box-shadow: var(--shadow-sm);
}

.game-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-card {
    position: relative;
    display: grid;
    gap: 14px;
    overflow: hidden;
}

.game-card::before {
    content: "";
    position: absolute;
    top: 16px;
    right: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(226, 29, 61, .45);
    animation: pulse-live 1.8s infinite;
}

.game-card h3 {
    padding-right: 20px;
    color: var(--primary);
    font-size: 18px;
}

.times {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.times span,
.history-grid span,
.result-values div,
.preview,
.total,
.copy-link {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.times strong,
.history-grid strong,
.result-values strong,
.total strong,
.preview strong {
    color: var(--primary);
    font-size: 16px;
}

.date-line {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    background: #EDF1F7;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.badge.open,
.badge.active,
.badge.result_published,
.badge.completed,
.badge.win {
    background: rgba(25, 185, 120, .12);
    color: #0B7A4F;
}

.badge.prediction_closed,
.badge.result_pending,
.badge.rejected,
.badge.loss {
    background: rgba(226, 29, 61, .12);
    color: #B01731;
}

.badge.scheduled,
.badge.processing {
    background: rgba(17, 27, 58, .10);
    color: var(--secondary);
}

.badge.pending {
    background: rgba(245, 184, 46, .18);
    color: #8B5D00;
}

.tabs,
.segmented {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab,
.segmented a {
    min-height: 46px;
    min-width: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--secondary);
    font-weight: 900;
}

.tab.active,
.segmented .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fade-up .18s ease;
}

.number-grid,
.triple-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(48px, 1fr));
    gap: 9px;
}

.number-grid button,
.triple-grid button,
.triple-grid span {
    min-height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--primary);
    font-size: 17px;
    font-weight: 950;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.number-grid button:hover,
.triple-grid button:hover {
    border-color: rgba(17, 27, 58, .28);
    transform: translateY(-1px);
}

.number-grid button.selected,
.triple-grid button.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: inset 0 -3px 0 var(--accent);
}

.reward {
    margin: 0 0 12px;
    color: var(--success);
    font-weight: 850;
}

.cart {
    position: sticky;
    bottom: 16px;
    z-index: 9;
}

.cart-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.result-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-values strong {
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1;
}

.result-values.compact strong {
    font-size: 24px;
}

.history-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.result-history-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.result-history-mobile {
    display: none;
}

.result-date-card {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.result-date-card h2 {
    margin: 0;
    padding: 13px 14px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
}

.mobile-result-labels,
.mobile-result-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.mobile-result-labels span {
    min-width: 0;
    padding: 6px 2px;
    border-right: 1px solid var(--border);
    background: var(--warning);
    color: var(--primary);
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    text-align: center;
}

.mobile-result-labels span:last-child,
.mobile-result-grid > *:nth-child(8n) {
    border-right: 0;
}

.mobile-result-grid > * {
    min-width: 0;
    min-height: 42px;
    display: grid;
    place-items: center;
    padding: 6px 2px;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
}

.mobile-result-patti {
    background: #fff;
    color: var(--primary);
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 950;
    line-height: 1;
    overflow-wrap: anywhere;
}

.mobile-result-patti.single-only {
    font-size: clamp(10px, 3vw, 12px);
    text-transform: uppercase;
}

.mobile-result-single {
    background: #FFF8DF;
    color: var(--accent);
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 950;
    line-height: 1;
}

.mobile-result-single.empty {
    color: var(--muted);
}

.result-date-game {
    display: grid;
    gap: 4px;
    padding: 13px 14px;
    border-top: 1px solid var(--border);
}

.result-date-game span {
    color: var(--secondary);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.result-date-game strong {
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
}

.result-date-game small {
    color: var(--muted);
    font-weight: 850;
}

.result-history-grid {
    min-width: 960px;
    width: 100%;
    border-collapse: collapse;
}

.result-history-grid th,
.result-history-grid td {
    min-width: 104px;
    padding: 0;
    border: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
}

.result-history-grid thead th {
    padding: 13px 10px;
    background: var(--warning);
    color: var(--primary);
    font-weight: 950;
}

.result-history-grid .sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
}

.result-history-grid .date-cell {
    min-width: 190px;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    white-space: normal;
}

.result-cell {
    min-height: 88px;
    display: grid;
    place-items: center;
    gap: 3px;
    color: var(--primary);
    text-decoration: none;
}

.patti-result {
    font-size: 1.7rem;
    font-weight: 950;
    line-height: 1;
}

.single-result {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 900;
}

.single-only-label {
    font-size: 1rem;
}

.result-cell small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.result-cell.empty {
    color: var(--muted);
    font-size: 1.5rem;
    font-weight: 900;
}

.search,
.filters input,
.filters select,
.form input,
.form select,
.form textarea,
.cart input {
    width: 100%;
    min-height: 50px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.form textarea {
    min-height: 120px;
    resize: vertical;
}

.search:focus,
.filters input:focus,
.filters select:focus,
.form input:focus,
.form select:focus,
.form textarea:focus,
.cart input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus);
}

.form {
    gap: 16px;
}

.form label,
.cart label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.check {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.check input {
    width: 18px;
    min-height: 18px;
}

.filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.form-section {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.grid.two,
.digit-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.alert {
    padding: 12px 14px;
    border: 1px solid rgba(226, 29, 61, .22);
    border-radius: var(--radius-md);
    background: rgba(226, 29, 61, .10);
    color: #A4142B;
    font-weight: 750;
}

.alert.success {
    border-color: rgba(25, 185, 120, .24);
    background: rgba(25, 185, 120, .12);
    color: #0B7A4F;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    background: var(--surface-soft);
    color: var(--secondary);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

td {
    color: var(--text);
}

tbody tr:hover td {
    background: #FCFDFE;
}

.share-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.copy-link {
    overflow-wrap: anywhere;
}

.triple-chart {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.triple-column {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.triple-column strong,
.triple-column span {
    display: block;
    text-align: center;
}

.triple-grid.manage span {
    display: grid;
    place-items: center;
}

.triple-grid small,
.inactive-number {
    color: var(--muted);
}

.inactive-number {
    text-decoration: line-through;
}

.profile {
    text-align: center;
}

.profile .avatar {
    width: 86px;
    height: 86px;
    margin: 0 auto 12px;
    font-size: 34px;
}

.bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 28;
    display: none;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: var(--bottom-nav-height);
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -10px 30px rgba(17, 27, 58, .08);
}

.bottom-nav a {
    min-width: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.bottom-nav .ui-icon {
    width: 20px;
    height: 20px;
}

.bottom-nav a.active {
    color: var(--accent);
}

.toast-region {
    position: fixed;
    top: 88px;
    right: 18px;
    z-index: 80;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in .18s ease;
}

.toast.success {
    border-color: rgba(25, 185, 120, .28);
}

.toast.error {
    border-color: rgba(226, 29, 61, .28);
}

.toast.warning {
    border-color: rgba(245, 184, 46, .48);
}

.toast-mark {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    font-weight: 950;
}

.toast.success .toast-mark {
    background: var(--success);
}

.toast.error .toast-mark {
    background: var(--danger);
}

.toast.warning .toast-mark {
    background: var(--warning);
    color: var(--primary);
}

.toast button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 900;
}

.modal-root {
    position: relative;
    z-index: 90;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, .45);
    animation: fade-in .18s ease;
}

.app-modal {
    width: min(430px, 100%);
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: modal-in .18s ease;
}

.app-modal h2 {
    margin: 0;
    color: var(--primary);
    font-size: 20px;
}

.app-modal p {
    margin: 0;
    color: var(--muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.button-loader {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.is-loading {
    pointer-events: none;
}

.reveal {
    animation: fade-up .24s ease both;
}

body.sidebar-collapsed .sidebar,
body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .profile-info,
body.sidebar-collapsed .nav-group-toggle span,
body.sidebar-collapsed .nav-link span {
    display: none;
}

body.sidebar-collapsed .sidebar-header,
body.sidebar-collapsed .sidebar-menu-scroll,
body.sidebar-collapsed .sidebar-footer {
    padding-left: 10px;
    padding-right: 10px;
}

body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .sidebar-profile {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-profile {
    margin-left: 10px;
    margin-right: 10px;
}

body.sidebar-collapsed .topbar,
body.sidebar-collapsed .shell {
    margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .shell {
    width: calc(100% - var(--sidebar-collapsed));
}

body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-group-toggle {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

@keyframes pulse-live {
    0% { box-shadow: 0 0 0 0 rgba(226, 29, 61, .45); }
    70% { box-shadow: 0 0 0 9px rgba(226, 29, 61, 0); }
    100% { box-shadow: 0 0 0 0 rgba(226, 29, 61, 0); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dashboard-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 20px;
}

.dashboard-head > div,
.wallet-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.dashboard-head > div {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 132px;
    padding: 24px;
}

.dashboard-head span {
    color: var(--muted);
    font-weight: 800;
}

.dashboard-head h1 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(26px, 4vw, 36px);
}

.wallet-card {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 22px;
}

.wallet-card .ui-icon {
    width: 28px;
    height: 28px;
    color: var(--success);
}

.wallet-card strong {
    color: var(--primary);
    font-size: 30px;
    line-height: 1;
}

.today-games-table {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.today-games-table table {
    min-width: 0;
}

.status-pill {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #EDF1F7;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.status-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-pill.running {
    background: rgba(25, 185, 120, .12);
    color: #0B7A4F;
}

.status-pill.closed,
.status-pill.result-pending,
.status-pill.result-declared {
    background: rgba(226, 29, 61, .12);
    color: #B01731;
}

.status-pill.result-published {
    background: rgba(25, 185, 120, .14);
    color: #0B7A4F;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 180px;
    text-align: center;
}

.empty-icon {
    width: 42px;
    height: 42px;
    color: var(--muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.compact-list,
.current-bets,
.my-bets-list {
    display: grid;
    gap: 10px;
}

.compact-row,
.bet-row,
.my-bet-card {
    min-width: 0;
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.compact-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(120px, .8fr) minmax(90px, .6fr) auto;
    align-items: center;
}

.compact-row strong,
.compact-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.badge.waiting {
    background: rgba(245, 184, 46, .18);
    color: #8B5D00;
}

.game-play-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(220px, auto);
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.game-play-header h1,
.game-play-header p {
    margin: 0;
}

.game-play-header h1 {
    color: var(--primary);
    font-size: clamp(24px, 4vw, 32px);
}

.game-play-header span {
    color: var(--muted);
    font-weight: 850;
    text-transform: uppercase;
}

.back-link {
    color: var(--secondary);
    font-weight: 900;
}

.status-panel {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.status-panel strong,
.pending-countdown {
    color: var(--primary);
    font-size: 24px;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.prediction-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 16px;
    align-items: start;
}

.prediction-main {
    display: grid;
    gap: 16px;
}

.panel-title-row,
.cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-title-row h2,
.cart-head h2 {
    margin: 0;
}

.prediction-cart {
    position: sticky;
    top: calc(var(--topbar-height) + 16px);
    max-height: calc(100dvh - var(--topbar-height) - 32px);
    display: grid;
    gap: 12px;
    overflow: hidden;
}

.prediction-cart .cart-list {
    display: grid;
    gap: 10px;
    max-height: min(48dvh, 420px);
    overflow-y: auto;
    padding-right: 2px;
}

.cart-close,
.cart-sheet-backdrop,
.mobile-cart-bar {
    display: none;
}

body.cart-open {
    overflow: hidden;
}

.success-panel {
    margin-top: 16px;
}

.result-pending-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.result-pending-card h2 {
    color: var(--danger);
    text-transform: uppercase;
}

.my-bet-card {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.my-bet-card > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.my-bet-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.my-bet-card strong {
    overflow-wrap: anywhere;
    color: var(--primary);
}

.my-bet-card.win {
    border-color: rgba(25, 185, 120, .36);
    background: rgba(25, 185, 120, .08);
}

.my-bet-card.loss {
    border-color: rgba(226, 29, 61, .24);
    background: rgba(226, 29, 61, .06);
}

.bet-total-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.bet-total-grid span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 800;
}

.bet-total-grid strong {
    color: var(--primary);
    font-size: 18px;
}

.user-dashboard {
    display: grid;
    gap: 18px;
}

.premium-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
}

.welcome-card,
.premium-wallet-card,
.premium-stats article,
.premium-game-card,
.premium-empty-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.welcome-card {
    min-height: 170px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, #111B3A 0%, #1D4ED8 62%, #5B21B6 100%);
    color: #fff;
}

.welcome-card .eyebrow {
    color: rgba(255, 255, 255, .78);
    font-weight: 850;
}

.welcome-card h1 {
    max-width: 680px;
    margin: 0;
    color: #fff;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.08;
}

.welcome-card p {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-weight: 700;
}

.premium-wallet-card {
    display: grid;
    align-content: space-between;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(145deg, #111B3A, #172554 58%, #1E1B4B);
    color: #fff;
}

.wallet-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .74);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.wallet-title .ui-icon {
    width: 23px;
    height: 23px;
    color: #22C55E;
}

.premium-wallet-card strong {
    color: #fff;
    font-size: 34px;
    line-height: 1;
}

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wallet-actions a {
    min-height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: rgba(255, 255, 255, .10);
    color: #fff;
    font-weight: 850;
}

.premium-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.premium-stats article {
    min-height: 112px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 16px;
    background: var(--surface);
}

.premium-stats .ui-icon {
    width: 24px;
    height: 24px;
    color: #2563EB;
}

.premium-stats article:nth-child(2) .ui-icon {
    color: #16A34A;
}

.premium-stats article:nth-child(3) .ui-icon {
    color: #F59E0B;
}

.premium-stats article:nth-child(4) .ui-icon {
    color: #7C3AED;
}

.premium-stats strong {
    color: var(--primary);
    font-size: 26px;
    line-height: 1;
}

.premium-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.premium-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
}

.premium-section-head h2 {
    margin: 2px 0 0;
    color: var(--primary);
    font-size: 24px;
}

.premium-section-head p {
    margin: 2px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.premium-section-head a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 850;
}

.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #16A34A;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.live-dot::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #16A34A;
    box-shadow: 0 0 0 5px rgba(22, 163, 74, .12);
}

.premium-game-grid {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.premium-game-table-head {
    display: grid;
    grid-template-columns: minmax(160px, 2fr) minmax(105px, .8fr) minmax(96px, .75fr) minmax(96px, .75fr) minmax(105px, .8fr) minmax(120px, .9fr);
    gap: 10px;
    align-items: center;
    min-height: 48px;
    padding: 0 14px 0 18px;
    background: #F8FAFC;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.premium-game-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(160px, 2fr) minmax(105px, .8fr) minmax(96px, .75fr) minmax(96px, .75fr) minmax(105px, .8fr) minmax(120px, .9fr);
    gap: 10px;
    align-items: center;
    min-height: 88px;
    padding: 14px 14px 14px 18px;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    background: var(--surface);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.premium-game-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: #718096;
}

.premium-game-card:hover {
    transform: none;
    background: #FCFDFE;
    box-shadow: none;
}

.premium-game-card.running::before {
    background: #16A34A;
}

.premium-game-card.result-pending::before {
    background: #F59E0B;
}

.premium-game-card.result-published::before {
    background: #2563EB;
}

.game-card-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.game-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(37, 99, 235, .10);
    color: #2563EB;
}

.game-icon .ui-icon {
    width: 23px;
    height: 23px;
}

.game-card-top strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--primary);
    font-size: 17px;
    font-weight: 950;
    text-transform: uppercase;
}

.game-title-link {
    display: grid;
    gap: 2px;
}

.game-card-top span:not(.game-icon) {
    display: block;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-weight: 750;
}

.game-time-grid {
    display: contents;
}

.game-time-grid div,
.game-countdown {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.game-time-grid span,
.game-countdown span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.game-time-grid strong,
.game-countdown strong {
    color: var(--primary);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.game-action {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 900;
    transition: transform .18s ease, filter .18s ease;
}

.game-action:hover {
    transform: translateY(-1px);
    filter: brightness(.97);
}

.game-action:active {
    transform: scale(.98);
}

.game-action.play {
    background: #16A34A;
    color: #fff;
}

.game-action.result {
    background: var(--primary);
    color: #fff;
}

.premium-empty-card,
.soft-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 24px;
    background: var(--surface);
    text-align: center;
}

.premium-empty-card .ui-icon,
.soft-empty .ui-icon {
    width: 34px;
    height: 34px;
    color: #2563EB;
}

.premium-empty-card h2,
.soft-empty h3 {
    margin: 0;
    color: var(--primary);
}

.premium-empty-card p,
.soft-empty p {
    margin: 0;
    color: var(--muted);
}

.premium-bottom-grid {
    margin-top: 0;
}

.premium-list-panel {
    display: grid;
    gap: 12px;
}

.list-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-panel-head .ui-icon {
    width: 22px;
    height: 22px;
    color: #7C3AED;
}

.list-panel-head h2 {
    margin: 0;
}

.premium-bet-row {
    border-radius: 12px;
    background: #F8FAFC;
}

.game-header-card-grid,
.admin-header-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.game-header-card,
.admin-header-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.game-header-card {
    display: grid;
    padding: 0;
    color: inherit;
    text-decoration: none;
    text-align: left;
}

.game-header-card:hover,
.admin-header-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.game-header-card.selected {
    border-color: rgba(226, 29, 61, .58);
    box-shadow: 0 18px 42px rgba(226, 29, 61, .14);
}

.header-card-image,
.admin-header-card > img,
.header-upload-preview img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #EAF0F8;
}

.header-card-image img,
.admin-header-card > img,
.header-upload-preview img,
.header-preview-image img,
.header-games-head img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-card-image img {
    transition: transform .25s ease;
}

.game-header-card:hover .header-card-image img {
    transform: scale(1.03);
}

.header-card-body,
.admin-header-card-body {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.header-card-body strong,
.admin-header-card h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--primary);
    font-size: 18px;
    font-weight: 950;
    text-transform: uppercase;
}

.header-card-body span:not(.header-card-action),
.admin-header-card p,
.header-games-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.header-card-body em {
    width: fit-content;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(17, 27, 58, .08);
    color: var(--secondary);
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
    text-transform: uppercase;
}

.header-card-body em.live {
    background: rgba(25, 185, 120, .12);
    color: #0B7A4F;
}

.header-card-body em.result-pending {
    background: rgba(245, 184, 46, .18);
    color: #8B5D00;
}

.header-card-body em.result-available {
    background: rgba(37, 99, 235, .12);
    color: #1D4ED8;
}

.header-card-body em.closed {
    background: rgba(226, 29, 61, .10);
    color: #B01731;
}

.header-card-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.game-header-card.selected .header-card-action {
    background: var(--accent);
}

.user-header-detail {
    gap: 16px;
}

.game-header-page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.game-header-back {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--secondary);
    font-weight: 900;
    box-shadow: var(--shadow-sm);
}

.game-header-back .ui-icon {
    transform: rotate(90deg);
}

.game-header-breadcrumb {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.game-header-breadcrumb span::before,
.game-header-breadcrumb strong::before {
    content: "/";
    margin-right: 8px;
    color: var(--muted);
}

.game-header-breadcrumb a,
.game-header-breadcrumb strong {
    color: var(--primary);
}

.game-header-hero {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.game-header-hero-image {
    width: 100%;
    height: 100%;
    min-height: 220px;
    overflow: hidden;
    background: #EAF0F8;
}

.game-header-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-header-hero-copy {
    display: grid;
    gap: 10px;
    padding: 22px 22px 22px 0;
}

.game-header-hero-copy h1 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--primary);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
    text-transform: uppercase;
}

.game-header-hero-copy p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.game-header-list-head {
    margin-bottom: -4px;
}

.header-placeholder {
    min-height: 100%;
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 18px;
    background: linear-gradient(135deg, #111B3A, #2563EB);
    color: #fff;
    text-align: center;
    font-weight: 900;
}

.header-placeholder .ui-icon {
    width: 34px;
    height: 34px;
}

.header-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.header-pill-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
}

.header-pill-row a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--secondary);
    font-weight: 900;
}

.header-pill-row a.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.header-games-panel {
    display: none;
    gap: 12px;
    animation: fade-up .22s ease;
}

.header-games-panel.open {
    display: grid;
}

.header-games-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.header-games-head img,
.small-placeholder {
    width: 76px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 12px;
    overflow: hidden;
}

.header-games-head h3 {
    margin: 0;
    color: var(--primary);
    font-size: 20px;
    text-transform: uppercase;
}

.header-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.header-preview-image {
    width: 74px;
    height: 48px;
    overflow: hidden;
    border-radius: 10px;
    background: #EAF0F8;
}

.header-upload-preview {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.day-checks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.day-checks legend {
    padding: 0 8px;
    color: var(--primary);
    font-weight: 900;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.row-actions .small {
    min-height: 34px;
    padding: 7px 10px;
}

.action-icon {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 40px;
    border: 1px solid transparent;
    border-radius: 11px;
    transition: transform .12s ease, filter .18s ease, border-color .18s ease;
}

.action-icon:hover {
    filter: brightness(.98);
    transform: translateY(-1px);
}

.action-edit {
    border-color: rgba(34, 108, 246, .16);
    background: rgba(34, 108, 246, .10);
    color: #226CF6;
}

.action-transfer {
    border-color: rgba(25, 185, 120, .18);
    background: rgba(25, 185, 120, .12);
    color: #087D59;
}

.action-withdraw {
    border-color: rgba(226, 29, 61, .16);
    background: rgba(226, 29, 61, .10);
    color: #C21835;
}

.limit-hint {
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.inline-actions form {
    margin: 0;
}

@media (max-width: 1199px) {
    .game-header-card-grid,
    .admin-header-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid,
    .history-grid,
    .premium-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .triple-chart {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .sidebar,
    .app-sidebar {
        width: min(86vw, 320px);
        height: 100dvh;
        transform: translateX(-105%);
    }

    body.drawer-open .sidebar,
    body.drawer-open .app-sidebar {
        transform: translateX(0);
    }

    body.drawer-open .drawer-overlay {
        display: block;
        opacity: 1;
    }

    .topbar,
    .shell,
    body.sidebar-collapsed .topbar,
    body.sidebar-collapsed .shell {
        margin-left: 0;
    }

    .shell,
    body.sidebar-collapsed .shell {
        width: 100%;
        max-width: none;
    }

    .topbar {
        min-height: 64px;
        padding: 10px 16px;
    }

    .topbar-title h1 {
        font-size: 18px;
    }

    .breadcrumbs,
    .topbar-search,
    .topbar-wallet,
    .profile-name {
        display: none;
    }

    .profile-trigger {
        padding: 6px;
    }

    .shell {
        padding: 18px 16px calc(var(--bottom-nav-height) + 22px + env(safe-area-inset-bottom));
    }

    .bottom-nav {
        display: grid;
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }

    .cart {
        bottom: calc(var(--bottom-nav-height) + 12px);
    }
}

@media (max-width: 767px) {
    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .section-title a,
    .primary,
    .secondary {
        width: 100%;
    }

    .game-list,
    .stats-grid,
    .history-grid,
    .result-values,
    .times,
    .share-grid,
    .filters,
    .grid.two,
    .digit-row {
        grid-template-columns: 1fr;
    }

    .result-history-wrap {
        display: none;
    }

    .result-history-mobile {
        display: grid;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding-bottom: 100px;
    }

    .result-date-card {
        width: 100%;
        max-width: 100%;
        border-radius: 12px;
        box-shadow: var(--shadow-md);
    }

    .result-date-card h2 {
        min-height: 54px;
        display: flex;
        align-items: center;
        padding: 14px 16px;
        background: var(--primary);
        color: #fff;
        font-size: clamp(16px, 4.6vw, 18px);
        line-height: 1.25;
        text-transform: uppercase;
    }

    .mobile-result-labels,
    .mobile-result-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .mobile-result-patti {
        font-size: clamp(16px, 5.1vw, 20px);
        letter-spacing: 0;
    }

    .mobile-result-single {
        font-size: clamp(14px, 4.5vw, 17px);
    }

    .table-wrap.responsive-cards table,
    .table-wrap.responsive-cards thead,
    .table-wrap.responsive-cards tbody,
    .table-wrap.responsive-cards tr,
    .table-wrap.responsive-cards th,
    .table-wrap.responsive-cards td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .table-wrap.responsive-cards {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .table-wrap.responsive-cards thead {
        display: none;
    }

    .table-wrap.responsive-cards tbody {
        display: grid;
        gap: 12px;
    }

    .table-wrap.responsive-cards tr {
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .table-wrap.responsive-cards td {
        display: grid;
        grid-template-columns: minmax(92px, .42fr) minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border-bottom: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .table-wrap.responsive-cards td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 950;
        line-height: 1.25;
        text-transform: uppercase;
    }

    .table-wrap.responsive-cards td:first-child {
        grid-template-columns: 1fr;
        padding-top: 0;
        color: var(--primary);
        font-size: 17px;
        font-weight: 950;
    }

    .table-wrap.responsive-cards td:first-child::before {
        display: none;
    }

    .row-actions {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .row-actions .action-icon {
        flex: 0 0 40px;
    }

    .dashboard-head,
    .dashboard-grid,
    .game-play-header,
    .prediction-page,
    .my-bet-card,
    .bet-total-grid,
    .premium-hero,
    .premium-game-grid,
    .game-header-card-grid,
    .admin-header-grid,
    .day-checks {
        grid-template-columns: 1fr;
    }

    .user-dashboard {
        gap: 14px;
    }

    .welcome-card {
        min-height: 150px;
        padding: 18px;
    }

    .premium-wallet-card,
    .premium-game-card {
        padding: 16px;
    }

    .premium-section-head {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .premium-section-head a {
        justify-content: center;
        width: 100%;
    }

    .header-games-head {
        align-items: flex-start;
    }

    .game-header-page-top {
        align-items: stretch;
        flex-direction: column;
    }

    .game-header-back {
        width: fit-content;
    }

    .game-header-breadcrumb {
        display: none;
    }

    .game-header-hero {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .game-header-hero-image {
        min-height: 180px;
        aspect-ratio: 16 / 9;
    }

    .game-header-hero-copy {
        padding: 18px;
    }

    .premium-game-grid {
        display: grid;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .premium-game-table-head {
        display: grid;
        grid-template-columns: minmax(0, 1.35fr) 70px 70px 94px;
        gap: 6px;
        min-width: 0;
        min-height: 44px;
        padding: 0 8px 0 12px;
        background: #F8FAFC;
        border-bottom: 1px solid var(--border);
    }

    .premium-game-table-head span:nth-child(2),
    .premium-game-table-head span:nth-child(5) {
        display: none;
    }

    .premium-game-card {
        grid-template-columns: minmax(0, 1.35fr) 70px 70px 94px;
        grid-template-rows: auto auto;
        gap: 5px 6px;
        min-width: 0;
        min-height: 76px;
        padding: 10px 8px 10px 12px;
        border: 0;
        border-top: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
    }

    .premium-game-card:hover {
        transform: none;
        box-shadow: none;
    }

    .game-time-grid {
        display: contents;
    }

    .game-card-top {
        grid-column: 1;
        grid-row: 1;
        gap: 7px;
        min-width: 0;
    }

    .premium-game-card > .status-pill {
        grid-column: 1;
        grid-row: 2;
        max-width: 100%;
    }

    .premium-game-card > .game-time-grid div:first-child {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .premium-game-card > .game-time-grid div:last-child {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .premium-game-card > .game-countdown {
        display: none;
    }

    .premium-game-card > .game-action {
        grid-column: 4;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .game-time-grid div,
    .game-countdown {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .game-icon {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .game-icon .ui-icon {
        width: 17px;
        height: 17px;
    }

    .game-card-top strong {
        font-size: 11px;
        line-height: 1.15;
    }

    .game-card-top span:not(.game-icon),
    .game-time-grid span,
    .game-countdown span {
        font-size: 9px;
    }

    .game-time-grid strong,
    .game-countdown strong {
        font-size: 12px;
    }

    .game-action {
        min-height: 36px;
        padding: 7px 8px;
        border-radius: 10px;
        font-size: 11px;
        line-height: 1.1;
        white-space: normal;
    }

    .game-header-games-grid .premium-game-table-head,
    .game-header-games-grid .premium-game-card {
        grid-template-columns: minmax(0, 1fr) 58px 58px 78px;
    }

    .game-header-games-grid .premium-game-table-head {
        padding: 0 6px 0 10px;
        font-size: 9px;
        line-height: 1.1;
    }

    .game-header-games-grid .premium-game-card {
        padding: 10px 6px 10px 10px;
    }

    .game-header-games-grid .game-card-top {
        grid-template-columns: minmax(0, 1fr);
    }

    .game-header-games-grid .game-icon,
    .game-header-games-grid .game-card-top span:not(.game-icon) {
        display: none;
    }

    .status-pill {
        min-height: 24px;
        padding: 4px 7px;
        font-size: 9px;
        line-height: 1;
        white-space: normal;
    }

    .status-panel {
        justify-items: stretch;
    }

    .today-games-table {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .today-games-table table,
    .today-games-table thead,
    .today-games-table tbody,
    .today-games-table tr,
    .today-games-table th,
    .today-games-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .today-games-table thead {
        display: none;
    }

    .today-games-table tr {
        margin-bottom: 12px;
        padding: 16px;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .today-games-table td {
        display: grid;
        grid-template-columns: minmax(94px, auto) minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        padding: 8px 0;
        border: 0;
        white-space: normal;
    }

    .today-games-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .today-games-table td:first-child {
        grid-template-columns: 1fr;
        padding-top: 0;
    }

    .today-games-table td:first-child::before {
        display: none;
    }

    .compact-row {
        grid-template-columns: 1fr;
    }

    .prediction-cart {
        position: fixed;
        inset: auto 0 0;
        z-index: 75;
        width: 100%;
        max-height: 85dvh;
        height: min(75vh, 650px);
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        border-radius: 18px 18px 0 0;
        transform: translateY(105%);
        transition: transform .2s ease;
    }

    .prediction-cart.sheet-open {
        transform: translateY(0);
    }

    .prediction-cart .cart-list {
        max-height: none;
        overflow-y: auto;
    }

    .cart-close {
        display: inline-grid;
    }

    .cart-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(0, 0, 0, .42);
    }

    body.cart-open .cart-sheet-backdrop {
        display: block;
    }

    .mobile-cart-bar {
        position: fixed;
        inset: auto 0 calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)) 0;
        z-index: 45;
        display: grid;
        grid-template-columns: auto auto minmax(120px, 1fr);
        gap: 10px;
        align-items: center;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 -10px 30px rgba(17, 27, 58, .10);
    }

    .mobile-cart-bar .primary {
        width: auto;
        min-height: 40px;
        padding: 8px 12px;
    }

    .amount-panel {
        margin-bottom: 84px;
    }

    .filters {
        padding: 12px;
    }

    .number-grid,
    .triple-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .panel,
    .result-card,
    .history-card,
    .game-card {
        padding: 16px;
    }

    .toast-region {
        top: 74px;
        right: 50%;
        transform: translateX(50%);
    }

    .modal-backdrop {
        align-items: end;
        padding: 0;
    }

    .app-modal {
        width: 100%;
        border-radius: 18px 18px 0 0;
    }
}

@media (max-width: 420px) {
    body {
        font-size: 14px;
    }

    .shell {
        padding-left: 14px;
        padding-right: 14px;
    }

    .number-grid,
    .triple-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .bottom-nav a {
        font-size: 10px;
    }

    .mobile-result-grid > * {
        min-height: 36px;
        padding-left: 1px;
        padding-right: 1px;
    }

    .mobile-result-labels span {
        font-size: 10px;
    }

    .premium-stats {
        gap: 10px;
    }

    .premium-stats article {
        min-height: 96px;
        padding: 13px;
    }

    .premium-stats strong {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
