/* The phone screens. These follow the real Cress app (frontend-vite) rather
   than the website's brand ground: dark surfaces, Sora / DM Sans / JetBrains
   Mono, orange in Adventure mode and green in Care mode. Sizes are in cqw so
   every screen scales with its phone. */

.phone {
  width: var(--pw, 280px);
  aspect-ratio: 9 / 19.2;
  padding: calc(var(--pw, 280px) * 0.034);
  border-radius: calc(var(--pw, 280px) * 0.16);
  background: #1B1C1F;
  box-shadow:
    inset 0 0 0 1.5px #34363B,
    inset 0 1px 0 2px #44474D,
    0 2px 4px hsl(var(--sc-shadow-color) / 0.18),
    0 18px 36px -14px hsl(var(--sc-shadow-color) / 0.5),
    0 50px 80px -40px hsl(var(--sc-shadow-color) / 0.55);
}
.app {
  --bg: #0D0D0F; --surface: #141416; --card: #1A1A1E; --card-2: #212126;
  --border: #2C2C30; --text: #F5F5F7; --text-2: #A1A1AA; --text-3: #6E6E78;
  --acc: #F97316; --acc-l: #FB9A56; --acc-ink: #1B0F07; --glow: rgba(249,115,22,0.35);
  --care: #4ADE80; --gold: #E0B55C; --purple: #9C92E6; --sky: #5DA9C9;
  container-type: inline-size;
  position: relative; height: 100%; overflow: hidden;
  border-radius: calc(var(--pw, 280px) * 0.13);
  background: var(--bg); color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  display: flex; flex-direction: column;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}
.app.is-care { --acc: #4ADE80; --acc-l: #86EFAC; --acc-ink: #06200F; --glow: rgba(74,222,128,0.28); }
.app svg.lucide { width: 1em; height: 1em; }

.a-status { display: flex; justify-content: space-between; align-items: center; padding: 4.4cqw 7cqw 0; height: 11cqw; font-family: "JetBrains Mono", monospace; font-size: 3.9cqw; font-weight: 600; position: relative; z-index: 2; }
.a-status i { display: flex; gap: 1.4cqw; align-items: center; font-style: normal; font-size: 3.2cqw; }
.a-status b { display: block; width: 6.4cqw; height: 3.2cqw; border: 0.45cqw solid currentColor; border-radius: 1cqw; position: relative; opacity: 0.85; }
.a-status b::after { content: ""; position: absolute; inset: 0.5cqw 1.4cqw 0.5cqw 0.5cqw; background: currentColor; border-radius: 0.4cqw; }
.a-island { position: absolute; top: 2.6cqw; left: 50%; translate: -50% 0; width: 28cqw; height: 7.6cqw; border-radius: 99px; background: #000; z-index: 5; }

.a-body { flex: 1; min-height: 0; padding: 2cqw 5cqw 0; overflow: hidden; display: flex; flex-direction: column; gap: 3cqw; position: relative; z-index: 1; }
.a-glow::before { content: ""; position: absolute; inset: 0 0 45% 0; z-index: 0; pointer-events: none;
  background: radial-gradient(70% 60% at 50% 38%, color-mix(in srgb, var(--acc) 34%, transparent), transparent 70%), linear-gradient(to bottom, color-mix(in srgb, var(--acc) 10%, transparent), transparent); }
.a-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2cqw; }
.a-meta { font-family: "Sora", sans-serif; font-weight: 600; font-size: 2.9cqw; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin: 0; }
.a-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: 7.6cqw; letter-spacing: -0.03em; line-height: 1.05; margin: 1cqw 0 0; }
.a-gear { width: 9cqw; height: 9cqw; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); font-size: 4.2cqw; flex: none; }
.a-pills { display: flex; gap: 1.6cqw; align-items: center; }
.a-pill { display: inline-flex; align-items: center; gap: 1cqw; padding: 1.1cqw 2.4cqw; border-radius: 99px; border: 1px solid var(--border); background: var(--card-2); font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 3.2cqw; line-height: 1; white-space: nowrap; }
.a-pill--acc { color: var(--acc-l); background: color-mix(in srgb, var(--acc) 14%, transparent); border-color: color-mix(in srgb, var(--acc) 35%, transparent); }
.a-pill--gold { color: var(--gold); background: rgba(224,181,92,0.13); border-color: rgba(224,181,92,0.32); }
.a-pill.bump { animation: a-bump 560ms var(--sc-ease-out); }
@keyframes a-bump { 35% { transform: scale(1.18); } }

.a-card { background: var(--card); border: 1px solid var(--border); border-radius: 4.4cqw; padding: 3.6cqw 3.8cqw; }
.a-row { display: flex; justify-content: space-between; align-items: baseline; gap: 2cqw; }
.a-num { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 3.4cqw; color: var(--acc-l); font-variant-numeric: tabular-nums; white-space: nowrap; }
.a-num span { color: var(--text-3); }
.a-bar { height: 1.5cqw; border-radius: 99px; background: #2A2A2F; overflow: hidden; margin-top: 2cqw; }
.a-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--c, var(--acc)); transition: width 320ms var(--sc-ease-out); }
.a-card .a-meta + .a-bar { margin-top: 2cqw; }
.a-sub { font-size: 3.1cqw; color: var(--text-2); margin: 1.8cqw 0 0; }
.a-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 1.6cqw; width: 100%; padding: 3.8cqw; border-radius: 3.6cqw; background: var(--acc); color: var(--acc-ink); font-family: "Sora", sans-serif; font-weight: 700; font-size: 3.9cqw; box-shadow: 0 1.6cqw 6cqw var(--glow), inset 0 1px 0 rgba(255,255,255,0.25); text-align: center; }
.a-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; }
.a-mini .a-meta { display: flex; align-items: center; gap: 1.2cqw; font-size: 2.6cqw; }
.a-mini .a-meta svg { color: var(--acc-l); font-size: 3.2cqw; }
.a-mini strong { display: block; font-family: "Sora", sans-serif; font-size: 4.2cqw; font-weight: 700; letter-spacing: -0.02em; margin-top: 1.6cqw; }
.a-mini small { display: block; font-size: 2.9cqw; color: var(--text-2); margin-top: 0.6cqw; }

/* home */
.a-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.4cqw; padding-top: 1cqw; }
.a-hero .sprite { width: 40cqw; }
.a-hero h3 { font-family: "Sora", sans-serif; font-weight: 800; font-size: 7.4cqw; letter-spacing: -0.03em; margin: 2cqw 0 0; line-height: 1.05; }
.a-hero p { margin: 0; font-size: 3.4cqw; color: var(--text-2); }
.a-tagpill { display: inline-block; margin-top: 1.6cqw; padding: 1.2cqw 3cqw; border-radius: 99px; background: #111113; border: 1px solid var(--border); font-size: 3cqw; font-weight: 600; }

/* navigation */
.a-nav { display: flex; justify-content: space-around; padding: 2.6cqw 2cqw 5.4cqw; background: var(--bg); border-top: 1px solid #1F1F23; margin-top: auto; position: relative; z-index: 2; }
.a-nav span { display: flex; flex-direction: column; align-items: center; gap: 1cqw; font-family: "Sora", sans-serif; font-size: 2.3cqw; font-weight: 600; letter-spacing: 0.1em; color: var(--text-3); }
.a-nav span svg { font-size: 5.2cqw; }
.a-nav span.on { color: var(--acc); }

/* log (the peak screen) */
.quests { display: flex; flex-direction: column; gap: 2cqw; }
.quest {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; align-items: center; gap: 3cqw;
  padding: 2.8cqw 3.2cqw; border-radius: 4cqw;
  background: var(--card); border: 1px solid var(--border);
  transition: background-color 200ms var(--sc-ease-out), opacity 200ms var(--sc-ease-out);
}
.quest:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.quest__ic { width: 9.4cqw; height: 9.4cqw; border-radius: 3cqw; display: grid; place-items: center; font-size: 4.6cqw; flex: none; background: var(--qbg, #22301F); color: var(--qc, var(--care)); transition: background-color 200ms var(--sc-ease-out), color 200ms var(--sc-ease-out); }
.quest__t { flex: 1; line-height: 1.25; min-width: 0; }
.quest__t strong { display: block; font-size: 3.8cqw; font-weight: 600; font-family: "Sora", sans-serif; letter-spacing: -0.01em; }
.quest__t span { font-size: 3cqw; color: var(--text-3); }
.quest__r { text-align: right; line-height: 1.3; }
.quest__r b { display: block; font-family: "JetBrains Mono", monospace; font-size: 3.4cqw; color: var(--acc-l); font-weight: 600; }
.quest__r small { font-size: 2.8cqw; color: var(--acc-l); opacity: 0.8; }
.quest.is-done { background: #151517; }
.quest.is-done .quest__t strong, .quest.is-done .quest__r { opacity: 0.45; }
.quest.is-done .quest__ic { background: rgba(74,222,128,0.12); color: var(--care); }
.quest__ic .ic-done { display: none; }
.quest.is-done .quest__ic .ic-todo { display: none; }
.quest.is-done .quest__ic .ic-done { display: block; }

/* character */
.a-char { position: relative; border-radius: 5cqw; border: 1px solid var(--border); overflow: hidden; padding: 4cqw 0 3.6cqw; text-align: center;
  background: radial-gradient(60% 70% at 50% 40%, rgba(249,115,22,0.35), transparent 70%), #16110D; }
.a-char .sprite { width: 30cqw; margin: 0 auto; }
.a-char strong { display: block; font-family: "Sora", sans-serif; font-weight: 700; font-size: 5.2cqw; margin-top: 1.6cqw; }
.a-char span { font-family: "Sora", sans-serif; font-size: 2.7cqw; letter-spacing: 0.16em; color: var(--acc-l); font-weight: 600; }
.a-stat + .a-stat { margin-top: 2.6cqw; }
.a-stat .a-row { font-size: 3.2cqw; color: var(--text-2); }
.a-stat .a-row b { font-family: "JetBrains Mono", monospace; font-weight: 600; color: var(--c); }
.a-stat .a-bar { margin-top: 1.4cqw; }

/* passport */
.a-pass { border-radius: 4.4cqw; padding: 3.6cqw 4cqw; border: 1px solid rgba(224,181,92,0.45); background: linear-gradient(140deg, #2A1E10, #17130E 70%); position: relative; }
.a-pass .a-meta { color: var(--gold); font-size: 2.6cqw; }
.a-pass strong { display: block; font-family: "Sora", sans-serif; font-weight: 700; font-size: 5.2cqw; letter-spacing: -0.02em; margin-top: 0.8cqw; }
.a-pass .sprite { position: absolute; right: 3.4cqw; top: 3.4cqw; width: 11cqw; padding: 1cqw; border: 1px solid rgba(224,181,92,0.5); border-radius: 2.4cqw; background: #1E1710; }
.a-pass dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; margin: 3cqw 0 0; gap: 0 2cqw; }
.a-pass dt { font-family: "Sora", sans-serif; font-size: 2.2cqw; letter-spacing: 0.12em; color: #8C7B5E; text-transform: uppercase; }
.a-pass dd { margin: 0.6cqw 0 0; font-family: "JetBrains Mono", monospace; font-size: 2.9cqw; color: #E9DCC1; }
.stamps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; }
.stamp { aspect-ratio: 1 / 0.9; border-radius: 3cqw; border: 1px solid var(--sb, #2C2C30); background: var(--sbg, #141416); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4cqw; color: var(--sc, #3C3C42); }
.stamp svg { font-size: 5.4cqw; }
.stamp span { font-family: "Sora", sans-serif; font-size: 2.1cqw; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--st, #3C3C42); text-align: center; line-height: 1.2; }
.stamp--o { --sb: rgba(249,115,22,0.4); --sbg: #2A170B; --sc: #FB9A56; --st: #E8C6A8; }
.stamp--g { --sb: rgba(74,222,128,0.4); --sbg: #0F2217; --sc: #4ADE80; --st: #BDE9CC; }
.stamp--y { --sb: rgba(224,181,92,0.4); --sbg: #241C0F; --sc: #E0B55C; --st: #E8D8B4; }

/* stores */
.chips { display: flex; gap: 1.6cqw; }
.chip-a { all: unset; cursor: pointer; padding: 1.5cqw 3cqw; border-radius: 99px; border: 1px solid var(--border); background: var(--card-2); font-size: 3cqw; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.chip-a[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.chip-a:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--border); border-radius: 3cqw; padding: 0.8cqw; font-size: 3.1cqw; font-weight: 600; text-align: center; }
.seg span { padding: 1.6cqw; border-radius: 2.4cqw; color: var(--text-2); }
.seg span.on { background: var(--acc); color: var(--acc-ink); }
.map { position: relative; height: 38cqw; border-radius: 4cqw; border: 1px solid var(--border); background-color: #111113;
  background-image: linear-gradient(#1E1E22 1px, transparent 1px), linear-gradient(90deg, #1E1E22 1px, transparent 1px); background-size: 12cqw 12cqw; overflow: hidden; }
.map::before { content: ""; position: absolute; left: 10%; top: 95%; width: 70%; height: 1.4cqw; background: #2C2C31; transform-origin: 0 50%; rotate: -52deg; border-radius: 99px; }
.map::after { content: ""; position: absolute; left: 44%; top: 30%; width: 52%; height: 1.4cqw; background: #2C2C31; transform-origin: 0 50%; rotate: 16deg; border-radius: 99px; }
.pin { position: absolute; z-index: 1; width: 7.4cqw; height: 7.4cqw; border-radius: 50% 50% 50% 0; rotate: -45deg; display: grid; place-items: center; background: var(--pc); box-shadow: 0 1cqw 3cqw rgba(0,0,0,0.5); transition: opacity 200ms var(--sc-ease-out), scale 200ms var(--sc-ease-out); }
.pin svg { rotate: 45deg; font-size: 3.6cqw; color: #111; }
.pin.is-off { opacity: 0.18; scale: 0.8; }
.near { display: flex; flex-direction: column; gap: 2cqw; }
.near__c { border-radius: 4cqw; border: 1px solid var(--border); background: var(--card); padding: 3cqw 3.4cqw; }
.near__c[hidden] { display: none; }
.near__c .a-row { font-size: 2.8cqw; color: var(--text-3); }
.near__tag { display: inline-flex; align-items: center; gap: 1cqw; padding: 0.8cqw 2cqw; border-radius: 99px; font-size: 2.8cqw; font-weight: 600; color: var(--nt); background: color-mix(in srgb, var(--nt) 14%, transparent); }
.near__c strong { display: block; font-family: "Sora", sans-serif; font-size: 3.8cqw; font-weight: 700; margin-top: 1.8cqw; letter-spacing: -0.01em; }
.near__c p { margin: 0.8cqw 0 0; font-size: 3cqw; color: var(--text-2); line-height: 1.4; }
.near__empty { font-size: 3.2cqw; color: var(--text-3); text-align: center; padding: 4cqw 0; }

/* scan */
.scan { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5cqw; padding: 0 7cqw; text-align: center; position: relative; z-index: 1; }
.scan__frame { position: relative; width: 60cqw; aspect-ratio: 1; display: grid; place-items: center; border-radius: 4cqw; background: radial-gradient(closest-side, #1A1A1E, #0D0D0F); }
.scan__frame > i { position: absolute; width: 11cqw; height: 11cqw; border: 0 solid var(--acc); }
.scan__frame > i:nth-child(1) { top: 0; left: 0; border-top-width: 1cqw; border-left-width: 1cqw; border-top-left-radius: 4cqw; }
.scan__frame > i:nth-child(2) { top: 0; right: 0; border-top-width: 1cqw; border-right-width: 1cqw; border-top-right-radius: 4cqw; }
.scan__frame > i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1cqw; border-left-width: 1cqw; border-bottom-left-radius: 4cqw; }
.scan__frame > i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1cqw; border-right-width: 1cqw; border-bottom-right-radius: 4cqw; }
.scan__frame > svg { font-size: 26cqw; color: #3A3A40; }
.scan__line { position: absolute; left: 10%; right: 10%; top: 50%; height: 0.6cqw; background: var(--acc); border-radius: 99px; box-shadow: 0 0 4cqw var(--glow); animation: scanline 2.4s var(--sc-ease-in-out) infinite alternate; }
@keyframes scanline { from { transform: translateY(-24cqw); } to { transform: translateY(24cqw); } }
@media (prefers-reduced-motion: reduce) { .scan__line { animation: none; } }
.scan p { margin: 0; font-size: 3.4cqw; line-height: 1.45; color: var(--text-2); }
.scan p strong { display: block; color: var(--text); font-family: "Sora", sans-serif; font-size: 5cqw; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1cqw; }
.scan .a-btn { width: auto; padding: 3cqw 6cqw; }
.a-btn:focus-visible { outline: 2px solid var(--acc-l); outline-offset: 2px; }
.sheet { position: absolute; left: 3cqw; right: 3cqw; bottom: 3cqw; z-index: 4; background: #18181B; border: 1px solid var(--border); border-radius: 6cqw; padding: 5cqw; transform: translateY(120%); transition: transform 380ms var(--sc-ease-drawer); text-align: left; }
.sheet.is-open { transform: none; }
.sheet .stamp { width: 18cqw; margin-bottom: 3cqw; }
.sheet strong { display: block; font-family: "Sora", sans-serif; font-size: 5cqw; font-weight: 700; letter-spacing: -0.02em; }
.sheet p { margin: 1.2cqw 0 0; font-size: 3.2cqw; color: var(--text-2); line-height: 1.45; }
.sheet .a-pills { margin-top: 3cqw; flex-wrap: wrap; }

/* mode switch */
.mode { display: grid; grid-template-columns: 1fr 1fr; padding: 0.8cqw; border-radius: 99px; background: var(--card); border: 1px solid var(--border); }
.mode button { all: unset; cursor: pointer; text-align: center; padding: 1.8cqw; border-radius: 99px; font-family: "Sora", sans-serif; font-size: 3cqw; font-weight: 700; color: var(--text-2); transition: background-color 200ms var(--sc-ease-out), color 200ms var(--sc-ease-out); }
.mode button[aria-pressed="true"] { background: var(--acc); color: var(--acc-ink); }
.mode button:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.is-care [data-game] { display: none !important; }
[data-care-only] { display: none !important; }
.is-care [data-care-only] { display: revert !important; }

/* the pixel companion */
.sprite svg { display: block; width: 100%; height: auto; overflow: visible; }

.quest--bonus { cursor: default; border-color: rgba(224,181,92,0.35); background: #1C1911; --qbg: rgba(224,181,92,0.14); --qc: var(--gold); }
.a-bonus { font-style: normal; font-family: "Sora", sans-serif; font-size: 2.2cqw; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.4cqw 1.4cqw; border-radius: 99px; background: rgba(224,181,92,0.18); color: var(--gold); vertical-align: 0.3cqw; margin-left: 1cqw; }
.quest--locked { cursor: default; opacity: 0.45; --qbg: #1E1E22; --qc: var(--text-3); }
.a-near { display: flex; align-items: center; gap: 3cqw; }
.a-near__ic { width: 9cqw; height: 9cqw; border-radius: 3cqw; display: grid; place-items: center; background: rgba(249,115,22,0.14); color: var(--acc-l); font-size: 4.4cqw; flex: none; }
.a-near strong { display: block; font-family: "Sora", sans-serif; font-size: 3.6cqw; font-weight: 700; }
.a-near small { font-size: 2.9cqw; color: var(--text-2); }
