@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700;800&family=Varela+Round&display=swap');

:root {
  color-scheme: dark;
  --bg: #080d13;
  --bg-elevated: #0d151e;
  --surface: #121c26;
  --surface-2: #172432;
  --surface-soft: #0e1720;
  --line: #243545;
  --line-soft: #192936;
  --muted: #91a2b3;
  --muted-strong: #b5c2cf;
  --text: #f4f8fc;
  --primary: #5aa9ff;
  --primary-strong: #8bc6ff;
  --primary-soft: #132f49;
  --accent: #52d6a2;
  --accent-soft: #123528;
  --danger: #ff7d8a;
  --danger-soft: #391d25;
  --warning: #f2c879;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 12px 36px rgb(0 0 0 / 18%);
  --shadow-lg: 0 28px 80px rgb(0 0 0 / 28%);
  --ease: 200ms cubic-bezier(.2, .8, .2, 1);
  font-family: 'Nunito Sans', Inter, system-ui, sans-serif;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eaf2f9;
  --surface-soft: #f7fafc;
  --line: #ccdae6;
  --line-soft: #dde7ef;
  --muted: #536779;
  --muted-strong: #334a5f;
  --text: #102132;
  --primary: #1677c8;
  --primary-strong: #0e67b1;
  --primary-soft: #dcebfa;
  --accent: #16835f;
  --accent-soft: #dff3ea;
  --danger: #c43e50;
  --danger-soft: #fbe8eb;
  --warning: #9a650d;
  --shadow-sm: 0 12px 36px rgb(35 70 100 / 10%);
  --shadow-lg: 0 28px 80px rgb(35 70 100 / 14%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--text); background: var(--bg); }
body::before { content: ''; position: fixed; z-index: -2; inset: 0; pointer-events: none; background: radial-gradient(circle at 12% 0%, rgb(90 169 255 / 9%), transparent 30%), radial-gradient(circle at 92% 72%, rgb(82 214 162 / 6%), transparent 28%); }
html[data-theme='light'] body::before { background: radial-gradient(circle at 12% 0%, rgb(22 119 200 / 10%), transparent 30%), radial-gradient(circle at 92% 72%, rgb(22 131 95 / 7%), transparent 28%); }
button, input, select, textarea { font: inherit; }
button, [role='button'] { cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(120px); opacity: .1; pointer-events: none; }
.ambient-one { width: 420px; height: 420px; top: -250px; left: -100px; background: var(--primary); }
.ambient-two { width: 360px; height: 360px; right: -180px; bottom: -160px; background: var(--accent); opacity: .06; }

:where(button, a, input, select, textarea, [role='button']):focus-visible { outline: 3px solid rgb(90 169 255 / 62%); outline-offset: 3px; }

.site-header { position: sticky; z-index: 50; top: 0; min-height: 76px; padding: 0 clamp(22px, 5vw, 74px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgb(39 49 61 / 72%); background: rgb(11 15 20 / 88%); box-shadow: 0 12px 36px rgb(0 0 0 / 12%); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; font-family: 'Varela Round', system-ui, sans-serif; font-size: 19px; letter-spacing: -.5px; }
.brand > span:last-child > span { color: var(--accent); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 18%); border-radius: 13px; color: #071521; background: linear-gradient(145deg, var(--primary-strong), var(--primary)); box-shadow: 0 10px 28px rgb(90 169 255 / 20%); font-weight: 900; }
.header-actions, .guest-auth-actions, .customer-nav { display: flex; align-items: center; }
.header-actions { gap: 16px; }
.guest-auth-actions { gap: 8px; }
.preference-controls { display: inline-flex; align-items: center; gap: 6px; }
.preference-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--muted-strong); background: var(--surface-soft); font-size: 11px; font-weight: 900; transition: color var(--ease), border-color var(--ease), background var(--ease); }
.preference-button:hover { color: var(--text); border-color: #39617e; background: var(--surface-2); }
.theme-icon { width: 19px; height: 19px; }
html[data-theme='dark'] .theme-icon-sun, html[data-theme='light'] .theme-icon-moon { display: none; }
.floating-preferences { position: fixed; z-index: 40; top: 20px; right: 22px; }
body:has(#admin-app:not(.hidden)) .floating-preferences { display: none; }
.admin-topbar-actions { display: flex; align-items: center; gap: 16px; }
.system-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 12px; font-weight: 700; }
.system-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgb(120 217 161 / 9%); }
.customer-nav { align-self: stretch; gap: 4px; }
.customer-nav button { height: 100%; min-width: 72px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; transition: color var(--ease), border-color var(--ease), background var(--ease); }
.customer-nav button:hover { color: var(--text); background: rgb(255 255 255 / 3%); }
.customer-nav button.active { color: var(--text); border-color: var(--primary); }
.profile-menu { position: relative; }
.profile-trigger { min-height: 44px; display: flex; align-items: center; gap: 10px; max-width: 260px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--surface-soft); transition: border-color var(--ease), background var(--ease); }
.profile-trigger:hover { border-color: #3b4757; background: var(--surface); }
.profile-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #071521; background: var(--primary); font-weight: 900; }
.profile-email { max-width: 160px; overflow: hidden; color: var(--muted-strong); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown { position: absolute; z-index: 20; top: calc(100% + 10px); right: 0; width: 190px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.profile-dropdown button { width: 100%; min-height: 42px; padding: 10px 12px; border: 0; border-radius: 9px; color: var(--muted-strong); background: transparent; text-align: left; font-size: 12px; font-weight: 700; }
.profile-dropdown button:hover { color: var(--text); background: var(--surface-2); }
.profile-dropdown .danger-text { color: #ff9aa4; }

.auth-layout { width: min(1180px, calc(100% - 48px)); margin: auto; padding: 64px 0 104px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 44px 56px; }
.hero-copy { grid-column: 1; grid-row: 1; max-width: 720px; padding: 24px 0 20px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 1.7px; }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; opacity: .75; }
.hero-copy h1 { max-width: 760px; margin: 20px 0 24px; font-family: 'Varela Round', system-ui, sans-serif; font-size: clamp(42px, 5.2vw, 70px); font-weight: 400; line-height: 1.07; letter-spacing: -3.5px; text-wrap: balance; }
.hero-copy h1 em { color: var(--primary-strong); font-style: normal; }
.hero-copy > p { max-width: 610px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.trust-row span { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 999px; color: var(--muted-strong); background: rgb(255 255 255 / 2%); font-size: 12px; font-weight: 700; }
.trust-row span::before { content: ''; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(120 217 161 / 8%); }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgb(24 32 43 / 97%), rgb(18 25 34 / 97%)); box-shadow: var(--shadow-lg); }
.auth-card { position: static; grid-column: 2; grid-row: 1 / span 2; width: 100%; max-width: 360px; justify-self: end; padding: 24px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border: 1px solid var(--line-soft); border-radius: 14px; background: #0d1218; }
.segmented button { min-height: 42px; padding: 9px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; transition: color var(--ease), background var(--ease), box-shadow var(--ease); }
.segmented button.active { color: var(--text); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.auth-heading { display: flex; align-items: center; gap: 15px; margin: 30px 0 24px; }
.auth-heading h2, .redeem-card h2 { margin: 0 0 5px; font-family: 'Varela Round', system-ui, sans-serif; font-size: 21px; font-weight: 400; letter-spacing: -.5px; }
.auth-heading p, .redeem-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.icon-bubble { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #24547a; border-radius: 14px; color: var(--primary-strong); background: var(--primary-soft); font-weight: 900; }
.icon-bubble svg { width: 21px; height: 21px; }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: var(--muted-strong); font-size: 12px; font-weight: 800; }
input, select, textarea { width: 100%; min-height: 46px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; color: var(--text); background: #0e141b; transition: border-color var(--ease), box-shadow var(--ease), background var(--ease); }
input::placeholder, textarea::placeholder { color: #697586; }
input:hover, select:hover, textarea:hover { border-color: #384554; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #101a24; box-shadow: 0 0 0 4px rgb(90 169 255 / 13%); }
select[multiple] { min-height: 120px; }
.button { min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 13px; color: var(--text); background: var(--surface-2); font-size: 12px; font-weight: 800; transition: color var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease), transform var(--ease); }
.button:hover { border-color: #3a4655; background: #202b37; }
.button:active { transform: translateY(1px); }
.button.primary { color: #071521; background: linear-gradient(135deg, var(--primary-strong), var(--primary)); box-shadow: 0 10px 26px rgb(90 169 255 / 20%); }
.button.primary:hover { border-color: rgb(255 255 255 / 18%); background: linear-gradient(135deg, #a9d5ff, #70b6ff); box-shadow: 0 13px 32px rgb(90 169 255 / 27%); }
.button.ghost { border-color: var(--line); color: var(--muted-strong); background: transparent; box-shadow: none; }
.button.ghost:hover { color: var(--text); background: rgb(255 255 255 / 4%); }
.button.danger { border-color: #59303a; color: #ffabb3; background: var(--danger-soft); }
.button.danger:hover { border-color: #75404c; background: #47242d; }
.button.small { min-height: 38px; padding: 8px 13px; font-size: 11px; }
.button:disabled { cursor: wait; opacity: .52; transform: none; }
.wide { width: 100%; }
.fine-print { margin: 18px 0 0; color: #758192; font-size: 10px; line-height: 1.5; text-align: center; }
.text-button { justify-self: end; min-height: 28px; margin-top: -8px; padding: 3px 0; border: 0; color: var(--primary-strong); background: transparent; font-size: 11px; font-weight: 800; }
.text-button:hover { color: #b8dcff; }
.guest-catalog { grid-column: 1; grid-row: 2; width: 100%; padding-top: 44px; border-top: 1px solid var(--line); }
.guest-catalog .section-intro h2 { font-size: clamp(26px, 3vw, 36px); }

.dashboard { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 68px 0 104px; }
.dashboard-heading, .admin-topbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.dashboard-heading h1, .admin-topbar h1 { margin: 8px 0; font-family: 'Varela Round', system-ui, sans-serif; font-size: clamp(34px, 4vw, 48px); font-weight: 400; letter-spacing: -2px; }
.dashboard-heading p { margin: 0; color: var(--muted); }
.summary-chip { min-width: 132px; padding: 15px 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); text-align: center; }
.summary-chip span { display: block; color: var(--accent); font-size: 28px; font-weight: 800; }
.summary-chip small { color: var(--muted); }
.redeem-card { padding: 26px 28px; display: grid; grid-template-columns: 1fr minmax(350px, .8fr); align-items: center; gap: 32px; }
.redeem-card > div { display: grid; grid-template-columns: 44px 1fr; column-gap: 16px; }
.redeem-card .icon-bubble { grid-row: span 2; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { min-width: 0; }
.content-section { margin-top: 40px; }
.section-intro { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.section-intro h2 { margin: 7px 0 0; font-family: 'Varela Round', system-ui, sans-serif; font-size: 24px; font-weight: 400; letter-spacing: -.7px; }
.section-intro p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.content-heading { margin: 0 0 15px; color: var(--muted-strong); font-size: 14px; }
.content-heading.spaced { margin-top: 38px; }
.card-grid, .game-grid, .listing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.access-card, .game-card, .listing-card, .list-card, .stat-card, .table-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 12px 40px rgb(0 0 0 / 10%); }
.listing-card { position: relative; overflow: hidden; padding: 22px; }
.listing-accent { position: absolute; z-index: 2; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--primary), var(--accent), transparent 82%); opacity: .9; }
.listing-cover { position: relative; height: 158px; display: grid; place-items: center; margin: -22px -22px 20px; overflow: hidden; color: var(--primary-strong); background: radial-gradient(circle at 20% 20%, #173d5d, #131f2a 58%, #0d151d); font-family: 'Varela Round', system-ui, sans-serif; font-size: 36px; }
.listing-cover::after { content: ''; position: absolute; inset: auto 0 0; height: 48%; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.listing-cover img, .game-cover img, .admin-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.listing-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.listing-head h3 { margin: 7px 0 0; font-family: 'Varela Round', system-ui, sans-serif; font-size: 17px; font-weight: 400; line-height: 1.35; }
.listing-choice { display: flex; align-items: baseline; gap: 9px; margin: 24px 0 15px; }
.listing-choice strong { color: var(--accent); font-size: 34px; line-height: 1; letter-spacing: -1px; }
.listing-choice span { color: var(--muted); font-size: 11px; }
.listing-games { min-height: 54px; display: flex; flex-wrap: wrap; align-content: start; gap: 7px; color: var(--muted); font-size: 10px; }
.listing-games span, .tag { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); }
.listing-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.listing-footer small { overflow: hidden; color: #8793a3; text-overflow: ellipsis; }
.access-card, .list-card { padding: 21px; }
.card-top, .entitlement-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.game-avatar { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #24547a; border-radius: 14px; color: var(--primary-strong); background: var(--primary-soft); font-family: 'Varela Round', system-ui, sans-serif; font-size: 19px; }
.access-card h3, .game-card h3, .list-card h3 { margin: 4px 0; font-size: 15px; }
.access-card p, .game-card p, .list-card p { margin: 0; color: var(--muted); font-size: 11px; }
.credential { margin: 18px 0 0; display: grid; gap: 8px; }
.credential-row { padding: 10px 11px; display: grid; grid-template-columns: 65px 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--surface-soft); font-size: 11px; }
.credential-row span:first-child { color: var(--muted); }
.credential-row code { overflow: hidden; text-overflow: ellipsis; }
.copy-button { min-width: 32px; min-height: 32px; padding: 3px; border: 0; color: var(--primary-strong); background: transparent; }
.card-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }
.expiry { color: #8591a0; font-size: 10px; }
.stack-list { display: grid; gap: 15px; }
.code-reference { color: var(--primary-strong); font-family: ui-monospace, monospace; font-size: 9px; font-weight: 800; letter-spacing: .8px; }
.choice-badge, .status-badge { padding: 6px 10px; border: 1px solid #2b5940; border-radius: 999px; color: #9ce9ba; background: var(--accent-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-badge.muted { border-color: var(--line); color: var(--muted-strong); background: var(--surface-2); }
.mini-games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.mini-game { min-height: 58px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-soft); text-align: left; transition: border-color var(--ease), background var(--ease); }
.mini-game:not(:disabled):hover { border-color: #356f9d; background: var(--surface-2); }
.mini-game:disabled { cursor: default; opacity: .45; }
.mini-game strong, .mini-game small { display: block; }
.mini-game strong { font-size: 11px; }
.mini-game small { color: var(--muted); font-size: 9px; }
.game-card { overflow: hidden; display: block; }
.game-card > div:last-child { padding: 16px 18px 18px; }
.game-cover { position: relative; height: 164px; display: grid; place-items: center; overflow: hidden; color: var(--primary-strong); background: linear-gradient(145deg, #163b59, #121e29); font-family: 'Varela Round', system-ui, sans-serif; font-size: 28px; }
.interactive-card { cursor: pointer; transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease), background var(--ease); }
.interactive-card:hover { transform: translateY(-2px); border-color: #315f82; background: var(--surface-2); box-shadow: 0 22px 52px rgb(0 0 0 / 20%); }
.interactive-card:active { transform: translateY(0); }
.empty-state { grid-column: 1 / -1; padding: 54px 24px; border: 1px dashed #374352; border-radius: var(--radius-md); color: var(--muted); background: rgb(255 255 255 / 1.5%); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 17px; }
.profile-layout { display: grid; grid-template-columns: minmax(240px, .7fr) 1.3fr; gap: 20px; }
.profile-card { padding: 34px; text-align: center; }
.profile-large-avatar { width: 80px; height: 80px; display: grid; place-items: center; margin: 0 auto 19px; border: 1px solid rgb(255 255 255 / 16%); border-radius: 25px; color: #071521; background: linear-gradient(145deg, var(--primary-strong), var(--primary)); box-shadow: 0 16px 40px rgb(90 169 255 / 22%); font-size: 31px; font-weight: 900; }
.profile-card h2 { margin: 0; overflow-wrap: anywhere; font-size: 16px; }
.profile-card > p { color: var(--muted); font-size: 11px; }
.profile-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 27px; padding-top: 19px; border-top: 1px solid var(--line); font-size: 10px; }
.profile-meta span { color: var(--muted); }
.profile-details { display: grid; align-content: start; gap: 17px; }
.profile-stats { margin: 0; }
.profile-details .list-card p { margin: 8px 0 18px; line-height: 1.7; }
.password-card form { margin-top: 18px; }
.security-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.password-dialog { width: min(470px, calc(100% - 28px)); }
.password-dialog > .form-stack { padding: 0 25px 26px; }
.dialog-copy { margin: 0 0 5px; color: var(--muted); font-size: 11px; line-height: 1.7; }

.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.key-card { width: min(420px, 100%); padding: 36px; display: grid; gap: 19px; text-align: center; }
.brand.centered { justify-self: center; margin-bottom: 10px; }
.key-card h1 { margin: -7px 0 0; font-family: 'Varela Round', system-ui, sans-serif; font-weight: 400; letter-spacing: -1px; }
.key-card p, .key-card small { margin: 0; color: var(--muted); }
.key-card label { text-align: left; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; padding: 28px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgb(15 21 29 / 96%); box-shadow: 14px 0 44px rgb(0 0 0 / 12%); backdrop-filter: blur(18px); }
.sidebar .brand { padding: 0 10px 30px; }
.sidebar nav { display: grid; flex: 1; align-content: start; gap: 6px; }
.sidebar nav button { min-height: 44px; width: 100%; padding: 11px 13px; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 12px; color: #95a1b0; background: transparent; text-align: left; font-size: 12px; font-weight: 700; transition: color var(--ease), background var(--ease), border-color var(--ease); }
.sidebar nav button:hover { color: var(--text); background: rgb(255 255 255 / 3%); }
.sidebar nav button.active { border-color: #24547a; color: var(--primary-strong); background: var(--primary-soft); }
.admin-main { grid-column: 2; width: 100%; max-width: 1500px; padding: 44px clamp(24px, 4vw, 64px) 84px; }
.admin-topbar { align-items: center; }
.admin-topbar h1 { font-size: 32px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { padding: 21px; }
.stat-card span { color: var(--muted); font-size: 10px; font-weight: 800; }
.stat-card strong { display: block; margin-top: 7px; font-size: 29px; letter-spacing: -1px; }
.stat-card strong.accent { color: var(--accent); }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 30px 0 15px; }
.section-toolbar h2 { margin: 0; font-family: 'Varela Round', system-ui, sans-serif; font-size: 19px; font-weight: 400; }
.table-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { color: #8793a3; background: var(--surface-soft); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .9px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.data-table td { color: var(--muted-strong); font-size: 11px; }
.data-table tbody tr { transition: background var(--ease); }
.data-table tbody tr:hover { background: rgb(255 255 255 / 2%); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table strong { color: var(--text); }
.admin-product-cell { display: flex; align-items: center; gap: 11px; }
.admin-thumb { position: relative; width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid #24547a; border-radius: 12px; color: var(--primary-strong); background: var(--primary-soft); font-weight: 900; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { color: var(--muted-strong); font-size: 9px; }
.row-actions { display: flex; gap: 7px; white-space: nowrap; }
.checkbox-label { display: flex; grid-template-columns: none; align-items: center; gap: 8px; }
.checkbox-label input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--primary); }

dialog { width: min(540px, calc(100% - 30px)); max-height: 88vh; overflow: auto; padding: 26px; border: 1px solid #35404d; border-radius: 22px; color: var(--text); background: var(--surface); box-shadow: 0 34px 110px rgb(0 0 0 / 58%); }
dialog::backdrop { background: rgb(3 6 10 / 76%); backdrop-filter: blur(7px); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; margin-bottom: 23px; }
.dialog-head h2 { margin: 6px 0 0; font-family: 'Varela Round', system-ui, sans-serif; font-weight: 400; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: transparent; font-size: 22px; transition: color var(--ease), background var(--ease); }
.icon-button:hover { color: var(--text); background: var(--surface-2); }
.dialog-form { display: grid; gap: 16px; }
.item-detail-dialog { width: min(700px, calc(100% - 30px)); padding: 0; overflow: hidden auto; }
.item-detail-dialog .dialog-head { position: sticky; z-index: 2; top: 0; margin: 0; padding: 21px 25px; border-bottom: 1px solid var(--line); background: rgb(21 28 37 / 94%); backdrop-filter: blur(12px); }
#item-detail-body { padding: 0 25px 25px; }
.detail-cover { position: relative; height: 250px; display: grid; place-items: center; margin: 0 -25px 23px; overflow: hidden; color: var(--primary-strong); background: radial-gradient(circle at 25% 20%, #173f60, #131f2a 58%, #0d151d); font-family: 'Varela Round', system-ui, sans-serif; font-size: 46px; }
.detail-cover::after { content: ''; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.detail-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.detail-summary > div { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.detail-summary span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.detail-summary strong { display: block; overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.detail-block { margin-top: 25px; }
.detail-block h3 { margin: 0 0 12px; font-size: 14px; }
.detail-copy { margin: 0; color: var(--muted-strong); font-size: 11px; line-height: 1.8; white-space: pre-line; }
.detail-info { margin-top: 23px; padding: 15px 17px; border: 1px solid #2f5d45; border-radius: 13px; color: #a8e7c0; background: var(--accent-soft); font-size: 11px; line-height: 1.7; }
.detail-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.detail-actions a { text-align: center; }
.missing-link, .muted-copy { margin-right: auto; color: var(--muted); font-size: 10px; }
.detail-package-list { display: grid; gap: 9px; }
.detail-package-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.detail-package-row > a { min-height: 44px; display: grid; place-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--primary-strong); background: var(--surface-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.detail-package-row > a:hover, .detail-package-list button:hover { border-color: #356f9d; background: var(--surface-2); }
.detail-package-list button { min-height: 54px; width: 100%; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-soft); text-align: left; transition: border-color var(--ease), background var(--ease); }
.detail-package-list span, .detail-package-list strong, .detail-package-list small { display: block; }
.detail-package-list small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.detail-package-list b { color: var(--accent); }
#codes-dialog p { color: var(--warning); font-size: 11px; }
#generated-codes { margin-bottom: 12px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.7; }
.toast-container { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 10px; }
.toast { width: min(350px, calc(100vw - 44px)); padding: 14px 16px; border: 1px solid #2f5d45; border-radius: 14px; color: #b8edcc; background: #163326; box-shadow: var(--shadow-lg); font-size: 12px; animation: slide-in .24s ease; }
.toast.error { border-color: #6a3540; color: #ffb3ba; background: var(--danger-soft); }
@keyframes slide-in { from { transform: translateY(10px); opacity: 0; } }

html[data-theme='light'] .site-header { border-bottom-color: rgb(204 218 230 / 84%); background: rgb(255 255 255 / 88%); box-shadow: 0 12px 36px rgb(35 70 100 / 8%); }
html[data-theme='light'] .brand-mark, html[data-theme='light'] .profile-avatar, html[data-theme='light'] .profile-large-avatar, html[data-theme='light'] .button.primary { color: #061b2c; }
html[data-theme='light'] .profile-trigger, html[data-theme='light'] .profile-dropdown, html[data-theme='light'] .sidebar, html[data-theme='light'] dialog { background: var(--surface); }
html[data-theme='light'] .panel { background: linear-gradient(145deg, #ffffff, #f8fbfd); }
html[data-theme='light'] .segmented { border-color: #bdd0df; background: #e8f0f7; box-shadow: inset 0 1px 2px rgb(35 70 100 / 8%); }
html[data-theme='light'] .segmented button { color: #50677b; }
html[data-theme='light'] .segmented button:not(.active):hover { color: #18364f; background: rgb(255 255 255 / 54%); }
html[data-theme='light'] .segmented button.active { color: #0b4f85; background: #ffffff; box-shadow: inset 0 0 0 1px #6aa7d8, 0 5px 14px rgb(22 119 200 / 16%); }
html[data-theme='light'] input, html[data-theme='light'] select, html[data-theme='light'] textarea { background: #f7fafc; }
html[data-theme='light'] input:focus, html[data-theme='light'] select:focus, html[data-theme='light'] textarea:focus { background: #ffffff; }
html[data-theme='light'] .trust-row span, html[data-theme='light'] .empty-state { background: rgb(255 255 255 / 72%); }
html[data-theme='light'] .button.primary { background: linear-gradient(135deg, #6db6f1, #3193dd); box-shadow: 0 10px 26px rgb(22 119 200 / 18%); }
html[data-theme='light'] .button.primary:hover { background: linear-gradient(135deg, #81c2f5, #43a0e4); }
html[data-theme='light'] .button.ghost { color: #304a60; }
html[data-theme='light'] .fine-print, html[data-theme='light'] .listing-footer small, html[data-theme='light'] .expiry, html[data-theme='light'] .data-table th { color: #607487; }
html[data-theme='light'] .data-table th { background: #f1f6fa; }
html[data-theme='light'] .data-table tbody tr:hover { background: rgb(22 119 200 / 4%); }
html[data-theme='light'] .listing-cover::after, html[data-theme='light'] .detail-cover::after { background: linear-gradient(transparent, var(--surface)); }
html[data-theme='light'] .detail-info { border-color: #9acfb8; color: #155b43; background: #e3f6ec; font-weight: 600; }
html[data-theme='light'] .item-detail-dialog .dialog-head { background: rgb(255 255 255 / 94%); }
html[data-theme='light'] dialog::backdrop { background: rgb(17 31 44 / 48%); }
html[data-theme='light'] .toast { color: #155b43; background: #e3f6ec; }
html[data-theme='light'] .toast.error { color: #8d2433; background: #fbe8eb; }

@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; gap: 48px; padding: 72px 0 96px; }
  .hero-copy { grid-column: 1; grid-row: 1; margin: auto; padding: 0; text-align: center; }
  .hero-copy > p { margin-inline: auto; }
  .trust-row { justify-content: center; }
  .guest-catalog { grid-column: 1; grid-row: 2; }
  .auth-card { grid-column: 1; grid-row: 3; max-width: 440px; justify-self: center; }
  .redeem-card { grid-template-columns: 1fr; }
  .card-grid, .game-grid, .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell { grid-template-columns: 82px 1fr; }
  .sidebar { width: 82px; padding-inline: 12px; }
  .sidebar .brand > span:last-child, .sidebar nav span, .sidebar > .button { display: none; }
  .sidebar .brand { padding-inline: 10px; }
  .sidebar nav button { justify-content: center; font-size: 17px; }
  .admin-main { grid-column: 2; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-card { overflow-x: auto; }
  .data-table { min-width: 680px; }
  .profile-email { display: none; }
  .profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .site-header { min-height: 68px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .system-state { display: none; }
  .guest-auth-actions .button { min-height: 44px; padding: 8px 11px; }
  .header-actions { gap: 8px; }
  .preference-button { width: 38px; height: 38px; }
  .customer-nav { order: 3; width: 100%; height: 46px; justify-content: space-around; border-top: 1px solid var(--line-soft); }
  .customer-nav button { flex: 1; padding-inline: 8px; }
  .profile-trigger { padding: 4px; }
  .profile-trigger > span:last-child { display: none; }
  .auth-layout, .dashboard { width: min(100% - 28px, 1180px); }
  .auth-layout { padding-top: 52px; }
  .hero-copy h1 { font-size: clamp(38px, 12vw, 50px); letter-spacing: -2.2px; }
  .hero-copy > p { font-size: 15px; }
  .auth-card { padding: 22px; }
  .dashboard { padding-top: 44px; }
  .dashboard-heading { align-items: center; }
  .redeem-card { padding: 21px; }
  .inline-form, .detail-actions { flex-direction: column; align-items: stretch; }
  .card-grid, .game-grid, .listing-grid, .stats-grid { grid-template-columns: 1fr; }
  .detail-cover { height: 195px; }
  .detail-summary { grid-template-columns: 1fr; }
  .detail-package-row { grid-template-columns: 1fr; }
  .detail-package-row > a { padding: 10px 14px; }
  .missing-link { margin: 0; text-align: center; }
  .admin-main { padding: 30px 14px 64px; }
  .section-toolbar { align-items: start; }
}

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