/* ============================================================
   TAMA-DNA — base layout & components (mobile-first)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  background: #07070c;
  font-family: 'Zen Maru Gothic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #fff;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }

/* ---------- phone frame (desktop only) ---------- */
#device {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 80% at 50% -10%, #191927 0%, #07070c 60%),
    #07070c;
}
#app {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg, #0d0d16);
  transition: background 700ms ease;
}
@media (min-width: 560px) and (min-height: 700px) {
  #app {
    width: 412px; height: min(900px, 94vh);
    border-radius: 42px;
    box-shadow:
      0 0 0 10px #14141c,
      0 0 0 12px #2b2b38,
      0 40px 90px -20px rgba(0,0,0,.9),
      0 0 120px -30px var(--accent, #6a6aff);
  }
  #device::after {
    content: 'TAMA–DNA  ·  browser proof of concept  ·  best on a phone';
    position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
    font: 500 11px/1 'DotGothic16', monospace; letter-spacing: .18em; color: #4a4a60;
  }
}

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 420ms ease, transform 420ms cubic-bezier(.2,.8,.2,1);
  transform: scale(1.02);
}
.screen.is-active { display: flex; opacity: 1; transform: none; }
.screen.is-leaving { display: flex; opacity: 0; transform: scale(.97); pointer-events: none; }

/* ============================================================
   TITLE SCREEN
   ============================================================ */
.screen-title {
  background:
    radial-gradient(90% 60% at 50% 0%, #2a2050 0%, rgba(0,0,0,0) 70%),
    radial-gradient(70% 50% at 80% 100%, #4a1a3a 0%, rgba(0,0,0,0) 70%),
    linear-gradient(180deg, #0e0b1e 0%, #08070f 100%);
  justify-content: center;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
}
.title-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 20% 18%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 68% 12%, #ffe9b3, transparent),
    radial-gradient(1.2px 1.2px at 84% 34%, #cfe4ff, transparent),
    radial-gradient(1.8px 1.8px at 12% 52%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 44% 30%, #ffd9f2, transparent),
    radial-gradient(1.3px 1.3px at 92% 66%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 32% 78%, #bcd8ff, transparent);
  opacity: .8;
  animation: twinkle 5s ease-in-out infinite;
}
@keyframes twinkle { 0%,100%{opacity:.45} 50%{opacity:.95} }
.title-inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 16px; }
.title-kicker {
  font: 400 10px/1 'DotGothic16', monospace; letter-spacing: .3em; color: #8d84c9; text-align: center;
}
.title-logo {
  margin: 0; text-align: center; line-height: .82;
  font-family: 'Chakra Petch', sans-serif; font-weight: 700; font-size: 68px; letter-spacing: -.02em;
  display: flex; justify-content: center; align-items: baseline; gap: 2px;
}
.logo-line1 { color: #fff; text-shadow: 0 0 30px rgba(255,255,255,.35); }
.logo-dash { color: #ff5fa2; }
.logo-line2 {
  background: linear-gradient(180deg,#8affe1,#5b8cff 60%,#c86bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title-sub {
  margin: 0; text-align: center; font-size: 15px; line-height: 1.55; color: #cfc9f0; font-weight: 500;
}
.creator-mock {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  border-radius: 18px; padding: 14px; backdrop-filter: blur(8px);
}
.creator-label {
  display: flex; align-items: center; gap: 7px;
  font: 400 9.5px/1 'DotGothic16', monospace; letter-spacing: .22em; color: #9d95d6;
}
.creator-label .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.creator-label .soon {
  margin-left: auto; color: #0c0c14; background: #ffd166; padding: 3px 6px; border-radius: 4px; letter-spacing: .12em; font-size: 8.5px;
}
.creator-field {
  margin-top: 10px; min-height: 62px; padding: 11px 12px; border-radius: 12px;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.08);
  font: 500 13px/1.5 'Chakra Petch', monospace; color: #a7f3d0;
}
.caret { display: inline-block; width: 8px; height: 15px; background: #a7f3d0; margin-left: 2px; vertical-align: -2px; animation: blinkcaret 1s steps(2) infinite; }
@keyframes blinkcaret { 0%,49%{opacity:1} 50%,100%{opacity:0} }
.creator-steps { display: flex; gap: 6px; margin-top: 10px; }
.cstep {
  flex: 1; text-align: center; font-size: 9.5px; letter-spacing: .04em; color: #b9b2e6;
  background: rgba(255,255,255,.05); border-radius: 9px; padding: 7px 3px;
}
.cstep b { display: block; color: #ff8ec4; font-family: 'Chakra Petch'; font-size: 13px; }
.creator-note { margin-top: 9px; font-size: 10.5px; color: #7d76ad; text-align: center; }
.creator-note em { color: #a7f3d0; font-style: normal; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border-radius: 16px; padding: 13px 18px; text-align: center;
  transition: transform 120ms ease, box-shadow 200ms ease, filter 200ms ease;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent, #6a6aff), var(--accent2, #4b3aff));
  box-shadow: 0 8px 0 -2px var(--accentDark, #2c1f9e), 0 14px 30px -10px var(--accent, #6a6aff);
  color: #fff;
}
.btn-primary:active { box-shadow: 0 4px 0 -2px var(--accentDark, #2c1f9e), 0 8px 18px -10px var(--accent, #6a6aff); transform: translateY(3px) scale(.99); }
.btn-primary[disabled] { filter: grayscale(1) brightness(.55); box-shadow: none; pointer-events: none; }
.btn-ghost { border: 1px solid rgba(255,255,255,.18); color: #d6d0f5; background: rgba(255,255,255,.04); }
.btn-jp { font-size: 12px; opacity: .85; letter-spacing: .12em; }
.btn-en { font: 600 12.5px/1.2 'Chakra Petch', sans-serif; letter-spacing: .12em; }
.btn-xl { padding: 15px 18px; }
.btn-sm { padding: 9px 14px; border-radius: 12px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); font-size: 18px; line-height: 1;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.small { width: 34px; height: 34px; font-size: 16px; }

/* ============================================================
   SELECT SCREEN
   ============================================================ */
.screen-select {
  background: linear-gradient(180deg, #0f0d1c 0%, #08070f 100%);
  padding-top: calc(10px + env(safe-area-inset-top));
}
.select-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px 4px; }
.select-title { font: 600 14px/1.1 'Chakra Petch', sans-serif; letter-spacing: .18em; }
.select-title small { display: block; font-family: 'Zen Maru Gothic'; font-size: 10px; letter-spacing: .2em; color: #8b83bd; margin-top: 3px; }
.select-deck {
  flex: 1; display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; padding: 10px 14px 14px;
  scrollbar-width: none;
}
.select-deck::-webkit-scrollbar { display: none; }
.pick {
  position: relative; flex: 0 0 84%; scroll-snap-align: center;
  border-radius: 24px; overflow: hidden; display: flex; flex-direction: column;
  border: 2px solid rgba(255,255,255,.1);
  transition: transform 300ms cubic-bezier(.2,.8,.2,1), border-color 300ms, box-shadow 300ms, filter 300ms;
  filter: saturate(.6) brightness(.72);
  transform: scale(.95);
}
.pick.is-picked { filter: none; transform: scale(1); border-color: var(--pickAccent); box-shadow: 0 20px 50px -18px var(--pickAccent), inset 0 0 60px -20px var(--pickAccent); }
.pick-bg { position: absolute; inset: 0; z-index: 0; }
.pick-art { position: relative; z-index: 1; flex: 1; display: grid; place-items: end center; padding-bottom: 4px; min-height: 0; }
.pick-art .creature { width: 74%; max-width: 230px; }
.pick-info {
  position: relative; z-index: 2; padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(6,4,12,0) 0%, rgba(6,4,12,.86) 26%, rgba(6,4,12,.97) 100%);
}
.pick-jp { font-size: 11px; letter-spacing: .3em; color: var(--pickAccent); }
.pick-name { margin: 2px 0 4px; font: 700 21px/1 'Chakra Petch', sans-serif; letter-spacing: .02em; }
.pick-tag { font-size: 11.5px; color: #cdc7ea; line-height: 1.45; min-height: 33px; }
.pick-traits { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.trait { font: 400 9px/1 'DotGothic16', monospace; letter-spacing: .1em; padding: 5px 7px; border-radius: 6px; background: rgba(255,255,255,.09); color: #e6e1ff; }
.trait.special { background: var(--pickAccent); color: #0a0a12; font-weight: 700; }
.select-foot { padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.select-hint { text-align: center; font: 400 10px/1 'DotGothic16', monospace; letter-spacing: .16em; color: #6f68a0; }

/* ============================================================
   GAME SCREEN
   ============================================================ */
.screen-game { background: var(--bg); }
.hud {
  position: relative; z-index: 6;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 8px;
  background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,0));
}
.hud-name { font: 700 17px/1 var(--fontDisplay, 'Chakra Petch'), sans-serif; letter-spacing: .06em; color: var(--ink, #fff); text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.hud-meta { display: flex; gap: 6px; margin-top: 6px; }
.chip {
  font: 400 9px/1 'DotGothic16', monospace; letter-spacing: .12em;
  padding: 5px 7px; border-radius: 6px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.14); color: #fff;
}
.chip-rel { background: var(--accentSoft, rgba(255,255,255,.16)); border-color: var(--accent); color: var(--ink); }
.hud-right { display: flex; align-items: center; gap: 8px; }
.hud-clock { display: flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 10px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.12); }
.tod-icon { font-size: 13px; line-height: 1; }
.tod-name { font: 400 9px/1 'DotGothic16', monospace; letter-spacing: .14em; }

/* ---------- stage ---------- */
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.scene { position: absolute; inset: 0; z-index: 0; }
.weather { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.stage-glow { position: absolute; inset: 0; z-index: 4; pointer-events: none; box-shadow: inset 0 -70px 70px -40px rgba(0,0,0,.7), inset 0 60px 60px -50px rgba(0,0,0,.5); }
.creature-wrap {
  position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%);
  width: min(82%, 320px); z-index: 2; display: grid; place-items: end center;
}
.creature { width: 100%; transform-origin: 50% 100%; }
.creature svg { width: 100%; height: auto; overflow: visible; }
.creature-shadow {
  position: absolute; bottom: -2%; left: 50%; transform: translateX(-50%);
  width: 58%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 70%);
  animation: shadowBob 3.4s ease-in-out infinite;
}
@keyframes shadowBob { 0%,100%{transform:translateX(-50%) scale(1)} 50%{transform:translateX(-50%) scale(.9,.85)} }
.mess-layer { position: absolute; inset: 0; pointer-events: none; }
.mess {
  position: absolute; font-size: 24px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
  animation: messIn 500ms cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes messIn { from{transform:scale(0) rotate(-40deg); opacity:0} to{transform:scale(1) rotate(var(--r,0deg)); opacity:1} }

.stage-badges { position: absolute; top: 8px; left: 12px; right: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.badge {
  font: 400 9px/1 'DotGothic16', monospace; letter-spacing: .12em; padding: 5px 8px; border-radius: 20px;
  background: rgba(0,0,0,.55); border: 1px solid var(--accent); color: var(--accent);
  animation: badgeIn 300ms ease both; backdrop-filter: blur(4px);
}
.badge.warn { border-color: #ff6b6b; color: #ff9a9a; }
.badge.good { border-color: #6ee7a8; color: #9ef5c6; }
@keyframes badgeIn { from{opacity:0; transform:translateY(-6px)} to{opacity:1; transform:none} }

/* ---------- speech bubble ---------- */
/* sits around the character's waist: their face stays readable while they talk */
.bubble-wrap { position: absolute; left: 12px; right: 12px; bottom: 26%; z-index: 5; display: flex; justify-content: center; pointer-events: none; }
.bubble {
  max-width: 96%; padding: 11px 15px; border-radius: var(--bubbleRadius, 18px);
  background: var(--bubbleBg, rgba(255,255,255,.96)); color: var(--bubbleInk, #16161e);
  font: 600 14.5px/1.42 var(--fontBubble, 'Zen Maru Gothic'), sans-serif;
  border: var(--bubbleBorder, 0);
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(8px) scale(.94); transition: opacity 220ms ease, transform 260ms cubic-bezier(.2,1.5,.4,1);
  text-align: center; position: relative; white-space: pre-line;
}
.bubble.show { opacity: 1; transform: none; }
.bubble::after {
  content: ''; position: absolute; top: -7px; left: 50%; margin-left: -8px;
  border: 8px solid transparent; border-bottom-color: var(--bubbleTail, rgba(255,255,255,.96)); border-top: 0;
}
.bubble.think { border-radius: 22px; font-style: italic; opacity: .92; }
.bubble.think::after { display: none; }

/* ---------- fx layer ---------- */
.fx-layer { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.pop {
  position: absolute; font: 700 15px/1 'Chakra Petch', sans-serif; letter-spacing: .04em;
  text-shadow: 0 2px 6px rgba(0,0,0,.8); animation: popUp 1200ms ease-out forwards; white-space: nowrap;
}
.pop.up { color: #86efac; } .pop.down { color: #fca5a5; } .pop.spec { color: var(--accent); }
@keyframes popUp { 0%{opacity:0; transform:translateY(6px) scale(.7)} 18%{opacity:1; transform:translateY(-4px) scale(1.1)} 100%{opacity:0; transform:translateY(-52px) scale(1)} }
.particle { position: absolute; pointer-events: none; will-change: transform, opacity; }

/* ---------- panel: ability + needs + actions ---------- */
.panel {
  position: relative; z-index: 6;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--panelBg, linear-gradient(180deg, rgba(12,12,20,.86), rgba(8,8,14,.98)));
  border-top: 1px solid var(--panelLine, rgba(255,255,255,.1));
  backdrop-filter: blur(12px);
}
.ability { margin-bottom: 9px; }
.ability-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font: 400 9px/1 'DotGothic16', monospace; letter-spacing: .18em; color: var(--accent); margin-bottom: 5px;
}
/* the panel is dark in every theme and every time of day, so it does not follow --ink
   (which flips dark for the light-sky hours) */
.ability-state { color: rgba(255,255,255,.82); letter-spacing: .1em; }
.ability-track {
  position: relative; height: 9px; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1);
}
.ability-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, var(--accent2, #7b5bff), var(--accent, #b48bff));
  transition: width 500ms cubic-bezier(.2,.8,.2,1), background 400ms;
  box-shadow: 0 0 12px var(--accent);
}
.ability-fill.full { animation: abilityPulse 1.1s ease-in-out infinite; }
@keyframes abilityPulse { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.7)} }
.ability-ticks { position: absolute; inset: 0; pointer-events: none; }
.ability-ticks i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.45); }

.needs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 10px; }
.need { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.need-ico { font-size: 12px; line-height: 1; filter: grayscale(.2); }
.need-track { width: 100%; height: 7px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; position: relative; }
.need-track i {
  display: block; height: 100%; width: 50%; border-radius: 5px;
  background: linear-gradient(90deg, #5eead4, #34d399);
  transition: width 600ms cubic-bezier(.2,.8,.2,1), background 400ms;
}
.need.mid .need-track i { background: linear-gradient(90deg, #fcd34d, #fbbf24); }
.need.low .need-track i { background: linear-gradient(90deg, #fb7185, #ef4444); }
.need.low { animation: needAlert 1.6s ease-in-out infinite; }
@keyframes needAlert { 0%,100%{opacity:1} 50%{opacity:.55} }
.need-lab { font: 400 7.5px/1 'DotGothic16', monospace; letter-spacing: .1em; color: rgba(255,255,255,.5); }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.act {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; border-radius: 15px;
  background: var(--btnBg, rgba(255,255,255,.08));
  border: 1px solid var(--btnLine, rgba(255,255,255,.12));
  transition: transform 110ms ease, background 200ms, box-shadow 200ms, opacity 200ms;
  overflow: hidden;
}
.act::before {
  content:''; position: absolute; inset: 0; background: var(--accent); opacity: 0; transition: opacity 200ms;
}
.act:active { transform: scale(.94); }
.act:active::before { opacity: .22; }
.act[disabled] { opacity: .34; pointer-events: none; }
.act-ico { font-size: 19px; line-height: 1; }
.act-lab { font: 600 9px/1 'Chakra Petch', sans-serif; letter-spacing: .12em; opacity: .9; }
.act-special {
  background: var(--specialBg, linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05)));
  border-color: var(--accent);
}
.act-special.ready {
  animation: specialReady 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 1px var(--accent), 0 0 22px -4px var(--accent);
}
@keyframes specialReady {
  0%,100% { box-shadow: 0 0 0 1px var(--accent), 0 0 16px -6px var(--accent); }
  50% { box-shadow: 0 0 0 2px var(--accent), 0 0 30px 0px var(--accent); }
}
.act-ready {
  position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent); display: none;
}
.act-special.ready .act-ready { display: block; animation: pulse 1s infinite; }

/* ============================================================
   OVERLAYS / SHEETS / MODALS
   ============================================================ */
.overlay {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(4,3,10,.72); backdrop-filter: blur(6px);
  animation: fadeIn 240ms ease both;
  padding: 16px;
}
.overlay[hidden] { display: none; }
.overlay.center { align-items: center; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.sheet {
  width: 100%; max-width: 380px; max-height: 88%; overflow-y: auto;
  border-radius: 22px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--sheetBg, linear-gradient(180deg, #16151f, #0e0d15));
  border: 1px solid var(--sheetLine, rgba(255,255,255,.14));
  box-shadow: 0 -20px 60px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04) inset;
  animation: sheetUp 340ms cubic-bezier(.2,.9,.25,1) both;
}
@keyframes sheetUp { from{transform:translateY(28px); opacity:0} to{transform:none; opacity:1} }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-kanji { font-family: var(--fontDisplay, 'Shippori Mincho B1'), serif; font-size: 26px; color: var(--accent); line-height: 1; }
.sheet-title { font: 700 15px/1.15 'Chakra Petch', sans-serif; letter-spacing: .1em; }
.sheet-title small { display: block; font-family: 'Zen Maru Gothic'; font-weight: 500; font-size: 10.5px; letter-spacing: .06em; color: #a49dcd; margin-top: 3px; }
.sheet-close { margin-left: auto; }
.queued {
  margin-left: auto; flex: none;
  font: 400 8.5px/1 'DotGothic16', monospace; letter-spacing: .12em;
  color: var(--accent); border: 1px solid var(--accent);
  padding: 5px 7px; border-radius: 5px; white-space: nowrap;
}
.sheet-close + .queued, .queued + .sheet-close { margin-left: 8px; }
.sheet-body { font-size: 13.5px; line-height: 1.6; color: #ddd8f5; }
.sheet-body p { margin: 0 0 10px; }
.sheet-body em { color: var(--accent); font-style: normal; }

.opt-list { display: grid; gap: 8px; margin-top: 12px; }
.opt {
  display: flex; align-items: center; gap: 11px; text-align: left; width: 100%;
  padding: 11px 12px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  transition: transform 110ms ease, background 200ms, border-color 200ms;
}
.opt:active { transform: scale(.975); background: rgba(255,255,255,.12); border-color: var(--accent); }
.opt-ico { font-size: 23px; width: 30px; text-align: center; flex: none; }
.opt-main { flex: 1; min-width: 0; }
.opt-name { font-weight: 700; font-size: 13.5px; }
.opt-desc { font-size: 11px; color: #a9a2d3; margin-top: 2px; line-height: 1.4; }
.opt-flag { font: 400 8.5px/1 'DotGothic16', monospace; letter-spacing: .1em; padding: 4px 6px; border-radius: 5px; flex: none; }
.opt-flag.like { background: rgba(110,231,168,.18); color: #86efac; }
.opt-flag.hate { background: rgba(248,113,113,.18); color: #fca5a5; }

.event-card { text-align: left; }
.event-tag {
  display: inline-block; font: 400 8.5px/1 'DotGothic16', monospace; letter-spacing: .18em;
  padding: 5px 8px; border-radius: 5px; background: var(--accent); color: #0a0a12; margin-bottom: 10px;
}
.event-title { font: 700 19px/1.2 var(--fontDisplay, 'Chakra Petch'), sans-serif; margin: 0 0 8px; }
.event-text { font-size: 13.5px; line-height: 1.6; color: #e2ddf8; }
.event-result {
  margin-top: 12px; padding: 11px 12px; border-radius: 12px;
  background: rgba(255,255,255,.05); border-left: 3px solid var(--accent);
  font-size: 12.5px; line-height: 1.55; color: #cfc9ee;
  animation: sheetUp 300ms ease both;
}
.result-fx { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fx-chip { font: 400 9px/1 'DotGothic16', monospace; letter-spacing: .08em; padding: 5px 7px; border-radius: 5px; background: rgba(255,255,255,.08); }
.fx-chip.up { color: #86efac; } .fx-chip.down { color: #fca5a5; }

/* memory / journal */
.mem-list { display: grid; gap: 7px; }
.mem {
  display: flex; gap: 10px; padding: 10px 11px; border-radius: 12px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07);
}
.mem-ico { font-size: 17px; flex: none; }
.mem-txt { font-size: 12.5px; line-height: 1.45; }
.mem-time { font: 400 8.5px/1 'DotGothic16', monospace; color: #7f79ab; margin-top: 4px; letter-spacing: .08em; }
.empty { text-align: center; color: #7f79ab; font-size: 12px; padding: 22px 0; }

/* DNA inspector */
.dna-block { margin-top: 10px; }
.dna-h { font: 400 9px/1 'DotGothic16', monospace; letter-spacing: .2em; color: var(--accent); margin-bottom: 6px; }
.dna-code {
  font: 500 10.5px/1.6 'Chakra Petch', ui-monospace, monospace; color: #b9e8d5;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  padding: 10px 11px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto;
}
.k { color: #8ab4ff; } .s { color: #ffd08a; } .n { color: #ff9ec7; }

/* toasts */
.toasts { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 60; display: grid; gap: 6px; justify-items: center; pointer-events: none; padding-bottom: 10px; }
.toast {
  font: 600 11.5px/1.3 'Chakra Petch', sans-serif; letter-spacing: .06em;
  padding: 8px 13px; border-radius: 20px; background: rgba(8,8,16,.9); border: 1px solid var(--accent);
  color: #fff; animation: toastIn 260ms ease both, toastOut 300ms ease 1.7s both;
  box-shadow: 0 8px 24px -10px #000;
}
@keyframes toastIn { from{opacity:0; transform:translateY(10px) scale(.9)} to{opacity:1; transform:none} }
@keyframes toastOut { to{opacity:0; transform:translateY(-8px)} }

/* full-screen flash */
.flash { position: absolute; inset: 0; z-index: 80; pointer-events: none; opacity: 0; background: #fff; }
.flash.go { animation: flashHit 460ms ease-out; }
@keyframes flashHit { 0%{opacity:.92} 100%{opacity:0} }
.flash.red.go { background: #ff2b2b; }
.flash.gold.go { background: #ffe6a1; }

/* cinematic (transformation etc.) */
.cinematic { position: absolute; inset: 0; z-index: 70; overflow: hidden; }
.cinematic[hidden] { display: none; }

/* away / return card */
.away-hero {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px;
  background: linear-gradient(120deg, var(--accentSoft), rgba(255,255,255,.03)); margin-bottom: 12px;
}
.away-hero .big { font: 700 26px/1 'Chakra Petch'; color: var(--accent); }
.away-hero .lab { font: 400 9px/1.4 'DotGothic16', monospace; letter-spacing: .14em; color: #b6afdd; }
.away-log { display: grid; gap: 8px; }
.away-line {
  display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: #e0dbf7;
  padding: 9px 11px; border-radius: 12px; background: rgba(255,255,255,.05);
  animation: sheetUp 340ms ease both;
}
.away-line .aico { font-size: 16px; flex: none; }
.away-line:nth-child(2){animation-delay:.07s} .away-line:nth-child(3){animation-delay:.14s}
.away-line:nth-child(4){animation-delay:.21s} .away-line:nth-child(5){animation-delay:.28s}

/* settings rows */
.row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 13px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); width: 100%; text-align: left;
  font-size: 13px;
}
.row + .row { margin-top: 7px; }
.row .r-ico { font-size: 17px; width: 24px; text-align: center; }
.row .r-sub { font-size: 10.5px; color: #948dc0; margin-top: 2px; }
.row-danger { border-color: rgba(248,113,113,.4); color: #fca5a5; }

/* numbered steps — used by the "add to home screen" sheet */
.steps { display: grid; gap: 7px; margin-top: 4px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 12.5px; line-height: 1.45; color: #ddd8f5; }
.step b {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 10px/1 'Chakra Petch', sans-serif;
  background: var(--accentSoft, rgba(255,255,255,.12)); color: var(--accent); border: 1px solid var(--accent);
}
.step i { font-style: normal; font-weight: 700; color: var(--accent); }
.mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.mini {
  padding: 9px 4px; border-radius: 10px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1); font: 600 11px/1 'Chakra Petch'; letter-spacing: .04em;
}
.mini:active { transform: scale(.94); background: var(--accentSoft); }
.mini.on { background: var(--accent); color: #10101a; border-color: var(--accent); }
.hr { height: 1px; background: rgba(255,255,255,.1); margin: 14px 0; }

/* spar minigame */
.spar { text-align: center; }
.spar-track {
  position: relative; height: 54px; margin: 16px 0 10px; border-radius: 12px;
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.12); overflow: hidden;
}
.spar-zone {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 22%; transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(255,60,60,.12), rgba(255,60,60,.42), rgba(255,60,60,.12));
  border-left: 2px solid #ff4d4d; border-right: 2px solid #ff4d4d;
}
.spar-cursor {
  position: absolute; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: #fff;
  box-shadow: 0 0 14px #fff; left: 0;
}
.spar-hits { display: flex; justify-content: center; gap: 8px; margin-bottom: 4px; }
.spar-hits i {
  width: 13px; height: 13px; border-radius: 3px; background: rgba(255,255,255,.14); transform: rotate(45deg);
  transition: background 180ms, box-shadow 180ms;
}
.spar-hits i.hit { background: #ff3b3b; box-shadow: 0 0 12px #ff3b3b; }
.spar-hits i.miss { background: #4b4b57; }
.spar-cta { font: 400 10px/1 'DotGothic16', monospace; letter-spacing: .2em; color: #ff8a8a; }
