:root {
  color-scheme: dark;
  --bg: #121018;
  --bg-2: #191622;
  --surface: #211d2c;
  --surface-2: #2a2436;
  --text: #fff7ec;
  --muted: #b9adbf;
  --coral: #ff6b5f;
  --cyan: #35d6d0;
  --lime: #c8f560;
  --yellow: #ffd166;
  --danger: #ff4d7d;
  --border: rgba(255, 255, 255, .1);
  --shadow: 0 22px 60px rgba(0, 0, 0, .32);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100%; margin: 0; background: radial-gradient(circle at 20% 0%, rgba(53, 214, 208, .13), transparent 32%), linear-gradient(180deg, #14111d 0%, #0f0d14 100%); color: var(--text); letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; padding: 14px 14px 92px; position: relative; overflow-x: hidden; }
.screen { display: grid; gap: 18px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 12px; background: linear-gradient(180deg, rgba(18, 16, 24, .97), rgba(18, 16, 24, .76)); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #121018; background: linear-gradient(135deg, var(--lime), var(--cyan)); box-shadow: var(--shadow); font-size: 13px; }
.language-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.04); }
.language-switch a { min-width: 25px; padding: 7px 4px; border-radius: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; }
.language-switch .is-active { background: var(--text); color: var(--bg); }
.hero { min-height: calc(100vh - 138px); display: grid; align-content: center; gap: 20px; padding: 16px 0 26px; }
.hero-copy h1, .page-head h1, .summary-screen h1 { margin: 0; font-size: clamp(38px, 12vw, 64px); line-height: .92; letter-spacing: 0; }
.hero-copy p, .page-head p { color: var(--muted); line-height: 1.55; }
.micro { margin: 0 0 8px; color: var(--cyan); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.hero-actions, .setup-actions, .dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { border: 0; border-radius: var(--radius); min-height: 46px; padding: 13px 16px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; color: var(--text); font-weight: 900; cursor: pointer; transition: transform .18s ease, filter .18s ease, opacity .18s ease; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.large { min-height: 54px; padding: 15px 19px; }
.primary { background: linear-gradient(135deg, var(--coral), #ff9a5f); color: #160f13; }
.secondary { background: rgba(53, 214, 208, .16); border: 1px solid rgba(53, 214, 208, .35); }
.ghost { background: rgba(255,255,255,.06); border: 1px solid var(--border); }
.warning { background: rgba(255, 209, 102, .18); border: 1px solid rgba(255, 209, 102, .45); }
.success { background: rgba(200, 245, 96, .17); border: 1px solid rgba(200, 245, 96, .45); }
.danger { background: rgba(255, 77, 125, .17); border: 1px solid rgba(255, 77, 125, .42); }
.hero-phone { max-width: 100%; min-width: 0; border-radius: 22px; padding: 18px; min-height: 360px; background: linear-gradient(160deg, #272233, #15121f); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; align-content: end; gap: 12px; overflow: hidden; position: relative; }
.hero-phone::before { content: ""; position: absolute; inset: 18px 18px auto; height: 120px; border-radius: 8px; background: linear-gradient(135deg, rgba(255,107,95,.7), rgba(53,214,208,.45)); opacity: .75; }
.timer-orb { position: relative; margin-top: 96px; width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-size: 30px; font-weight: 950; }
.mini-card, .rule-box, .notice-card, .summary-card, .scene-card, .goal-card, .prompt-card, .auth-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: rgba(255,255,255,.055); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.mini-card.hot { background: rgba(255,107,95,.18); }
.mini-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mini-actions span { padding: 12px; border-radius: 8px; text-align: center; font-weight: 900; background: rgba(255,255,255,.08); }
.section-band { padding: 8px 0 18px; }
.section-band h2 { margin: 0 0 12px; font-size: 28px; }
.steps, .card-grid, .stats-grid { display: grid; gap: 12px; }
.steps article, .game-card, .stats-grid article { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: rgba(255,255,255,.055); }
.steps b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--lime); color: #14111d; }
.steps h3, .game-card h3 { margin: 10px 0 6px; }
.steps p, .game-card p, .notice-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.game-card span, .game-card small, .prompt-card span, .scene-card span { color: var(--cyan); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.page-head { display: flex; justify-content: space-between; gap: 14px; align-items: end; }
.page-head h1 { font-size: clamp(34px, 11vw, 52px); }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.chip { flex: 0 0 auto; border: 1px solid var(--border); color: var(--muted); background: rgba(255,255,255,.04); padding: 10px 12px; border-radius: 999px; font-weight: 800; }
.chip.is-active { background: var(--cyan); color: #0f0d14; }
.setup-grid, .settings-list, .auth-card form { display: grid; gap: 12px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
input, select { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; background: #17131f; color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(53,214,208,.14); }
.check-row, .switch-row { grid-template-columns: auto 1fr; align-items: center; color: var(--text); }
.switch-row { grid-template-columns: 1fr auto; padding: 14px 0; border-bottom: 1px solid var(--border); }
.check-row input, .switch-row input { width: 22px; height: 22px; accent-color: var(--coral); }
.timer-bar { position: sticky; top: 58px; z-index: 8; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius); background: rgba(18,16,24,.88); border: 1px solid var(--border); backdrop-filter: blur(12px); }
.timer-bar div { text-align: center; display: grid; gap: 2px; }
.timer-bar span { color: var(--muted); font-size: 12px; font-weight: 800; }
.timer-bar strong { font-size: 44px; line-height: .95; color: var(--lime); }
.icon-btn { min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.06); color: var(--text); font-weight: 900; }
.play-panel { display: grid; gap: 12px; }
.scene-card { background: linear-gradient(150deg, rgba(255,107,95,.22), rgba(53,214,208,.1)); }
.scene-card h2, .goal-card h3, .prompt-card p { margin: 6px 0; }
.objective-list { display: grid; gap: 8px; margin-top: 12px; }
.objective-item { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.06); }
.objective-item.is-done { color: var(--lime); text-decoration: line-through; }
.prompt-card p { font-size: 22px; line-height: 1.2; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-grid .danger { grid-column: 1 / -1; }
.summary-screen { min-height: 70vh; display: grid; align-content: center; gap: 14px; position: relative; }
.summary-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-card dl div { padding: 10px; border-radius: 8px; background: rgba(255,255,255,.06); }
.summary-card dt { color: var(--muted); font-size: 12px; }
.summary-card dd { margin: 3px 0 0; font-size: 22px; font-weight: 950; }
.toast-stack { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); width: min(92vw, 480px); display: grid; gap: 8px; z-index: 50; pointer-events: none; }
.toast { padding: 13px 14px; border-radius: 8px; background: #fff7ec; color: #121018; box-shadow: var(--shadow); font-weight: 850; animation: toast-in .24s ease; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; background: rgba(0,0,0,.58); padding: 18px; }
.dialog-card { width: min(100%, 480px); border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: var(--surface); box-shadow: var(--shadow); }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 520px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(18,16,24,.94); border-top: 1px solid var(--border); backdrop-filter: blur(16px); z-index: 30; }
.bottom-nav a { display: grid; place-items: center; gap: 2px; padding: 7px 3px; border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 900; }
.bottom-nav span { font-size: 18px; }
.bottom-nav .is-active { color: var(--text); background: rgba(255,255,255,.08); }
.form-message { padding: 10px; border-radius: 8px; background: rgba(255,77,125,.14); color: var(--text); }
.notice-card.big { display: grid; gap: 12px; }
.stats-grid { grid-template-columns: repeat(2, 1fr); }
.stats-grid b { display: block; font-size: 30px; color: var(--lime); }
.is-hidden { display: none !important; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 760px) {
  .app-shell { padding-left: 0; padding-right: 0; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr .82fr; min-height: 720px; align-items: center; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 430px) {
  .brand span:last-child { display: none; }
  .language-switch a { min-width: 29px; }
  .bottom-nav a { font-size: 10px; }
  .hero-copy h1 { font-size: clamp(36px, 11vw, 48px); }
}
