/* HANDY: the workshop at night.
   Materials are honest: graphite, brass, ember. Nothing pretends to be wood.
   Every value below has a reason. Nothing is arbitrary. */

:root {
  --void: #0a0b0d;
  --surface: #14161a;
  --surface-2: #1a1d22;
  --raised: #22262c;
  --hair: rgba(255, 255, 255, 0.075);
  --hair-strong: rgba(255, 255, 255, 0.14);
  --ink: #f2eee6;
  --ink-2: #a8a49c;
  --ink-3: #8a867e;   /* 4.5:1 on --void; do not darken */
  --brass: #c9962f;
  --brass-lit: #f0c463;
  --ember: #ff6b1a;
  --ember-lit: #ffab4d;
  --steel: #79828e;
  --danger: #e35c4a;

  --r: 14px;
  --r-sm: 10px;
  --pad: 20px;
  --tap: 48px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, .68, .2);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --void: #eae7e0;
  --surface: #f7f5f1;
  --surface-2: #fffdf9;
  --raised: #ffffff;
  --hair: rgba(20, 22, 26, 0.10);
  --hair-strong: rgba(20, 22, 26, 0.20);
  --ink: #171a1f;
  --ink-2: #5c6068;
  --ink-3: #606369;   /* 4.9:1 on light --void; do not lighten */
  --brass: #8a6410;
  --brass-lit: #a97c18;
  --ember: #d1490a;
  --ember-lit: #e8721f;
  --steel: #5c6570;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--void);
  color: var(--ink);
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
/* The bench: a machined grid and one warm glow, painted once on their own layer.
   As a background-attachment:fixed image this repainted on every scroll frame. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 107, 26, .07), transparent 60%),
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 100% 100%, 44px 44px, 44px 44px;
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(201, 150, 47, .10), transparent 60%),
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 100% 100%, 44px 44px, 44px 44px;
}

button, input, textarea, select { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass-lit); outline-offset: 3px; border-radius: 4px; }

.ico { width: 22px; height: 22px; flex: none; }

/* Numerals are the language of the game. Machined, tabular, never dancing. */
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  font-weight: 600;
}

/* ---------- shell ---------- */

.app {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(env(safe-area-inset-top) + 12px) var(--pad) 12px;
  background: color-mix(in srgb, var(--void) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}
.topbar__row { display: flex; align-items: center; gap: 12px; }
.rank { flex: 1; min-width: 0; }
.rank__level { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.rank__title {
  font-size: 19px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* The pilot light. It only burns while the streak is alive. */
.flame {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 9px; border-radius: 999px;
  border: 1px solid var(--hair); background: var(--surface);
  color: var(--ink-3);
}
.flame .ico { width: 18px; height: 18px; }
.flame .num { font-size: 14px; }
.flame.alive { color: var(--ember-lit); border-color: color-mix(in srgb, var(--ember) 35%, transparent); }
.flame.alive .ico { animation: flicker 2.6s var(--ease) infinite; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ember) 55%, transparent)); }
.flame.saved { color: var(--steel); }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  30% { transform: scale(1.06) rotate(-1.5deg); opacity: .92; }
  55% { transform: scale(.97) rotate(1deg); opacity: 1; }
  75% { transform: scale(1.03) rotate(-.5deg); opacity: .95; }
}

.themer { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--hair); color: var(--ink-3); }
.themer:hover { color: var(--ink); }

/* XP rail: brass filling a machined channel. */
.xpbar { margin-top: 14px; }
.xpbar__meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.xpbar__meta .num { font-size: 13px; color: var(--ink); }
.xpbar__meta span:last-child { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.xpbar__rail { height: 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hair); overflow: hidden; }
.xpbar__fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brass), var(--brass-lit));
  box-shadow: 0 0 12px color-mix(in srgb, var(--brass) 60%, transparent);
  transition: width 1.1s var(--ease);
}

/* ---------- views ---------- */

main { flex: 1; padding: 20px var(--pad) 32px; }
.view { display: none; animation: viewin .32s var(--ease); }
.view.on { display: block; }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 12px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--hair); }

/* The standing order. Stencilled on the wall of the workshop.
   It is the loudest type in the app because it is the whole point of the app. */
.order { margin: 4px 0 26px; }
.order__t {
  font-size: clamp(38px, 12.5vw, 60px); line-height: .92; font-weight: 800;
  letter-spacing: -.045em; text-transform: uppercase;
  /* The punchline is the second line, so the light falls on it, not off it. */
  background: linear-gradient(172deg, var(--ink-3) 8%, var(--ink) 62%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.order__t::after {
  content: ""; display: block; width: 46px; height: 2px; margin-top: 16px;
  background: var(--ember); box-shadow: 0 0 12px var(--ember);
}
.order__h { margin-top: 16px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); max-width: 34ch; }

#hero { min-height: 264px; }        /* reserve it: the hero arrives after JS */
.strip { min-height: 86px; }

/* The hero. The single largest thing on the screen, always. */
.hero {
  position: relative; border-radius: var(--r); padding: 26px 22px 22px;
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  border: 1px solid var(--hair);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.hero::before { /* corner tickmarks: machined, not decorative */
  content: ""; position: absolute; inset: 10px; pointer-events: none;
  background:
    linear-gradient(var(--hair-strong), var(--hair-strong)) 0 0 / 12px 1px no-repeat,
    linear-gradient(var(--hair-strong), var(--hair-strong)) 0 0 / 1px 12px no-repeat,
    linear-gradient(var(--hair-strong), var(--hair-strong)) 100% 100% / 12px 1px no-repeat,
    linear-gradient(var(--hair-strong), var(--hair-strong)) 100% 100% / 1px 12px no-repeat;
}
.hero.dread { border-color: color-mix(in srgb, var(--ember) 40%, transparent); }
.hero.dread::after {
  content: ""; position: absolute; inset: -40% -10% auto; height: 70%;
  background: radial-gradient(60% 100% at 50% 0, color-mix(in srgb, var(--ember) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.hero__tag {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--hair-strong); color: var(--ink-3);
}
.hero.dread .hero__tag { color: var(--ember-lit); border-color: color-mix(in srgb, var(--ember) 45%, transparent); background: color-mix(in srgb, var(--ember) 10%, transparent); }
.hero__title { font-size: clamp(26px, 7vw, 34px); line-height: 1.1; font-weight: 680; letter-spacing: -.025em; }
.hero__meta { display: flex; align-items: center; gap: 14px; margin-top: 16px; color: var(--ink-3); font-size: 13px; }
.hero__meta .dot { width: 3px; height: 3px; border-radius: 999px; background: currentColor; }
.hero__xp { color: var(--brass-lit); }
.hero__age { color: var(--ember-lit); }

.hero__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }

.btn {
  height: var(--tap); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  border: 1px solid var(--hair-strong); color: var(--ink);
  background: var(--raised);
  transition: transform .14s var(--ease), filter .18s var(--ease);
}
.btn:active { transform: scale(.975); }
.btn--primary {
  background: linear-gradient(180deg, var(--brass-lit), var(--brass));
  color: #17130a; border-color: transparent;
  box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--brass) 90%, transparent);
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { background: transparent; }
.btn--wide { grid-column: 1 / -1; }
.btn--sm { height: 40px; font-size: 14px; padding: 0 16px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

.timer { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Alternates: a bench of other jobs, scrolled by thumb. */
.strip { display: flex; gap: 10px; overflow-x: auto; margin: 18px -20px 0; padding: 2px 20px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.chip {
  scroll-snap-align: start; flex: none; min-width: 158px; max-width: 220px; text-align: left;
  border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 13px 14px;
  background: var(--surface); transition: border-color .2s var(--ease), transform .14s var(--ease);
}
.chip:active { transform: scale(.98); }
.chip:hover { border-color: var(--hair-strong); }
.chip.dread { border-color: color-mix(in srgb, var(--ember) 35%, transparent); }
.chip__t { font-size: 14px; font-weight: 560; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip__m { margin-top: 8px; font-size: 11px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.chip__m .xp { color: var(--brass); font-family: var(--mono); }

.quest {
  margin-top: 24px; border: 1px dashed var(--hair-strong); border-radius: var(--r-sm);
  padding: 16px 18px; background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.quest.done { border-style: solid; border-color: color-mix(in srgb, var(--brass) 50%, transparent); }
.quest__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.quest__text { font-size: 14px; font-weight: 550; }
.quest__count { font-family: var(--mono); font-size: 13px; color: var(--brass-lit); }
.quest__rail { height: 3px; margin-top: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.quest__fill { height: 100%; background: var(--brass); transition: width .8s var(--ease); }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty h3 { color: var(--ink); font-size: 20px; margin-bottom: 8px; font-weight: 600; letter-spacing: -.02em; }
.empty p { font-size: 14px; line-height: 1.6; max-width: 34ch; margin: 0 auto 22px; }

/* ---------- the jar ---------- */

.quickadd { display: flex; gap: 8px; margin-bottom: 22px; }
.quickadd input {
  flex: 1; height: var(--tap); padding: 0 16px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--hair); font-size: 16px;
}
.quickadd input::placeholder { color: var(--ink-3); }
.quickadd input:focus { border-color: var(--hair-strong); outline: none; }
.quickadd button { width: var(--tap); height: var(--tap); border-radius: var(--r-sm); background: var(--raised); border: 1px solid var(--hair-strong); display: grid; place-items: center; }

.joblist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 30px; }
.job {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: var(--r-sm); border: 1px solid var(--hair); background: var(--surface);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.job.dread { border-color: color-mix(in srgb, var(--ember) 32%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--ember) 7%, var(--surface)), var(--surface) 60%); }
.job.going { opacity: 0; transform: translateX(40px) scale(.96); }
.job__tick {
  width: 30px; height: 30px; flex: none; border-radius: 999px;
  border: 1.5px solid var(--hair-strong); display: grid; place-items: center; color: transparent;
  transition: all .2s var(--ease);
}
.job__tick:hover { border-color: var(--brass); color: var(--brass); }
.job__tick .ico { width: 15px; height: 15px; }
.job__body { flex: 1; min-width: 0; }
.job__t { font-size: 15px; font-weight: 520; line-height: 1.35; }
.job__m { margin-top: 4px; font-size: 11px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; text-transform: uppercase; letter-spacing: .08em; }
.job.dread .job__m .age { color: var(--ember-lit); }
.job__kill { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: var(--ink-3); border-radius: 999px; opacity: .5; }
.job__kill:hover { color: var(--danger); opacity: 1; }
.job__kill .ico { width: 14px; height: 14px; }

/* ---------- trophy room ---------- */

.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 16px 12px; }
.trophy {
  display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center;
  padding: 6px 2px; border-radius: var(--r-sm);
  /* Eighteen medallions do not need styling until they are actually on screen. */
  content-visibility: auto;
  contain-intrinsic-size: auto 140px;
}
.trophy .medal { width: 84px; height: 84px; transition: transform .35s var(--ease); }
.trophy:hover .medal { transform: translateY(-3px) scale(1.03); }
.trophy__n { font-size: 11px; font-weight: 560; line-height: 1.3; color: var(--ink-2); }
.trophy__p { font-size: 10px; color: var(--ink-3); font-family: var(--mono); }
.trophy.earned .trophy__n { color: var(--ink); }
.medal .shine { display: none; }

/* ---------- stats + record ---------- */

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 28px; }
.tile { padding: 16px 18px; border-radius: var(--r-sm); border: 1px solid var(--hair); background: var(--surface); }
.tile__v { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.tile__l { margin-top: 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.tile--brass .tile__v { color: var(--brass-lit); }
.tile--ember .tile__v { color: var(--ember-lit); }

.cal { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-bottom: 28px; }
.cal__col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.cal__d { aspect-ratio: 1; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--hair); }
.cal__d[data-l="1"] { background: color-mix(in srgb, var(--brass) 32%, var(--surface-2)); border-color: transparent; }
.cal__d[data-l="2"] { background: color-mix(in srgb, var(--brass) 62%, var(--surface-2)); border-color: transparent; }
.cal__d[data-l="3"] { background: var(--brass); border-color: transparent; box-shadow: 0 0 8px -1px color-mix(in srgb, var(--brass) 70%, transparent); }

.bars { display: flex; flex-direction: column; gap: 9px; margin-bottom: 28px; }
.bar { display: grid; grid-template-columns: 76px 1fr 30px; align-items: center; gap: 10px; }
.bar__l { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.bar__t { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar__f { height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--brass) 55%, transparent), var(--brass)); transition: width .8s var(--ease); }
.bar__n { font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-align: right; }

.feed { display: flex; flex-direction: column; gap: 10px; }
.entry {
  display: flex; gap: 14px; align-items: center; padding: 12px 14px;
  border-radius: var(--r-sm); border: 1px solid var(--hair); background: var(--surface);
  content-visibility: auto; contain-intrinsic-size: auto 78px;
}
.entry img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid var(--hair); }
.entry__ph { width: 54px; height: 54px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--hair); }
.entry__b { flex: 1; min-width: 0; }
.entry__t { font-size: 14px; font-weight: 540; }
.entry__m { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.entry__x { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--brass-lit); }

.tools { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 8px; }
.tools .btn { flex: 1; min-width: 130px; }

/* ---------- tab bar ---------- */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; max-width: 640px; margin: 0 auto;
  padding: 8px 6px calc(env(safe-area-inset-bottom) + 8px);
  /* Opaque on purpose. A full-width backdrop-filter layer here cost more in
     recompositing than the frosted look was worth; the top bar keeps the glass. */
  background: var(--void);
  border-top: 1px solid var(--hair);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 6px; color: var(--ink-3); border-radius: 10px; position: relative; }
.tab span { font-size: 10px; letter-spacing: .06em; }
.tab.on { color: var(--brass-lit); }
.tab.on::before { content: ""; position: absolute; top: 0; width: 18px; height: 2px; border-radius: 999px; background: var(--brass); box-shadow: 0 0 10px var(--brass); }

/* ---------- sheets ---------- */

.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .68); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.scrim.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-width: 640px; margin: 0 auto;
  background: var(--surface); border-top: 1px solid var(--hair-strong);
  border-radius: 22px 22px 0 0; padding: 10px var(--pad) calc(env(safe-area-inset-bottom) + 22px);
  transform: translateY(101%); transition: transform .42s var(--ease);
  max-height: 88dvh; overflow-y: auto;
}
.sheet.on { transform: none; }
.sheet__grab { width: 38px; height: 4px; border-radius: 999px; background: var(--hair-strong); margin: 4px auto 18px; }
.sheet h2 { font-size: 21px; font-weight: 660; letter-spacing: -.02em; margin-bottom: 4px; }
.sheet .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 20px; }
.sheet label { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 20px 0 10px; }
.sheet input[type="text"], .sheet textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--hair); font-size: 16px; resize: none;
}

.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pick {
  border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 12px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--surface-2); transition: all .18s var(--ease);
}
.pick .ico { width: 20px; height: 20px; color: var(--ink-3); }
.pick b { font-size: 13px; font-weight: 600; }
.pick i { font-size: 9px; font-style: normal; color: var(--ink-3); font-family: var(--mono); }
.pick[aria-pressed="true"] { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, var(--surface-2)); }
.pick[aria-pressed="true"] .ico, .pick[aria-pressed="true"] i { color: var(--brass-lit); }
.picker--cat { grid-template-columns: repeat(4, 1fr); }
.picker--cat .pick b { font-size: 10px; font-weight: 500; letter-spacing: .02em; }

.shotrow { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.shot { width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--hair-strong); }
.sheet .btn--wide { margin-top: 24px; width: 100%; }

/* ---------- the payout ---------- */

.reward {
  position: fixed; inset: 0; z-index: 90; display: none;
  place-items: center; text-align: center; padding: 32px;
  background: radial-gradient(circle at 50% 40%, #1c1206, var(--void) 62%);
}
:root[data-theme="light"] .reward { background: radial-gradient(circle at 50% 40%, #fff6e2, #e6e2da 62%); }
.reward.on { display: grid; }
.reward__inner { position: relative; z-index: 2; }

/* No rays. There is no light source in this room except the metal itself,
   so the only honest glow is the one the medallion is sitting in. */
.reward__rays {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 42%,
    color-mix(in srgb, var(--brass) 22%, transparent), transparent 46%);
  transform: scale(.7);
}
.reward.on .reward__rays {
  opacity: 1; transform: none;
  transition: opacity 1.2s var(--ease) .15s, transform 1.6s var(--ease) .15s;
}

.reward__xp {
  font-family: var(--mono); font-size: clamp(64px, 22vw, 108px); font-weight: 700;
  letter-spacing: -.04em; line-height: 1; color: var(--brass-lit);
  text-shadow: 0 0 60px color-mix(in srgb, var(--brass) 55%, transparent);
}
.reward__xp small { font-size: .28em; letter-spacing: .2em; display: block; margin-top: 10px; color: var(--ink-3); text-shadow: none; }
.reward__mults { display: flex; gap: 8px; justify-content: center; margin-top: 22px; min-height: 30px; }
.reward__mult {
  font-family: var(--mono); font-size: 12px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--hair-strong); color: var(--ink-2);
  opacity: 0; transform: translateY(8px);
  animation: pop .5s var(--ease) forwards;
}
.reward__mult.dread { color: var(--ember-lit); border-color: color-mix(in srgb, var(--ember) 45%, transparent); }
@keyframes pop { to { opacity: 1; transform: none; } }

.reward__job { margin-top: 26px; font-size: 15px; color: var(--ink-2); max-width: 28ch; margin-inline: auto; line-height: 1.5; }
.reward__skip { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 26px); left: 0; right: 0; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); z-index: 3; }

/* Badge unlock: the medallion arrives, then the light sweeps across it. */
.reward__medal { animation: arrive .9s var(--ease) both; }
@keyframes arrive {
  0% { opacity: 0; transform: scale(.3) rotate(-25deg); filter: blur(6px); }
  60% { opacity: 1; transform: scale(1.08) rotate(3deg); filter: blur(0); }
  100% { transform: scale(1) rotate(0); }
}
.reward .medal { width: min(56vw, 210px); height: auto; }
.reward .medal .shine { display: block; animation: sweep 1.5s var(--ease) .75s both; }
@keyframes sweep { from { transform: rotate(18deg) translateX(0); } to { transform: rotate(18deg) translateX(320px); } }

.reward__kicker { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--brass); margin-bottom: 20px; }
.reward__name { font-size: clamp(30px, 9vw, 44px); font-weight: 700; letter-spacing: -.03em; margin-top: 26px; }
.reward__tier { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); margin-top: 10px; }
.reward__flav { margin-top: 18px; font-size: 15px; color: var(--ink-2); font-style: italic; max-width: 26ch; margin-inline: auto; line-height: 1.5; }

.reward__level {
  font-size: clamp(38px, 12vw, 62px); font-weight: 780; letter-spacing: -.04em;
  line-height: 1.02; margin-top: 18px; text-transform: uppercase;
  background: linear-gradient(168deg, var(--brass-lit) 20%, var(--brass) 70%, var(--ink-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: arrive .9s var(--ease) both;
}
.reward__lvlnum { font-family: var(--mono); font-size: 13px; letter-spacing: .3em; color: var(--brass); text-transform: uppercase; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--raised); border: 1px solid var(--hair-strong); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 520;
  transition: all .3s var(--ease); box-shadow: 0 16px 40px -20px #000;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.skiplink { position: absolute; left: -9999px; }
.skiplink:focus { left: 12px; top: 12px; z-index: 100; background: var(--raised); padding: 10px 14px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reward .medal .shine { display: none; }
}

/* Freestyle: for the job he did before he thought to write it down. */
.freestyle {
  width: 100%; margin-top: 16px; padding: 14px; border-radius: var(--r-sm);
  border: 1px dashed var(--hair-strong); color: var(--ink-3);
  font-size: 13.5px; font-weight: 520; transition: color .2s var(--ease), border-color .2s var(--ease);
}
.freestyle:hover { color: var(--brass-lit); border-color: color-mix(in srgb, var(--brass) 45%, transparent); }
