/* KeyBattle - plain CSS, no build step. */
:root {
  --ink: #0f1222; --soft: #475069; --muted: #7c859e; --ground: #f6f7fb; --panel: #ffffff; --line: #e4e7f0;
  --accent: #4f46e5; --accent-2: #06b6d4; --accent-ink: #ffffff; --ok: #15803d; --bad: #c2362b; --bad-bg: #fde4e1; --ghost: #f59e0b;
  --grad: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --night: #0f1222;
  --shadow: 0 1px 2px rgba(15,18,34,.05), 0 10px 30px rgba(15,18,34,.07);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", "Noto Sans KR", "Malgun Gothic", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--ground); line-height: 1.5; }
a { color: var(--accent); }

/* header / footer */
.top { display: flex; align-items: center; gap: 1.5rem; padding: .8rem 1.5rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--ink); letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 1rem; }
.nav a, .tools a { color: var(--soft); text-decoration: none; }
.nav a.on, .nav a:hover { color: var(--ink); font-weight: 600; }
.tools { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.tools a.btn { color: var(--accent-ink); }
.me { font-weight: 600; }
.inline { display: inline; margin: 0; }
.linkish { background: none; border: 0; color: var(--soft); cursor: pointer; font: inherit; padding: 0; }
.langs { position: relative; }
.langs summary { cursor: pointer; list-style: none; color: var(--soft); }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: " ▾"; }
.langs .menu { position: absolute; right: 0; top: 1.8rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; z-index: 10; min-width: 9rem; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.langs .menu a { display: block; padding: .35rem .6rem; border-radius: 6px; color: var(--ink); }
.langs .menu a.on, .langs .menu a:hover { background: var(--ground); }
.foot { text-align: center; color: var(--muted); font-size: .9rem; padding: 2rem 1rem 3rem; }
.foot nav { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }
.foot a { color: var(--muted); }

.wrap { max-width: 980px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.page h1 small, .h-play small { font-size: .55em; color: var(--muted); font-weight: 500; }
.narrow { max-width: 560px; margin: 0 auto; }
.lead { color: var(--soft); }
.note-small { color: var(--muted); font-size: .88rem; }

/* buttons */
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius); padding: .65rem 1.2rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn-alt { background: var(--ink); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-small { padding: .35rem .8rem; font-size: .92rem; }
.btn:disabled { opacity: .6; cursor: default; }

/* play */
.h-play { font-size: 1.4rem; margin: 0 0 .8rem; }
.modes { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.modes button { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; font: inherit; cursor: pointer; color: var(--soft); }
.modes button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.stats { display: flex; gap: 2rem; margin: .5rem 0 1rem; }
.stats div { display: flex; flex-direction: column; }
.stats span { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--accent); }
.stats small { color: var(--muted); font-size: .8rem; }
.stage { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem .8rem; }
.text { font-size: 1.55rem; line-height: 2.2rem; height: calc(2.2rem * 3); overflow: hidden; color: #9a9ea6; cursor: text; word-break: keep-all; overflow-wrap: anywhere; user-select: none; }
.text.script-latin { font-family: var(--mono); }
.text.script-han { word-break: break-all; letter-spacing: .05em; }
.text span { border-radius: 3px; }
.text span.ok { color: var(--ink); }
.text span.bad { color: var(--bad); background: var(--bad-bg); }
.text span.sp.bad { box-shadow: inset 0 -3px 0 var(--bad); }
.text span.pend { color: var(--accent); }
.text span.cur { box-shadow: inset 2px 0 0 var(--accent); animation: blink 1s steps(1) infinite; }
.text span.ghost { box-shadow: inset 0 -4px 0 var(--ghost); }
@keyframes blink { 50% { box-shadow: inset 2px 0 0 transparent; } }
.catcher { position: absolute; left: 0; top: 0; width: 2px; height: 2rem; opacity: 0; border: 0; padding: 0; resize: none; overflow: hidden; caret-color: transparent; }
.hint { text-align: center; color: var(--muted); margin: .6rem 0 0; font-size: .92rem; }

/* result */
.result { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin-top: 1rem; }
.res-big strong { font-size: 3.2rem; color: var(--accent); line-height: 1; }
.res-big span { color: var(--muted); font-size: 1.1rem; }
.res-grid { display: grid; grid-template-columns: max-content auto; gap: .2rem 1rem; margin: 1rem 0; }
.res-grid dt { color: var(--muted); }
.res-grid dd { margin: 0; font-weight: 600; }
.res-slow kbd { display: inline-block; min-width: 1.6rem; text-align: center; padding: .1rem .35rem; margin-right: .3rem; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 5px; font-family: var(--mono); background: var(--ground); }
.res-ghost.win { color: var(--ok); font-weight: 600; }
.res-ghost.lose { color: var(--soft); font-weight: 600; }
.res-note { color: var(--soft); }
.res-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.res-link { display: flex; align-items: center; gap: .5rem; flex: 1 1 18rem; }
.res-link input { flex: 1; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: var(--ground); }

/* leaderboard */
.tabs { display: flex; gap: .4rem; margin: 1rem 0; flex-wrap: wrap; }
.tabs a { padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--soft); }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.board { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.board th, .board td { padding: .55rem .9rem; border-bottom: 1px solid var(--line); text-align: left; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board tbody tr:first-child td { font-weight: 700; }
.empty { color: var(--muted); padding: 2rem 0; }

/* forms */
.form { display: flex; flex-direction: column; gap: .9rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.form label small { font-weight: 400; color: var(--muted); }
.form input, .form textarea { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); }
.form .check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.errors { color: var(--bad); margin: 0; padding-left: 1.2rem; }
.ok-box { background: #e4f3ea; color: var(--ok); padding: .7rem 1rem; border-radius: var(--radius); }
.legal h2 { font-size: 1.1rem; margin-top: 1.6rem; }

@media (max-width: 640px) {
  .top { gap: .8rem; padding: .7rem 1rem; }
  .tools { margin-left: 0; width: 100%; }
  .text { font-size: 1.25rem; line-height: 1.9rem; height: calc(1.9rem * 3); }
  .stage { padding: 1rem; }
  .stats span { font-size: 1.6rem; }
}

/* ---- Phase 2: lessons, races, Scripture, Pro, account ---- */
.back { margin: 0 0 .4rem; font-size: .92rem; }
.back a { color: var(--muted); text-decoration: none; }
.pro-link { font-weight: 700; color: var(--ghost) !important; }
.note-box { background: #fff7e6; border: 1px solid #f3dca8; padding: .8rem 1rem; border-radius: var(--radius); }
.res-note.pass { color: var(--ok); font-weight: 600; }
.res-note.retry { color: var(--bad); }

.lessons { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: .5rem; }
.lessons li { display: grid; grid-template-columns: 2.4rem 1fr auto auto; align-items: center; gap: .8rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; }
.lessons .num { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--ground); font-weight: 700; }
.lessons li.done .num { background: var(--ok); color: #fff; }
.lessons li.locked { opacity: .65; }
.lessons .what { display: flex; flex-direction: column; }
.lessons .keys { font-family: var(--mono); color: var(--soft); letter-spacing: .08em; }
.lessons .state { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

.progress-line { display: flex; align-items: center; gap: .6rem; }
.bar { flex: 1; max-width: 22rem; height: .5rem; background: var(--line); border-radius: 999px; overflow: hidden; display: inline-block; }
.bar span { display: block; height: 100%; background: var(--ok); }
.bible-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr)); gap: .4rem; margin: 1rem 0; }
.bible-map .book { position: relative; display: block; padding: .5rem .55rem; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .88rem; overflow: hidden; }
.bible-map .book::before { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; width: var(--pct); background: var(--ok); }
.bible-map .book.nt { border-color: #d7dff1; }
.bible-map .book.full { background: #e4f3ea; border-color: #b9dcc6; }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.8rem, 1fr)); gap: .35rem; margin: 1rem 0 1.5rem; }
.chapters .ch { text-align: center; padding: .45rem 0; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-variant-numeric: tabular-nums; }
.chapters .ch.some { border-color: var(--ok); }
.chapters .ch.full { background: var(--ok); color: #fff; border-color: var(--ok); }

.compare { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; margin: 1rem 0 1.5rem; }
.compare th, .compare td { padding: .55rem .9rem; border-bottom: 1px solid var(--line); text-align: left; }
.compare th:last-child, .compare td:last-child { background: #f1f5ff; font-weight: 600; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.plan h2 { margin: 0; font-size: 1.1rem; }
.plan .price { font-size: 2.2rem; font-weight: 800; margin: .3rem 0; color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.card h2 { font-size: 1rem; margin: 0 0 .4rem; color: var(--soft); }
.card .big { font-size: 2rem; font-weight: 800; margin: 0; }
.pager { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }
.ad { margin: 2rem 0 0; min-height: 90px; }
.locked-box { text-align: center; padding-top: 2rem; }

.notebook header { border-bottom: 2px solid var(--ink); margin-bottom: 1rem; }
.nb-chapter h2 { font-size: 1.1rem; margin: 1.4rem 0 .4rem; }
.nb-chapter h2 small { color: var(--muted); font-weight: 400; }
.nb-chapter p { line-height: 1.8; margin: .2rem 0; }
@media print {
  .top, .foot, .no-print, .ad { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .nb-chapter { break-inside: avoid-page; }
}
@media (max-width: 640px) {
  .lessons li { grid-template-columns: 2.2rem 1fr auto; }
  .lessons .state { display: none; }
}

/* ---- admin ---- */
.admin .logo small { font-size: .7rem; color: var(--muted); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.btn-danger { background: var(--bad); }
.card.danger { border-color: #efc3bd; }
.card.form { gap: .5rem; }
.search { display: flex; gap: .5rem; margin: 1rem 0; }
.search input { flex: 1; max-width: 22rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; margin: .7rem 0; }
.msg header { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; color: var(--soft); }
.msg.handled { opacity: .6; }
.board.log .details { font-family: var(--mono); font-size: .8rem; color: var(--soft); max-width: 28rem; overflow-wrap: anywhere; }
.admin .board td, .admin .board th { font-size: .92rem; }

/* ---- Phase 3: fun modes ---- */
.menu-left { left: 0; right: auto; }
.play-menu summary.on { color: var(--ink); font-weight: 600; }
.nav { align-items: center; }
.tools-bar { display: flex; gap: .6rem; justify-content: flex-end; margin: -.4rem 0 .4rem; flex-wrap: wrap; }
.tool { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; }
.tool select { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: .1rem .3rem; }
.tool-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .15rem .6rem; cursor: pointer; }
.tool-btn.on { border-color: var(--accent); color: var(--accent); }

/* live keyboard */
.vkb { margin: 1rem auto 0; display: flex; flex-direction: column; gap: .3rem; align-items: center; user-select: none; }
.vkb-row { display: flex; gap: .3rem; }
.vkb-row.r1 { margin-left: 1.2rem; } .vkb-row.r2 { margin-left: 2rem; } .vkb-row.r3 { margin-left: 0; }
.vkb .key { width: 2.3rem; height: 2.3rem; border-radius: 6px; display: grid; place-items: center; font-size: .95rem; background: var(--panel); border: 1px solid var(--line); border-bottom-width: 3px; color: var(--soft); transition: background .15s, transform .08s; }
.vkb .key.wide { width: 3.6rem; }
.vkb .key.space { width: 15rem; }
.vkb .key.f0, .vkb .key.f7 { box-shadow: inset 0 -3px 0 #e8d5f5; }
.vkb .key.f1, .vkb .key.f6 { box-shadow: inset 0 -3px 0 #d5e6f5; }
.vkb .key.f2, .vkb .key.f5 { box-shadow: inset 0 -3px 0 #d6f0dd; }
.vkb .key.f3, .vkb .key.f4 { box-shadow: inset 0 -3px 0 #f8e6c8; }
.vkb .key.next { background: var(--accent); color: #fff; border-color: var(--accent); }
.vkb .key.hit { animation: kh .25s; }
.vkb .key.miss { animation: km .3s; }
@keyframes kh { 0% { transform: translateY(2px); background: #cfe9d8; } }
@keyframes km { 0% { background: var(--bad-bg); transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@media (max-width: 760px) { .vkb { display: none; } }

/* signature */
.res-sig { margin: 1.2rem 0 0; }
.res-sig canvas { width: 100%; max-width: 360px; border-radius: 12px; display: block; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.res-sig figcaption { margin-top: .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: var(--soft); }

/* boss */
.arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1rem; background: linear-gradient(180deg, #1d2030, #2b2f45); color: #fff; border-radius: var(--radius); padding: 1rem 1.2rem; margin: .4rem 0 .6rem; }
.fighter { text-align: center; }
.fighter .who { font-weight: 700; margin: .2rem 0; color: #fff; }
.monster { width: 130px; height: 130px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); animation: idle 2.4s ease-in-out infinite; }
.monster.hurt { animation: hurt .35s; }
@keyframes idle { 50% { transform: translateY(-4px); } }
@keyframes hurt { 0% { transform: translateX(-6px) rotate(-3deg); filter: brightness(2); } 60% { transform: translateX(5px); } }
.you-badge { font-size: 3rem; line-height: 130px; height: 130px; }
.you-side.hurt { animation: hurt .35s; }
.hp { height: .7rem; background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden; }
.hp span { display: block; height: 100%; transition: width .25s; }
.boss-hp span { background: linear-gradient(90deg, #e2473b, #f39a3d); }
.you-hp span { background: linear-gradient(90deg, #3fae6a, #8ed98b); }
.hp-num { font-size: .8rem; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.vs { text-align: center; min-width: 6rem; align-self: center; }
.combo { font-size: 1.6rem; font-weight: 800; color: #ffd166; }
.hit-text { font-weight: 800; font-size: 1.3rem; opacity: 0; }
.hit-text.go { animation: rise .7s; }
.hit-text.boss { color: #ffb4a8; } .hit-text.you { color: #ff6b6b; }
@keyframes rise { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-24px); } }
.arena.won .monster { animation: none; opacity: .35; transform: rotate(-12deg) translateY(10px); transition: all .6s; }
.arena.lost .you-badge { opacity: .35; }
.community { display: flex; align-items: center; gap: .6rem; font-size: .88rem; color: var(--soft); margin-bottom: .8rem; flex-wrap: wrap; }
.res-boss { font-size: 1.2rem; font-weight: 700; }
.res-boss.won { color: var(--ok); } .res-boss.lost, .res-boss.time { color: var(--bad); }
@media (max-width: 640px) { .monster, .you-badge { width: 84px; height: 84px; line-height: 84px; font-size: 2rem; } }

/* rhythm */
.rh-stage { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.rh-top { display: flex; justify-content: center; align-items: center; gap: 1.5rem; }
.rh-ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--line) 0); }
.rh-score { font-size: 2rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.rh-combo { font-weight: 700; color: var(--ghost); min-width: 5rem; }
.rh-lane { display: flex; gap: 1.2rem; justify-content: center; align-items: baseline; margin: 1.4rem 0 .4rem; min-height: 3rem; overflow: hidden; }
.rh-word { color: var(--muted); font-size: 1.1rem; }
.rh-word.now { color: var(--ink); font-size: 2rem; font-weight: 700; }
.rh-grade { height: 1.6rem; font-weight: 800; opacity: 0; }
.rh-grade.go { animation: rise .6s; }
.rh-grade.perfect { color: var(--ok); } .rh-grade.good { color: var(--accent); } .rh-grade.miss { color: var(--bad); }
.rh-input { font: inherit; font-size: 1.5rem; text-align: center; padding: .5rem; width: min(22rem, 100%); border: 2px solid var(--line); border-radius: var(--radius); }
.rh-input:focus { outline: none; border-color: var(--accent); }
.rh-final { font-size: 2rem; font-weight: 800; margin: .6rem 0 0; }

/* pulse */
.pulse-big { display: flex; gap: 3rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.pulse-big div { display: flex; flex-direction: column; }
.pulse-big span { font-size: 3rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pulse-big small { color: var(--muted); }
.zones { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 70px; align-items: end; }
.zone { --v: 0; display: block; height: calc(8px + var(--v) * 62px); background: var(--line); border-radius: 3px; }
.zone.live { background: linear-gradient(180deg, var(--accent), #8fb3ff); animation: glow 2s ease-in-out infinite; }
.zone.mine { outline: 2px solid var(--ghost); outline-offset: 1px; }
@keyframes glow { 50% { filter: brightness(1.25); } }
.zone-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; margin-bottom: 1.5rem; }
.pulse-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.feed small { color: var(--muted); }
.langbars { list-style: none; padding: 0; margin: 0; }
.langbars li { display: grid; grid-template-columns: 5.5rem 1fr 3rem; gap: .5rem; align-items: center; padding: .3rem 0; }
.langbars b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .pulse-cols { grid-template-columns: 1fr; } }

/* ---- Phase 4: rooms, classroom, pet ---- */
.room { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: .4rem 0 .8rem; position: relative; }
.room-share { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--soft); }
.room-share input { flex: 1; min-width: 14rem; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--ground); }
.room-name { display: flex; gap: .5rem; align-items: end; margin-top: .8rem; flex-wrap: wrap; }
.room-name label { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; }
.room-name input { padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.lanes { list-style: none; padding: 0; margin: .9rem 0 .4rem; display: flex; flex-direction: column; gap: .35rem; }
.lane { display: grid; grid-template-columns: 9rem 1fr 6rem; gap: .6rem; align-items: center; }
.lane-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane.me .lane-name { color: var(--accent); }
.lane.away { opacity: .45; }
.lane-track { height: .8rem; background: var(--ground); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.lane-fill { display: block; height: 100%; background: linear-gradient(90deg, #8fb3ff, var(--accent)); transition: width .6s linear; }
.lane.me .lane-fill { background: linear-gradient(90deg, #ffd27a, var(--ghost)); }
.lane.done .lane-fill { background: var(--ok); }
.lane-speed { text-align: right; font-variant-numeric: tabular-nums; color: var(--soft); font-size: .9rem; }
.room-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; }
.room-status { color: var(--soft); }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4rem; font-weight: 800; color: var(--accent); background: rgba(255,255,255,.85); border-radius: var(--radius); }

.ticks { padding-left: 1.2rem; } .ticks li { margin: .3rem 0; }
.narrow-form { max-width: 28rem; }
.class-card { text-decoration: none; color: var(--ink); }
.class-card:hover { border-color: var(--accent); }
.join-box { display: flex; gap: 2rem; flex-wrap: wrap; align-items: end; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.join-box div { display: flex; flex-direction: column; }
.join-box small { color: var(--muted); }
.join-box .code { font-family: var(--mono); font-size: 2rem; letter-spacing: .15em; color: var(--accent); }
.join-link { flex: 1; min-width: 16rem; }
.join-link input { padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--ground); }
.goal { background: #fff7e6; border-radius: var(--radius); padding: .5rem .8rem; display: inline-block; }
.row-actions { display: flex; gap: .8rem; }
.row-actions form { margin: 0; }
.danger-text { color: var(--bad) !important; }
@media print { .no-print { display: none !important; } }

.pet-row, .pet-pick { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; }
.pet-pick label { display: flex; flex-direction: column; align-items: center; cursor: pointer; border: 2px solid transparent; border-radius: var(--radius); padding: .3rem; font-weight: 600; }
.pet-pick input { position: absolute; opacity: 0; }
.pet-pick label:has(input:checked) { border-color: var(--accent); background: #f1f5ff; }
.pet-home { text-align: center; background: linear-gradient(180deg, #eef5ff, var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.pet-home h2 { margin: .2rem 0; }
.pet-home h2 small { color: var(--muted); font-weight: 500; font-size: .7em; }
.pet-home .xp { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.pet-home .bar { width: 16rem; max-width: 100%; }
.mood { color: var(--soft); }
.pet-bob { animation: bob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.mood-sleepy .pet-bob { animation-duration: 5s; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.inline-form { flex-direction: row; align-items: end; margin-top: 1rem; }
.inline-form label { flex: 1; }
.res-pet { color: var(--ghost); font-weight: 700; }
@media (max-width: 640px) { .lane { grid-template-columns: 6rem 1fr 4.5rem; } }
.class-slots { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1.1rem; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; }
.class-slots p, .class-slots form { margin: 0; }
