/* RESPAWN Кейсы — фирменный стиль клуба: тёмный фон, жёлтый акцент, Russo One + Rubik */
:root {
  --bg: #0c0c0e;
  --black: #0a0a0b;
  --surface: #141417;
  --surface-2: #1b1b1f;
  --line: #26262b;
  --white: #f4f4f5;
  --gray: #9a9aa2;
  --gray-dim: #6b6b73;
  --yellow: #ffe000;
  --yellow-deep: #f5c400;
  --green: #2fd97a;
  --red: #f85149;

  /* Редкость призов */
  --r-common: #8a8f9c;
  --r-uncommon: #4b9cff;
  --r-rare: #a66bff;
  --r-epic: #ff4fa3;
  --r-legendary: var(--yellow);

  --radius: 14px;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --display: 'Russo One', 'Rubik', sans-serif;
  --body: 'Rubik', -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
  --tabbar-h: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--black);
  color: var(--white);
  font: 400 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Сетка «HUD» + зерно на фоне */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 224, 0, .09), transparent 60%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 32px 100%,
    var(--bg);
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

.app {
  max-width: 480px; min-height: 100%; margin: 0 auto;
  display: flex; flex-direction: column;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

/* ---------- Верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--gutter);
  background: linear-gradient(var(--black) 60%, transparent);
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--yellow); color: var(--black);
  padding: 6px 14px 6px 6px; border-radius: 999px;
  box-shadow: 0 0 24px rgba(255, 224, 0, .25);
}
.logo-mark {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--black); color: var(--yellow);
  font: 11px/1 var(--display); letter-spacing: -.5px;
}
.logo-word { font: 15px/1 var(--display); letter-spacing: .5px; }
.balance { text-align: right; line-height: 1.1; }
.balance strong { display: block; font: 20px/1 var(--display); color: var(--yellow); }
.balance strong::after { content: ' Б'; font-size: 12px; color: var(--gray); }

.eyebrow {
  font: 500 10px/1.2 var(--mono); letter-spacing: 1.6px; text-transform: uppercase; color: var(--gray);
}
.eyebrow.dot::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; vertical-align: 1px;
  border-radius: 50%; background: var(--yellow); box-shadow: 0 0 8px var(--yellow);
}

.screen { flex: 1; padding: 8px var(--gutter) 24px; outline: none; }
.screen > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.screen > *:nth-child(2) { animation-delay: .06s; }
.screen > *:nth-child(3) { animation-delay: .12s; }
.screen > *:nth-child(4) { animation-delay: .18s; }
.screen > *:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .3px; }
h1 { font-size: 30px; line-height: 1.05; }
h2 { font-size: 19px; margin-bottom: 12px; }
.muted { color: var(--gray); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { margin: 0; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 12px;
  font: 500 16px/1 var(--body);
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--yellow); color: var(--black); box-shadow: 0 6px 24px rgba(255, 224, 0, .25); }
.btn-primary:hover { background: #fff04d; }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Вход ---------- */
.login { display: flex; flex-direction: column; gap: 22px; padding-top: 6vh; }
.login h1 span { color: var(--yellow); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field input {
  height: 54px; padding: 0 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--white);
  font: 500 17px var(--body); letter-spacing: .3px;
}
.field input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 224, 0, .15); }
.hint {
  display: flex; gap: 10px; padding: 14px; border-radius: 12px;
  background: var(--surface); border: 1px dashed var(--line); color: var(--gray); font-size: 13px;
}
.hint b { color: var(--white); font-weight: 500; }

/* ---------- Прогресс за сегодня ---------- */
.today {
  position: relative; overflow: hidden;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.today-time { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 4px; }
.today-time strong { font: 40px/1 var(--display); }
.today-time span { color: var(--gray); }
.track { position: relative; height: 10px; margin: 26px 0 30px; border-radius: 99px; background: var(--surface-2); }
.track-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: inherit;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, var(--yellow-deep) 8px 16px);
  box-shadow: 0 0 16px rgba(255, 224, 0, .45);
  animation: fill 1.2s cubic-bezier(.2, .8, .2, 1) both .2s;
}
@keyframes fill { from { width: 0 !important; } }
.mark { position: absolute; top: -6px; transform: translateX(-50%); text-align: center; }
.mark::before { content: ''; display: block; width: 2px; height: 22px; margin: 0 auto; background: var(--line); }
.mark span { display: block; margin-top: 4px; font: 500 11px var(--mono); color: var(--gray-dim); white-space: nowrap; }
.mark.done::before { background: var(--yellow); }
.mark.done span { color: var(--yellow); }
.today-note { font-size: 13px; color: var(--gray); }
/* Сейчас за ПК: пульсирующая точка и подсветка карточки */
.today.is-playing { border-color: rgba(47, 217, 122, .35); background: linear-gradient(140deg, rgba(47, 217, 122, .07), var(--surface) 55%); }
.today.is-playing .eyebrow.dot::before { display: none; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: 0; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(47, 217, 122, .6); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(47, 217, 122, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 217, 122, 0); } }
.today.is-playing .today-time strong { font-variant-numeric: tabular-nums; }
.today.is-done .today-time strong { font-size: 30px; color: var(--green); }
.today-note b { color: var(--white); font-weight: 500; }

/* ---------- Ящики-кейсы ---------- */
.crate {
  --c: var(--gray);
  position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255,255,255,.07), transparent 40%),
    var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line));
  display: grid; place-items: center;
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--c) 18%, transparent);
}
.crate::before, .crate::after { /* жёлтые «опасные» полосы сверху и снизу */
  content: ''; position: absolute; left: 0; right: 0; height: 12%;
  background: repeating-linear-gradient(-45deg, var(--c) 0 10px, transparent 10px 20px);
  opacity: .55;
}
.crate::before { top: 0; } .crate::after { bottom: 0; }
.crate-label { position: relative; z-index: 1; text-align: center; }
.crate-label strong { display: block; font: clamp(30px, 11vw, 52px)/1 var(--display); color: var(--c); text-shadow: 0 0 24px color-mix(in srgb, var(--c) 50%, transparent); }
.crate-label span { font: 500 10px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray); }
.crate.t3 { --c: #c9ced8; }
.crate.t5 { --c: var(--yellow); }
.crate.t8 { --c: #ff8a1f; }
.crate.morning { --c: #6fd3ff; }

/* Готовый к открытию кейс — главная карточка */
.ready {
  display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center;
  padding: 14px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(255, 224, 0, .14), var(--surface) 55%);
  border: 1px solid rgba(255, 224, 0, .45);
}
.ready .crate { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-1.5deg); } }
.ready h2 { margin: 4px 0 4px; }
.ready p { color: var(--gray); font-size: 13px; margin-bottom: 12px; }
.ready .btn { min-height: 44px; width: 100%; }

.empty {
  padding: 18px; border-radius: var(--radius); border: 1px dashed var(--line);
  color: var(--gray); font-size: 14px; text-align: center;
}

.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.level { padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: left; transition: border-color .2s, transform .2s; }
.level:hover { border-color: var(--gray-dim); transform: translateY(-2px); }
.level .crate { margin-bottom: 10px; }
.level h3 { font: 15px var(--display); font-weight: 400; }
.level p { font-size: 12px; color: var(--gray); }

/* ---------- Список призов (превью кейса) ---------- */
.prize-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prize {
  --r: var(--r-common);
  position: relative; padding: 12px 6px 10px; border-radius: 10px; text-align: center;
  background: linear-gradient(to top, color-mix(in srgb, var(--r) 22%, transparent), transparent 70%), var(--surface);
  border-bottom: 3px solid var(--r);
}
.prize svg { width: 34px; height: 34px; margin: 0 auto 6px; display: block; color: var(--r); }
.prize b { display: block; font: 13px/1.15 var(--display); font-weight: 400; }
.prize small { font: 500 9px var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--gray); }
.r-common { --r: var(--r-common); } .r-uncommon { --r: var(--r-uncommon); } .r-rare { --r: var(--r-rare); }
.r-epic { --r: var(--r-epic); } .r-legendary { --r: var(--r-legendary); }

/* ---------- Рулетка ---------- */
.open-head { text-align: center; margin: 4px 0 18px; }
.open-head .crate { width: 132px; margin: 0 auto 14px; }
.roulette {
  position: relative; margin: 0 calc(-1 * var(--gutter)); padding: 18px 0;
  background: var(--black); border-block: 1px solid var(--line); overflow: hidden;
}
.roulette::before, .roulette::after { /* затемнение краёв */
  content: ''; position: absolute; top: 0; bottom: 0; width: 22%; z-index: 2; pointer-events: none;
}
.roulette::before { left: 0; background: linear-gradient(90deg, var(--black), transparent); }
.roulette::after { right: 0; background: linear-gradient(-90deg, var(--black), transparent); }
.strip { display: flex; gap: 8px; will-change: transform; }
.strip .prize { flex: 0 0 104px; }
.pointer { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%); z-index: 3; background: var(--yellow); box-shadow: 0 0 14px var(--yellow); }
.pointer::before, .pointer::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); border: 8px solid transparent; }
.pointer::before { top: 0; border-top-color: var(--yellow); }
.pointer::after { bottom: 0; border-bottom-color: var(--yellow); }
.open-actions { margin-top: 22px; display: grid; gap: 10px; }

/* Результат */
.result {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--gutter);
  background: rgba(5, 5, 6, .82); backdrop-filter: blur(6px);
  animation: fadein .3s both;
}
@keyframes fadein { from { opacity: 0; } }
.result-card {
  --r: var(--r-common);
  position: relative; width: min(100%, 380px); padding: 28px 22px 22px; border-radius: 20px; text-align: center;
  background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--r) 35%, transparent), transparent 70%), var(--surface);
  border: 1px solid color-mix(in srgb, var(--r) 60%, var(--line));
  box-shadow: 0 0 80px color-mix(in srgb, var(--r) 35%, transparent);
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.result-card svg { width: 84px; height: 84px; color: var(--r); filter: drop-shadow(0 0 18px var(--r)); margin-bottom: 10px; }
.result-card h2 { font-size: 28px; margin: 6px 0; }
.result-card .rarity { color: var(--r); }
.result-card p { color: var(--gray); font-size: 14px; margin: 8px 0 18px; }
.code {
  display: block; margin: 4px 0 16px; padding: 12px; border-radius: 10px;
  background: var(--black); border: 1px dashed var(--yellow);
  font: 500 22px var(--mono); letter-spacing: 3px; color: var(--yellow);
}

/* ---------- История ---------- */
.list { display: grid; gap: 8px; }
.row {
  --r: var(--r-common);
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--r);
}
.row svg { width: 34px; height: 34px; color: var(--r); }
.row b { display: block; font: 15px var(--display); font-weight: 400; }
.row small { color: var(--gray); font-size: 12px; }
.row .code-sm { font: 500 12px var(--mono); color: var(--yellow); letter-spacing: 1px; }
.chip { padding: 5px 9px; border-radius: 99px; font: 500 10px var(--mono); letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
.chip.ok { background: rgba(47, 217, 122, .12); color: var(--green); }
.chip.wait { background: rgba(255, 224, 0, .12); color: var(--yellow); }
.chip.done { background: var(--surface-2); color: var(--gray); }
.day-label { margin: 18px 0 8px; }

/* ---------- Профиль ---------- */
.profile-card {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.avatar {
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  background: var(--yellow); color: var(--black); font: 26px var(--display);
}
.profile-card h1 { font-size: 24px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.stat strong { display: block; font: 22px var(--display); }
.settings { display: grid; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; background: var(--surface); }
.setting + .setting { border-top: 1px solid var(--line); }
.setting small { display: block; color: var(--gray); font-size: 12px; }
.switch { position: relative; flex: 0 0 46px; height: 28px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--gray); transition: transform .2s, background .2s; }
.switch[aria-checked="true"] { background: rgba(255, 224, 0, .2); border-color: var(--yellow); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--yellow); }
.rules { padding-left: 18px; color: var(--gray); font-size: 14px; display: grid; gap: 6px; }
.rules b { color: var(--white); font-weight: 500; }

/* ---------- Игра дня ---------- */
.game-hero {
  position: relative; overflow: hidden; padding: 20px; border-radius: 18px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 224, 0, .06) 0 14px, transparent 14px 28px),
    linear-gradient(140deg, rgba(255, 224, 0, .16), var(--surface) 60%);
  border: 1px solid rgba(255, 224, 0, .4);
}
.game-hero h1 { margin: 10px 0 6px; font-size: 34px; }
.game-hero p { color: var(--gray); font-size: 14px; }
.game-hero .btn { margin-top: 18px; }
.game-art { position: absolute; right: 18px; top: 22px; display: flex; flex-direction: column-reverse; align-items: center; gap: 3px; opacity: .9; }
.game-art i { display: block; height: 12px; border-radius: 2px; background: var(--yellow); box-shadow: inset 0 3px rgba(255,255,255,.3); }
.today-score { display: flex; gap: 16px; margin-top: 14px; }
.today-score div { flex: 1; }
.today-score strong { display: block; font: 24px var(--display); }
.levels-line { display: flex; gap: 6px; margin-top: 10px; }
.levels-line span { flex: 1; padding: 6px 0; text-align: center; border-radius: 8px; background: var(--surface-2); font: 500 10px var(--mono); color: var(--gray-dim); }
.levels-line span.done { background: rgba(255, 224, 0, .14); color: var(--yellow); }

.wallet { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.wallet-total { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 14px; }
.wallet-total strong { font: 40px/1 var(--display); color: var(--yellow); }
.batch { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.batch b { font: 16px var(--display); font-weight: 400; }
.burn { font: 500 11px var(--mono); color: var(--gray); }
.burn.soon { color: #ff8a1f; }
.wallet .hint { margin-top: 14px; }

.schedule { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sched { padding: 12px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.sched.today { border-color: var(--yellow); background: rgba(255, 224, 0, .08); }
.sched b { display: block; font: 15px var(--display); font-weight: 400; margin-top: 4px; }
.demo { margin-top: 8px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); font: 500 10px var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--gray); }
.demo:hover { border-color: var(--yellow); color: var(--yellow); }

/* Полноэкранная игра */
.play {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 100% 26px,
    radial-gradient(100% 50% at 50% 0%, rgba(255, 224, 0, .08), transparent),
    var(--black);
  animation: fadein .25s both;
}
.play-hud { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gutter) 6px; max-width: 480px; width: 100%; margin: 0 auto; }
.play-score { font: 46px/1 var(--display); color: var(--yellow); text-shadow: 0 0 24px rgba(255, 224, 0, .45); }
.play-close { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; }
.play canvas { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; display: block; touch-action: none; cursor: pointer; }
.play-tip { text-align: center; padding: 10px 0 calc(16px + env(safe-area-inset-bottom)); }

/* ---------- Нижнее меню ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: 0; z-index: 20; transform: translateX(-50%);
  width: min(100%, 480px); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(10, 10, 11, .92); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; color: var(--gray-dim); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--yellow); }
.tabbar a.active svg { filter: drop-shadow(0 0 6px rgba(255, 224, 0, .6)); }

/* ---------- Уведомление ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 16px; border-radius: 12px; max-width: calc(100% - 32px);
  background: var(--white); color: var(--black); font-weight: 500; font-size: 14px;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   ПЛАНШЕТ (≥ 600px): та же раскладка, что на телефоне, но шире
   ===================================================================== */
@media (min-width: 600px) {
  .app { max-width: 640px; }
  .tabbar { width: min(100%, 640px); }
  .levels { grid-template-columns: repeat(4, 1fr); }
  .prize-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =====================================================================
   КОМПЬЮТЕР (≥ 960px): меню в шапке, экраны в две колонки
   ===================================================================== */
@media (min-width: 960px) {
  :root { --gutter: 32px; }
  .app { max-width: 1180px; padding-bottom: 40px; }

  /* Шапка: логотип — меню — баланс */
  .topbar { padding: 18px var(--gutter); gap: 24px; background: linear-gradient(var(--black) 70%, transparent); }
  .logo { padding: 7px 18px 7px 7px; }
  .logo-mark { width: 30px; height: 30px; font-size: 12px; }
  .logo-word { font-size: 17px; }
  .tabbar {
    position: static; transform: none; width: auto; height: auto; padding: 5px;
    display: flex; gap: 4px; margin-right: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: none;
  }
  .tabbar a { flex-direction: row; gap: 8px; padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--gray); transition: color .15s, background .15s; }
  .tabbar a:hover { color: var(--white); background: var(--surface-2); }
  .tabbar a.active { color: var(--black); background: var(--yellow); }
  .tabbar a.active svg { filter: none; }
  .tabbar svg { width: 18px; height: 18px; }
  .balance { display: flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
  .balance strong { font-size: 22px; }

  .screen { padding: 16px var(--gutter) 40px; }
  h1 { font-size: 36px; }
  h2 { font-size: 21px; }
  .toast { bottom: 28px; }

  /* Общие правила для экранов-сеток: отступы задаёт сетка, а не .section */
  .screen[data-view] > * { min-width: 0; }
  .screen[data-view="home"], .screen[data-view="game"], .screen[data-view="profile"] { display: grid; gap: 24px; align-items: start; }
  .screen[data-view="home"] > .section, .screen[data-view="game"] > .section, .screen[data-view="profile"] > .section { margin-top: 0; }

  /* Вход: слева приветствие, справа форма */
  .screen[data-view="login"] > .login {
    display: grid; grid-template-columns: 1.15fr .85fr; grid-template-areas: "hero form" "hero hint";
    gap: 20px 64px; align-items: center; padding-top: 10vh;
  }
  .screen[data-view="login"] > .login > div:first-child { grid-area: hero; }
  .screen[data-view="login"] > .login > div:first-child h1 { font-size: 56px; }
  .screen[data-view="login"] > .login > div:first-child p { font-size: 18px; max-width: 460px; }
  .screen[data-view="login"] #login-form { grid-area: form; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
  .screen[data-view="login"] .hint { grid-area: hint; }

  /* Главная: готовый кейс | сегодня в клубе; ниже — все виды кейсов в ряд */
  .screen[data-view="home"] { grid-template-columns: 1.1fr 1fr; }
  .screen[data-view="home"] > :nth-child(3) { grid-column: 1 / -1; }
  .screen[data-view="home"] > :first-child { display: grid; gap: 16px; align-content: start; align-self: stretch; }
  .screen[data-view="home"] > :first-child:has(> .empty:only-child) { align-content: stretch; }
  .screen[data-view="home"] > :first-child > .empty:only-child { display: grid; place-items: center; }
  .ready { grid-template-columns: 160px 1fr; gap: 24px; padding: 20px; }
  .ready h2 { font-size: 26px; }
  .ready p { font-size: 14px; }
  .ready .btn { width: auto; min-width: 200px; }
  .empty { padding: 32px; font-size: 15px; }
  .today { padding: 24px; }
  .levels { gap: 16px; }
  .level { padding: 14px; }
  .level h3 { font-size: 17px; margin-top: 4px; }
  .level p { font-size: 13px; }

  /* Кейс и открытие: по центру, рулетка шире */
  .screen[data-view="case"], .screen[data-view="open"] { width: 100%; max-width: 980px; margin: 0 auto; } /* width — иначе экран сжимается по содержимому */
  .open-head .crate { width: 168px; }
  .prize-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .roulette { margin: 0; border: 1px solid var(--line); border-radius: 18px; padding: 24px 0; }
  .strip .prize { flex-basis: 132px; }
  .strip .prize svg { width: 44px; height: 44px; }
  .open-actions { grid-template-columns: 1fr 1fr; max-width: 560px; margin-left: auto; margin-right: auto; }
  .screen[data-view="case"] > .section:last-child { max-width: 320px; margin-left: auto; margin-right: auto; }

  /* Игра: слева игра дня (на две строки), справа копилка и расписание */
  .screen[data-view="game"] { grid-template-columns: 1.2fr 1fr; }
  .screen[data-view="game"] > .game-hero { grid-row: span 2; padding: 32px; min-height: 100%; }
  .game-hero h1 { font-size: 48px; }
  .game-hero p { font-size: 16px; }
  .game-art { right: 32px; top: 32px; transform: scale(1.4); transform-origin: top right; }
  .game-hero .btn { max-width: 320px; }

  /* Полноэкранная игра на компьютере: поле по центру, подсказка про клавиатуру */
  .play canvas { max-width: 520px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .play-hud { max-width: 520px; }

  /* История: аккуратная колонка по центру */
  .screen[data-view="history"] { width: 100%; max-width: 820px; margin: 0 auto; }
  .row { grid-template-columns: 52px 1fr auto; padding: 14px 18px; }
  .row b { font-size: 16px; }

  /* Профиль: две колонки */
  .screen[data-view="profile"] { grid-template-columns: 1fr 1fr; }
  .screen[data-view="profile"] > .stats { margin-top: 0; align-self: stretch; }
  .screen[data-view="profile"] > .stats .stat { display: flex; flex-direction: column; justify-content: center; }
  .screen[data-view="profile"] > .section:last-child { grid-column: 1 / -1; max-width: 320px; }
  .profile-card { padding: 24px; }

  /* Окно выигрыша — крупнее */
  .result-card { width: min(100%, 440px); padding: 36px 28px 28px; }

  /* Наведение мышью */
  .btn-ghost:hover { border-color: var(--gray-dim); }
  .ready:hover .crate { animation-duration: 1.4s; }
}

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