/* Forge313 Quests — Dragon Kingdom theme (Dec 4, 2026). Mobile-first, big tap targets. */
:root {
  --night: #140b33; --night2: #24124f; --violet: #3b1f7a; --line: #5a3fb0;
  --gold: #f5b301; --gold2: #ffe08a; --ink: #2a1a07; --parch: #fff4d6; --parch2: #f3dfae;
  --text: #f6f0ff; --muted: #c9bdf0; --green: #2fbf73; --red: #ff5470; --hero: #f5b301;
  --r: 18px; --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(120% 80% at 50% 0%, #3b1f7a 0%, #1c0f45 45%, #0b0620 100%) fixed; color: var(--text); }
body { padding: env(safe-area-inset-top, 0) 0 calc(24px + var(--safe-b)); overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, .fancy { font-family: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif; letter-spacing: .02em; }
.sky { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.sky i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff7d6; opacity: .7; animation: tw 3s infinite ease-in-out; }
.sky i:nth-child(1){left:8%;top:6%} .sky i:nth-child(2){left:22%;top:14%;animation-delay:.4s} .sky i:nth-child(3){left:40%;top:4%;animation-delay:1s}
.sky i:nth-child(4){left:63%;top:10%;animation-delay:1.6s} .sky i:nth-child(5){left:80%;top:5%;animation-delay:.8s} .sky i:nth-child(6){left:92%;top:18%;animation-delay:2s}
.sky i:nth-child(7){left:14%;top:30%;animation-delay:1.2s} .sky i:nth-child(8){left:52%;top:24%;animation-delay:2.4s} .sky i:nth-child(9){left:72%;top:34%;animation-delay:.2s}
.sky i:nth-child(10){left:30%;top:44%;animation-delay:1.8s} .sky i:nth-child(11){left:88%;top:48%;animation-delay:.6s} .sky i:nth-child(12){left:5%;top:58%;animation-delay:2.8s}
@keyframes tw { 50% { opacity: .15; transform: scale(.6); } }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: linear-gradient(#1c0f45ee, #1c0f4500); backdrop-filter: blur(4px); }
.top h1 { flex: 1; margin: 0; font-size: 1.25rem; color: var(--gold2); text-shadow: 0 2px 0 #00000066; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #ffffff18; color: var(--gold2); font-size: 2rem; line-height: 1; text-decoration: none; }
.purse { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: linear-gradient(#ffe08a, #f5b301); color: var(--ink); font-weight: 800; box-shadow: 0 3px 0 #a86400; }
.purse .fl { color: #b23a00; }
main { max-width: 760px; margin: 0 auto; padding: 4px 14px 16px; }
.hint { color: var(--muted); text-align: center; margin: 6px 0 14px; }
.hidden, [hidden] { display: none !important; }

/* gate */
.gate h2 { text-align: center; font-size: 1.6rem; margin: 14px 0 4px; color: var(--gold2); }
.heroes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 14px; }
.hero { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 0; border-radius: 22px; cursor: pointer; text-align: left; color: var(--text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--hero) 55%, #24124f), #24124f 75%); box-shadow: 0 6px 0 #0b0620, inset 0 0 0 2px color-mix(in srgb, var(--hero) 70%, white 10%); transition: transform .12s; }
.hero:active { transform: translateY(4px); box-shadow: 0 2px 0 #0b0620, inset 0 0 0 2px var(--hero); }
.crest { flex: none; display: grid; place-items: center; width: 72px; height: 82px; font-size: 2.3rem; background: var(--hero); clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); box-shadow: inset 0 -6px 0 #0003; }
.hero .who { display: block; font-size: .85rem; color: var(--gold2); text-transform: uppercase; letter-spacing: .12em; }
.hero .nm { display: block; font: 800 1.5rem/1.1 "Cinzel", Georgia, serif; }
.hero .meta { display: flex; gap: 10px; margin-top: 6px; font-size: .95rem; color: var(--muted); flex-wrap: wrap; }
.court-link { display: block; margin: 26px auto 0; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: #ffffff10; color: var(--gold2); font-weight: 700; cursor: pointer; }

/* kid home */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r); background: linear-gradient(160deg, color-mix(in srgb, var(--hero) 45%, #24124f), #24124f 80%); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--hero) 60%, transparent); }
.banner .crest { width: 60px; height: 70px; font-size: 2rem; }
.banner h2 { margin: 0; font-size: 1.35rem; }
.banner .sub { color: var(--muted); font-size: .95rem; }
.dragon { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 14px; border-radius: var(--r); background: #ffffff10; border: 1px solid #ffffff20; }
.dragon .egg { font-size: 2.6rem; animation: bob 2.4s infinite ease-in-out; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.dragon b { color: var(--gold2); }
.bar { height: 10px; border-radius: 99px; background: #0b062099; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #2fbf73, #ffe08a); border-radius: 99px; transition: width .6s; }
.choose { text-align: center; margin: 18px 0 8px; font-size: 1.2rem; color: var(--gold2); }
.map { position: relative; display: grid; gap: 14px; }
.place { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 0; border-radius: 20px; cursor: pointer; text-align: left; color: var(--ink);
  background: linear-gradient(var(--parch), var(--parch2)); box-shadow: 0 6px 0 #8a5a12, 0 10px 24px #0007; transition: transform .12s; }
.place:active { transform: translateY(4px); box-shadow: 0 2px 0 #8a5a12; }
.place .ic { flex: none; font-size: 2.6rem; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 16px; background: #fff8; }
.place h3 { margin: 0; font-size: 1.2rem; }
.place p { margin: 2px 0 0; color: #6b4a1a; font-size: .95rem; }
.place .badge { position: absolute; top: -8px; right: 10px; padding: 3px 10px; border-radius: 99px; font-weight: 800; font-size: .85rem; background: var(--red); color: white; box-shadow: 0 2px 0 #0005; }
.place .badge.ok { background: var(--green); }
.place.core { background: linear-gradient(#ffe9a8, #f7c948); box-shadow: 0 6px 0 #a86400, 0 10px 24px #0007; }
.path-dots { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.path-dots i { width: 16px; height: 16px; border-radius: 50%; background: #0002; border: 2px solid #8a5a12; }
.path-dots i.pending { background: #ffd24d; } .path-dots i.approved { background: var(--green); border-color: #0b4d2c; }

/* quest lists */
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 10px 2px; }
.panel-h h2 { margin: 0; color: var(--gold2); font-size: 1.35rem; }
.panel-h .small { color: var(--muted); font-size: .9rem; }
.quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.quest { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: linear-gradient(var(--parch), var(--parch2)); color: var(--ink); box-shadow: 0 4px 0 #8a5a12; }
.quest .qe { font-size: 2rem; width: 48px; text-align: center; flex: none; }
.quest .qt { flex: 1; min-width: 0; }
.quest .qt b { display: block; font-size: 1.08rem; }
.quest .qt small { color: #7a5a24; }
.coins { font-weight: 800; color: #9a5b00; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 16px; border: 0; border-radius: 14px; cursor: pointer; font-weight: 800; color: #fff;
  background: linear-gradient(#5ee39a, #1f9d5c); box-shadow: 0 4px 0 #0b5a33; transition: transform .1s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0b5a33; }
.btn.gold { background: linear-gradient(#ffe08a, #f5b301); color: var(--ink); box-shadow: 0 4px 0 #a86400; }
.btn.red { background: linear-gradient(#ff8095, #e0284a); box-shadow: 0 4px 0 #8a1028; }
.btn.ghost { background: #ffffff14; color: var(--gold2); box-shadow: inset 0 0 0 1px var(--line); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .45; filter: grayscale(.6); cursor: default; }
.state { font-weight: 800; font-size: .9rem; text-align: center; min-width: 92px; }
.state.pending { color: #8a5a00; } .state.approved { color: #11753f; } .state.rejected { color: #b0213b; }
.quest.approved { background: linear-gradient(#d9f7e4, #b6ebc9); box-shadow: 0 4px 0 #2a8a55; }
.quest.pending { background: linear-gradient(#fff2bd, #ffe08a); }
.bonus-box { margin: 14px 0; padding: 12px 14px; border-radius: 16px; border: 2px dashed var(--gold); color: var(--gold2); text-align: center; }
.shop .quest .qe { font-size: 2.2rem; }
.rare { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: linear-gradient(90deg, #b45cff, #ff5ec4); color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .05em; vertical-align: middle; }
.quest.rare-item { box-shadow: 0 4px 0 #6a2aa8, 0 0 0 2px #b45cff inset; }
.reqs { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.reqs li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #ffffff12; }
.empty { padding: 18px; text-align: center; color: var(--muted); border-radius: 16px; background: #ffffff0c; }
.trophies { display: grid; gap: 8px; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.log li { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: #ffffff0e; font-size: .95rem; }
.log .d { font-weight: 800; min-width: 52px; text-align: right; }
.log .d.pos { color: #7dffb0; } .log .d.neg { color: #ff9aac; } .log .d.zero { color: var(--muted); }
.log .w { flex: 1; } .log .t { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* parent court */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.tabs button { flex: none; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #ffffff10; color: var(--muted); font-weight: 700; cursor: pointer; }
.tabs button.on { background: linear-gradient(#ffe08a, #f5b301); color: var(--ink); border-color: transparent; }
.card { padding: 14px; border-radius: 16px; background: #ffffff10; border: 1px solid #ffffff1c; margin-bottom: 10px; }
.card h3 { margin: 0 0 8px; color: var(--gold2); font-size: 1.05rem; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #ffffff14; }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow small { display: block; color: var(--muted); }
.row .off { opacity: .5; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; justify-content: center; margin: 16px 0; }
.pin-pad button { height: 64px; border-radius: 16px; border: 0; background: #ffffff18; color: var(--text); font-size: 1.6rem; font-weight: 700; cursor: pointer; }
.pin-pad button:active { background: #ffffff30; }
.pin-dots { display: flex; justify-content: center; gap: 10px; min-height: 22px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gold2); }
.pin-dots i.f { background: var(--gold2); }
.whois { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }
.whois button { min-height: 48px; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--line); background: #ffffff10; color: var(--text); font-weight: 700; cursor: pointer; }
.whois button.on { background: linear-gradient(#ffe08a, #f5b301); color: var(--ink); }
.emo-pad { grid-template-columns: repeat(3, 76px); }
.emo-pad button { font-size: 2rem; }
.err { color: #ff9aac; text-align: center; min-height: 1.3em; }
label.f { display: block; margin: 10px 0 4px; color: var(--muted); font-size: .9rem; }
input.i, select.i, textarea.i { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: #0b0620; color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog { width: min(440px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 20px; padding: 18px; background: #1c0f45; color: var(--text); box-shadow: 0 20px 60px #000c; }
dialog::backdrop { background: #0b0620cc; }
dialog h3 { margin: 0 0 8px; color: var(--gold2); }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.chk { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.chk input { width: 22px; height: 22px; }

.toast { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; background: #0b0620f0; border: 1px solid var(--gold); color: var(--gold2); font-weight: 700; box-shadow: 0 10px 30px #000a; }
/* celebration */
.celebrate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #0b0620b0; overflow: hidden; }
.celebrate .msg { position: relative; z-index: 2; text-align: center; padding: 22px 26px; border-radius: 24px; background: linear-gradient(#ffe9a8, #f7c948); color: var(--ink); box-shadow: 0 8px 0 #a86400, 0 20px 60px #000c; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); max-width: 340px; }
.celebrate .msg .big { font-size: 4rem; display: block; animation: bob 1.2s infinite ease-in-out; }
.celebrate .msg h2 { margin: 6px 0; }
.celebrate .bit { position: absolute; top: -40px; font-size: 1.8rem; animation: fall linear forwards; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
@keyframes fall { to { transform: translateY(115vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .sky i, .dragon .egg, .celebrate .bit, .celebrate .msg .big { animation: none !important; } }
@media (min-width: 700px) { .map { grid-template-columns: 1fr 1fr; } .map .core { grid-column: 1 / -1; } }
.quest .btn.ghost { color: #6b4a1a; background: #00000010; box-shadow: inset 0 0 0 1px #8a5a12; }
