:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090b10;
  color: #f5f7fb;
  --panel: rgba(19, 23, 32, .88);
  --line: rgba(255,255,255,.12);
  --muted: #a9b0c0;
  --accent: #a9ffcb;
  --accent2: #b6adff;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 18% 0%, rgba(98,82,255,.18), transparent 35%), radial-gradient(circle at 90% 15%, rgba(70,255,174,.10), transparent 30%), #090b10; }
main { width: min(1050px, calc(100% - 32px)); margin: 0 auto; padding: 60px 0 90px; }
.hero { display: grid; grid-template-columns: 72px 1fr; gap: 22px; align-items: start; margin-bottom: 34px; }
.sigil { width: 72px; height: 72px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 34px; background: linear-gradient(145deg, rgba(169,255,203,.18), rgba(182,173,255,.12)); border-radius: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.eyebrow { letter-spacing: .22em; font-size: 12px; color: var(--accent); margin: 4px 0 10px; }
h1 { margin: 0; font-size: clamp(38px, 7vw, 74px); line-height: .98; max-width: 900px; }
.hero p:last-child { color: var(--muted); max-width: 720px; font-size: 18px; line-height: 1.6; }
.panel { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(16px); border-radius: 24px; padding: 26px; margin: 20px 0; box-shadow: 0 28px 90px rgba(0,0,0,.25); }
.hidden { display: none !important; }
.section-title { display: flex; gap: 13px; align-items: center; margin-bottom: 20px; }
.section-title span { color: var(--accent); font-family: ui-monospace, monospace; }
h2, h3 { margin: 0; }
label { display: grid; gap: 8px; margin: 16px 0; color: var(--muted); font-size: 14px; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.28); color: white; padding: 13px 14px; font: inherit; }
textarea { min-height: 110px; resize: vertical; }
button { border: 0; border-radius: 13px; background: var(--accent); color: #06110b; padding: 13px 17px; font-weight: 800; cursor: pointer; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.secondary { background: var(--accent2); color: #100c25; }
button.danger { background: #ff9fa5; margin-top: 20px; }
.status { min-height: 1.4em; color: var(--muted); }
.compact-panel { padding: 20px 26px; }
.account-grid { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) auto; gap: 12px; align-items: end; }
.account-grid label { margin: 0; }
.account-buttons, .button-stack, .battle-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-session { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
button.quiet { background: rgba(255,255,255,.08); color: var(--muted); padding: 9px 12px; }
button.danger-text { color: #ff9fa5; }
.familiar-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.familiar-head h2 { font-size: 36px; }
.badge { border: 1px solid rgba(169,255,203,.3); color: var(--accent); padding: 7px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.familiar-meta { color: var(--muted); line-height: 1.55; }
.cert-line { color: var(--accent); font: 12px/1.5 ui-monospace, monospace; }
.spellbook { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 18px; }
.spell { border: 1px solid var(--line); padding: 13px; border-radius: 14px; background: rgba(255,255,255,.025); }
.spell strong { display: block; }
.spell small { color: var(--muted); }
.actions { display: flex; gap: 14px; justify-content: space-between; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.join-row { display: flex; gap: 8px; }
.join-row input { width: 150px; text-transform: uppercase; letter-spacing: .15em; }
.room-banner { color: var(--muted); margin-bottom: 18px; }
.connection { margin-left: auto; color: #ff9fa5; font: 11px ui-monospace, monospace; }
.connection.online { color: var(--accent); }
.fighters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.fighter { border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
progress.meter { appearance: none; display: block; width: 100%; height: 8px; border: 0; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; margin: 9px 0; }
progress.meter::-webkit-progress-bar { background: rgba(255,255,255,.08); }
progress.meter::-webkit-progress-value { background: linear-gradient(90deg, var(--accent2), var(--accent)); }
progress.meter::-moz-progress-bar { background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.hand { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.attack { text-align: left; min-height: 160px; background: linear-gradient(145deg, rgba(182,173,255,.16), rgba(169,255,203,.08)); color: white; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; }
.attack .cost { color: var(--accent); font-family: ui-monospace, monospace; }
.attack p { color: var(--muted); flex: 1; }
.attack small { color: white; opacity: .85; }
.battle-log { margin-top: 18px; border-left: 2px solid var(--accent2); padding-left: 14px; color: var(--muted); }
.battle-log pre { max-height: 280px; overflow: auto; white-space: pre-wrap; }
.battle-actions { align-items: center; margin-top: 20px; }
.battle-actions button { margin-top: 0; }
.site-footer { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); padding: 20px 4px 0; font-size: 13px; }
.site-footer a, .legal-page a { color: var(--accent); }
.legal-page { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 90px; line-height: 1.65; }
.legal-page h1 { font-size: clamp(34px, 7vw, 58px); }
.legal-page h2 { margin-top: 32px; }
.legal-page .notice { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--panel); color: var(--muted); }
@media (max-width: 760px) { .account-grid { grid-template-columns: 1fr; } .account-buttons { justify-content: flex-start; } }
@media (max-width: 620px) { .hero { grid-template-columns: 1fr; } .sigil { width: 54px; height: 54px; border-radius: 18px; } .fighters { grid-template-columns: 1fr; } .account-session { align-items: flex-start; flex-direction: column; } }
