@font-face { font-family: "Silkscreen"; src: url(/fonts/Silkscreen-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url(/fonts/Silkscreen-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Departure Mono"; src: url(/fonts/DepartureMono-Regular.woff2) format("woff2"); font-display: swap; }

:root {
  --bg0: #0d081c;
  --bg1: #1a1036;
  --ink: #f5f0ff;
  --muted: #a99fc9;
  --dim: #8f87ad;
  --line: #2b2152;
  --panel: rgba(22, 14, 46, 0.92);
  --panel2: #1e1442;
  --shade: #07040f;
  --mono: "Departure Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --pix: "Silkscreen", var(--mono);
  --violet: #8b6cff;
  --pink: #ff7bb5;
  --yellow: #ffd84d;
  --green: #46e38f;
  --exit: #2fe27c;
  --red: #ff4f5e;
  --glow: 139, 108, 255;
  --u: 2px; /* one LCD pixel */
  --lcd: calc(var(--u) * 128);
  color-scheme: dark;
}
@media (min-width: 1180px) and (min-height: 860px) {
  :root { --u: 3px; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 50% 30%, var(--bg1), var(--bg0) 70%) fixed, var(--bg0);
  color: var(--ink);
  font: 400 14px/1.55 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* twinkling pixel sky + glow in the pet's colour */
.sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(560px 440px at 50% 40%, rgba(var(--glow), 0.2), transparent 70%),
    radial-gradient(2px 2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 82% 12%, #cbbcff 50%, transparent 51%),
    radial-gradient(2px 2px at 68% 72%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 24% 80%, #cbbcff 50%, transparent 51%),
    radial-gradient(3px 3px at 90% 46%, #ffd84d 50%, transparent 51%),
    radial-gradient(2px 2px at 6% 52%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 44% 8%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 56% 92%, #cbbcff 50%, transparent 51%);
  transition: background 0.8s;
  animation: twinkle 5s steps(2) infinite;
}
@keyframes twinkle { 50% { opacity: 0.82; } }

/* ---------- header ---------- */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 18px;
  max-width: 1380px; margin: 0 auto; padding: 18px 24px 6px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-egg {
  width: 26px; height: 32px; border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 32% 26%, #e5dcff, #9a7dff 45%, #5a3bd6);
  box-shadow: inset -3px -4px 6px rgba(40, 10, 110, 0.5), 0 4px 14px rgba(var(--glow), 0.5);
  position: relative;
}
.logo-egg::after { content: ""; position: absolute; inset: 9px 6px 9px; border-radius: 4px; background: #2a1a55; box-shadow: inset 0 0 0 2px #1a0f3a; }
.logo-t { font: 700 22px/1 "Silkscreen", monospace; letter-spacing: 1px; text-shadow: 3px 3px 0 #2b1766; }
.logo-t i { color: var(--pink); font-style: normal; }
.tag { margin: 0; color: var(--muted); font-size: 13px; }
.top-r { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 8px; padding: 0 16px; min-height: 40px;
  background: var(--pink); color: #2a0b22;
  font: 400 13px/1 var(--mono); letter-spacing: 1px; text-transform: uppercase; text-decoration: none;
  box-shadow: 0 4px 0 #b8336f;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
  white-space: nowrap;
}
.pill-btn:hover { filter: brightness(1.06); }
.pill-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8336f; }
.pill-btn:focus-visible, .chip-btn:focus-visible, .ghost-btn:focus-visible, .go:focus-visible, .row:focus-visible, .ico:focus-visible, .key:focus-visible, .thumbs button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.pill-btn.alt { background: var(--panel2); color: var(--ink); box-shadow: 0 4px 0 var(--shade), inset 0 0 0 2px var(--line); }
.pill-btn.alt:active { box-shadow: 0 1px 0 var(--shade), inset 0 0 0 2px var(--line); }
.pill-btn.on { background: var(--exit); color: #062414; box-shadow: 0 4px 0 #1d8a52; }
.ghost-btn { width: 40px; height: 40px; border-radius: 8px; border: 0; background: var(--panel2); box-shadow: 0 4px 0 var(--shade), inset 0 0 0 2px var(--line); display: grid; place-items: center; padding: 0; }
.ghost-btn canvas { width: 20px; height: 20px; image-rendering: pixelated; }
.ghost-btn.off canvas { opacity: 0.5; }

/* ---------- layout ---------- */
.stage {
  position: relative; z-index: 1;
  max-width: 1380px; margin: 0 auto; padding: 10px 24px 24px;
  display: grid; grid-template-columns: minmax(250px, 300px) 1fr minmax(290px, 340px); gap: 24px; align-items: start;
}
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col-c { align-items: center; padding-top: 6px; }
.panel {
  background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 14px 16px;
  box-shadow: 0 4px 0 var(--shade);
}
.panel h2 { margin: 0 0 12px; font: 400 12px/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: #cfc4ff; display: flex; align-items: center; gap: 8px; }
.h-note { font: 400 10px/1 var(--mono); letter-spacing: 1px; color: var(--pink); background: rgba(255, 123, 181, 0.12); padding: 4px 6px; border-radius: 4px; }
.h-note.live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: var(--pink); vertical-align: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* find */
.find-row { display: flex; gap: 6px; }
.find-row input {
  flex: 1; min-width: 0; padding: 0 12px; min-height: 44px; border-radius: 8px; border: 2px solid var(--line);
  background: #0e0820; outline: none; font-size: 14px;
}
.find-row input:focus { border-color: var(--violet); }
.go { border: 0; border-radius: 8px; padding: 0 16px; min-height: 44px; background: var(--violet); color: #fff; font: 400 13px var(--mono); letter-spacing: 1px; text-transform: uppercase; box-shadow: 0 4px 0 #4a2eb8; }
.go:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a2eb8; }
.find-actions { display: flex; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; border: 0; background: var(--panel2); box-shadow: inset 0 0 0 2px var(--line); border-radius: 8px; padding: 0 12px; font-size: 13px; }
.chip-btn canvas { width: 16px; height: 16px; image-rendering: pixelated; }
.chip-btn:hover { background: #281b56; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; aspect-ratio: 1; }
.thumbs button:hover, .thumbs button.on { border-color: var(--pink); }
.thumbs img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

.list { display: flex; flex-direction: column; gap: 4px; }
.row {
  display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; border: 0; background: none; text-align: left; width: 100%;
}
.row:hover { background: rgba(255, 255, 255, 0.06); }
.row.cur { background: rgba(var(--glow), 0.14); }
.row img { width: 36px; height: 36px; border-radius: 6px; image-rendering: pixelated; flex: none; }
.row .r-main { flex: 1; min-width: 0; }
.row .r-t { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-s { display: block; font-size: 12px; color: var(--muted); }
.row .r-v { font: 400 15px var(--mono); color: var(--yellow); }
.row .r-n { width: 14px; text-align: center; color: var(--dim); font-size: 13px; flex: none; }
#records .chip-btn { margin-top: 10px; }
.mood { font: 400 11px/1 var(--mono); letter-spacing: 1px; text-transform: uppercase; padding: 5px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); color: var(--muted); white-space: nowrap; }
.mood.hungry, .mood.miserable, .mood.away { background: rgba(255, 79, 94, 0.15); color: #ff8d97; }
.mood.bored, .mood.stinky, .mood.sleepy { background: rgba(255, 216, 77, 0.13); color: #ffe27c; }
.mood.happy, .mood.content { background: rgba(70, 227, 143, 0.13); color: #7ff0b3; }
.mood.lonely { background: rgba(139, 108, 255, 0.16); color: #c4b4ff; }
.mood.asleep { background: rgba(124, 196, 255, 0.13); color: #a9d8ff; }

/* Chogtown */
.town-wrap { position: relative; padding: 5px; background: #0e0820; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--line); }
#town { display: block; width: 100%; height: auto; image-rendering: pixelated; cursor: pointer; }
.town-stats { margin-top: 10px; font-size: 12px; color: var(--muted); }
.town-stats b { color: var(--ink); font-weight: 400; }
.town-stats b.pk { color: var(--pink); }
.town-stats b.gr { color: var(--exit); }
.legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--dim); }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; vertical-align: 0; }
.k-h { background: #46e38f; } .k-f { background: #b5e35b; } .k-n { background: #ffd84d; } .k-s { background: #ff4f5e; } .k-m { background: #ff7bb5; } .k-0 { background: #3a2f66; }
.town-tip {
  position: absolute; z-index: 5; display: flex; gap: 8px; align-items: center; width: 190px; padding: 6px 8px 6px 6px; pointer-events: none;
  background: #0e0820; border: 2px solid var(--line); border-radius: 8px; box-shadow: 0 4px 0 var(--shade); font-size: 12px;
}
.town-tip img { width: 36px; height: 36px; border-radius: 4px; image-rendering: pixelated; flex: none; }
.town-tip b { display: block; font-weight: 400; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.town-tip i { display: block; font-style: normal; color: var(--muted); font-size: 11px; line-height: 1.3; }

/* ---------- the device ---------- */
.device-wrap { position: relative; padding: 18px 0 4px; }
.device {
  --s0: #e3d9ff; --s1: #a58aff; --s2: #6c49ef; --s3: #4325b4; --key0: #ffa3cd; --key1: #ff5d9e; --key2: #b52c69;
  position: relative;
  width: calc(var(--lcd) + 196px);
  filter: drop-shadow(0 34px 40px rgba(0, 0, 0, 0.5));
  transition: transform 0.25s;
}
.device[data-tier="Uncommon"] { --s0: #d7fff1; --s1: #7fe9c8; --s2: #2db897; --s3: #157a68; }
.device[data-tier="Rare"] { --s0: #ffe0ef; --s1: #ff9fcb; --s2: #f0559a; --s3: #a8256a; --key0: #c7b6ff; --key1: #8b6cff; --key2: #4a2eb8; }
.device[data-tier="Epic"] { --s0: #fff6c8; --s1: #ffd863; --s2: #f0a91f; --s3: #a8650b; --key0: #c7b6ff; --key1: #8b6cff; --key2: #4a2eb8; }
.device[data-tier="Legendary"], .device[data-tier="1:1"] { --s0: #ffffff; --s1: #ffd1f0; --s2: #9fd8ff; --s3: #8b6cff; --key0: #fff3a8; --key1: #ffd84d; --key2: #b98a0c; }
.device.wiggle { animation: wiggle 0.42s steps(6); }
@keyframes wiggle { 20% { transform: rotate(-3deg); } 40% { transform: rotate(3deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }
.device.jump { animation: jump 0.5s steps(5); }
@keyframes jump { 40% { transform: translateY(-10px); } }

.ring { position: absolute; left: 50%; top: -26px; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%; border: 7px solid #cfc6e6; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25), 0 2px 0 #8d86a3; }
.ring span { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); width: 20px; height: 14px; border-radius: 4px; background: linear-gradient(#e6e0f5, #9d96b3); }

.shell {
  position: relative;
  padding: 92px 0 40px;
  border-radius: 50% 50% 48% 48% / 44% 44% 36% 36%;
  background:
    radial-gradient(circle at 30% 18%, var(--s0) 0, transparent 34%),
    radial-gradient(120% 90% at 50% 30%, var(--s1) 0, var(--s2) 55%, var(--s3) 100%);
  box-shadow:
    inset -16px -22px 34px rgba(30, 6, 90, 0.42),
    inset 14px 16px 26px rgba(255, 255, 255, 0.38),
    inset 0 0 0 3px rgba(255, 255, 255, 0.12);
  display: flex; flex-direction: column; align-items: center;
  overflow: hidden;
}
.device[data-tier="Legendary"] .shell, .device[data-tier="1:1"] .shell {
  background:
    radial-gradient(circle at 30% 18%, #fff 0, transparent 34%),
    conic-gradient(from var(--holo, 0deg) at 50% 45%, #ffd1f0, #9fd8ff, #c7ffdf, #fff3a8, #ffd1f0);
  animation: holo 6s linear infinite;
}
@property --holo { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes holo { to { --holo: 360deg; } }
/* sprinkles on the plastic */
.shell::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.45;
  background:
    radial-gradient(2px 2px at 18% 70%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 84% 64%, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 12% 40%, var(--yellow) 50%, transparent 51%),
    radial-gradient(3px 3px at 90% 32%, var(--pink) 50%, transparent 51%),
    radial-gradient(2px 2px at 76% 88%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 24% 90%, var(--yellow) 50%, transparent 51%);
}
.brand { position: absolute; top: 52px; left: 0; right: 0; text-align: center; font: 700 13px/1 "Silkscreen", monospace; letter-spacing: 3px; color: rgba(30, 8, 80, 0.55); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); }
.brand span { color: rgba(255, 255, 255, 0.85); }

.bezel {
  position: relative;
  padding: 8px 14px;
  border-radius: 38px 38px 44px 44px;
  background: linear-gradient(160deg, #33215f, #1d1140);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6), 0 2px 0 rgba(255, 255, 255, 0.35), 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.icons { display: flex; justify-content: space-around; gap: 4px; padding: 4px 0; }
.ico {
  position: relative; width: 56px; height: 46px; border: 0; border-radius: 8px; background: transparent; padding: 3px 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  opacity: 0.62; transition: opacity 0.15s, background 0.15s, transform 0.08s;
}
.ico canvas { image-rendering: pixelated; width: 24px; height: 24px; }
.ico:hover { opacity: 0.9; }
.ico.sel { opacity: 1; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 2px rgba(255, 216, 77, 0.85); }
.ico:active { transform: scale(0.92); }
.ico .cd { position: absolute; top: -4px; right: -2px; font: 400 9px/1 var(--mono); color: #1d1233; background: var(--yellow); border-radius: 3px; padding: 1px 2px; }
.ico .cd:empty { display: none; }
.ico.cool canvas { opacity: 0.35; }
.ico .lbl { font: 400 8px/1 var(--pix); letter-spacing: 0.5px; text-transform: uppercase; color: #cfc4ff; white-space: nowrap; pointer-events: none; }
.ico.sel .lbl { color: var(--yellow); }

.lcd {
  position: relative; width: var(--lcd); height: var(--lcd); margin: 4px auto;
  border-radius: 10px; overflow: hidden; background: #1a1036;
  box-shadow: 0 0 0 3px #120a28, 0 0 0 5px rgba(255, 255, 255, 0.06), 0 0 30px rgba(var(--glow), 0.35);
}
.lcd canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; }
.lcd-grid {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.14) 1px, transparent 1px) 0 0 / var(--u) var(--u),
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px) 0 0 / var(--u) var(--u);
  mix-blend-mode: multiply; opacity: 0.8;
}
.lcd-gloss { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(155deg, rgba(255, 255, 255, 0.14), transparent 38%), radial-gradient(120% 90% at 50% 120%, rgba(0, 0, 0, 0.25), transparent 60%); }

.speech {
  position: absolute; left: 50%; top: calc(var(--u) * 14); transform: translate(-50%, -6px) scale(0.96);
  max-width: 88%; width: max-content; padding: calc(var(--u) * 2.5) calc(var(--u) * 4); background: #fff; color: #1d1233;
  font: 400 calc(var(--u) * 4.6)/1.15 var(--pix); text-align: center;
  box-shadow: 0 0 0 2px #1d1233, 4px 4px 0 rgba(29, 18, 51, 0.6);
  opacity: 0; transition: opacity 0.18s, transform 0.18s steps(3); pointer-events: none;
}
.speech.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.speech::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 8px; height: 8px; background: #fff; box-shadow: 2px 2px 0 #1d1233; transform: translateX(-50%) rotate(45deg); }

/* food menu on the screen */
.menu {
  position: absolute; inset: 0; background: rgba(16, 9, 36, 0.86); display: flex; flex-direction: column; padding: calc(var(--u) * 6);
  gap: calc(var(--u) * 3); backdrop-filter: blur(2px);
}
.menu[hidden] { display: none; }
.menu h4 { margin: 0; font: 700 calc(var(--u) * 6)/1 "Silkscreen", monospace; color: var(--yellow); text-align: center; }
.menu-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 3); }
.food {
  position: relative; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.06); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #fff; font: 400 calc(var(--u) * 4.4)/1.1 "Silkscreen", monospace; padding: 4px;
}
.food canvas { width: calc(var(--u) * 20); height: calc(var(--u) * 20); image-rendering: pixelated; }
.food.sel { background: rgba(255, 216, 77, 0.16); box-shadow: inset 0 0 0 2px var(--yellow); }
.food.locked { opacity: 0.45; }
.food .fav { position: absolute; top: 4px; right: 6px; color: var(--yellow); font-size: calc(var(--u) * 4.4); }
.food .lock { font-size: calc(var(--u) * 3.6); color: #cfc4ff; }
.menu-x { align-self: center; border: 0; background: none; color: #cfc4ff; font: 400 calc(var(--u) * 4.4) var(--pix); min-height: 36px; padding: 6px 18px; }

.keys { position: relative; display: flex; gap: 26px; margin-top: 18px; align-items: flex-start; }
.key {
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, var(--key0), var(--key1) 55%, var(--key2));
  box-shadow: 0 5px 0 var(--key2), 0 8px 14px rgba(0, 0, 0, 0.35), inset 0 -3px 6px rgba(0, 0, 0, 0.2);
  color: var(--key2); font: 700 14px/1 var(--pix); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.06s, box-shadow 0.06s;
}
.key.mid { margin-top: 12px; }
.key:active, .key.down { transform: translateY(4px); box-shadow: 0 1px 0 var(--key2), 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.2); }
.speaker { position: relative; display: flex; gap: 6px; margin-top: 16px; }
.speaker i { width: 6px; height: 6px; border-radius: 50%; background: rgba(20, 6, 60, 0.4); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.3); }
.hint { margin: 16px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.hint b { display: inline-block; min-width: 20px; padding: 1px 5px; border-radius: 4px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line), 0 2px 0 var(--shade); color: var(--ink); font-weight: 400; }

/* ---------- pet card ---------- */
.pc-head { display: flex; gap: 12px; align-items: center; }
.pc-thumb { width: 60px; height: 60px; border-radius: 8px; image-rendering: pixelated; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12); background: #2a1a55; }
.pc-names { flex: 1; min-width: 0; }
.pc-name { font: 700 18px/1.15 var(--pix); overflow-wrap: anywhere; }
.pc-sub { color: var(--muted); font-size: 12px; margin-top: 5px; }
.tier { font: 400 11px/1 var(--mono); letter-spacing: 1px; text-transform: uppercase; padding: 5px 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.tier.Uncommon { color: #7fe9c8; background: rgba(127, 233, 200, 0.12); }
.tier.Rare { color: #ff9fcb; background: rgba(255, 159, 203, 0.13); }
.tier.Epic { color: #ffd863; background: rgba(255, 216, 99, 0.14); }
.tier.Legendary, .tier.\31\:1 { color: #1d1233; background: var(--yellow); }
.persona { margin: 14px 0 10px; padding: 12px; border-radius: 8px; background: rgba(var(--glow), 0.12); border: 1px solid rgba(var(--glow), 0.25); }
.persona-t { font: 700 15px/1.1 "Silkscreen", monospace; color: #fff; }
.quirks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.quirks li { font-size: 12px; padding: 3px 7px; border-radius: 4px; background: rgba(0, 0, 0, 0.22); color: #e3dcff; }
.home { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 4px 2px 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.home b { color: var(--ink); font-weight: 400; }
.home .days { font: 400 24px/1 var(--mono); color: var(--yellow); white-space: nowrap; }
.home-l { min-width: 0; }
.age { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 12px; color: var(--ink); }
.nw { white-space: nowrap; }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 6px; height: 8px; background: rgba(255, 255, 255, 0.12); }
.pips i.on { background: var(--yellow); }
.home .days small { font: 400 11px var(--mono); letter-spacing: 1px; color: var(--muted); margin-left: 4px; }
.you { font: 400 10px var(--mono); letter-spacing: 1px; color: #062414; background: var(--exit); border-radius: 5px; padding: 2px 5px; margin-left: 4px; }
.stats { display: grid; gap: 7px; padding: 12px 0 6px; }
.stat { display: grid; grid-template-columns: 62px 1fr 34px; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.bar { height: 10px; border-radius: 3px; background: rgba(0, 0, 0, 0.35); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.bar i { display: block; height: 100%; background: var(--green); transition: width 0.6s steps(8); background-image: linear-gradient(90deg, rgba(0,0,0,0.18) 50%, transparent 50%); background-size: 6px 100%; }
.bar i.mid { background-color: var(--yellow); }
.bar i.low { background-color: var(--red); }
.stat .n { font: 400 13px var(--mono); color: var(--ink); text-align: right; }
.pc-row { font-size: 13px; color: var(--muted); padding: 6px 0 2px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pc-row b { color: var(--ink); font-weight: 400; }
.pc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pet-card { position: relative; }
.delta { position: absolute; right: 52px; margin-top: -2px; font: 400 13px/1 var(--mono); pointer-events: none; animation: rise 1.2s steps(6) forwards; }
.delta.up { color: #7ff0b3; }
.delta.down { color: #ff8d97; }
@keyframes rise { 0% { transform: translateY(4px); opacity: 0; } 15% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
.strip { display: none; }
.lede { margin: 0; text-align: center; font-size: 13px; color: var(--muted); max-width: 34em; }

.log { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; }
.log-i { display: flex; gap: 8px; font-size: 13px; padding: 5px 2px; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); }
.log-i .who { color: var(--ink); white-space: nowrap; }
.log-i .what { color: var(--muted); flex: 1; min-width: 0; }
.log-i .when { color: var(--dim); font: 400 12px var(--mono); white-space: nowrap; }
.log-i.home .who { color: var(--exit); }
.empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.since { font-size: 13px; color: var(--muted); padding: 9px 10px; margin: 0 0 8px; border-radius: 6px; background: rgba(70, 227, 143, 0.08); box-shadow: inset 2px 0 0 var(--exit); }
.since b { display: block; color: #7ff0b3; font-weight: 400; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 2px; }

/* ---------- footer ---------- */
.how { position: relative; z-index: 1; max-width: 1380px; margin: 10px auto 40px; padding: 0 24px; }
.how-line { list-style: none; margin: 0 auto; padding: 14px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 28px; font-size: 13px; color: var(--muted); border-top: 2px dashed var(--line); max-width: 1100px; counter-reset: how; }
.how-line li { counter-increment: how; }
.how-line li::before { content: counter(how); display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 8px; border-radius: 4px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line); color: var(--yellow); font-size: 11px; }
.how-line b { color: var(--ink); font-weight: 400; }
.fine { color: var(--dim); font-size: 12px; text-align: center; margin: 18px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50;
  padding: 10px 16px; border-radius: 8px; background: #24164f; border: 2px solid #3a2c70; box-shadow: 0 4px 0 var(--shade);
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.dlg { border: 2px solid var(--line); border-radius: 10px; background: #1d1240; color: var(--ink); padding: 20px; width: min(360px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(5, 2, 15, 0.6); }
.dlg h3 { margin: 0 0 12px; font: 400 15px var(--pix); }
.dlg input { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 2px solid var(--line); background: #0e0820; }
.dlg-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- responsive ---------- */
/* big monitors: use the width, and a bigger device when there is height for it */
@media (min-width: 1560px) {
  .top, .stage, .how { max-width: 1720px; }
  .stage { grid-template-columns: minmax(300px, 380px) 1fr minmax(340px, 420px); gap: 40px; padding-left: 40px; padding-right: 40px; }
  .top { padding-left: 40px; padding-right: 40px; }
  body { font-size: 15px; }
}
@media (min-width: 1560px) and (min-height: 1040px) {
  :root { --u: 4px; }
}
@media (max-width: 1100px) {
  .stage { grid-template-columns: 1fr 1fr; }
  .col-c { grid-column: 1 / -1; order: -1; }
  .col-r { order: 0; }
  .col-l { order: 1; }
  .strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted); min-height: 24px; }
  .strip b { font: 400 15px/1 var(--pix); color: var(--ink); }
  .strip .s-day { color: var(--yellow); }
}
@media (max-width: 900px) {
  .tag { display: none; }
}
@media (max-width: 700px) {
  .top { padding: 14px 16px 4px; gap: 10px; }
  .tag { display: none; }
  .logo-t { font-size: 17px; }
  .top .pill-btn { padding: 8px 12px; font-size: 11px; }
  .stage { grid-template-columns: 1fr; padding: 6px 16px 20px; gap: 14px; }
  .col-r { order: 0; }
  .col-l { order: 1; }
  .hide-sm { display: none; }
  .how { padding: 0 16px; }
  .how-line { justify-content: flex-start; flex-direction: column; }
  .device { width: min(calc(var(--lcd) + 104px), calc(100vw - 24px)); }
  .device-wrap { padding-top: 10px; }
  .ring { display: none; }
  .shell { padding: 44px 0 26px; }
  .brand { top: 20px; font-size: 11px; }
  .bezel { padding: 4px 8px; border-radius: 30px 30px 36px 36px; }
  .ico { width: 50px; height: 44px; }
  .keys { gap: 24px; margin-top: 14px; }
  .key { width: 52px; height: 52px; }
  .speaker { display: none; }
  .hint { margin-top: 10px; }
  .col-c { padding-top: 0; }
  .ghost-btn { width: 44px; height: 44px; }
  .top .pill-btn { min-height: 44px; }
}
@media (max-width: 380px) {
  :root { --u: 1.75px; }
  .top { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .logo-t { font-size: 15px; }
  .logo-egg { width: 22px; height: 28px; }
  .top .pill-btn { padding: 0 10px; letter-spacing: 0; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .sky, .device[data-tier="Legendary"] .shell { animation: none; }
  .device.wiggle, .device.jump { animation: none; }
}
