:root {
  --bg: #0b0f14;
  --ink: #f3efe6;
  --muted: rgba(243, 239, 230, 0.55);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-line: rgba(255, 255, 255, 0.12);
  --accent: #e9c46a;
  --good: #6ee7a8;
  --bad: #ff7b7b;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: Outfit, system-ui, -apple-system, sans-serif; overscroll-behavior: none; overflow: hidden; }
body {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(233, 196, 106, 0.10), transparent 60%),
    radial-gradient(80% 50% at 50% 110%, rgba(38, 120, 84, 0.18), transparent 60%),
    var(--bg);
}
#app {
  height: 100dvh; max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding-top: var(--sat);
}
.hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 2px;
}
.brand { font-family: Fraunces, Outfit, serif; font-style: italic; font-weight: 600; font-size: 22px; letter-spacing: 0.04em; color: var(--ink); }
.brand i { color: var(--accent); font-style: normal; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 26px; letter-spacing: 0.02em; color: var(--ink); text-shadow: 0 0 24px rgba(233,196,106,0.25); }
.timer.done { color: var(--good); }
.hud-right { display: flex; gap: 8px; align-items: center; }
button { font: inherit; color: var(--ink); cursor: pointer; border: 1px solid var(--glass-line); background: var(--glass); border-radius: 999px; padding: 10px 16px; font-weight: 700; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .12s ease, background .2s ease, opacity .2s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button:active { transform: scale(0.96); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: linear-gradient(180deg, #f2d27f, #d9ab3e); color: #2a1f05; border-color: rgba(255,255,255,0.35); box-shadow: 0 6px 22px rgba(233,196,106,0.28), inset 0 1px 0 rgba(255,255,255,0.5); }
button.ghost { background: transparent; }
button.pill { padding: 6px 12px; font-size: 13px; font-weight: 700; }
button.pill.free { color: var(--accent); }
button.icon { padding: 6px 9px; font-size: 15px; line-height: 1; }
.status { text-align: center; font-size: 13.5px; color: var(--muted); padding: 2px 16px 4px; min-height: 22px; font-weight: 500; letter-spacing: 0.01em; transition: color .3s; }
.status.good { color: var(--good); }
.status.bad { color: var(--bad); }
#stage { flex: 1; min-height: 0; position: relative; }
#c { width: 100%; height: 100%; display: block; touch-action: none; }
.bar { display: flex; gap: 8px; padding: 8px 12px calc(10px + var(--sab)); }
.bar button { flex: 1; padding: 13px 8px; font-size: 15px; }
.bar .primary { flex: 1.35; }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(6, 9, 13, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 20; opacity: 1; transition: opacity .3s; }
.overlay.hidden { opacity: 0; pointer-events: none; }
.card { width: min(420px, 100%); background: linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04)); border: 1px solid rgba(255,255,255,0.16); border-radius: 24px; padding: 26px 22px 20px; box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.18); text-align: center; transform: translateY(0); animation: rise .45s cubic-bezier(.2,.9,.2,1.1); }
.overlay.hidden .card { animation: none; }
@keyframes rise { from { transform: translateY(24px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.eyebrow { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.big { font-size: 56px; font-weight: 800; letter-spacing: -0.01em; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.words { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 12px; }
.words span { background: #f4eddc; color: #1b1a17; border-radius: 8px; padding: 5px 9px; font-weight: 800; letter-spacing: 0.12em; font-size: 14px; box-shadow: 0 2px 0 #cbbf9f, 0 6px 14px rgba(0,0,0,0.3); }
.meta { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; min-height: 18px; }
.actions { display: flex; gap: 10px; }
.actions button { flex: 1; padding: 13px; }

.toast { position: fixed; left: 50%; bottom: calc(88px + var(--sab)); transform: translateX(-50%) translateY(0); background: rgba(20, 24, 30, 0.92); border: 1px solid var(--glass-line); color: var(--ink); padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: 15px; z-index: 30; transition: opacity .25s, transform .25s; box-shadow: 0 12px 40px rgba(0,0,0,0.45); max-width: 90vw; text-align: center; }
.toast.hidden { opacity: 0; transform: translateX(-50%) translateY(8px); pointer-events: none; }
.toast b { color: var(--accent); letter-spacing: 0.12em; }
