/* The Stamina Bar: a dark slate backdrop, bright sage green as the brand colour, with warm oak and brushed steel.
   One look for everyone (it doesn't change with the phone's light or dark setting). */
:root {
  --concrete: #262b31;     /* the slate backdrop */
  --concrete-2: #2e343a;
  --panel: #343b42;
  --panel-edge: #4b545d;
  --steel: #aeb5ba;
  --steel-dark: #6f7a80;
  --ink: #eef1ee;
  --ink-soft: #a9b3ad;
  --wood: #a86e43;
  --wood-dark: #7d4f2c;
  --wood-light: #c98f5e;
  --amber: #8fc77f;        /* bright sage: the primary (named amber from the first palette) */
  --amber-hi: #b8e6a4;
  --accent-ink: #b8e6a4;
  --good: #8fd5a3;
  --bad: #ef7a66;
  --track: #4a525b;
  --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 6px 18px rgba(0,0,0,.35);
  --radius: 10px;
  --hud: 'Silkscreen', ui-monospace, monospace;
  --body: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font: 16px/1.45 var(--body); color: var(--ink);
  background-color: var(--concrete);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,.035) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,.05) 0 1px, transparent 1.5px),
    linear-gradient(180deg, transparent 0 calc(100% - 1px), rgba(0,0,0,.05) calc(100% - 1px));
  background-size: 7px 7px, 11px 11px, 100% 240px;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
.px-icon { display: block; image-rendering: pixelated; }
.icon { display: inline-flex; vertical-align: middle; }
button { font: inherit; color: inherit; cursor: pointer; }
input {
  font: inherit; color: var(--ink); width: 100%; padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--panel-edge); background: var(--concrete); margin: 4px 0 8px;
}
h1, h2, h3 { margin: 0 0 10px; line-height: 1.15; }
h3 { font-size: 17px; }
.muted { color: var(--ink-soft); font-weight: 400; }

/* Header: a strip of warm wood with a brushed-steel wordmark plate. */
.topbar {
  position: sticky; top: 0; z-index: 5; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: repeating-linear-gradient(90deg, var(--wood) 0 22px, var(--wood-dark) 22px 23px, var(--wood-light) 23px 46px, var(--wood-dark) 46px 47px);
  box-shadow: 0 2px 0 rgba(0,0,0,.15);
}
.wordmark {
  display: inline-block; font-family: var(--hud); font-size: 18px; letter-spacing: 1px; color: #252b31;
  padding: 6px 12px; border-radius: 6px;
  background: linear-gradient(180deg, #eef1f3, #b9c0c5 55%, #d9dee1);
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 rgba(0,0,0,.25);
}
.wm-the { font-size: 12px; color: #5d666b; }
.wm-bar { color: #4f8a45; }

main { max-width: 560px; margin: 0 auto; padding: 16px; }
.screen > * + * { margin-top: 14px; }
.card {
  background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--panel-edge);
}

/* Bars: a steel track with an amber fill; the big STAMINA bar is segmented like a game HUD. */
.bar { height: 10px; border-radius: 3px; background: var(--track); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.2) inset; }
.bar-fill { height: 100%; background: linear-gradient(180deg, var(--amber-hi), var(--amber)); transition: width .5s ease; }
.bar.thin { height: 6px; margin-top: 6px; }
.bar.stat .bar-fill { background: var(--c); }
.bar.quest { flex: 1; height: 8px; }
.bar.stamina {
  position: relative; height: 26px; border-radius: 4px; padding: 3px; background: #252b31;
  box-shadow: 0 0 0 2px #8d969b, 0 0 0 4px #252b31;
}
.bar.stamina .bar-fill {
  border-radius: 2px; box-shadow: 0 0 12px rgba(184,230,164,.6);
  background: linear-gradient(180deg, #d6f2c8 0 30%, var(--amber-hi) 30% 60%, var(--amber) 60%);
}
.bar.stamina::after {
  content: ''; position: absolute; inset: 3px; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--segments, 12) - 2px), #252b31 calc(100% / var(--segments, 12) - 2px) calc(100% / var(--segments, 12)));
}

/* Character */
.hero {
  display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(200,235,190,.18), rgba(0,0,0,.12)),
    repeating-linear-gradient(0deg, var(--wood) 0 9px, var(--wood-dark) 9px 10px, var(--wood-light) 10px 19px, var(--wood-dark) 19px 20px);
  color: #fff8ee; box-shadow: var(--shadow);
}
.hero-art {
  flex: none; padding: 8px 10px 0; border-radius: 8px;
  background: radial-gradient(ellipse at 50% 100%, rgba(190,230,170,.45), transparent 70%), rgba(0,0,0,.18);
}
.hero-text { flex: 1; min-width: 0; }
.hero-name { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.hero-class { font-size: 15px; opacity: .92; }
.level-badge {
  display: inline-flex; align-items: baseline; gap: 4px; margin-top: 8px; padding: 2px 10px; border-radius: 6px;
  font-family: var(--hud); background: linear-gradient(180deg, #eef1f3, #b9c0c5); color: #252b31;
  box-shadow: 0 2px 0 rgba(0,0,0,.3);
}
.level-badge span { font-size: 11px; } .level-badge b { font-size: 20px; }
.hero-next { font-size: 13px; margin-top: 6px; opacity: .9; }
.hero .bar.thin { background: rgba(0,0,0,.3); }

.stamina-bar-block { padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-edge); box-shadow: var(--shadow); }
.sb-label { display: flex; justify-content: space-between; font-family: var(--hud); font-size: 15px; margin-bottom: 10px; }
.sb-sub { font-size: 13px; color: var(--ink-soft); margin-top: 10px; text-align: right; }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--panel-edge); box-shadow: var(--shadow); text-align: center;
}
.stat-chip b { font-size: 20px; }
.week-dots { display: flex; gap: 4px; margin-top: 2px; }
.week-dots i { width: 8px; height: 8px; border-radius: 2px; background: var(--track); }
.week-dots i.on { background: var(--amber); } .stat-chip span:last-child { font-size: 12px; color: var(--ink-soft); }

.stats { display: grid; gap: 8px; }
.stat-row { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--panel-edge); border-left: 4px solid var(--c); }
.stat-main { flex: 1; }
.stat-top { display: flex; justify-content: space-between; margin-bottom: 5px; }
.stat-name { font-weight: 700; } .stat-lv { font-family: var(--hud); font-size: 13px; }
.stat-how { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 0; border-top: 1px solid var(--track); font-size: 14px; }
.log li:first-child { border-top: 0; }
.log-date { color: var(--ink-soft); font-size: 12px; text-align: right; }
.log-xp { grid-column: 1 / -1; font-family: var(--hud); font-size: 11px; color: var(--accent-ink); }

/* Quests */
.quest { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--track); }
.card h3 + .quest { border-top: 0; }
.quest-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: var(--concrete); border: 1px solid var(--panel-edge); }
.quest-main { flex: 1; min-width: 0; }
.quest-name { font-weight: 700; }
.quest-text { font-size: 14px; color: var(--ink-soft); }
.quest-progress { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.quest.done .quest-name { text-decoration: line-through; text-decoration-color: var(--good); }
.quest.done .bar-fill { background: var(--good); }
.quest.boss .quest-icon { background: #252b31; border-color: #8d969b; }
.quest.boss .quest-name { color: var(--bad); letter-spacing: .2px; }
.story-card { border-left: 4px solid var(--wood); }
.reward { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 99px; background: var(--concrete); font-size: 12px; font-weight: 700; border: 1px solid var(--panel-edge); }

/* Log */
.choices { display: grid; gap: 10px; }
.big-choice {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 10px; text-align: left;
  border: 1px solid var(--panel-edge); background: linear-gradient(180deg, var(--panel), var(--concrete-2));
  box-shadow: 0 2px 0 rgba(0,0,0,.08); min-height: 64px;
}
.big-choice b { display: block; font-size: 17px; } .big-choice small { color: var(--ink-soft); font-size: 13px; }
.big-choice:active { transform: translateY(1px); }
.form label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }
.pills, .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets { margin-top: 6px; }
.pill { padding: 9px 14px; border-radius: 99px; border: 1px solid var(--panel-edge); background: var(--concrete); min-height: 40px; }
.pill.small { padding: 5px 11px; min-height: 32px; font-size: 13px; }
.pill.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--panel-edge); background: var(--concrete); font-size: 24px; }
.stepper output { min-width: 110px; text-align: center; font-family: var(--hud); font-size: 18px; }
.zone-feel { font-size: 14px; margin: 8px 0 0; } .good { color: var(--good); font-weight: 700; }
.primary {
  display: block; width: 100%; margin-top: 18px; padding: 14px; border: 0; border-radius: 10px;
  font-weight: 700; font-size: 17px; color: #252b31;
  background: linear-gradient(180deg, var(--amber-hi), var(--amber)); box-shadow: 0 3px 0 #4f7f46;
}
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #4f7f46; }
.link { background: none; border: 0; padding: 4px 0; color: var(--ink-soft); text-decoration: underline; }
.footer-links { text-align: center; margin-top: 24px; }

/* Roll for Intelligence Check (the daily puzzle) */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 320px; margin: 12px auto; padding: 6px; border-radius: 10px; background: #252b31; }
.cell { aspect-ratio: 1; border: 0; border-radius: 6px; background: #f7f5f1; display: grid; place-items: center; }
.cell.alt { background: #e6e1d8; }
.cell.given { background: #c9ccce; box-shadow: 0 -2px 0 rgba(0,0,0,.18) inset; }
.cell.sel { box-shadow: 0 0 0 3px var(--amber) inset; }
.cell.bad { background: #f4c9c0; }
.cell:disabled { cursor: default; color: inherit; }
.palette { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sym { width: 56px; height: 56px; border-radius: 10px; border: 1px solid var(--panel-edge); background: var(--concrete); display: grid; place-items: center; }
.sym.clear, .sym.hint { width: auto; padding: 0 14px; font-size: 14px; }
.solved { text-align: center; font-weight: 700; color: var(--good); display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Bottom tabs: a brushed steel rail. */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #d9dee1, #aeb5ba); border-top: 1px solid #fff; box-shadow: 0 -2px 10px rgba(0,0,0,.12);
}
.tabs[hidden] { display: none; }
.tabs button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; border-radius: 8px;
  background: none; font-size: 12px; font-weight: 700; color: #3a3b3a;
}
.tabs button.on { background: #252b31; color: #b8e6a4; }

/* Celebration */
dialog { border: 0; border-radius: 14px; padding: 0; max-width: min(420px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(22,26,30,.6); }
.celebrate-inner { padding: 20px; text-align: center; }
.celebrate-inner canvas { margin: 4px auto 8px; display: block; animation: hop .6s ease-in-out 3; }
.celebrate-inner h2 { font-family: var(--hud); color: var(--accent-ink); font-size: 26px; }
@keyframes hop { 50% { transform: translateY(-8px); } }
.events { list-style: none; padding: 0; margin: 0; text-align: left; }
.events li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 15px; }
.ev-big { font-weight: 700; font-size: 17px !important; color: var(--accent-ink); }
.ev-quest, .ev-level { font-weight: 700; }
.ev-note { color: var(--ink-soft); font-size: 13px !important; }

/* Onboarding */
.welcome h1 { font-size: 28px; }
.welcome p { color: var(--ink-soft); margin: 0; }
.preview { display: grid; place-items: center; padding: 14px 0 4px; border-radius: 10px; margin-bottom: 10px;
  background: radial-gradient(ellipse at 50% 100%, rgba(184,230,164,.35), transparent 65%), var(--concrete); }
/* The look picker (app/look.js) */
.look { display: grid; gap: 10px; margin-bottom: 14px; }
.look-preview { display: flex; align-items: flex-end; justify-content: center; gap: 18px; margin-bottom: 0; }
.look-turn { display: flex; gap: 6px; align-items: flex-end; opacity: .9; }
.look-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.look-tab { padding: 8px 11px; border-radius: 999px; border: 1px solid var(--panel-edge); background: var(--concrete); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; }
.look-tab.on { background: var(--amber); border-color: transparent; color: #1d2a17; }
.look-tab.shuffle { margin-left: auto; }
.look-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; max-height: 330px; overflow-y: auto; padding: 2px; }
.look-tile { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 5px; border-radius: 10px; border: 2px solid transparent; background: var(--concrete); color: var(--ink); font: inherit; font-size: 12px; line-height: 1.2; }
.look-tile.on { border-color: var(--amber); background: var(--panel); }
.look-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.look-swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--panel-edge); }
.look-swatch.on { box-shadow: 0 0 0 3px var(--amber); }
.look-tile:focus-visible, .look-swatch:focus-visible, .look-tab:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.look-actions { display: flex; align-items: center; gap: 14px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Account */
.acct { display: grid; gap: 12px; }
.acct-tabs { display: flex; gap: 6px; }
.acct-tab { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--panel-edge); background: var(--concrete); color: var(--ink); font-weight: 700; }
.acct-tab.on { background: var(--amber); color: #1f2a1c; border-color: var(--amber); }
.acct-body { display: grid; gap: 10px; }
.acct-body h4 { margin: 8px 0 0; font-size: 15px; }
.acct-field { display: grid; gap: 4px; }
.acct-field label { font-weight: 700; font-size: 14px; }
.acct-field input { margin: 0; }
.acct-hint { font-size: 13px; color: var(--ink-soft); margin: 0; }
.acct-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-end { justify-content: flex-end; }
.acct-btn { padding: 10px 16px; border-radius: 8px; border: 0; font-weight: 700; color: #1f2a1c; background: linear-gradient(180deg, var(--amber-hi), var(--amber)); }
.acct-btn.ghost { background: none; border: 1px solid var(--panel-edge); color: var(--ink); }
.acct-link { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; padding: 4px; }
.acct-msg { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: var(--concrete); }
.acct-msg.error { border-left: 4px solid var(--bad); }
.acct-msg.good { border-left: 4px solid var(--good); }
.acct-msg.info { border-left: 4px solid var(--amber); }
.acct-who { margin: 0; }

/* ---------- Gear: rarity, the Locker, gym bags and the reveal (app/locker.js) ---------- */
.rarity { display: inline-block; font: 10px var(--hud); letter-spacing: .04em; color: var(--r); border: 1px solid var(--r); border-radius: 99px; padding: 1px 7px; }
.hero-title { font: 12px var(--hud); letter-spacing: .03em; margin: -2px 0 4px; }
.hero-art { padding: 4px; }
.quest-rewards { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip.gear-chip { color: #d6a0ff; border-color: #6a4f86; }
.chip.bag-chip { color: #ffd86a; border-color: #8a6f2a; }
.events li.ev-gear { color: var(--r); font-weight: 700; }
.events li.ev-bag { color: #ffd86a; font-weight: 700; }

.locker-head h3 { margin-bottom: 2px; }
.bags-card { border-color: #8a6f2a; background: linear-gradient(180deg, #3b3524, var(--panel)); }
.bag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.bag { display: grid; justify-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--panel-edge); background: var(--concrete); color: var(--ink); font: 600 13px var(--body); cursor: pointer; animation: bag-wiggle 2.4s ease-in-out infinite; }
.bag:nth-child(2n) { animation-delay: .4s; }
@keyframes bag-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-6deg); } 90% { transform: rotate(6deg); } 95% { transform: rotate(-3deg); } }
.bag-art { width: 54px; height: 40px; border-radius: 10px 10px 8px 8px; background: linear-gradient(180deg, #8fc77f, #4f8a45); position: relative; box-shadow: inset 0 -6px 0 rgba(0,0,0,.25); }
.bag-art::before { content: ""; position: absolute; left: 14px; right: 14px; top: -9px; height: 12px; border: 4px solid #2a2c2e; border-bottom: 0; border-radius: 10px 10px 0 0; }
.bag-art::after { content: ""; position: absolute; left: 8px; right: 8px; top: 12px; height: 3px; background: rgba(255,255,255,.6); border-radius: 2px; }
.bag-art[data-kind=sports] { background: linear-gradient(180deg, #6fb0e8, #2f5f9a); }
.bag-art[data-kind=pro] { background: linear-gradient(180deg, #d6a0ff, #5e3a8c); }
.bag-art[data-kind=champion] { background: linear-gradient(180deg, #ffd86a, #a87a1e); }
.bag-art[data-kind=home], .bag-art[data-kind=homepro] { background: linear-gradient(180deg, #f08ac0, #b84a86); }

.wearing { display: flex; gap: 14px; align-items: center; }
.wearing-pic { flex: none; display: grid; place-items: center; background: var(--concrete); border-radius: 10px; padding: 6px; }
.wearing-list { flex: 1; display: grid; gap: 2px; font-size: 13px; }
.wearing-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 6px; align-items: center; }
.slot-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 8px; }
.gear { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 8px 6px; border-radius: 10px; border: 2px solid var(--panel-edge); background: var(--concrete); color: var(--ink); font: inherit; font-size: 12px; text-align: center; cursor: pointer; }
.gear b { font-size: 12px; line-height: 1.2; }
.gear canvas { image-rendering: pixelated; }
.gear.worn { border-color: var(--r); box-shadow: 0 0 0 2px var(--r) inset; }
.gear.locked { opacity: .5; cursor: default; }
.gear-unknown { width: 48px; height: 72px; display: grid; place-items: center; font: 22px var(--hud); color: var(--ink-soft); }
.gear-flavor { font-size: 11px; color: var(--ink-soft); line-height: 1.25; }
.frame-swatch { width: 48px; height: 60px; border-radius: 8px; border: 5px solid var(--f1); box-shadow: 0 0 0 2px var(--f2); background: var(--panel); }
.odds summary { cursor: pointer; font-weight: 700; }
.odds-table { width: 100%; font-size: 12px; border-collapse: collapse; margin-top: 6px; }
.odds-table th, .odds-table td { padding: 3px 4px; text-align: center; border-bottom: 1px solid var(--track); }
.odds-table td:first-child { text-align: left; }

/* The reveal: about three seconds, louder the rarer; tap to skip. */
dialog.reveal-open { padding: 0; border: 0; background: transparent; max-width: min(420px, 94vw); overflow: visible; }
dialog.reveal-open::backdrop { background: rgba(10,12,14,.82); }
.reveal { position: relative; overflow: hidden; border-radius: 16px; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--r) 30%, transparent), transparent 70%), var(--panel); border: 2px solid var(--r); padding: 22px 18px 18px; text-align: center; min-height: 360px; }
.reveal-bag { display: grid; justify-items: center; gap: 8px; animation: bag-open 1.3s ease-in forwards; position: absolute; left: 0; right: 0; top: 70px; }
.reveal-bag .bag-art { width: 110px; height: 80px; }
.reveal-bagname { font: 13px var(--hud); color: var(--ink-soft); }
@keyframes bag-open { 0% { transform: scale(1); } 20% { transform: scale(1.05) rotate(-4deg); } 35% { transform: scale(1.05) rotate(4deg); } 50% { transform: scale(1.1) rotate(-6deg); } 70% { transform: scale(1.15) rotate(6deg); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.reveal-item { opacity: 0; animation: item-in .5s ease-out 1.25s forwards; position: relative; }
@keyframes item-in { from { opacity: 0; transform: translateY(20px) scale(.8); } to { opacity: 1; transform: none; } }
.reveal.skip .reveal-bag { display: none; }
.reveal.skip .reveal-item { animation-delay: 0s; animation-duration: .15s; }
.reveal-rays { position: absolute; left: 50%; top: 110px; width: 1px; height: 1px; pointer-events: none; }
.r-rare .reveal-rays, .r-epic .reveal-rays { box-shadow: 0 0 80px 50px color-mix(in srgb, var(--r) 45%, transparent); animation: rays 2s ease-in-out infinite; }
.r-legendary .reveal-rays, .r-mythic .reveal-rays { box-shadow: 0 0 120px 80px color-mix(in srgb, var(--r) 55%, transparent); animation: rays 2s ease-in-out infinite; }
@keyframes rays { 50% { transform: scale(1.25); } }
.r-mythic { animation: mythic-hue 3s linear infinite 1.25s; }
@keyframes mythic-hue { to { filter: hue-rotate(360deg); } }
.reveal-rarity { font: 16px var(--hud); color: var(--r); letter-spacing: .08em; margin-bottom: 8px; }
.r-legendary .reveal-rarity, .r-mythic .reveal-rarity { font-size: 20px; text-shadow: 0 0 12px var(--r); }
.reveal-pic { display: grid; place-items: center; min-height: 160px; }
.reveal-pic canvas { image-rendering: pixelated; }
.reveal-title { font: 20px var(--hud); color: var(--r); padding: 30px 0; }
.reveal-name { font-weight: 700; font-size: 20px; margin-top: 6px; }
.reveal-flavor { font-style: italic; color: var(--ink-soft); margin: 6px 0 10px; }
.reveal-dupe { color: #ffd86a; font-size: 14px; }
.reveal-actions { display: flex; gap: 10px; justify-content: center; }
.reveal-actions .primary { width: auto; padding: 10px 20px; }
.confetti { position: absolute; top: -10px; width: 6px; height: 10px; border-radius: 2px; opacity: 0; animation: confetti 1.8s ease-in forwards; }
@keyframes confetti { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(420px) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .reveal-bag { display: none; } .reveal-item { opacity: 1; animation: none; } .confetti, .bag { animation: none !important; } }

/* ---------- Workout from home (app/homeview.js) ---------- */
.home-card h3 { margin-bottom: 4px; }
.equip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.equip { padding: 10px 14px; border-radius: 99px; border: 1px solid var(--panel-edge); background: var(--concrete); color: var(--ink); font: inherit; font-size: 14px; min-height: 44px; }
.equip.on { background: var(--amber); color: #14200f; border-color: var(--amber); font-weight: 700; }
.home-plan { border-top: 1px solid var(--track); padding: 12px 0; }
.home-plan.suggested { border-left: 3px solid var(--amber); padding-left: 10px; }
.home-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.home-tier { font: 11px var(--hud); color: var(--amber-hi); }
.home-pick { font-size: 11px; font-weight: 700; color: #14200f; background: var(--amber); border-radius: 99px; padding: 1px 8px; }
.home-name { font-size: 17px; flex-basis: 100%; }
.home-reward { font-size: 13px; color: #ffd86a; margin: 4px 0 6px; }
.home-moves { margin: 6px 0 10px 18px; padding: 0; font-size: 14px; }
.home-moves li { margin: 4px 0; }
.home-moves .muted { font-size: 12px; }
.home-done { color: var(--good); font-weight: 700; }
.feel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: var(--ink); font-weight: 500; }
.home-care { background: #3a2f2c; border-left: 3px solid var(--bad); padding: 8px 10px; border-radius: 6px; font-size: 14px; }
.home-note { font-size: 13px; margin-top: 8px; }
.tabs { grid-template-columns: repeat(6, 1fr); }
.tabs button { font-size: 11px; white-space: nowrap; }
.wearing-row { grid-template-columns: 58px 1fr auto; }
.wearing-pic { padding: 4px; }
@media (max-width: 420px) { .wearing { align-items: flex-start; } .wearing-pic canvas { width: 108px !important; height: auto !important; } }
.hero-title { display: inline-block; background: rgba(20,24,28,.82); padding: 2px 8px; border-radius: 6px; }

/* Netlify's floating "Powered by Netlify" badge covers our buttons on phones. (It can also be turned off in the
   Netlify dashboard: Project configuration > General > Powered by Netlify badge.) */
#nl-badge-frame { display: none !important; }

/* ---------- The Gilded Tankard: Chef Jeff's fridge planner (2026-10-16) ---------- */
.tavern-card { background: linear-gradient(180deg, #3a2a1c, #2b2119); border-color: #8a6a3a; }
.tavern-card h2 { font-family: 'Silkscreen', monospace; color: #f2c14e; letter-spacing: 1px; margin: 0 0 6px; }
.tavern-card p { margin: 4px 0; font-style: italic; color: #f0e0c0; }
.pantry-mic { width: 100%; padding: 16px; margin: 8px 0; border-radius: 14px; border: 2px solid #8fc77f; background: linear-gradient(180deg, #b8e6a4, #8fc77f); color: #14200f; font: 700 17px 'Space Grotesk', system-ui, sans-serif; cursor: pointer; }
.pantry-mic.on { background: #e0584a; border-color: #ffb3a6; color: #fff; animation: pantry-pulse 1.2s ease-in-out infinite; }
@keyframes pantry-pulse { 50% { box-shadow: 0 0 0 6px rgba(224, 88, 74, .25); } }
.pantry-live { padding: 8px 10px; border-radius: 10px; background: #1e2226; font-style: italic; }
.pantry-err { color: #ffb3a6; }
.pantry-typerow { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.pantry-type { flex: 1; min-height: 44px; border-radius: 10px; border: 1px solid #4b545d; background: #1e2226; color: inherit; padding: 8px 10px; font: inherit; resize: vertical; }
.pantry-preview { margin-top: 10px; padding: 10px; border-radius: 12px; border: 1px dashed #8fc77f; }
.pantry-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pantry-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: #2e343a; border: 1px solid #4b545d; font-size: 14px; }
.pantry-chip.have { border-color: #5f9a52; }
.pantry-x { border: 0; background: none; color: #a9b3ad; font-size: 16px; cursor: pointer; padding: 0 2px; }
.pantry-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.recipes-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.meal-tabs { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.meal-tabs::-webkit-scrollbar { display: none; }
.meal-tabs .pill { flex: none; }
.meal-tabs .pill.on { border-color: #8fc77f; color: #b8e6a4; }
.recipe { border: 1px solid #4b545d; border-radius: 12px; padding: 10px 12px; margin-top: 10px; background: #262b31; }
.recipe.short { border-style: dashed; opacity: .92; }
.recipe-head { display: flex; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: none; color: inherit; text-align: left; padding: 0; cursor: pointer; font: inherit; }
.recipe-head > div { display: grid; gap: 2px; }
.recipe-head b { color: #f2c14e; }
.recipe-meta { font-size: 12px; color: #a9b3ad; white-space: nowrap; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.recipe-tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #2b3c2f; color: #d6f2c8; }
.recipe-uses { margin: 4px 0; font-size: 14px; }
.recipe-miss { color: #f6c75a; }
.recipe-coffee { margin: 6px 0 2px; padding: 6px 10px; border-radius: 10px; background: #33281e; color: #f0e0c0; font-size: 14px; }
.recipe-line { font-style: italic; color: #f0e0c0; }
.recipe-steps { margin: 6px 0 10px 18px; padding: 0; display: grid; gap: 4px; }
.recipe-note { margin-top: 12px; font-size: 12px; color: #a9b3ad; }
.meal-tabs .pill.on { background: #2b3c2f; border-color: #8fc77f; color: #d6f2c8; }
.recipe-head { flex-wrap: wrap; }
.recipe-head > div { flex: 1 1 180px; }

/* Chef Jeff's Pre-Ride Snack (2026-10-19) */
.riding-soon { margin-top: 8px; border-color: #8a6a3a; color: #f2c14e; }
.pip-says { margin: 6px 0 10px; font-style: italic; color: #f0e0c0; }
.recipe-timing { margin: 4px 0 0; font-size: 14px; color: #b8e6a4; }
.pip-pick { display: block; width: 100%; margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; text-align: left;
  background: #33281e; border: 1px solid #8a6a3a; color: #f0e0c0; font: inherit; cursor: pointer; }
.pip-pick b { color: #f2c14e; }
.pip-pick small { display: block; color: #cdb88f; margin-top: 2px; }
.recipes-top .meal-tabs { flex: 1 1 100%; min-width: 0; }
.recipe, .recipes-card { scroll-margin-top: calc(76px + env(safe-area-inset-top)); }

/* Your table (Zach, 2026-10-19): diets, leave-outs, allergies, dislikes. */
.table-card .table-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.table-group { display: grid; gap: 6px; margin: 10px 0; }
.table-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.table-chips .pill { min-height: 40px; }
.table-dislike { min-height: 44px; border-radius: 10px; padding: 0 10px; font: inherit; background: var(--card2, #262b31); color: inherit; border: 1px solid var(--line, #4b545d); max-width: 100%; }
.recipe-swap { margin: 4px 0; font-size: 14px; color: #cfe4ff; }
.table-chips .pill.on { background: #2b3c2f; border-color: #8fc77f; color: #d6f2c8; }

/* The Week's Menu and Chef Jeff's errand scroll (Zach, 2026-10-19). */
.recipe-headrow { display: flex; align-items: flex-start; gap: 8px; }
.recipe-headrow .recipe-head { flex: 1; min-width: 0; }
.recipe-star { flex: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid #4b545d; background: #262b31; color: #c9ced2; font-size: 22px; line-height: 1; }
.recipe-star.on { color: #f6c75a; border-color: #c99a2e; background: #3a3325; }
.recipe-star:disabled { opacity: .4; }
.menu-dishes { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.menu-dishes li { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.menu-dishes li .pantry-x { margin-left: auto; }
.shop-aisle { display: grid; gap: 4px; margin: 10px 0; }
.shop-item { display: flex; align-items: flex-start; gap: 10px; min-height: 40px; padding: 6px 4px; border-radius: 8px; }
.shop-item input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: #8fc77f; }
.shop-item.got > span { text-decoration: line-through; opacity: .6; }
.shop-for { font-size: 12px; }
.shop-extras { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 14px; }
.browse-more { display: block; margin: 10px 0 0; }
.shop-extras { justify-content: flex-start; width: auto; }
.shop-extras input, .shop-item input { flex: none; width: 22px !important; height: 22px; margin: 0; padding: 0; }
.menu-dishes li { align-items: baseline; }
