:root{
  color-scheme:dark;
  font-family:"Microsoft YaHei UI","PingFang SC","Segoe UI",sans-serif;
  --paper:#fff2de;
  --muted:#cfb7b6;
  --accent:#ffd08c;
  --outline:#513037;
  --stage:#28141b;
}
*,*::before,*::after{box-sizing:border-box}
body{
  margin:0;min-height:100vh;min-height:100dvh;color:var(--paper);
  background:radial-gradient(ellipse at 47% -15%,#482630 0,transparent 60%),#1b1219;
}
button,kbd,input{font:inherit}
button{cursor:pointer;color:inherit}
button,.tab{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
:is(button,a,input):focus-visible{outline:3px solid #fff0b8;outline-offset:3px}
button:disabled{cursor:default}
[hidden]{display:none!important}
.language-entry{
  min-height:100vh;min-height:100svh;display:grid;place-items:center;
  padding:max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));
  background:linear-gradient(0deg,#170c14de,transparent 56%),linear-gradient(90deg,#1a0e1bb8 0%,#23121c38 58%,#1b101a9c),url("./assets/arena.webp") center/cover no-repeat,#281720;
}
.entry-stage{width:min(100%,1020px);display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,360px);align-items:center;gap:clamp(28px,7vw,96px)}
.entry-lockup{color:#fff3da;text-shadow:0 3px 15px #220f18}
.entry-lockup canvas{display:block;width:clamp(72px,9vw,116px);height:auto;filter:drop-shadow(0 8px 11px #210e18ac)}
.entry-lockup h1{margin:8px 0 0;padding-top:9px;border-top:4px solid #edbb80;width:fit-content;max-width:100%;font-size:clamp(38px,6.4vw,88px);line-height:1.08;letter-spacing:-.05em;font-weight:900;text-wrap:balance;overflow-wrap:anywhere}
.entry-form{padding:clamp(20px,3vw,32px);border:1px solid #8d6b60;border-top:3px solid #e2b773;border-radius:5px;background:#281a21f5;box-shadow:0 16px 50px #10081166}
.entry-form fieldset{border:0;margin:0;padding:0;min-inline-size:0}
.entry-form legend{padding:0;margin:0 0 16px;color:#fff0d8;font-weight:800;font-size:clamp(22px,2.5vw,30px);line-height:1.18}
.entry-options{display:grid;gap:5px}
.entry-options label{display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 14px;color:#eadad1;border:1px solid transparent;border-bottom-color:#664951;border-radius:3px;cursor:pointer;touch-action:manipulation;font-size:16px;line-height:1.25}
.entry-options label:has(:checked){color:#fff2db;background:#51343a;border-color:#d7a56e}
.entry-options label:focus-within{outline:2px solid #ffdda4;outline-offset:2px}
.entry-options input{margin:0;width:17px;height:17px;flex:none;accent-color:#f6c382}
.entry-form .entry-start{margin-top:20px;width:100%;min-height:46px;display:flex;align-items:center;justify-content:space-between;gap:9px;padding:9px 15px;border:1px solid #fed49a;border-radius:3px;background:#f3bf80;color:#2a1920;font-size:16px}
.entry-start span[aria-hidden]{font-size:1.25em;line-height:1}
.entry-start:disabled{opacity:.65}
@media(max-width:660px) and (orientation:portrait){
  .language-entry{padding-inline:max(18px,env(safe-area-inset-left)) max(18px,env(safe-area-inset-right))}
  .entry-stage{max-width:380px;grid-template-columns:minmax(0,1fr);gap:19px}
  .entry-lockup{display:flex;gap:12px;align-items:center}
  .entry-lockup canvas{width:60px}
  .entry-lockup h1{padding:0;border:0;margin:0;font-size:clamp(32px,9vw,44px)}
  .entry-form{padding:20px}
}
@media(orientation:landscape) and (max-height:540px){
  .language-entry{padding-block:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-bottom))}
  .entry-stage{max-width:850px;grid-template-columns:minmax(0,1fr) minmax(230px,1.05fr);gap:clamp(16px,4vw,42px)}
  .entry-lockup canvas{width:clamp(55px,10vw,81px)}
  .entry-lockup h1{font-size:clamp(32px,5.7vw,54px)}
  .entry-form{padding:13px 16px}
  .entry-form legend{margin-bottom:9px;font-size:22px}
  .entry-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  .entry-options label{gap:8px;padding:6px;min-height:44px}
  .entry-form .entry-start{margin-top:10px;min-height:44px}
}
.game{
  width:min(100%,1540px);margin-inline:auto;padding:0 32px 18px;
  min-height:100vh;min-height:100dvh;
  display:grid;grid-template-rows:auto minmax(330px,1fr) auto;gap:12px;
}
.game[data-view=ranking]{grid-template-rows:auto 1fr}
.game[data-view=arena]{height:100dvh;grid-template-rows:auto minmax(0,1fr) auto}
.game[data-view=arena] .arena{height:100%;min-height:0;max-height:790px}
.bar{
  min-height:75px;display:grid;grid-template-columns:1fr auto 1fr;
  align-items:center;gap:20px;
}
.title{display:flex;align-items:center;gap:12px;min-width:0}
.title h1{font-size:clamp(1.14rem,2vw,1.62rem);line-height:1.16;letter-spacing:.055em;margin:0;white-space:nowrap;font-weight:850}
.brand-mark{
  display:grid;place-items:center;width:42px;height:42px;border-radius:13px;
  flex:none;background:linear-gradient(150deg,#ffc981,#f6a553);
  box-shadow:inset 0 1px 0 #fff9dc9e,0 5px 14px #100a10a1;
}
.brand-mark canvas{width:33px;height:33px}
.modes{
  padding:4px;background:#1b1219;border:1px solid #57323c;border-radius:12px;
  display:flex;align-items:center;gap:3px;box-shadow:0 2px 8px #0d090e45;
}
.tab{
  min-height:38px;border:none;border-radius:8px;background:transparent;color:#e2c9c3;
  font-size:.91rem;font-weight:700;padding:5px 16px;
  display:flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap;text-decoration:none;
}
.tab:hover{background:#34202b}
.tab[aria-pressed=true],.tab[aria-current=page]{background:#4a2d38;color:#ffe0aa;box-shadow:inset 0 0 0 1px #93634855}
.rank-icon{
  width:12px;height:11px;align-self:center;background:currentColor;
  clip-path:polygon(0 100%,0 55%,23% 55%,23% 100%,37% 100%,37% 0,62% 0,62% 100%,76% 100%,76% 32%,100% 32%,100% 100%);
}
.time-icon{display:block;width:12px;height:12px;border:1.6px solid currentColor;border-radius:50%;position:relative}
.time-icon::before{content:"";position:absolute;left:3.7px;top:1.4px;width:3.5px;height:4.5px;border-left:1.3px solid currentColor;border-bottom:1.3px solid currentColor}
.utilities{justify-self:end;display:flex;gap:7px}
.utility{
  width:42px;height:41px;border:1px solid #5b3a45;border-radius:11px;background:#33212c;
  display:grid;place-items:center;text-align:center;font-size:1.16rem;font-weight:850;color:#f9ddbc;
}
.utility:hover{background:#54313a;border-color:#86564f}
.utility canvas{width:23px;height:23px}
.book-icon{display:block;width:21px;height:16px;position:relative}
.book-icon::before,.book-icon::after{content:"";position:absolute;top:0;width:10px;height:15px;border:1.7px solid currentColor;border-radius:2px 3px 0 0}
.book-icon::before{left:1px;transform:skewY(12deg)}.book-icon::after{right:0;transform:skewY(-12deg)}
.language{max-width:6.8em;min-width:0;border:1px solid #785447;border-radius:8px;font-family:inherit;font-size:.81rem;font-weight:600;color:#ffdbac;background:#30212a;padding:4px}
.utility[aria-pressed=false]{color:#b49b9b;background:#281923}
.arena{
  position:relative;inset:0;isolation:isolate;overflow:hidden;min-height:365px;
  height:clamp(365px,calc(100dvh - 207px),790px);
  border:1px solid #80604d70;border-radius:23px;background:var(--stage);
  box-shadow:0 13px 31px #0e080ec4;
}
.room,.room-shade,#ring{position:absolute;inset:0;width:100%;height:100%}
.room{
  display:block;object-fit:cover;object-position:50% 62%;pointer-events:none;
  user-select:none;
}
.room-shade{
  pointer-events:none;
  background:linear-gradient(180deg,#170b1683,transparent 27%,transparent 82%,#1009139e),
    radial-gradient(ellipse at 50% 55%,transparent 44%,#13091460 100%);
}
#ring{display:block;touch-action:none;outline:none;user-select:none;cursor:crosshair}
.arena[data-action=hammer][data-held=true] #ring{cursor:grabbing}
.hud{
  inset:18px 20px auto;position:absolute;pointer-events:none;
  display:grid;grid-template-columns:1fr auto 1fr;align-items:start;gap:10px;
}
.counter{
  min-width:110px;justify-self:start;border:1px solid #dca87c53;
  padding:9px 13px 9px 14px;border-radius:13px;
  background:#29161ddd;box-shadow:0 5px 20px #14091149,inset 0 1px 0 #ffddae15;
}
@media(pointer:fine){.counter{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}}
.counter-label{display:block;color:#e6c4ac;font-size:.82rem;font-weight:650;letter-spacing:.046em;white-space:nowrap}
.counter output{
  display:block;font-family:"Arial Rounded MT Bold","Segoe UI",sans-serif;font-weight:900;
  font-variant-numeric:tabular-nums;font-size:2.08rem;letter-spacing:-.055em;line-height:1.04;
  margin-top:3px;color:#fff0d4;
}
.score{grid-column:1}
.damage{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-top:6px;color:#e8bea3;font-size:.72rem;white-space:nowrap}
.counter .damage output{display:inline;margin:0;color:#fbe2c6;font-size:1rem;letter-spacing:0}
.damage.critical,.counter .damage.critical output{color:#ffcb75;text-shadow:0 0 12px #ff9c6266}
.record{grid-column:3;justify-self:end;text-align:right}
.record output{color:#ffd496}
.timer{
  grid-column:2;justify-self:center;text-align:center;padding:7px 22px 10px;min-width:135px;
}
.timer>div{margin-top:3px;display:flex;gap:6px;align-items:baseline;justify-content:center}
.timer output{display:inline}
.unit{font-size:.76rem;color:#f8d0a7}
.timer progress{
  appearance:none;display:block;border:0;border-radius:10px;width:100%;height:4px;margin-top:7px;overflow:hidden;
  background:#59313b;color:#ffd291;
}
.timer progress::-webkit-progress-bar{background:#59313b}
.timer progress::-webkit-progress-value{background:#ffd291;border-radius:7px}
.timer progress::-moz-progress-bar{background:#ffd291;border-radius:7px}
.timer.warning output{color:#ff9b71}
.timer.warning progress::-webkit-progress-value{background:#ff9877}
.timer.warning progress::-moz-progress-bar{background:#ff9877}
.combo{
  pointer-events:none;position:absolute;right:20px;top:112px;display:flex;align-items:baseline;gap:6px;
  color:#ffdf9c;text-shadow:0 3px #73282d,0 0 16px #ac5e3485;
  opacity:0;transform:translateY(-7px) scale(.9);
  transition:opacity .15s ease,transform .15s ease;
}
.combo.active{opacity:1;transform:translateY(0) scale(1)}
.combo output{font-weight:900;font-size:2.8rem;line-height:1;letter-spacing:-.07em}
.combo span{font-size:.99rem;font-weight:800}
.chain-meter{position:absolute;inset:auto 0 -5px 0;height:3px;overflow:hidden;background:#5b3b35;border-radius:3px}
.chain-meter i{display:block;height:100%;background:#ffd18f;transform-origin:left center}
.event-toast{
  --event:#ffd28e;position:absolute;z-index:1;left:50%;top:110px;pointer-events:none;
  display:flex;flex-direction:column;align-items:center;gap:2px;white-space:nowrap;text-align:center;
  padding:8px 20px 9px;min-width:144px;border:1px solid var(--event);border-radius:12px;
  color:var(--event);background:linear-gradient(155deg,#482834f2,#211923ed);
  box-shadow:0 8px 23px #10070dc2,inset 0 0 18px #ffd2931b;
  opacity:0;transform:translate(-50%,10px) scale(.96);
  transition:opacity .18s ease,transform .22s ease;
}
.event-toast.active{opacity:1;transform:translate(-50%,0) scale(1)}
.event-toast strong{font-size:1.32rem;line-height:1.12;font-weight:900;letter-spacing:.04em}
.event-toast span{font-size:.76rem;color:#fff0df}
@media(min-width:781px){.event-toast{top:128px;left:clamp(106px,16%,210px);max-width:26%;white-space:normal}}
.starter{
  position:absolute;left:50%;bottom:18px;transform:translateX(-50%);pointer-events:none;
  display:flex;align-items:center;justify-content:center;gap:8px;max-width:calc(100% - 24px);
  padding:8px 14px;background:#2c1b22e8;border:1px solid #8f654c99;border-radius:99px;
  color:#ffe6c3;font-size:.86rem;font-weight:650;text-align:center;white-space:nowrap;
  transition:opacity .28s ease,translate .28s ease;
  box-shadow:0 4px 17px #140b15a8;
}
.starter.gone{opacity:0;translate:0 7px}
.tap-mark{width:11px;height:11px;border-radius:50%;background:#ffc68c;box-shadow:0 0 0 3px #e8a36b45;flex:none}
.loading{
  position:absolute;left:50%;top:49%;transform:translate(-50%,-50%);padding:12px 18px;
  background:#21151eec;border:1px solid #987768;border-radius:10px;font-size:.96rem;text-align:center;
}
.deck{padding:1px 0 0}
.controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.action{
  position:relative;display:flex;align-items:center;gap:9px;
  min-width:0;min-height:64px;padding:7px 12px;border-radius:12px;
  border:1px solid #5b3945;background:linear-gradient(145deg,#3e2832,#291c27);
  box-shadow:inset 0 1px 0 #ffdec40c,0 3px 8px #100a13a0;
  color:#f5dec9;font-weight:800;font-size:.97rem;white-space:nowrap;text-align:left;
  transition:background .16s ease,border-color .16s ease,transform .16s ease;
}
@media(hover:hover){.action:hover{background:#51313c;border-color:#986d5a;transform:translateY(-1px)}}
.action:active{transform:translateY(1px)}
.action-name{display:grid;gap:3px;line-height:1.08}
.action-name small{font-size:.72rem;font-weight:600;color:#d1b4ac;line-height:1.18;font-variant-numeric:tabular-nums}
.action-name small:empty{display:none}
.action[aria-pressed=true] .action-name small{color:#663e35}
.action[aria-pressed=true]{
  background:linear-gradient(144deg,#ffcf92,#f4a760);
  border-color:#ffdfae;color:#351c1c;
  box-shadow:inset 0 1px 0 #fff6df,0 4px 11px #ed9b522d;
}
.action-icon{
  width:39px;height:39px;flex:none;border-radius:9px;display:grid;place-items:center;
  background:#1f151de0;
}
.action-icon canvas{width:33px;height:33px}
.action[aria-pressed=true] .action-icon{background:#443039}
.action[data-action=baton] .action-icon{background:#243b3b}
.action[data-action=chair] .action-icon{background:#303249}
.action kbd,.key-guide kbd{
  display:inline-grid;place-items:center;font-size:.73rem;font-family:"Segoe UI",sans-serif;
  line-height:1;min-width:18px;min-height:19px;border:1px solid #b883775e;
  background:#1e141ebf;color:#edc6aa;padding:2px 5px;border-radius:4px;font-weight:650;
}
.action kbd{margin-left:auto;align-self:start}
.action[aria-pressed=true] kbd{background:#f3b778;color:#4d2926;border-color:#aa675d8c}
.hint-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:34px;
  color:#e1c8bf;padding:2px 2px 0;
}
.tip,.key-guide{margin:0;font-size:.85rem}
.tip::before{content:"";display:inline-block;width:5px;height:5px;margin-right:9px;vertical-align:3px;border-radius:50%;background:#ffcb85}
.key-guide{color:#c7abac;white-space:nowrap;display:flex;align-items:center;gap:5px}
.key-guide i{display:block;width:3px;height:3px;margin-inline:4px;border-radius:50%;background:#ad8982}
.pending-shortcut{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;
  padding:4px 9px;border:1px solid #806348;border-radius:7px;color:#ffe0aa;
  font-size:.8rem;font-weight:700;text-decoration:none;line-height:1.22;text-align:center;
}
.pending-shortcut::after{content:"";width:6px;height:6px;border-top:1.5px solid;border-right:1.5px solid;transform:rotate(45deg);flex:none}
.hint-row:has(.pending-shortcut:not([hidden])) .key-guide{display:none}
.leaderboard{
  align-self:start;width:min(100%,925px);margin:clamp(21px,6vh,60px) auto 35px;overflow:hidden;
  border:1px solid #946a515e;border-radius:23px;background:#1f151d;
  box-shadow:0 20px 55px #120810b5;
}
.ranking-head{
  position:relative;display:flex;align-items:flex-end;justify-content:space-between;gap:20px;
  padding:clamp(21px,4vw,45px);border-bottom:1px solid #d89b6347;
  background:radial-gradient(ellipse at 86% 22%,#9b5b3a79,transparent 67%),
    linear-gradient(132deg,#472732,#2b1c28 72%);
}
.ranking-head h2{margin:0 0 9px;font-size:clamp(1.74rem,4vw,3.1rem);line-height:1.11;letter-spacing:.018em}
.ranking-head h2:focus{outline:none}
.ranking-head p{margin:0;color:#dec1b0;font-size:.91rem}
.ranking-head .primary{flex-shrink:0;min-height:46px}
.guest-claims{padding:17px clamp(15px,4vw,45px);border-bottom:1px solid #785d485e;background:#2b2025}
.guest-claims h3{margin:0;color:#ffe1ae;font-size:1.03rem}
.guest-claims p{margin:5px 0 9px;color:var(--muted);font-size:.84rem;line-height:1.45}
#claimRows{margin:0;padding:0;list-style:none}
#claimRows li{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:8px 0;border-top:1px solid #72524475}
#claimRows li span{color:var(--paper);font-weight:700;font-variant-numeric:tabular-nums}
#claimRows button{min-height:44px;max-width:100%;padding:6px 12px;font-size:.86rem}
.claim-status{margin:0;padding:10px clamp(15px,4vw,45px);color:#ffe0a7;font-size:.9rem;line-height:1.45}
.claim-status:empty{display:none}
.rankings{padding:10px clamp(15px,4vw,45px) 26px}
.ranking-empty{
  display:grid;place-items:center;margin:20px 0 0;min-height:180px;
  padding:25px;text-align:center;color:#dbbcb5;border:1px dashed #7b534bba;
  border-radius:13px;background:#2b1d2788;
}
.rank-table{width:100%;border-collapse:collapse;table-layout:fixed;font-variant-numeric:tabular-nums}
.rank-table :is(th,td){padding:11px 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
.rank-table th{color:#c9a9a5;font-size:.83rem;font-weight:600;border-bottom:1px solid #6c4a5080}
.rank-table :is(th,td):first-child{width:15%;text-align:center}
.rank-table :is(th,td):nth-child(3){width:22%;text-align:right}
.rank-table :is(th,td):last-child{width:23%;text-align:right}
.rank-table td{font-size:1rem;line-height:1.6;border-bottom:1px solid #65404d5c}
.rank-table tbody tr:first-child{background:#ffd29a14}
.rank-table td:first-child,.rank-table td:nth-child(3){font-weight:850;color:#ffd18e}
.rank-table tbody tr:nth-child(2) td:first-child{color:#d7cef2}
.rank-table tbody tr:nth-child(3) td:first-child{color:#eeb48e}
.dialog{
  border:1px solid #976649;border-radius:22px;padding:24px 27px;
  max-height:calc(100dvh - 24px);overflow:auto;width:min(91vw,540px);color:var(--paper);
  background:linear-gradient(145deg,#3b232d,#241822);box-shadow:0 23px 80px #150b15da;
}
.dialog::backdrop{background:#110a13ba;backdrop-filter:blur(5px)}
.dialog h2{margin:0 33px 11px 0;font-size:1.6rem}
.dialog p{margin:0 0 18px;color:#e0c3b7;font-size:.95rem;line-height:1.62}
.dismiss{
  position:absolute;right:13px;top:12px;width:32px;height:32px;border-radius:9px;
  background:#52323c;border:1px solid #93655b;color:#fbe4cd;font-size:1.36rem;font-weight:800;
}
.dialog dl{display:grid;gap:9px;margin:14px 0 22px}
.dialog dl div{display:grid;grid-template-columns:minmax(100px,30%) minmax(0,1fr);gap:12px;align-items:baseline}
.dialog dt{display:flex;align-items:baseline;gap:6px;font-weight:800}
.dialog dt kbd{border:1px solid #815a54;padding:1px 4px;border-radius:4px}
.dialog dd{margin:0;color:#e3c7bf;font-size:.91rem;line-height:1.45}
.dialog .help-keys{font-size:.83rem}
.recipe-book{border-top:1px solid #87604f5e;margin-bottom:18px;padding-top:13px}
.recipe-book h3{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 0 8px;font-size:1rem}
.recipe-book h3 output{font-size:.82rem;color:#ffce95}
.recipe-book ul{list-style:none;margin:0;padding:0;display:grid;gap:5px}
.recipe-book li{padding:7px 10px;border-radius:8px;background:#1f151c99;color:#dfc1b5;font-size:.82rem}
.recipe-book li strong{font-size:.88rem;color:#ffe1b9}
.recipe-book li span{display:block;margin-top:2px}
.codex{width:min(94vw,730px);padding:22px 24px;border-color:#997954;background:linear-gradient(155deg,#36262f,#1c151c 72%)}
.codex .recipe-book{border:0;margin:0 0 14px;padding:0}
.codex-head{display:flex;align-items:baseline;gap:15px;padding-right:24px;flex-wrap:wrap}
.codex-head h2{margin:0;font-family:Georgia,serif;font-size:clamp(1.5rem,4.5vw,2.25rem);letter-spacing:.035em}
.codex-head output{color:#e5bd84;font-weight:700;font-size:.83rem}
.codex #scopeNote{margin:5px 0;color:#d3babe;font-size:.86rem}
.codex .book-pairs{margin:9px 0 0;font-size:.89rem;color:#f1d6ba}
.codex-progress{display:block;width:100%;height:5px;margin:10px 0 16px;accent-color:#f4bb70}
.codex .recipe-book ul{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.codex .entry{--ink:#b49a8e;position:relative;display:grid;align-content:start;gap:5px;padding:11px 13px;min-height:90px;border-radius:9px;border:1px solid #76605355;border-left:3px solid var(--ink);background:#32252c}
.codex .entry.locked{border-left-color:#63535a;background:repeating-linear-gradient(135deg,#2a2027 0 7px,#2c2229 7px 8px)}
.codex .entry strong{font-size:1.01rem;color:var(--ink)}
.codex .entry span,.codex .entry small{color:#d4bdba;font-size:.8rem;line-height:1.4}
.codex .entry small{color:var(--ink);font-weight:750}
.combo-art{min-height:25px;display:flex;gap:2px;align-items:center;color:#a99389;font:italic 700 22px/1 Georgia,serif}
.combo-art canvas{width:31px;height:31px}
@media(max-width:440px){.codex{padding:17px}.codex .recipe-book ul{grid-template-columns:1fr}.codex .entry{min-height:65px}.codex .entry.locked .combo-art{display:none}}
.primary,.secondary{
  padding:9px 16px;border-radius:9px;min-height:42px;font-weight:800;
  border:1px solid #ffe1af;background:linear-gradient(#ffce94,#f4a463);color:#301722;
}
.primary:hover{filter:brightness(1.09)}
.secondary{border-color:#8e665f;color:#f6d6bc;background:#4d3039}
.secondary:hover{background:#603b45}
.result{text-align:center;width:min(90vw,440px)}
.result h2{margin:0 0 10px}
.result p{margin:0}
#finalScore{
  font-family:"Arial Rounded MT Bold","Segoe UI",sans-serif;font-variant-numeric:tabular-nums;
  font-size:clamp(2.5rem,11vw,4.8rem);line-height:1.12;font-weight:900;color:#ffd593;
}
.result-combo{padding:6px 0 20px}
.board-actions,.profile-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.profile-link{min-height:40px;padding:5px 8px;border:0;background:transparent;color:#f6c79d;text-decoration:underline;text-underline-offset:4px;font:inherit;cursor:pointer}
.profile-fields{display:grid;gap:13px}
.profile-fields label{min-width:0;display:grid;align-content:start;gap:6px;color:#f5d8bc;font-weight:700;font-size:.89rem}
.profile-fields input,.handle-input{width:100%;min-width:0;border:1px solid #956c64;color:var(--paper);background:#271a23;border-radius:8px}
.profile-fields input{min-height:44px;padding:8px 10px;font-size:16px}
.handle-input{display:flex;align-items:center;padding-left:11px;color:#ffcf99}
.handle-input input{border:0;background:transparent}
.profile-actions{margin-top:18px}
.profile-dialog .identity-rule{margin:10px 0 0;color:#f5cd96;font-size:.85rem;line-height:1.35}
.profile-fields input:read-only{color:#e0c7ab}
.score-receipt{margin:0 0 16px;padding:10px 12px;border-block:1px solid #875b5266}
.score-receipt p{font-size:.9rem;color:#ffd7a6;overflow-wrap:anywhere}
.rank-table td .handle{display:block;color:#d6ada3;font-size:.8em;white-space:normal;overflow-wrap:anywhere}
@media(min-width:560px) and (max-height:500px){.profile-fields{grid-template-columns:1fr 1fr}.profile-dialog{padding:16px 21px}.profile-dialog p{margin-bottom:10px}.result{padding:14px 21px}.result-combo{padding-bottom:8px}}
.dialog-buttons{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.dialog-buttons > :is(button,a){min-height:44px}
.dialog-buttons #registerNext{width:100%}
.dialog-buttons #registerNext:not([hidden]) ~ #retry{background:#4d3039;border-color:#8e665f;color:#f6d6bc}
.dialog-buttons a{display:inline-flex;align-items:center;text-decoration:none}
.result:focus{outline:none}
@media(orientation:landscape) and (max-height:540px) and (min-width:480px){
  .result[open]{
    display:grid;grid-template-columns:minmax(105px,.8fr) minmax(0,2.1fr);
    grid-template-areas:"heading heading" "label receipt" "points buttons" "combo buttons";
    align-items:center;gap:4px 18px;width:min(94vw,740px);padding:14px 20px;
  }
  .result h2{grid-area:heading;margin:0 0 8px;font-size:clamp(1.15rem,4.5vh,1.6rem)}
  #resultNote{grid-area:label;align-self:end}
  #finalScore{grid-area:points;align-self:end;font-size:clamp(2.4rem,13vh,4.3rem);line-height:1}
  .result-combo{grid-area:combo;align-self:start;padding:4px 0 0}
  .result .score-receipt{grid-area:receipt;margin:0 0 4px;padding:5px 6px 8px;border-top:0}
  .result .score-receipt p{line-height:1.4}
  .result .dialog-buttons{grid-area:buttons;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .result .dialog-buttons > :is(a,button){justify-content:center;line-height:1.2;padding:5px 8px}
  .result .dialog-buttons:has(#registerNext:not([hidden])) #backToFree{order:-1}
  .result .dialog-buttons #registerNext{order:-2}
}
.no-script{text-align:center}
@media(min-width:861px) and (min-height:760px){.arena{height:clamp(500px,calc(100dvh - 198px),790px)}}
@media(max-width:1040px){.game{padding-inline:20px}.action{gap:6px;padding-inline:7px}.action-icon{width:34px;height:34px}.action-icon canvas{width:28px;height:28px}.action kbd{padding:2px 3px;min-width:15px}}
@media(max-width:780px){
  .game{padding:env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) max(11px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));gap:8px;grid-template-rows:auto minmax(300px,1fr) auto}
  .bar{min-height:88px;padding-block:8px;grid-template-columns:1fr auto;column-gap:9px;row-gap:6px}
  .brand-mark{width:32px;height:32px;border-radius:9px}.brand-mark canvas{width:25px;height:25px}
  .title{gap:8px}.utilities{grid-row:1;grid-column:2;gap:6px}
  .utility{width:34px;height:34px;border-radius:8px}.utility canvas{width:20px;height:20px}
  .modes{grid-row:2;grid-column:1/-1;justify-self:center;padding:3px;border-radius:9px}
  .tab{min-height:30px;padding-inline:13px;border-radius:6px;font-size:.84rem}
  .arena{border-radius:15px;min-height:302px;height:calc(100dvh - 225px)}
  .room{object-position:50% 66%}
  .hud{inset:10px 10px auto;gap:5px}.counter{padding:7px 9px;min-width:72px;border-radius:9px}
  .counter-label{font-size:.72rem}.counter output{font-size:1.58rem}
  .damage{font-size:.64rem;gap:5px;margin-top:4px}.counter .damage output{font-size:.85rem}
  .timer{min-width:92px}.timer progress{margin-top:5px}
  .combo{right:12px;top:80px}.combo output{font-size:2.08rem}.combo span{font-size:.83rem}
  .event-toast{top:81px;padding:6px 13px;min-width:112px}.event-toast strong{font-size:1.05rem}
  .controls{gap:6px}
  .action{min-height:51px;gap:7px;font-size:.87rem;padding:5px 8px;border-radius:9px}
  .action-icon{width:31px;height:31px;border-radius:7px}.action-icon canvas{width:27px;height:27px}
  .action-name{gap:3px}.action-name small{font-size:.67rem}
  .action kbd,.key-guide{display:none}
  .hint-row{justify-content:center;min-height:31px;padding-top:4px}
  .hint-row:has(.pending-shortcut:not([hidden])){justify-content:space-between}
  .hint-row:has(.pending-shortcut:not([hidden])) .tip{text-align:start}
  .pending-shortcut{flex:none;min-height:44px;max-width:36%}
  .tip{font-size:.79rem;text-align:center}
  .starter{bottom:13px;padding:6px 10px;font-size:.76rem}
  .leaderboard{margin:14px 0 21px;border-radius:16px}
  .ranking-head{display:grid;align-items:start;gap:14px;padding:19px}
  .ranking-head .primary{justify-self:start}
  .ranking-head p{font-size:.82rem}
  .rankings{padding:7px 7px 16px}
  .rank-table :is(th,td){padding:8px 5px}
  .rank-table td{font-size:.88rem}.rank-table th{font-size:.73rem}
}
@media(max-width:350px){.game{padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right))}.title h1{font-size:1.06rem}.utilities{gap:4px}.action{gap:4px;padding-inline:4px}.action-icon{width:26px;height:26px}.action-icon canvas{width:23px;height:23px}}
@media(max-width:1120px){.bar{gap:9px}.tab{padding-inline:10px}.utilities{gap:4px}.language{max-width:6em}.utility{width:34px;height:35px}.brand-mark{width:33px;height:33px}.brand-mark canvas{width:25px;height:25px}}
@media(min-width:781px) and (max-width:1030px){.bar{grid-template-columns:minmax(0,1fr) auto auto}.game{padding-inline:12px}.title h1{font-size:clamp(.93rem,1.75vw,1.16rem)}}
@media(max-width:570px){.bar{grid-template-columns:minmax(0,1fr) auto}.title{gap:5px}.title h1{font-size:.94rem;white-space:normal}.language{max-width:5.1em}.utilities .utility{width:29px}.tab{font-size:.79rem;padding-inline:8px}.action-name{min-width:0;overflow-wrap:anywhere}.tab .rank-icon,.tab .time-icon{display:none}}
@media(max-width:560px) and (orientation:portrait){
  .controls{gap:5px}
  .action{flex-direction:column;justify-content:flex-start;gap:4px;min-height:76px;padding:6px 2px 5px;text-align:center;font-size:.77rem}
  .action-icon{width:29px;height:26px}.action-icon canvas{width:25px;height:25px}
  .action-name{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:4px}
  .action-name>span{line-height:1.12;text-wrap:balance}
  .action-name small{font-size:.66rem}
}
.utilities .book-button{display:flex;width:auto;align-items:center;justify-content:center;gap:6px;padding:3px 9px;color:#ffdc9e;border-color:#93704d;font-size:.81rem}
.action-name,.action-name small{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
@media(orientation:landscape) and (max-height:540px) and (min-width:520px){
  .game{height:100dvh;min-height:0;grid-template-rows:auto minmax(0,1fr) auto;gap:4px;padding:env(safe-area-inset-top) max(6px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))}
  .bar{display:flex;min-height:37px;gap:6px;padding:2px 0}.modes{margin:auto;padding:2px}.tab{min-height:29px;font-size:.78rem;padding:3px 7px}.utilities{flex:none;align-items:center}
  .title{gap:5px}.title h1{font-size:.94rem}.brand-mark{width:26px;height:26px}.utility,.utilities .utility{height:30px;width:31px}.utilities .book-button{width:auto}
  .language{height:30px;max-width:6em}.arena{height:100%;min-height:0;border-radius:11px}.hud{inset:6px 8px auto}.counter{padding:4px 8px;min-width:63px}.counter output{font-size:1.34rem}.counter-label{font-size:.68rem}
  .combo{top:60px}.starter{bottom:7px}.controls{gap:5px}.action{min-height:46px;padding:3px 7px;gap:6px;font-size:.79rem}.action-icon{width:29px;height:29px}.action-icon canvas{width:25px;height:25px}
  .event-toast{top:73px;left:calc(8px + min(11.5%,90px));width:min(23%,180px);min-width:0;padding:5px 8px;white-space:normal}
  .event-toast strong{font-size:1rem}.event-toast span{font-size:.75rem}
  .action-name small{font-size:.65rem}.deck kbd,.hint-row{display:none}
  .deck:has(.pending-shortcut:not([hidden])){display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px}
  .deck:has(.pending-shortcut:not([hidden])) .hint-row{display:flex;min-height:0;padding:0}
  .deck:has(.pending-shortcut:not([hidden])) .tip{display:none}
  .pending-shortcut{width:min(105px,15vw);max-width:none;min-height:44px;padding:3px 6px;font-size:.72rem}
  .game[data-view=ranking]{height:auto;min-height:100dvh;grid-template-rows:auto 1fr}
}
@media(orientation:portrait) and (max-width:780px){
  .event-toast{top:auto;bottom:8px;flex-direction:row;gap:8px;max-width:calc(100% - 24px);padding:5px 10px;white-space:normal}
}
@media(orientation:landscape) and (max-height:540px) and (max-width:740px){.title h1{display:none}.tab .rank-icon,.tab .time-icon{display:none}}
@media(max-width:1120px){.book-button .book-icon{display:none}.utilities .book-button{padding-inline:7px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}.chain-meter{display:none}}

.dialog:not([open]){display:none}
.identity{display:block;text-align:center;font-size:.68rem;font-weight:700;line-height:1.25;color:#eed095;max-width:16em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.guest-option{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 15px;margin:0 0 15px;background:#251b23;border:1px solid #826954;border-left:3px solid #e1b877;border-radius:9px}
.guest-option strong,.guest-option span{display:block}
.guest-option strong{color:#ffe0a8;font-size:1.05rem}
.guest-option span{margin-top:3px;line-height:1.4;color:#dcc5b6;font-size:.86rem}
.guest-option button{flex-shrink:0;min-height:42px}
@media(max-height:500px){.guest-option{padding:7px 11px;margin-bottom:8px}.profile-dialog .profile-actions{margin-top:9px}}
