/* Tamacatchi — toy-shop pastel × pixel LCD */
:root {
  --bg: #fff3f7;
  --bg2: #fde7f0;
  --ink: #2a1d3d;
  --ink-2: #4b3a63;
  --muted: #85769b;
  --line: #2a1d3d;
  --card: #ffffff;
  --pink: #ff8db1;
  --pink-l: #ffc6da;
  --mint: #4fcaa1;
  --mint-l: #bff0dd;
  --lilac: #a48bff;
  --lilac-l: #e2d9ff;
  --lemon: #ffd65a;
  --lemon-l: #fff1b8;
  --sky: #74baf8;
  --sky-l: #cfe7ff;
  --cherry: #ef4060;
  --green: #18a35c;
  --red: #e2385d;
  --lcd: #e4edcc;
  --lcd-ink: #2b3524;
  --night: #1d1840;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(42, 29, 61, 0.9);
  --shadow-s: 0 4px 0 rgba(42, 29, 61, 0.9);
  --font-pixel: 'Tiny5', ui-monospace, monospace;
  --font: 'Fredoka', ui-rounded, system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-synthesis: none; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 141, 177, 0.22) 1.5px, transparent 2px),
    radial-gradient(circle at 13px 13px, rgba(164, 139, 255, 0.16) 1.5px, transparent 2px);
  background-size: 24px 24px;
  overflow-x: hidden;
  min-height: 100vh;
}
img, canvas { max-width: 100%; }
canvas.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--pink); color: #fff; }
h1, h2, h3, .pixel { font-family: var(--font-pixel); font-weight: 700; letter-spacing: 0.01em; line-height: 1.05; margin: 0; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.up { color: var(--green); }
.down { color: var(--red); }
.hide { display: none !important; }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 243, 247, 0.82);
  border-bottom: 3px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-pixel); font-size: 26px; font-weight: 700; }
.logo canvas { width: 44px; height: 44px; }
.logo b { color: var(--pink); -webkit-text-stroke: 0; text-shadow: 2px 2px 0 var(--ink); }
.nav { display: flex; gap: 6px; margin-left: 8px; }
.nav a { text-decoration: none; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.nav a:hover, .nav a.on { background: var(--pink-l); }
.top .spacer { flex: 1; }
.adopt { display: flex; align-items: center; background: #fff; border: 3px solid var(--line); border-radius: 999px; padding: 3px 3px 3px 14px; box-shadow: var(--shadow-s); }
.adopt input { border: 0; outline: 0; font: inherit; font-size: 14px; width: 210px; background: transparent; color: var(--ink); }
.adopt button { border: 0; background: var(--lilac); color: #fff; font-weight: 700; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.burger { display: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 700; font-size: 17px; text-decoration: none;
  padding: 13px 22px; border-radius: 999px; border: 3px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-s);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.btn.pink { background: var(--pink); color: #fff; text-shadow: 1px 1px 0 rgba(42, 29, 61, 0.35); }
.btn.mint { background: var(--mint); color: #fff; text-shadow: 1px 1px 0 rgba(42, 29, 61, 0.3); }
.btn.lilac { background: var(--lilac); color: #fff; text-shadow: 1px 1px 0 rgba(42, 29, 61, 0.3); }
.btn.lemon { background: var(--lemon); }
.btn.ink { background: var(--ink); color: #fff; }
.btn.small { padding: 8px 14px; font-size: 15px; }
.btn.big { padding: 17px 30px; font-size: 20px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-size: 14px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--lcd); color: var(--lcd-ink); border: 2px solid var(--line); white-space: nowrap; }
.pill.moon { background: var(--night); color: #ffd65a; }
.pill.happy, .pill.eating { background: var(--mint-l); }
.pill.sad, .pill.sick { background: #ffd3dc; }
.pill.sleepy { background: #2c3360; color: #dfe3ff; }
.pill.hungry { background: var(--lemon-l); }
.pill.dead { background: #e3dff0; }
.pill.hatch { background: var(--lilac-l); }

.card { background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- tamagotchi device */
.tama { position: relative; width: min(380px, 86vw); aspect-ratio: 380 / 476; margin-inline: auto; container-type: inline-size; user-select: none; -webkit-user-select: none; }
.tama-ears { position: absolute; inset: 0; pointer-events: none; }
.tama-ears svg { position: absolute; top: 2.5%; width: 34%; height: auto; overflow: visible; }
.tama-ears .l { left: 4%; }
.tama-ears .r { right: 4%; transform: scaleX(-1); }
.tama-ring { position: absolute; left: 50%; top: 2.2%; width: 12%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; border: 2.4cqw solid #d9d8ea; box-shadow: 0 0 0 0.8cqw var(--line), inset 0 0 0 0.8cqw var(--line); background: transparent; }
.tama-ring::after { content: ''; position: absolute; inset: -2.4cqw; border-radius: 50%; background: linear-gradient(140deg, rgba(255, 255, 255, 0.9), transparent 40%); mix-blend-mode: soft-light; }
.tama-body {
  position: absolute; left: 0; right: 0; top: 11%; bottom: 0;
  border-radius: 50% 50% 46% 46% / 52% 52% 48% 48%;
  background:
    radial-gradient(70% 55% at 32% 22%, rgba(255, 255, 255, 0.75), transparent 55%),
    radial-gradient(120% 100% at 50% 0%, var(--shell-a) 30%, var(--shell-b) 100%);
  border: 0.9cqw solid var(--line);
  box-shadow: inset -3cqw -4cqw 7cqw rgba(42, 29, 61, 0.16), inset 2cqw 2cqw 5cqw rgba(255, 255, 255, 0.6), 0 2.2cqw 0 rgba(42, 29, 61, 0.9);
}
.tama.gold .tama-body::before, .tama.clear .tama-body::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0.4cqw, transparent 0.6cqw);
  background-size: 7cqw 7cqw; opacity: 0.35;
}
.tama-brand { position: absolute; top: 8%; left: 0; right: 0; text-align: center; font-family: var(--font-pixel); font-weight: 700; font-size: 4.2cqw; letter-spacing: 0.12em; color: color-mix(in srgb, var(--line) 70%, var(--shell-b)); opacity: 0.85; }
.tama-brand::before, .tama-brand::after { content: '♥'; color: color-mix(in srgb, var(--shell-b) 60%, var(--cherry)); margin: 0 1.6cqw; font-size: 3.4cqw; }
.tama-bezel {
  position: absolute; left: 14.5%; right: 14.5%; top: 16%;
  border-radius: 9cqw 9cqw 11cqw 11cqw;
  background: color-mix(in srgb, var(--shell-b) 62%, var(--line));
  border: 0.8cqw solid var(--line);
  box-shadow: inset 0 1.4cqw 0 rgba(255, 255, 255, 0.18), inset 0 -1.6cqw 0 rgba(0, 0, 0, 0.18);
  padding: 2.4cqw 3.6cqw 2.6cqw;
  display: flex; flex-direction: column; gap: 1.4cqw;
}
.tama-icons { display: flex; justify-content: space-between; padding: 0 1cqw; }
.tama-icons i { width: 5.6cqw; aspect-ratio: 1; display: block; opacity: 0.32; transition: opacity 0.2s; filter: drop-shadow(0 0.3cqw 0 rgba(0, 0, 0, 0.25)); }
.tama-icons i canvas { width: 100%; height: 100%; display: block; }
.tama-icons i.on { opacity: 1; }
.tama-icons i.blink { animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.tama-screen { position: relative; aspect-ratio: 80 / 64; border-radius: 2.6cqw; overflow: hidden; background: var(--lcd); border: 0.7cqw solid #1a1527; box-shadow: inset 0 0 0 0.6cqw rgba(0, 0, 0, 0.15); }
.tama-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.tama-screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(30, 40, 20, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 40, 20, 0.07) 1px, transparent 1px),
    linear-gradient(155deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 38%);
  background-size: calc(100% / 80) calc(100% / 64), calc(100% / 80) calc(100% / 64), 100% 100%;
}
.tama-buttons { position: absolute; left: 0; right: 0; bottom: 7%; height: 15%; }
.tama-buttons button {
  position: absolute; width: 11.5cqw; aspect-ratio: 1; border-radius: 50%; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--btn, #fff3c4) 45%, color-mix(in srgb, var(--btn, #ffd65a) 70%, var(--line)) 100%);
  border: 0.8cqw solid var(--line);
  box-shadow: 0 1.3cqw 0 var(--line);
  transition: transform 0.06s, box-shadow 0.06s;
  -webkit-tap-highlight-color: transparent;
}
.tama-buttons button:active, .tama-buttons button.pressed { transform: translateY(1.2cqw); box-shadow: 0 0.1cqw 0 var(--line); }
.tama-buttons button[data-b='a'] { left: 25%; top: 4%; }
.tama-buttons button[data-b='b'] { left: 50%; top: 26%; transform: translateX(-50%); }
.tama-buttons button[data-b='b']:active, .tama-buttons button[data-b='b'].pressed { transform: translateX(-50%) translateY(1.2cqw); }
.tama-buttons button[data-b='c'] { right: 25%; top: 4%; }
.tama-buttons span { position: absolute; font-family: var(--font-pixel); font-size: 3cqw; font-weight: 700; color: color-mix(in srgb, var(--line) 70%, var(--shell-b)); opacity: 0.8; transform: translateX(-50%); white-space: nowrap; }
.tama-buttons span.a { left: calc(25% + 5.75cqw); top: calc(4% + 14.5cqw); }
.tama-buttons span.b { left: 50%; top: calc(26% + 14.5cqw); }
.tama-buttons span.c { right: calc(25% + 5.75cqw); top: calc(4% + 14.5cqw); transform: translateX(50%); }
.tama.bounce { animation: tama-bounce 0.35s ease; }
@keyframes tama-bounce { 30% { transform: translateY(-6px) rotate(-1.2deg); } 60% { transform: translateY(1px) rotate(0.8deg); } }
.tama .mute { position: absolute; right: 3%; bottom: 3%; width: 9cqw; aspect-ratio: 1; border-radius: 50%; border: 0.6cqw solid var(--line); background: #fff; font-size: 4.4cqw; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: 0 0.8cqw 0 var(--line); }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; padding: 56px 0 40px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6.4vw, 82px); line-height: 0.98; }
.hero h1 .hl { color: var(--pink); text-shadow: 3px 3px 0 var(--ink); }
.hero h1 .hl2 { color: var(--mint); text-shadow: 3px 3px 0 var(--ink); }
.hero p.lead { font-size: 20px; color: var(--ink-2); max-width: 540px; margin: 22px 0 28px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero .rules { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero .rules .chip { font-size: 15px; padding: 6px 14px; box-shadow: 0 3px 0 var(--line); }
.stage { position: relative; }
.stage .tama { width: min(360px, 82vw); }
.story { margin: 26px auto 0; width: min(420px, 92vw); background: #fff; border: 3px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-s); padding: 12px 14px 10px; }
.story .cap { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--font-pixel); font-weight: 700; font-size: 18px; min-height: 26px; }
.story .cap small { font-family: var(--font); font-weight: 600; font-size: 13px; color: var(--muted); }
.story canvas { width: 100%; height: 76px; display: block; margin-top: 6px; }
.floaty { position: absolute; pointer-events: none; image-rendering: pixelated; animation: floaty 6s ease-in-out infinite; opacity: 0.9; }
@keyframes floaty { 50% { transform: translateY(-14px) rotate(4deg); } }

/* ---------------------------------------------------------------- sections */
section { padding: 64px 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(30px, 4vw, 46px); }
.sec-head p { margin: 8px 0 0; color: var(--muted); font-size: 18px; max-width: 560px; }
.band { background: var(--ink); color: #fff; position: relative; }
.band .sec-head p { color: #c9bfe0; }
.band .empty { background: #fff; color: var(--ink); }
.band .tabs button { border-color: #fff; box-shadow: 0 3px 0 rgba(255,255,255,.5); }
.band .tabs button.on { background: var(--pink); color: #fff; }
.band::before, .band::after { content: ''; position: absolute; left: 0; right: 0; height: 18px; background: radial-gradient(circle at 12px 0, transparent 12px, var(--ink) 12.5px) repeat-x; background-size: 24px 18px; }
.band::before { top: -17px; transform: rotate(180deg); }
.band::after { bottom: -17px; }

.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.how .card { padding: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.how .card .lcd-mini { aspect-ratio: 80 / 64; }
.how h3 { font-size: 24px; }
.how p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.how .tag { align-self: flex-start; }

.lcd-mini { position: relative; border-radius: 14px; overflow: hidden; border: 3px solid var(--line); background: var(--lcd); }
.lcd-mini canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.lcd-mini::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(155deg, rgba(255, 255, 255, 0.25), transparent 40%); }

/* ticker */
.ticker { border-block: 3px solid var(--line); background: var(--lemon); overflow: hidden; white-space: nowrap; }
.ticker .track { display: inline-flex; gap: 38px; padding: 10px 0; animation: tick 60s linear infinite; font-weight: 600; }
.ticker .track span { display: inline-flex; gap: 8px; align-items: center; }
.ticker a { text-decoration: none; font-weight: 700; }
@keyframes tick { to { transform: translateX(-50%); } }

/* nursery */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { border: 3px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 16px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.tabs button.on { background: var(--ink); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.cat-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; text-decoration: none; transition: transform 0.12s; background: #fff; border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cat-card:hover { transform: translateY(-4px) rotate(-0.4deg); }
.cat-card .lcd-mini { aspect-ratio: 80 / 64; border-color: var(--line); background: var(--frame, var(--lcd)); padding: 6px; }
.cat-card .lcd-mini canvas { border-radius: 8px; }
.cat-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cat-card .sym { font-family: var(--font-pixel); font-weight: 700; font-size: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-card .name { color: var(--muted); font-size: 14px; margin-top: -8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-card .stats { display: flex; gap: 10px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.bar { height: 10px; border-radius: 999px; border: 2px solid var(--line); background: #f4eefb; overflow: hidden; }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--lilac) 0 6px, #b8a5ff 6px 12px); }
.bar.grad i { background: repeating-linear-gradient(-45deg, var(--lemon) 0 6px, #ffe58f 6px 12px); }
.empty { padding: 46px 20px; text-align: center; border: 3px dashed var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.6); }
.empty canvas { width: 160px; display: block; margin: 0 auto 12px; }
.empty h3 { font-size: 26px; margin-bottom: 8px; }

/* trait wall */
.wall { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.wall .w { position: relative; aspect-ratio: 1; border-radius: 16px; border: 3px solid var(--line); overflow: hidden; background: #fff; cursor: pointer; transition: transform 0.12s; }
.wall .w:hover { transform: scale(1.06) rotate(-2deg); z-index: 2; }
.wall .w canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.wall .w b { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--ink); color: #fff; letter-spacing: 0.04em; text-transform: uppercase; }
.tier-common { --tier: #b8b0c8; }
.tier-uncommon { --tier: var(--mint); }
.tier-rare { --tier: var(--sky); }
.tier-epic { --tier: var(--lilac); }
.tier-legendary { --tier: #ffb020; }
.wall .w b { background: var(--tier); color: var(--ink); }

/* faq */
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.faq details { background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 16px 20px; box-shadow: var(--shadow-s); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: '+'; font-family: var(--font-pixel); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq p { margin: 10px 0 0; color: var(--ink-2); }

/* footer */
footer { border-top: 3px solid var(--line); background: #fff; padding: 34px 0 40px; margin-top: 40px; }
footer .wrap { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
footer small { color: var(--muted); }

/* ---------------------------------------------------------------- cat page */
.cat-page { padding: 34px 0 20px; }
.cat-grid { display: grid; grid-template-columns: 420px 1fr; gap: 34px; align-items: start; }
.cat-left { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.cat-left .tama { width: min(400px, 88vw); }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.panel { padding: 22px; }
.coin-head { display: flex; gap: 16px; align-items: center; }
.coin-head .ava { width: 84px; height: 84px; border-radius: 20px; border: 3px solid var(--line); flex: none; overflow: hidden; background: #fff; }
.coin-head .ava canvas, .coin-head .ava img { width: 100%; height: 100%; display: block; image-rendering: pixelated; object-fit: cover; }
.coin-head h1 { font-size: clamp(30px, 4vw, 44px); overflow-wrap: anywhere; }
.coin-head .sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.ca { font-family: ui-monospace, monospace; font-size: 13px; cursor: pointer; }
.mood-line { margin: 18px 0 4px; font-size: 20px; font-weight: 600; }
.mood-line b { font-family: var(--font-pixel); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.tile { border: 3px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; }
.tile small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.tile b { display: block; font-family: var(--font-pixel); font-size: 26px; line-height: 1.15; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile em { font-style: normal; font-weight: 700; font-size: 14px; }
.vitals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.vit { border: 3px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.vit small { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.hearts { font-size: 24px; letter-spacing: 3px; color: var(--red); line-height: 1; }
.hearts .off { color: #e7dcef; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dna { margin-top: 22px; }
.dna h3 { font-size: 22px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.dna table { width: 100%; border-collapse: collapse; font-size: 15px; }
.dna td { padding: 7px 0; border-bottom: 2px dashed #eadff3; }
.dna td:last-child { text-align: right; font-weight: 600; }
.stars { color: #ffb020; letter-spacing: 2px; }
.stars .off { color: #e7dcef; }
.chart-card { margin-top: 28px; padding: 18px; }
.chart-card h3 { font-size: 24px; }
.chart-wrap { position: relative; height: 260px; margin-top: 12px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; padding: 4px 9px; border-radius: 8px; transform: translate(-50%, -130%); white-space: nowrap; display: none; }
.diary { margin-top: 28px; padding: 18px 22px; }
.diary h3 { font-size: 24px; margin-bottom: 8px; }
.diary ul { list-style: none; margin: 0; padding: 0; }
.diary li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 2px dashed #eadff3; font-size: 15.5px; }
.diary li time { color: var(--muted); font-size: 13px; min-width: 92px; padding-top: 2px; }
.rip { margin-top: 18px; padding: 18px; border-radius: 18px; border: 3px solid var(--line); background: linear-gradient(180deg, #2a2456, #463a7c); color: #fff; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.rip h3 { font-size: 26px; }
.rip p { margin: 4px 0 0; color: #d8d0f5; }
.rip .btn { margin-left: auto; }
.notice { padding: 14px 16px; border-radius: 16px; border: 3px solid var(--line); background: var(--lemon-l); font-weight: 600; }

/* ---------------------------------------------------------------- launch */
.launch-page { padding: 36px 0 20px; }
.launch-grid { display: grid; grid-template-columns: 420px 1fr; gap: 34px; align-items: start; }
.incubator { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.incubator .tama { width: min(390px, 88vw); }
.dna-card { width: 100%; padding: 16px 18px; }
.dna-card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dna-card .head b { font-family: var(--font-pixel); font-size: 22px; }
.traits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.traits .chip { font-size: 13px; padding: 3px 10px; }
.reroll { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.form { padding: 26px; }
.form h1 { font-size: clamp(34px, 4.6vw, 52px); }
.form .lead { color: var(--ink-2); margin: 10px 0 22px; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; gap: 10px; }
.field label small { color: var(--muted); font-weight: 500; }
.input, textarea.input, select.input {
  font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 3px solid var(--line); border-radius: 14px;
  padding: 11px 14px; outline: none; width: 100%; transition: box-shadow 0.12s;
}
.input:focus { box-shadow: 0 0 0 4px var(--pink-l); }
textarea.input { min-height: 112px; resize: vertical; line-height: 1.45; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.quick button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; font-weight: 700; cursor: pointer; font-size: 14px; }
.quick button.on { background: var(--mint-l); }
.field label.check { justify-content: flex-start; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--pink); }
details.adv { margin: 4px 0 18px; }
details.adv summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.wallet-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.wallet-row .who { font-family: ui-monospace, monospace; font-size: 14px; }
.fine { font-size: 13.5px; color: var(--muted); margin-top: 14px; }
.cost { display: flex; justify-content: space-between; font-size: 15px; padding: 10px 14px; border-radius: 14px; background: #faf5ff; border: 2px dashed #d9cdea; margin-bottom: 16px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(29, 24, 64, 0.55); backdrop-filter: blur(4px); padding: 16px; }
.modal .box { width: min(460px, 100%); padding: 24px; text-align: center; }
.modal h3 { font-size: 30px; margin-bottom: 6px; }
.modal .lcd-mini { width: 240px; aspect-ratio: 80 / 64; margin: 14px auto; }
.steps { text-align: left; list-style: none; padding: 0; margin: 16px 0; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-weight: 600; color: var(--muted); }
.steps li::before { content: '○'; font-family: var(--font-pixel); width: 20px; text-align: center; }
.steps li.doing { color: var(--ink); }
.steps li.doing::before { content: '◐'; animation: spin 1s steps(4) infinite; }
.steps li.done { color: var(--green); }
.steps li.done::before { content: '✓'; }
.steps li.fail { color: var(--red); }
.steps li.fail::before { content: '✕'; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal .err { color: var(--red); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.modal .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(140%); z-index: 200; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; border: 3px solid var(--line); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.6, 1); max-width: calc(100vw - 32px); text-align: center; }
.toast.on { transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- graveyard */
.yard-hero { position: relative; background: linear-gradient(180deg, #120e2b 0%, #2a2456 60%, #463a7c 100%); color: #fff; padding: 70px 0 110px; overflow: hidden; border-bottom: 3px solid var(--line); }
.yard-hero h1 { font-size: clamp(44px, 7vw, 86px); text-shadow: 4px 4px 0 #000; }
.yard-hero p { color: #d8d0f5; font-size: 20px; max-width: 620px; margin: 16px 0 0; }
.yard-hero .moon { position: absolute; right: 8%; top: 40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fffbe0, #ffe27a 60%, #f2c14a); box-shadow: 0 0 80px rgba(255, 226, 122, 0.55); }
.yard-hero .stars { position: absolute; inset: 0; background-image: radial-gradient(circle, #fff 1px, transparent 1.5px), radial-gradient(circle, #c8cdf5 1px, transparent 1.5px); background-size: 90px 90px, 140px 140px; background-position: 10px 20px, 60px 80px; opacity: 0.7; }
.yard-hero .fog { position: absolute; left: -10%; right: -10%; bottom: -30px; height: 120px; background: radial-gradient(60% 100% at 50% 100%, rgba(226, 220, 245, 0.55), transparent 70%); filter: blur(6px); }
.yard-hero .counts { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.yard-hero .counts .chip { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.yard { background: linear-gradient(180deg, #463a7c 0, #e8e3f6 260px, var(--bg) 520px); padding-top: 30px; }
.graves { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.grave { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: #f6f3fc; border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; transition: transform 0.12s; }
.grave:hover { transform: translateY(-4px); }
.grave .lcd-mini { aspect-ratio: 80 / 64; background: #d9d4ea; }
.grave .sym { font-family: var(--font-pixel); font-weight: 700; font-size: 20px; }
.grave .cause { font-size: 14px; font-weight: 700; color: var(--red); }
.grave .meta { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.grave .f { align-self: flex-start; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1020px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-inline: auto; }
  .hero .cta, .hero .rules { justify-content: center; }
  .how { grid-template-columns: 1fr 1fr; }
  .wall { grid-template-columns: repeat(6, 1fr); }
  .cat-grid, .launch-grid { grid-template-columns: 1fr; }
  .cat-left, .incubator { position: static; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .adopt input { width: 150px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .top .wrap { height: 60px; gap: 10px; }
  .logo { font-size: 21px; }
  .logo canvas { width: 36px; height: 36px; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); border-bottom: 3px solid var(--line); flex-direction: column; padding: 10px 16px; }
  .nav.open { display: flex; }
  .burger { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 3px solid var(--line); background: #fff; font-size: 20px; cursor: pointer; }
  .adopt { display: none; }
  .nav .adopt-m { display: flex; }
  .how { grid-template-columns: 1fr; }
  .wall { grid-template-columns: repeat(4, 1fr); }
  .faq { grid-template-columns: 1fr; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .vitals { grid-template-columns: 1fr; }
  section { padding: 46px 0; }
  .form { padding: 18px; }
  .panel { padding: 16px; }
  .tile b { font-size: 22px; }
  .rip .btn { margin-left: 0; }
}
.adopt-m { display: none; gap: 8px; margin-top: 8px; }
.adopt-m input { flex: 1; min-width: 0; }
