/* GameGob Quests: GameGob's own palette and faces (gamegob.com index.html tokens, self-hosted fonts). */
@font-face { font-family: 'JetBrains Mono'; src: url(/fonts/jetbrains-mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(/fonts/jetbrains-mono-700.woff2) format('woff2'); font-weight: 600 800; font-display: swap; }
@font-face { font-family: 'Press Start 2P'; src: url(/fonts/press-start-2p-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #050510; --surface: #0c0c1e; --surface-hover: #141432; --border: #1a1a3a;
  --text: #c8c8d8; --text-dim: #8a8aa8;
  --accent: #88CC88; --accent-bright: #aaffaa; --accent-glow: rgba(136, 204, 136, 0.25);
  --forge: #CC88FF; --forge-glow: rgba(204, 136, 255, 0.25);
  --boss: #DD5599; --boss-glow: rgba(221, 85, 153, 0.4);
  --gold: #FFCC00; --gold-glow: rgba(255, 204, 0, 0.35);
  --ember: #FFAA22; --ember-glow: rgba(255, 170, 34, 0.4);
  --pixel: 'Press Start 2P', monospace; --mono: 'JetBrains Mono', 'Courier New', monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 15px; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(136, 204, 136, 0.10), transparent 60%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(204, 136, 255, 0.07), transparent 60%),
    var(--bg);
}
body::before { /* CRT scanlines, faint */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px); opacity: 0.35;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.logo { font-family: var(--pixel); color: var(--accent); letter-spacing: 4px; text-shadow: 0 0 40px var(--accent-glow), 0 3px 0 #336633; }
.tag { font-size: 10px; letter-spacing: 3px; color: var(--text-dim); margin-top: 8px; }

/* ---------- locked page ---------- */
.gate { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; text-align: center; gap: 4px; }
.gate .logo { font-size: clamp(26px, 9vw, 44px); }
.gate-door { width: 84px; height: 96px; border: 3px solid var(--border); border-bottom: none; border-radius: 42px 42px 0 0; display: grid; place-items: center; margin-bottom: 22px; background: linear-gradient(var(--surface), var(--bg)); box-shadow: 0 0 40px var(--forge-glow) inset; animation: breathe 3.2s ease-in-out infinite; }
.lock { font-size: 30px; filter: drop-shadow(0 0 12px var(--forge)); }
.gate-msg { max-width: 330px; line-height: 1.6; color: var(--text); margin: 22px 0 22px; font-size: 14px; }
.gate-msg b { color: var(--forge); }
.gate-back { margin-top: 18px; color: var(--text-dim); font-size: 12px; text-decoration: none; }
.gate-back:hover { color: var(--accent); }
@keyframes breathe { 50% { box-shadow: 0 0 70px var(--forge-glow) inset, 0 0 24px var(--forge-glow); } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); font-family: var(--pixel); font-size: 10px; letter-spacing: 1px; text-decoration: none; color: var(--text); transition: transform .12s, box-shadow .2s, border-color .2s; }
.btn:active { transform: translateY(2px); }
.btn-go { background: var(--accent); color: #0a1a0a; border-color: var(--accent-bright); box-shadow: 0 4px 0 #336633, 0 0 24px var(--accent-glow); }
.btn-go:active { box-shadow: 0 1px 0 #336633; }
.btn-boss { background: var(--boss); color: #1a0510; border-color: #ff88bb; box-shadow: 0 4px 0 #772244, 0 0 24px var(--boss-glow); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { border-color: var(--text-dim); }
.btn-danger { color: var(--boss); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 9px; }

/* ---------- HUD ---------- */
.app { max-width: 640px; margin: 0 auto; padding: 0 14px calc(110px + env(safe-area-inset-bottom)); }
.hud { position: sticky; top: 0; z-index: 20; padding: calc(12px + env(safe-area-inset-top)) 2px 12px; background: linear-gradient(var(--bg) 78%, transparent); }
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hud .logo { font-size: 18px; letter-spacing: 3px; }
.hud-icons { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; font-size: 16px; }
.player { margin-top: 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); }
.lv { width: 54px; height: 54px; border-radius: 12px; border: 2px solid var(--accent); display: grid; place-items: center; text-align: center; font-family: var(--pixel); color: var(--accent); box-shadow: 0 0 18px var(--accent-glow) inset; }
.lv small { display: block; font-size: 7px; color: var(--text-dim); margin-bottom: 4px; }
.lv b { font-size: 16px; font-weight: 400; }
.who { min-width: 0; }
.who .title { font-family: var(--pixel); font-size: 9px; color: var(--forge); letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xpbar { margin-top: 9px; height: 12px; border-radius: 6px; background: #07071a; border: 1px solid var(--border); overflow: hidden; position: relative; }
.xpfill { height: 100%; width: 0; background: linear-gradient(90deg, #4a8a4a, var(--accent), var(--accent-bright)); box-shadow: 0 0 12px var(--accent-glow); transition: width .9s cubic-bezier(.2, .9, .2, 1); position: relative; }
.xpfill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: shimmer 2.8s infinite; }
@keyframes shimmer { 60%, 100% { transform: translateX(100%); } }
.xptext { margin-top: 6px; font-size: 11px; color: var(--text-dim); }
.streak { text-align: center; font-family: var(--pixel); }
.streak .flame { font-size: 22px; display: block; filter: drop-shadow(0 0 8px var(--ember)); }
.streak .flame.cold { filter: grayscale(1) opacity(.45); }
.streak b { display: block; font-size: 11px; font-weight: 400; color: var(--ember); margin-top: 4px; }
.streak small { font-size: 6px; color: var(--text-dim); }

/* ---------- list ---------- */
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; font-family: var(--pixel); font-size: 9px; letter-spacing: 2px; color: var(--text-dim); }
.section-h button { background: none; border: none; color: var(--text-dim); font: inherit; padding: 6px 0; }
.quests { display: flex; flex-direction: column; gap: 10px; }
.quest { --c: var(--accent); --g: var(--accent-glow); position: relative; border: 2px solid var(--border); border-left: 5px solid var(--c); border-radius: 12px; background: var(--surface); transition: border-color .2s, box-shadow .3s, transform .2s; animation: drop-in .35s ease-out both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(8px); } }
.quest.open { box-shadow: 0 0 0 1px var(--c), 0 0 22px var(--g); }
.qhead { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 12px 12px 12px; align-items: start; cursor: pointer; }
.qtitle { font-weight: 700; line-height: 1.35; color: #e4e4f0; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 10px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-dim); background: #08081a; white-space: nowrap; }
.chip.src { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.chip.xp { color: var(--gold); border-color: rgba(255, 204, 0, .35); }
.pips { letter-spacing: 1px; color: var(--gold); }
.check { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--c); background: transparent; display: grid; place-items: center; font-family: var(--pixel); font-size: 12px; color: var(--c); box-shadow: 0 0 12px var(--g) inset; }
.check:active { transform: scale(.9); }

/* due-date heat: glows harder as the day nears */
.chip.due.near { color: #ccccff; border-color: #44446a; }
.chip.due.warm { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.chip.due.hot { color: #fff; background: #3a2208; border-color: var(--ember); box-shadow: 0 0 12px var(--ember-glow); animation: pulse 1.6s ease-in-out infinite; }
.chip.due.burn { color: #fff; background: #3a0818; border-color: var(--boss); box-shadow: 0 0 14px var(--boss-glow); animation: pulse 0.9s ease-in-out infinite; }
.quest.heat-hot { border-color: rgba(255, 170, 34, .55); }
.quest.heat-burn { border-color: rgba(221, 85, 153, .7); box-shadow: 0 0 22px var(--boss-glow); }
@keyframes pulse { 50% { filter: brightness(1.45); } }

/* bosses: blockers that hold up other work */
.quest.boss { --c: var(--boss); --g: var(--boss-glow); background: linear-gradient(135deg, #1a0716, var(--surface) 55%); border-color: rgba(221, 85, 153, .45); }
.boss-tag { font-family: var(--pixel); font-size: 8px; color: var(--boss); letter-spacing: 2px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.boss-tag::before { content: "💀"; font-size: 12px; animation: bob 1.8s ease-in-out infinite; }
.hpbar { height: 6px; border-radius: 3px; background: #2a0a1a; margin-top: 10px; overflow: hidden; border: 1px solid #44142c; }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff3377, var(--boss)); transition: width .5s; }
@keyframes bob { 50% { transform: translateY(-2px); } }

.qbody { display: none; padding: 0 12px 14px; border-top: 1px dashed var(--border); }
.quest.open .qbody { display: block; }
.steps { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 8px 0; line-height: 1.5; font-size: 14px; border-bottom: 1px solid rgba(26, 26, 58, .6); }
.steps li:last-child { border-bottom: none; }
.steps button { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--border); background: #07071a; font-size: 12px; color: var(--accent); padding: 0; }
.steps li.done span { color: var(--text-dim); text-decoration: line-through; text-decoration-color: rgba(136, 204, 136, .6); }
.steps li.done button { border-color: var(--accent); background: rgba(136, 204, 136, .15); }
.steps code, .notes code { font-family: var(--mono); font-size: 12.5px; background: #07071a; border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; color: var(--accent-bright); word-break: break-all; }
.notes { margin-top: 10px; font-size: 13px; color: var(--text-dim); line-height: 1.55; white-space: pre-wrap; }
.notes a, .steps a { color: var(--forge); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions .btn-go, .actions .btn-boss { flex: 1 1 100%; }
.snoozes { display: none; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.snoozes.show { display: flex; }
.meta { margin-top: 10px; font-size: 11px; color: var(--text-dim); }

.quest.done { opacity: .62; border-left-color: #333355; }
.quest.done .qtitle { text-decoration: line-through; text-decoration-color: var(--accent); }
.quest.snoozed { opacity: .72; }
.empty { text-align: center; padding: 34px 12px; border: 2px dashed var(--border); border-radius: 14px; color: var(--text-dim); line-height: 1.7; }
.empty b { font-family: var(--pixel); font-size: 10px; color: var(--accent); display: block; margin-bottom: 10px; }
.collapsed { display: none; }

/* ---------- loot ---------- */
.loot { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.badge { border: 2px solid var(--border); border-radius: 12px; padding: 10px 6px; text-align: center; background: var(--surface); }
.badge i { font-style: normal; font-size: 26px; display: block; filter: grayscale(1) opacity(.25); }
.badge b { display: block; font-family: var(--pixel); font-size: 7px; line-height: 1.5; margin-top: 8px; color: var(--text-dim); font-weight: 400; }
.badge small { display: block; font-size: 9.5px; color: #55557a; margin-top: 4px; line-height: 1.3; }
.badge.got { border-color: rgba(255, 204, 0, .5); box-shadow: 0 0 16px var(--gold-glow) inset; }
.badge.got i { filter: drop-shadow(0 0 8px var(--gold-glow)); }
.badge.got b { color: var(--gold); }

/* ---------- add / edit sheet ---------- */
.fab { position: fixed; right: max(16px, calc(50% - 304px)); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; width: 62px; height: 62px; border-radius: 18px; border: 2px solid var(--accent-bright); background: var(--accent); color: #0a1a0a; font-family: var(--pixel); font-size: 22px; box-shadow: 0 5px 0 #336633, 0 0 30px var(--accent-glow); }
.fab:active { transform: translateY(3px); box-shadow: 0 2px 0 #336633; }
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(2, 2, 8, .7); backdrop-filter: blur(3px); display: none; }
.sheet-bg.show { display: block; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 640px; margin: 0 auto; max-height: 92dvh; overflow: auto; background: var(--surface); border: 2px solid var(--border); border-bottom: none; border-radius: 18px 18px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .9, .2, 1); }
.sheet.show { transform: none; }
.sheet h2 { font-family: var(--pixel); font-size: 12px; color: var(--accent); margin: 0 0 16px; font-weight: 400; letter-spacing: 2px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 10px; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; }
.field input, .field textarea { width: 100%; background: #07071a; border: 2px solid var(--border); border-radius: 10px; padding: 11px 12px; font-size: 16px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seg button { min-height: 50px; border-radius: 10px; border: 2px solid var(--border); background: #07071a; font-size: 10px; line-height: 1.3; padding: 4px 0; }
.seg button b { display: block; font-family: var(--pixel); font-size: 10px; font-weight: 400; color: var(--gold); }
.seg button.on { border-color: var(--gold); box-shadow: 0 0 12px var(--gold-glow) inset; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 2px solid var(--border); border-radius: 10px; background: #07071a; cursor: pointer; }
.toggle.on { border-color: var(--boss); box-shadow: 0 0 16px var(--boss-glow) inset; }
.toggle span { font-size: 13px; line-height: 1.4; }
.toggle b { font-family: var(--pixel); font-size: 9px; color: var(--boss); font-weight: 400; }
.xp-preview { font-family: var(--pixel); font-size: 9px; color: var(--gold); text-align: center; margin: 4px 0 14px; }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn-go { flex: 1; }

/* ---------- celebrations ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 1px; background: var(--c, var(--accent)); box-shadow: 0 0 8px var(--c, var(--accent)); animation: spark .9s cubic-bezier(.1, .8, .3, 1) forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }
.float-xp { position: absolute; font-family: var(--pixel); font-size: 14px; color: var(--gold); text-shadow: 0 0 12px var(--gold-glow), 0 2px 0 #664400; animation: rise 1.3s ease-out forwards; white-space: nowrap; transform: translateX(-50%); }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -80px) scale(1); } }
.quest.slain { animation: slain .55s ease-in forwards; }
@keyframes slain { 0% { transform: scale(1); } 30% { transform: scale(1.03); box-shadow: 0 0 40px var(--g); border-color: var(--c); } 100% { transform: scale(.94) translateX(30px); opacity: 0; } }
.shake { animation: shake .5s; }
@keyframes shake { 20% { transform: translate(-6px, 2px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 3px); } 80% { transform: translate(3px, -1px); } }
.banner { position: fixed; left: 50%; top: 38%; z-index: 70; transform: translate(-50%, -50%); text-align: center; pointer-events: none; animation: banner 2.4s ease-out forwards; }
.banner b { display: block; font-family: var(--pixel); font-size: clamp(18px, 7vw, 30px); font-weight: 400; color: var(--c, var(--accent)); text-shadow: 0 0 30px var(--c, var(--accent)), 0 4px 0 #000; letter-spacing: 3px; white-space: nowrap; }
.banner small { display: block; margin-top: 12px; font-family: var(--pixel); font-size: 9px; color: var(--text); letter-spacing: 2px; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 70; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--gold); background: #141008; box-shadow: 0 0 30px var(--gold-glow); animation: toast 3.4s ease-out forwards; min-width: 240px; }
.toast i { font-style: normal; font-size: 28px; }
.toast small { display: block; font-family: var(--pixel); font-size: 7px; color: var(--gold); letter-spacing: 2px; }
.toast b { display: block; margin-top: 4px; font-size: 13px; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 30px); } 10% { opacity: 1; transform: translate(-50%, 0); } 85% { opacity: 1; } 100% { opacity: 0; } }
.err { position: fixed; left: 14px; right: 14px; top: 14px; z-index: 80; padding: 12px; border: 2px solid var(--boss); border-radius: 10px; background: #1a0716; font-size: 13px; }

@media (min-width: 700px) { .qhead { padding: 14px 16px; } .qbody { padding: 0 16px 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }
