/* Paper, plum cloth, and the existing Hanno deck. */
:root {
  color-scheme: light;
  --bg:#f1ebdf; --panel:#faf5e9; --panel2:#eae0d1;
  --line:#d5c8b6; --ink:#28211f; --dim:#66574f;
  --plum:#412931; --plum-deep:#301e25; --cyan:#58613e; --pink:#993c42;
  --gold:#a25d32; --washi:#fbf2de; --straw:#beac79;
  --mat:#9e986f; --mat2:#817b55; --heri:#3b2b30;
  --display:Georgia,"Times New Roman",serif;
  --ui:system-ui,-apple-system,"Segoe UI",sans-serif;
}
body {
  color:var(--ink); font-family:var(--ui); font-size:16px;
  background:radial-gradient(ellipse at 50% 0,#faf5e9 0,transparent 72%),var(--bg);
}
button, input, textarea { font-family:inherit; }
:focus-visible, .kc:focus-visible { outline:3px solid #a84942; outline-offset:3px; }
.top {
  display:block; position:relative; margin:0; padding:0;
  background:#f7f0e3; border-bottom:1px solid var(--line); box-shadow:none;
}
.masthead {
  max-width:1336px; margin:auto; padding:0 clamp(18px,4vw,48px);
  min-height:76px; display:flex; align-items:center; gap:24px;
}
.brand { flex:none; color:var(--ink); border:0; background:transparent; padding:0; gap:10px; }
.brand .seal {
  width:33px; height:33px; display:grid; place-items:center;
  color:var(--washi); background:#853c42; border:0; border-radius:4px; font-size:19px;
  box-shadow:inset 0 0 0 2px #853c42,inset 0 0 0 3px #dfb4a1;
}
.brand .word { color:var(--plum); font:italic 700 39px/1 var(--display); letter-spacing:-.055em; }
.tabs {
  margin:0 0 0 auto; padding:0; display:flex; flex-wrap:wrap; gap:2px;
  background:none; border:0; border-radius:0;
}
.tabs button {
  color:var(--dim); background:none; border:0; border-radius:0; min-height:44px;
  padding:6px 12px; font-size:14px; font-weight:650;
}
.tabs button:hover { color:var(--plum); background:#eee3d5; }
.tabs button[aria-current=page] {
  color:var(--plum); box-shadow:inset 0 -2px #923d43; background:transparent; font-weight:750;
}
.mini { color:var(--dim); }
.mini:empty { display:none; }
.shell { max-width:1336px; padding:0 clamp(18px,4vw,48px) 62px; margin:auto; }
.panels { padding:0; }
[data-panel]:not([data-panel=play]) { padding-top:clamp(26px,5vw,60px); }
.hero {
  margin:28px 0 0; padding:0; min-height:490px;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0;
  background:var(--plum-deep); color:var(--washi); border:1px solid #5e4148; border-radius:12px;
  box-shadow:0 22px 48px #3e292521; overflow:hidden;
}
.hcopy { position:relative; z-index:2; padding:clamp(28px,4.5vw,66px); }
.hero .eyebrow {
  margin:0 0 22px; color:#e0b994; font-size:12px; font-weight:750; letter-spacing:.18em; text-transform:uppercase;
}
.hero h1 {
  color:var(--washi); font:400 clamp(43px,5.6vw,88px)/.99 var(--display);
  letter-spacing:-.063em; text-wrap:initial; margin:0;
}
.hero h1 em { color:#edc39a; font-weight:400; }
.hero .intro-copy { color:#e4d2c4; font-size:clamp(15px,1.45vw,18px); line-height:1.6; margin:22px 0 0; max-width:34ch; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:26px; }
.btn {
  background:var(--panel); color:var(--plum); border:1px solid var(--line);
  border-radius:5px; font-weight:700; box-shadow:none; text-transform:none; letter-spacing:0;
}
.btn:hover { background:#efe4d2; border-color:#a59381; }
.go,.btn.go { background:#58613e; border-color:#58613e; color:#fff8e8; box-shadow:none; }
.go:hover,.btn.go:hover { background:#424a2d; border-color:#424a2d; }
.hero-actions .btn { min-height:48px; padding:0 18px; font-size:15px; }
.hero-actions .go { background:#efcfaa; border-color:#efcfaa; color:#38272a; }
.hero-actions .go:hover { background:#ffe1bd; }
.hero-actions .btn:not(.go) { background:transparent; border-color:#97797b; color:var(--washi); }
.hero-actions .btn:not(.go):hover { background:#563840; }
.fan {
  align-self:stretch; order:initial; min-height:430px; height:auto; display:grid; place-items:center;
  isolation:isolate; background:
    radial-gradient(circle at 50% 48%,#80575985,transparent 71%),
    repeating-linear-gradient(0deg,#ffffff0b 0 1px,transparent 1px 4px),
    repeating-linear-gradient(90deg,#2513193d 0 1px,transparent 1px 5px),#432b34;
}
.fan-ring { position:absolute; width:80%; aspect-ratio:1; border:1px solid #c09a744d; border-radius:50%; }
.fan-ring::before,.fan-ring::after { content:""; position:absolute; inset:5%; border:1px solid #c09a7438; border-radius:50%; }
.fan-ring::after { inset:11%; }
.fan img {
  position:absolute; left:50%; top:50%; bottom:auto; width:min(37%,216px);
  aspect-ratio:2/3; object-fit:contain; border-radius:5px;
  transform-origin:50% 50%; box-shadow:0 18px 35px #1a1019aa;
}
.fan .fan-left { transform:translate(-107%,-47%) rotate(-15deg); }
.fan .fan-right { transform:translate(6%,-45%) rotate(15deg); }
.fan .fan-center { transform:translate(-50%,-52%) rotate(-2deg); }
.fan:hover img { translate:0 -3px; }
.mode-list { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:18px 0 0; }
.mode {
  display:flex; align-items:center; gap:13px; text-align:left; padding:16px;
  background:var(--panel); border:1px solid var(--line); border-radius:7px;
  min-height:89px; color:var(--plum);
}
.mode:hover { background:#fff9ed; border-color:#a89177; }
.mode-mark { color:#873e42; background:#eee0d0; border-radius:50%; width:40px; height:40px; display:grid; place-items:center; flex:none; font-size:20px; }
.mode strong,.mode small { display:block; }
.mode small { color:var(--dim); font-size:14px; margin-top:3px; }
#offNote { margin:20px 0 0; }
#onl { margin-top:24px; }
h2 { margin:0 0 20px; font:400 clamp(34px,5vw,62px)/1.05 var(--display); letter-spacing:-.043em; color:var(--plum); }
h3 { font:600 clamp(20px,2.3vw,30px)/1.15 var(--display); color:var(--plum); }
.lede { color:var(--dim); margin:0 0 24px; font-size:16px; max-width:58ch; }
.note,.small { color:var(--dim); font-size:14px; line-height:1.55; }
.opanel,.opts,.opp,.endp,.ytp {
  background:var(--panel); border:1px solid var(--line); border-radius:8px; box-shadow:none;
}
.opanel,.opts { padding:clamp(16px,2.5vw,28px); }
.duo { gap:16px; }
.opp { padding:20px; color:var(--ink); }
.opp[aria-pressed=true] { border-color:var(--cyan); box-shadow:inset 0 0 0 1px var(--cyan); background:#eeebdc; }
.opp b { font:700 24px var(--display); }
.medal { border-radius:50%; font:italic 700 30px var(--display); background:#6d523e; box-shadow:none; }
.rank { color:#51372f; background:#e9d7b9; }
.pips i { color:#865638; }
.seg button,.mmrow input,#malText,#meIn { background:#fffaef; color:var(--ink); border-color:var(--line); border-radius:5px; }
.seg button[aria-pressed=true] { background:var(--cyan); color:#fff8e8; border-color:var(--cyan); }
.opts .chk { padding:12px 0; border-top:1px solid var(--line); }
#presets { margin-top:10px; }
[data-panel=deck] .opts { display:block; }
[data-panel=deck] .ded { border-top:1px solid var(--line); margin-top:20px; padding-top:16px; }
.collection summary { font:600 23px var(--display); }
.deck-search { display:grid; gap:6px; align-items:center; margin:14px 0 18px; }
.deck-search label { font-size:14px; color:var(--dim); }
#cardSearch { width:min(100%,410px); min-height:46px; padding:0 12px; border:1px solid #bfae98; border-radius:5px; background:#fffaf0; color:var(--ink); }
#cardCount,#noclip { margin:0; }
.gal { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:16px; }
.dc { color:var(--plum); align-self:start; text-align:left; }
.gal img { aspect-ratio:2/3; object-fit:contain; border-radius:5px; box-shadow:0 4px 9px #3d262128; }
.dc:hover img { box-shadow:0 0 0 2px #805c4a,0 5px 12px #3d262136; }
.card-caption { display:block; margin-top:7px; }
.card-caption strong { display:block; font:700 16px/1.22 var(--display); }
.card-caption small { display:block; color:var(--dim); font-size:12px; line-height:1.3; margin-top:2px; }
.gal .tier { left:auto; right:5px; top:5px; padding:2px 5px; background:#f7eddb; color:#573a31; box-shadow:0 1px 4px #30221644; }
.gal .t-Hard { background:#823d41; color:#fff7e8; }
.gal .t-Easy { background:#53613e; color:#fff7e8; }
[data-panel=rules] ol { max-width:65ch; padding:0 0 0 26px; }
[data-panel=rules] li { padding:12px 0 12px 10px; border-bottom:1px solid var(--line); line-height:1.6; }
#match { min-height:100svh; background:radial-gradient(ellipse at 50% 28%,#5a3d46,#302127 68%); color:var(--washi); }
#match .mtop { color:var(--washi); background:#302127; border-bottom:1px solid #775b5b; }
#match .mlogo { color:#f8dfbd; font:italic 700 33px/1 var(--display); text-shadow:none; }
#match .vs,#match .vs b { color:#f4dfc7; }
#match .mtop .btn { color:#f4dfc7; background:#443037; border-color:#806467; }
#match .hud { background:#f6ead5!important; color:var(--plum); border:1px solid #d1b897; border-radius:7px; }
#match .hud .rt { font:600 clamp(18px,3vw,30px)/1.15 var(--display); color:var(--plum); }
#match .hud .rs { color:#66534a; }
#match .hud .btn,#match .hud .score span { color:var(--plum); border-color:#cbb395; }
#match .hud .score .timer { color:#66563d; }
#match .hud .ready { background:#58613e; color:#fff9ed; border-color:#58613e; }
#match .stage { background:repeating-linear-gradient(90deg,#ffffff06 0 1px,transparent 1px 6px); }
#match .mat {
 background:repeating-linear-gradient(90deg,#2b251e1a 0 1px,transparent 1px 5px),
   repeating-linear-gradient(0deg,#eaddab16 0 2px,transparent 2px 5px),linear-gradient(var(--mat),var(--mat2));
 box-shadow:0 0 0 6px #392a2c,0 0 0 7px #b39b6a,0 0 0 12px #392a2c,0 20px 40px #1f101d88;
}
.kc img,.now img,.zoom img,.fly img { object-fit:contain; }
.now,.zoom img { aspect-ratio:2/3; }
.endp h2 { font:italic 700 clamp(38px,7vw,62px)/1 var(--display); color:var(--plum); text-shadow:none; }
.endp h2.lose { color:var(--pink); text-shadow:none; }
.endp .k { color:#875344; }
.stats div,.lb li,.plist li { background:#efe5d5; }
@media(max-width:900px) {
 .masthead { flex-wrap:wrap; gap:4px 12px; padding-top:12px; }
 .tabs { margin:0; order:3; width:100%; flex-wrap:nowrap; overflow-x:auto; }
 .mini { margin-left:auto; }
 .tabs button { flex:none; }
 .hero { min-height:390px; }
 .fan { min-height:360px; }
}
@media(max-width:640px) {
 .hero { margin-top:18px; grid-template-columns:1fr; }
 .hcopy { padding:27px 23px; }
 .hero .eyebrow { margin-bottom:14px; }
 .hero h1 { font-size:clamp(39px,10vw,61px); }
 .fan { min-height:255px; }
 .fan img { width:min(29%,126px); }
 .fan-ring { width:240px; }
 .mode-list { grid-template-columns:1fr; gap:8px; }
 .mode { min-height:64px; padding:10px 14px; }
 .mode-mark { width:34px; height:34px; }
 .gal { grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:12px; }
 #match .hud .rs { white-space:normal; }
}
@media(prefers-reduced-motion:reduce) {
 .fan img,.scene,.opps .opp { transition:none; }
}

#title { min-height:100vh; }
.brand { display:flex; align-items:center; }
.mini { display:flex; align-items:center; gap:8px; font-size:14px; }
.shell { display:block; }
.tabs { flex-direction:row; }
.tabs button { line-height:1.2; white-space:nowrap; }
.hero h1 { font-size:clamp(43px,5vw,77px); }
.duo { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.opt>span,.statw th { color:var(--plum); font-weight:700; }
.hud .bar { background:#3d292224; }
.toast { background:var(--plum); color:var(--washi); }
.endp { max-height:calc(100svh - 32px); overflow:auto; }
@media(max-width:640px) {
 .hero h1 { font-size:clamp(39px,10vw,61px); }
 .duo { grid-template-columns:1fr; }
}

#match .hud .score span:not(.timer):not(.xb) { background:#e8d8bd; }
#match .hud .score b { color:var(--plum); }

/* Title mat */
#title:has([data-panel=play]:not([hidden])) {background:#101c26;color:#f8edcf;min-height:100svh}
#title:has([data-panel=play]:not([hidden])) .top {background:#101c26;border-color:#ffffff20}
#title:has([data-panel=play]:not([hidden])) :is(.tabs button,.brand .word,.mini){color:#f3e3c9}
#title:has([data-panel=play]:not([hidden])) .tabs button:hover {background:#38414a}
#title:has([data-panel=play]:not([hidden])) .shell {padding:0;max-width:none}
.dojo {isolation:isolate;position:relative;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:calc(100svh - 76px);box-sizing:border-box;padding:22px 16px 18px;text-align:center;background:linear-gradient(0deg,#101c26 0%,#192e38da 36%,#34334ac9 65%,#8d49478a 100%),url(cards/e95.webp) center 67%/cover}
.dojo:before{content:"";position:absolute;inset:0;z-index:-1;background:repeating-linear-gradient(0deg,transparent 0 3px,#12223322 4px);box-shadow:inset 0 0 14vw #0c172e88}
.moon{position:absolute;z-index:-1;width:min(42vw,470px);aspect-ratio:1;border-radius:50%;top:4%;background:linear-gradient(#ffe1a0cc,#f9a58240 71%,transparent);box-shadow:0 -2px 0 #ffe0b5}
.dojo-head{position:relative;color:#fff5dc;text-shadow:0 4px 24px #18182c}
.dojo-head span{font:700 .78rem var(--ui);text-transform:uppercase;letter-spacing:.33em}
.dojo-head h1{color:inherit;font:italic bold clamp(76px,11vw,154px)/.97 Georgia,serif;letter-spacing:-.09em;margin:0 0 8px;transform:rotate(-4deg);text-shadow:3px 4px #773e47,5px 6px #242333}
.quick-hand{display:flex;align-items:center;justify-content:center;gap:clamp(9px,2vw,36px);padding:22px 0 14px}
.quick-hand button{padding:0;border:2px solid #e8d8aa;background:#e8d8aa;opacity:1;border-radius:4px;width:clamp(82px,15vw,190px);aspect-ratio:2/3;box-shadow:0 11px 16px #050d17aa;transition:transform .22s,opacity .2s;transform:rotate(-7deg)}
.quick-hand button:nth-child(2){transform:translateY(-9px)}
.quick-hand button:nth-child(3){transform:rotate(7deg)}
.quick-hand img{display:block;width:100%;height:100%;border-radius:2px}
.quick-hand button:enabled:hover,.quick-hand button:focus-visible,.quick-hand .taken{transform:translateY(-16px) rotate(0);outline:3px solid #ffce80;outline-offset:4px}
.quick-hand .miss{opacity:.45}
.reader-desk{min-height:106px}
.reader-desk p{margin:8px 0 12px;color:#fff5df;font-weight:600}
.strike{border:2px solid #edcf8c;color:#fff2cf;background:#963b3a;padding:12px 30px;box-shadow:4px 4px #080f18;border-radius:2px;font:700 1.2rem Georgia,serif}
.strike:hover{background:#b24940}
.dojo-menu{border-top:1px solid #c7a87f66;display:flex;flex-wrap:wrap;justify-content:center;gap:8px 20px;margin-top:12px;padding-top:8px}
.dojo-menu button{color:#f3dfbf;background:transparent;border:0;font-weight:650;padding:10px 4px}.dojo-menu button:hover{text-decoration:underline}
#offNote{margin:0;text-align:center;color:#d3c5b4;background:#101c26;padding:10px}
@media(max-width:700px){.dojo{min-height:calc(100svh - 120px)}.quick-hand button{width:min(26vw,150px)}.moon{width:72vw}.dojo-menu{max-width:400px}.dojo-head h1{font-size:clamp(76px,18vw,112px)}}
@media(prefers-reduced-motion:reduce){.quick-hand button{transition:none}}

/* Shared game menus */
#title {
 --bg:#101c26;--panel:#182936;--panel2:#223b45;--line:#806b62;
 --ink:#fff1d3;--dim:#d1c0ac;--plum:#f0d5ad;--cyan:#edd19a;--pink:#ffabaa;--gold:#ffd491;
 min-height:100svh;color:var(--ink);
 background:radial-gradient(ellipse at 88% 0,#65414d 0,transparent 50%),linear-gradient(#273646,#101c26 58%);
 color-scheme:dark;
}
#title .top{background:#101c26;border-color:#ffffff26}
#title :is(.tabs button,.brand .word,.mini){color:#f3e3c9}
#title .tabs button:hover{background:#38414a}
#title [data-panel]>h2{font:italic bold clamp(48px,7vw,96px)/1 Georgia,serif;letter-spacing:-.065em;color:#fff0d1;text-shadow:3px 4px #773e47;margin-bottom:28px}
#title :is(.opanel,.opts,.opp,.ded){background:#162532;color:var(--ink);border-color:#b496705e}
#title :is(.btn,.seg button,select,input,textarea){background:#233847;color:#fff0d1;border-color:#a48467}
#title :is(.go,.seg [aria-pressed=true]){background:#963b3a;color:#fff0d1;border-color:#edcf8c}
#title #stats{overflow:auto}
#title .card-caption{background:#182936;color:#ffedc8}
#title .card-caption small{color:#d1c0ac}
#artView{padding:14px 20px 18px;background:#13212b;border:1px solid #b79a70;color:#ffedc8;max-width:min(90vw,600px);max-height:94dvh;text-align:center}
#artView::backdrop{background:#080e17e8}
#artView form{text-align:right}
#artView figure{margin:8px 0}
#artView figure img{height:min(68dvh,120vw);max-width:100%;object-fit:contain}
.art-controls{display:flex;justify-content:space-between}
#match.flatv .scene{transform:translate(var(--px,0px),var(--py,0px)) scale(var(--zm,1))}
#match #zoomIn,#match #zoomOut{min-width:38px;font-size:1rem}
