:root {
  --bg: #f6f4ee; --surface: #ffffff; --surface2: #eef0ea; --text: #1d2420; --muted: #5d6762; --line: #d5d9d2;
  --accent: #1f5f4a; --accent-ink: #ffffff; --focus: #c2410c; --warn: #9a3412; --ok: #166534;
  --board-green: #2e7d5b; --wood: #e3c28a; --wood-dark: #c79f5b; --sq-light: #ecd9b4; --sq-dark: #a77b4f;
  --card-bg: #ffffff; --card-red: #b91c1c; --card-black: #111827;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141815; --surface: #1d231f; --surface2: #252c27; --text: #e8ece8; --muted: #a2aca5; --line: #34403a;
    --accent: #5fbf96; --accent-ink: #0b1a13; --focus: #fb923c; --warn: #fdba74; --ok: #86efac;
    --card-bg: #f4f1ea; --shadow: 0 1px 2px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 system-ui, -apple-system, "Segoe UI", "Noto Sans", "Hiragino Sans", "Noto Sans JP", "Noto Sans Devanagari", "Noto Sans Arabic", sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: 0; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 10; }
.skip:focus { clip-path: none; width: auto; height: auto; overflow: visible; }
.muted { color: var(--muted); } .small { font-size: .88rem; }

.site-header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 800; text-decoration: none; color: var(--text); font-size: 1.1rem; }
.site-header nav { margin-inline-start: auto; }
.site-header nav a { text-decoration: none; font-weight: 600; }
.langmenu { position: relative; }
.langmenu summary { cursor: pointer; list-style: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .92rem; white-space: nowrap; }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; max-height: 70vh; overflow: auto; z-index: 20; }
.langmenu li a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.langmenu li a:hover, .langmenu li a[aria-current] { background: var(--surface2); }

main { max-width: 1080px; margin: 0 auto; padding: 16px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.25; margin: .4em 0 .3em; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1em 0 .3em; }
.lead { font-size: 1.08rem; max-width: 70ch; }
.crumbs ol { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; font-size: .9rem; flex-wrap: wrap; }
.crumbs li + li::before { content: "›"; margin-inline-end: 6px; color: var(--muted); }
[dir="rtl"] .crumbs li + li::before { content: "‹"; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .92rem; }
.toc { display: flex; gap: 14px; list-style: none; padding: 0; flex-wrap: wrap; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.game-grid.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.game-card a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.game-card a:hover { border-color: var(--accent); }
.game-icon { font-size: 2rem; line-height: 1; }
.game-name { font-weight: 800; font-size: 1.1rem; }
.game-sum { color: var(--muted); font-size: .93rem; }

.play { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin: 14px 0; }
.setup { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; }
.setup fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 8px; margin: 0; }
.setup legend { font-weight: 700; font-size: .92rem; padding: 0 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-item { display: inline-flex; align-items: center; gap: 4px; }
.levels { flex: 1 1 340px; }
.lv { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.lv input { margin-top: .4em; }
.lv label { display: flex; flex-direction: column; line-height: 1.35; }
.lv-desc { color: var(--muted); font-size: .86rem; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opt { display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
select, input[type="range"] { font: inherit; }
select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); min-height: 40px; }
.setup-actions { align-self: flex-end; }
.note { width: 100%; margin: 0; color: var(--warn); font-size: .9rem; }
.btn { font: inherit; font-weight: 600; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 4px 10px; font-size: .88rem; }
.btn.recommend { outline: 3px solid var(--ok); outline-offset: 1px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.status { min-height: 1.6em; font-weight: 700; margin: 6px 0 10px; }
.status[data-kind="warn"] { color: var(--warn); }
.status[data-kind="end"] { color: var(--ok); }
.score { font-weight: 600; margin: 4px 0; }
.tip { min-height: 1.4em; }
.game { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.game > * { max-width: 100%; }

/* grids */
.grid { display: grid; gap: 0; touch-action: manipulation; user-select: none; }
.grid .row { display: contents; }
.grid button { font: inherit; padding: 0; margin: 0; border: 0; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; color: inherit; }
.board-wrap { display: flex; flex-direction: column; gap: 4px; width: min(560px, calc(100vw - 64px)); }
.coords { display: grid; grid-template-columns: repeat(8, 1fr); text-align: center; font-size: .8rem; color: var(--muted); }

.othello { grid-template-columns: repeat(8, 1fr); width: min(520px, calc(100vw - 64px)); background: #1b4d39; padding: 4px; border-radius: 8px; gap: 2px; }
.othello button { background: var(--board-green); border-radius: 2px; }
.othello button.hint::after { content: ""; width: 22%; height: 22%; border-radius: 50%; background: rgba(255,255,255,.35); }
.othello button.last { box-shadow: inset 0 0 0 3px #facc15; }
.disc { width: 82%; height: 82%; border-radius: 50%; box-shadow: 0 2px 2px rgba(0,0,0,.35); }
.disc.b { background: radial-gradient(circle at 35% 30%, #4b5563, #0b0b0b 70%); }
.disc.w { background: radial-gradient(circle at 35% 30%, #ffffff, #d4d4d4 75%); }

.chess { grid-template-columns: repeat(8, 1fr); border: 3px solid #6b4a2b; }
.chess .light { background: var(--sq-light); } .chess .dark { background: var(--sq-dark); }
.chess .sel { box-shadow: inset 0 0 0 4px #2563eb; }
.chess .last { background-image: linear-gradient(rgba(250, 204, 21, .38), rgba(250, 204, 21, .38)); }
.chess .check { background-image: radial-gradient(circle, rgba(220,38,38,.75), transparent 70%); }
.chess .hint::after { content: ""; width: 26%; height: 26%; border-radius: 50%; background: rgba(0,0,0,.28); }
.chess .cap::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 4px solid rgba(0,0,0,.28); }
.pc { font-size: min(9vw, 52px); line-height: 1; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", serif; }
.pc.w { color: #fff; text-shadow: 0 0 2px #000, 0 0 1px #000, 0 1px 1px #000; }
.pc.b { color: #111; text-shadow: 0 0 1px #fff8; }
.movelist { max-height: 420px; overflow: auto; min-width: 180px; margin: 0; padding-inline-start: 2.2em; background: var(--surface2); border-radius: 10px; padding-top: 8px; padding-bottom: 8px; font-variant-numeric: tabular-nums; font-size: .92rem; }

.shogi-wrap { display: flex; flex-direction: column; gap: 8px; }
.shogi { grid-template-columns: repeat(9, 1fr); background: var(--wood); border: 2px solid #5b3b1a; }
.shogi button { background: transparent; border: 1px solid rgba(60, 35, 10, .55); margin: -.5px; }
.shogi + .coords, .board-wrap .coords:has(+ .shogi) { grid-template-columns: repeat(9, 1fr); }
.board-wrap:has(.shogi) .coords { grid-template-columns: repeat(9, 1fr); }
.shogi .sel { background: rgba(37, 99, 235, .3); }
.shogi .hint::after { content: ""; width: 24%; height: 24%; border-radius: 50%; background: rgba(0,0,0,.25); }
.shogi .cap { background: rgba(220, 38, 38, .25); }
.shogi .last { background: rgba(250, 204, 21, .45); }
.koma { display: flex; align-items: center; justify-content: center; width: 84%; height: 92%; background: #f7dca0; color: #1f1408; font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif; font-weight: 700; font-size: min(5.2vw, 30px); clip-path: polygon(50% 0, 88% 18%, 100% 100%, 0 100%, 12% 18%); line-height: 1; padding-top: 12%; }
.koma.rev { transform: rotate(180deg); }
.koma.promoted { color: #b91c1c; }
.hand { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 52px; padding: 6px 8px; background: var(--surface2); border-radius: 10px; }
.hand-label { font-weight: 700; margin-inline-end: 6px; }
.hand-pc { width: 46px; height: 50px; border: 1px solid var(--line); border-radius: 8px; background: var(--wood); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; padding: 0; }
.hand-pc .koma { font-size: 22px; }
.hand-pc.sel { outline: 3px solid #2563eb; }
.hand-pc sub { position: absolute; bottom: 0; inset-inline-end: 3px; font-weight: 800; }

.go-wrap { width: min(620px, calc(100vw - 64px)); }
.go { grid-template-columns: repeat(var(--n), 1fr); background: #dcb468; padding: 2%; border-radius: 6px; box-shadow: var(--shadow); }
.go .pt { background: transparent; }
.go .pt::before, .go .pt::after { content: ""; position: absolute; background: #3b2a14; z-index: 0; }
.go .pt::before { left: 0; right: 0; top: calc(50% - .5px); height: 1px; }
.go .pt::after { top: 0; bottom: 0; left: calc(50% - .5px); width: 1px; }
.go .pt[data-e~="l"]::before { left: 50%; } .go .pt[data-e~="r"]::before { right: 50%; }
.go .pt[data-e~="t"]::after { top: 50%; } .go .pt[data-e~="b"]::after { bottom: 50%; }
.stone, .star, .terr { position: relative; z-index: 1; border-radius: 50%; }
.stone { width: 92%; height: 92%; box-shadow: 1px 2px 2px rgba(0,0,0,.4); }
.stone.b { background: radial-gradient(circle at 35% 30%, #555, #000 70%); }
.stone.w { background: radial-gradient(circle at 35% 30%, #fff, #ccc 80%); }
.stone.dead { opacity: .4; }
.stone.last::after { content: ""; position: absolute; inset: 32%; border-radius: 50%; border: 2px solid #e11d48; }
.star { width: 22%; height: 22%; background: #3b2a14; }
.terr { position: absolute; width: 34%; height: 34%; border-radius: 2px; z-index: 2; }
.terr.b { background: #000; } .terr.w { background: #fff; border: 1px solid #000; }

/* cards */
.table { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.table.seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.seat { background: var(--surface2); border: 2px solid transparent; border-radius: var(--radius); padding: 8px 12px; }
.seat h3 { margin: 0 0 6px; font-size: 1rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seat.active { border-color: var(--accent); }
.seat.target { border-style: dashed; border-color: var(--focus); }
.seat.faded { opacity: .6; }
.seat.dealer { background: #1d5a43; color: #fff; }
.cards { display: flex; flex-wrap: wrap; gap: 6px; }
.card { width: 56px; height: 80px; border-radius: 8px; background: var(--card-bg); color: var(--card-black); border: 1px solid #9ca3af; position: relative; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.25); padding: 0; font-family: system-ui, sans-serif; flex: 0 0 auto; }
button.card { cursor: pointer; }
.card.red { color: var(--card-red); }
.card.joker { color: #6d28d9; }
.card .corner { position: absolute; top: 3px; left: 5px; font-size: .78rem; line-height: 1.05; text-align: center; }
.card .pip { font-size: 1.6rem; }
.card.joker .pip { font-size: .7rem; letter-spacing: .05em; }
.card.down { background: repeating-linear-gradient(45deg, #1f5f4a 0 6px, #2b7a60 6px 12px); border-color: #164534; }
.card.small { width: 34px; height: 48px; border-radius: 5px; }
.card.small .pip { font-size: 1rem; } .card.small .corner { font-size: .6rem; top: 1px; left: 3px; }
.cards.pickable .card:hover:not(:disabled), button.card.playable:hover { transform: translateY(-6px); }
button.card.playable { outline: 3px solid var(--ok); }
.hand-box { padding: 6px; border-radius: 10px; }
.hand-box.active { background: rgba(31, 95, 74, .14); outline: 2px solid var(--accent); }
.hand-meta { margin: 4px 0 0; font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.raise { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.raise input[type="range"] { width: min(260px, 60vw); }
.chip { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.dealer-btn { background: #fff; color: #000; font-weight: 800; }
.bet-ctl { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.board-cards { background: #1d5a43; color: #fff; border-radius: var(--radius); padding: 8px 12px; width: 100%; }
.board-cards h3 { margin: 0 0 6px; }
.sv-table { display: flex; flex-direction: column; gap: 4px; background: #1d5a43; padding: 8px; border-radius: var(--radius); overflow-x: auto; max-width: 100%; }
.sv-row { display: flex; gap: 3px; align-items: center; }
.sv-suit { color: #fff; width: 4.5em; font-size: .85rem; flex: 0 0 auto; }
.sv-suit.red { color: #fecaca; }
.sv-cell { width: 34px; height: 48px; flex: 0 0 auto; display: flex; }
.sv-empty { width: 34px; height: 48px; border: 1px dashed rgba(255,255,255,.3); border-radius: 5px; }

/* rules */
.rules { max-width: 75ch; }
.rules dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.rules dt { font-weight: 700; }
.rules dd { margin: 0; }
.levels-list li { margin-bottom: 4px; }

.dlg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 18px; max-width: min(92vw, 420px); }
.dlg::backdrop { background: rgba(0,0,0,.5); }
.dlg-title { font-weight: 700; margin-top: 0; }
.dlg-row { display: flex; flex-wrap: wrap; gap: 8px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 16px; background: var(--surface); text-align: center; }
.site-footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; list-style: none; padding: 0; }
.root-main { max-width: 720px; }
.lang-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.lang-list a { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding: 12px; }
  .play { padding: 10px; }
  .board-wrap, .othello, .go-wrap { width: calc(100vw - 44px); }
  .card { width: 46px; height: 66px; } .card .pip { font-size: 1.3rem; }
  .rules dl { grid-template-columns: 1fr; } .rules dd { margin-bottom: 6px; }
  .movelist { max-height: 160px; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.play { display: grid; gap: 14px; }
@media (min-width: 900px) { .play { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } .setup-box { position: sticky; top: 70px; } .setup .levels { flex-basis: 100%; } }
.setup-box { background: var(--surface2); border-radius: 10px; padding: 8px 10px; }
.setup-box summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.setup-box .setup { margin-top: 8px; }
.play-main { min-width: 0; }
@media (max-width: 600px) {
  .sv-table { padding: 6px; }
  .sv-row { gap: 2px; }
  .sv-suit { width: 3.2em; font-size: .72rem; }
  .sv-cell, .sv-empty, .sv-cell .card.small { width: 21px; height: 30px; }
  .sv-cell .card.small .pip { font-size: .7rem; }
  .sv-cell .card.small .corner { display: none; }
  .site-header { gap: 8px; }
}

/* ---------- card table: players face each other around the felt ---------- */
.felt {
  --felt: #1f6b4e; --felt-edge: #5b3a21;
  display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) minmax(0, 220px);
  grid-template-areas: "top top top" "left center right" "bottom bottom bottom";
  gap: 10px; align-items: center; width: 100%; padding: 14px;
  background: radial-gradient(ellipse at 50% 45%, #2a8763 0%, var(--felt) 55%, #164c37 100%);
  border: 10px solid var(--felt-edge); border-radius: 48px;
  box-shadow: inset 0 0 24px rgba(0,0,0,.45), 0 6px 16px rgba(0,0,0,.25);
  color: #fff; position: relative; overflow: visible;
}
.felt.wide { grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto); grid-template-areas: "left top right" "center center center" "bottom bottom bottom"; }
.felt.wide .felt-center { overflow-x: auto; justify-content: safe center; }
.felt-top { grid-area: top; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.felt-left { grid-area: left; min-width: 0; } .felt-right { grid-area: right; min-width: 0; }
.felt .cards.pickable { flex-wrap: wrap; }
.felt-center { grid-area: center; display: flex; justify-content: center; align-items: center; min-height: 92px; min-width: 0; }
.felt-bottom { grid-area: bottom; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.felt .seat { background: rgba(0,0,0,.22); color: #fff; border: 2px solid rgba(255,255,255,.12); text-align: center; min-width: 0; }
.felt .seat h3 { justify-content: center; font-size: .92rem; }
.felt .seat .cards { justify-content: center; }
.felt .seat.active { border-color: #fde68a; box-shadow: 0 0 0 3px rgba(253,230,138,.35); }
.felt .seat.target { border-style: dashed; border-color: #93c5fd; }
.felt .seat.dealer { background: rgba(0,0,0,.3); }
.felt .hand-meta { color: #e5f3ec; }
.felt .chip { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.felt .dealer-btn { background: #fff; color: #000; }
.felt .muted { color: #cfe6da; }
.felt .seat.at-bottom { flex: 1 1 280px; max-width: 760px; }
.felt .hand-box.active { background: rgba(255,255,255,.1); outline-color: #fde68a; }
.felt .bet-ctl label { color: #fff; }
.felt .board-cards { background: transparent; padding: 0; display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; width: auto; }
.board-main { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pot { margin: 0; font-weight: 700; }
.board-slots { min-height: 80px; min-width: 120px; border: 1px dashed rgba(255,255,255,.3); border-radius: 8px; }
.bet-stack { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: #facc15; color: #3b2a00; font-weight: 800; font-size: .8rem; box-shadow: 0 2px 0 #a16207; }
.felt .sv-table { background: rgba(0,0,0,.18); }
.pile-area { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pile-label { margin: 0; }

/* fanned hands and the deck */
.cards.fan { flex-wrap: nowrap; gap: 0; }
.card { --cw: 56px; }
.card.mini { --cw: 36px; }
.cards.fan > .card + .card { margin-left: min(6px, calc(var(--vis, 20px) - var(--cw))); }
.card.mini { width: 36px; height: 52px; border-radius: 6px; }
.card.mini .pip { font-size: 1rem; } .card.mini .corner { font-size: .58rem; top: 2px; left: 3px; }
.my-hand { gap: 5px; }
.deck-pile { position: relative; width: 56px; height: 80px; flex: 0 0 auto; }
.deck-pile .card { position: absolute; inset: 0; }
.deck-pile .card + .card { translate: -3px -3px; }
.deck-count { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: .78rem; color: #e5f3ec; }
.card { transform-style: preserve-3d; }
.card .flip-back { position: absolute; inset: -1px; border-radius: inherit; background: repeating-linear-gradient(45deg, #1f5f4a 0 6px, #2b7a60 6px 12px); border: 1px solid #164534; }
.card.flying { z-index: 20; box-shadow: 0 10px 16px rgba(0,0,0,.35); }
.felt .cards.pickable { gap: 4px; }
.felt .cards.pickable .card { cursor: pointer; }
.felt .cards.pickable .card:hover:not(:disabled) { translate: 0 -6px; }

/* "Play again" after a game ends */
.rematch { display: block; margin: 10px auto; font-size: 1.1rem; padding: 12px 28px; animation: rematch-in .35s ease-out; }
@keyframes rematch-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }

/* pieces sit above neighbouring squares while they move */
.grid .cell, .grid .pt { position: relative; }
.pc, .koma, .disc { position: relative; }
.pc, .koma, .disc, .stone { will-change: translate, scale; }

@media (max-width: 700px) {
  .felt { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 10px 8px; border-width: 7px; border-radius: 28px; }
  .felt-left, .felt-right, .felt-top { display: contents; }
  .felt .seat.at-left, .felt .seat.at-top, .felt .seat.at-right { flex: 1 1 140px; max-width: 48%; padding: 6px; }
  .felt-center { flex: 1 1 100%; }
  .felt-bottom { flex: 1 1 100%; }
  .felt .seat h3 { font-size: .82rem; }
  .card { --cw: 46px; }
  .cards.fan > .card + .card { margin-left: min(4px, calc(var(--vis, 20px) * .6 - var(--cw))); }
  .card.mini { width: 26px; height: 38px; --cw: 26px; }
  .card.mini .pip { font-size: .78rem; } .card.mini .corner { display: none; }
  .deck-pile { width: 46px; height: 66px; }
}
@media (prefers-reduced-motion: reduce) { .rematch { animation: none; } }

/* phones: keep the header on one line so the language button stays at the right edge */
@media (max-width: 600px) {
  .site-header { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; }
  .brand { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
  .site-header nav { margin-inline-start: 0; flex: 0 0 auto; white-space: nowrap; font-size: .9rem; }
  .langmenu { flex: 0 0 auto; }
  .langmenu summary { padding: 5px 8px; font-size: .85rem; }
  .langmenu ul { min-width: 0; width: max-content; max-width: calc(100vw - 24px); }
  [dir="rtl"] .site-header { flex-direction: row-reverse; }
  [dir="rtl"] .langmenu ul { inset-inline-end: auto; inset-inline-start: 0; }
}

/* ---------- casino-style games (play chips only) ---------- */
.dlg-title { white-space: pre-line; }
.wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.wallet-label { font-weight: 700; }
.wallet-amt { font-size: 1.35rem; font-variant-numeric: tabular-nums; color: var(--accent); }
.play-money { margin-top: 8px; }
.casino-controls { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.big-btn { font-size: 1.1rem; padding: 12px 26px; }
.chip-picker, .bet-select { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-btn { --c: #64748b; width: 46px; height: 46px; border-radius: 50%; border: 4px dashed #fff; background: var(--c); color: #fff; font-weight: 800; font-size: .85rem;
  box-shadow: 0 0 0 2px var(--c), 0 3px 6px rgba(0,0,0,.3); cursor: pointer; padding: 0; transition: transform .12s; }
.chip-btn.small { width: 38px; height: 38px; font-size: .78rem; border-width: 3px; }
.chip-btn[aria-checked="true"] { transform: translateY(-4px) scale(1.08); box-shadow: 0 0 0 3px #facc15, 0 6px 10px rgba(0,0,0,.35); }
.chip-btn:disabled { opacity: .45; cursor: default; }
.chip-btn.c1 { --c: #64748b; } .chip-btn.c2 { --c: #0891b2; } .chip-btn.c5 { --c: #dc2626; } .chip-btn.c10 { --c: #2563eb; }
.chip-btn.c25 { --c: #16a34a; } .chip-btn.c50 { --c: #ea580c; } .chip-btn.c100 { --c: #111827; } .chip-btn.c500 { --c: #7c3aed; }
.chip-stack { position: absolute; right: 4px; bottom: 4px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; background: #facc15; color: #3b2a00;
  font-weight: 800; font-size: .72rem; display: inline-flex; align-items: center; justify-content: center; border: 2px dashed #fff; box-shadow: 0 2px 4px rgba(0,0,0,.4); pointer-events: none; animation: chip-in .18s ease-out; }
@keyframes chip-in { from { translate: 0 -14px; scale: 1.3; opacity: 0; } }

/* baccarat */
.roads { display: grid; gap: 8px; margin-bottom: 10px; }
@media (min-width: 700px) { .roads { grid-template-columns: auto 1fr; } .road-stats { grid-column: 1 / -1; } }
.road-wrap { min-width: 0; }
.road-wrap h3 { margin: 0 0 4px; font-size: .82rem; }
.road { display: grid; grid-template-rows: repeat(6, 18px); grid-auto-flow: column; grid-auto-columns: 18px; gap: 1px; background: var(--line); border: 1px solid var(--line); width: max-content; max-width: 100%; overflow-x: auto; }
.road.big-road { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(var(--cols), 18px); }
.road span { width: 18px; height: 18px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 800; position: relative; }
.rd.b::before, .rd.p::before { content: ""; width: 13px; height: 13px; border-radius: 50%; border: 3px solid #dc2626; box-sizing: border-box; }
.rd.p::before { border-color: #2563eb; }
.tie-mark { position: absolute; width: 16px; height: 2px; background: #16a34a; transform: rotate(-45deg); font-style: normal; font-size: .5rem; }
.bd.b, .bd.p, .bd.t { color: #fff; border-radius: 50%; } .bd.b { background: #dc2626; } .bd.p { background: #2563eb; } .bd.t { background: #16a34a; }
.bac-felt { display: flex; flex-direction: column; gap: 14px; }
.bac-shoe { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.bac-hands { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.bac-hand { background: rgba(0,0,0,.22); border: 2px solid rgba(255,255,255,.15); border-radius: 14px; padding: 8px; min-height: 130px; text-align: center; transition: box-shadow .3s, border-color .3s; }
.bac-hand h3 { margin: 0 0 6px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.bac-hand.player h3 { color: #93c5fd; } .bac-hand.banker h3 { color: #fca5a5; }
.bac-hand.winner { border-color: #facc15; box-shadow: 0 0 18px rgba(250,204,21,.6); }
.bac-total { display: inline-flex; min-width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #111; font-weight: 900; align-items: center; justify-content: center; }
.bac-cards { justify-content: center; min-height: 82px; }
.bac-cards .card.third { rotate: 90deg; margin-left: 12px; }
.bac-vs { font-weight: 900; color: #fde68a; }
.bet-spots { display: grid; grid-template-columns: 1fr 1.6fr 1fr 1.6fr 1fr; gap: 6px; }
.bet-spot { position: relative; min-height: 74px; border-radius: 12px; border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.06); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 800; padding: 6px 4px; transition: background .2s, transform .1s; }
.bet-spot:hover:not(:disabled) { background: rgba(255,255,255,.14); } .bet-spot:active:not(:disabled) { transform: scale(.98); }
.bet-spot.s-player { border-color: #93c5fd; } .bet-spot.s-banker { border-color: #fca5a5; } .bet-spot.s-tie { border-color: #86efac; }
.spot-name { font-size: .9rem; } .spot-pay { font-size: .72rem; opacity: .8; }
.bet-spot.won { background: rgba(250,204,21,.35); box-shadow: 0 0 16px rgba(250,204,21,.7); }
.bet-spot.lost { opacity: .6; }
@media (max-width: 600px) { .bet-spots { grid-template-columns: 1fr 1fr 1fr; } .bet-spot.s-ppair, .bet-spot.s-bpair { min-height: 54px; } .bac-hands { grid-template-columns: 1fr 1fr; } .bac-vs { display: none; } }

/* slots */
.slot-machine { background: linear-gradient(180deg, #7f1d1d, #450a0a); border: 6px solid #e8c35a; border-radius: 20px; padding: 12px; color: #fff; box-shadow: inset 0 0 20px rgba(0,0,0,.5), 0 8px 18px rgba(0,0,0,.3); position: relative; }
.slot-machine.free { background: linear-gradient(180deg, #4c1d95, #1e1b4b); }
.slot-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.slot-title { font-weight: 900; letter-spacing: .08em; color: #fde68a; text-shadow: 0 0 8px #f59e0b; }
.free-banner { background: #facc15; color: #3b0764; font-weight: 900; padding: 2px 10px; border-radius: 999px; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { scale: 1.06; } }
.reels { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: #111; padding: 6px; border-radius: 10px; aspect-ratio: 5 / 3; }
.reel { position: relative; overflow: hidden; background: linear-gradient(180deg, #d1d5db, #fff 20%, #fff 80%, #d1d5db); border-radius: 6px; }
.reel.tease { box-shadow: 0 0 0 3px #facc15, 0 0 20px #facc15; }
.strip { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; }
.strip .sym { flex: 0 0 auto; }
.strip.spinning .sym { filter: blur(1.2px); }
.sym { display: flex; align-items: center; justify-content: center; font-size: clamp(1.1rem, 5.5vw, 2.3rem); font-weight: 900; color: #111; line-height: 1; }
.sym-seven { color: #dc2626; text-shadow: 0 2px 0 #7f1d1d; font-style: italic; }
.sym-bar > *, .sym-wild > * { pointer-events: none; }
.sym-bar { font-size: clamp(.65rem, 2.8vw, 1.05rem); color: #fff; text-shadow: 0 0 0 transparent; }
.sym-bar, .sym-wild { position: relative; }
.sym-bar::after, .sym-wild::after { content: ""; position: absolute; inset: 24% 10%; border-radius: 5px; z-index: -1; }
.sym-bar::after { background: #111; }
.sym-wild { font-size: clamp(.6rem, 2.6vw, 1rem); color: #fff; letter-spacing: .05em; }
.sym-wild::after { background: linear-gradient(135deg, #7c3aed, #db2777); inset: 18% 6%; }
.sym-bar, .sym-wild { isolation: isolate; }
.sym.hit-line, .sym.hit { animation: sym-hit .6s ease-in-out infinite alternate; }
@keyframes sym-hit { to { scale: 1.12; filter: drop-shadow(0 0 6px #f59e0b); } }
.line-overlay { position: absolute; left: 6px; top: 6px; width: calc(100% - 12px); height: calc(100% - 12px); pointer-events: none; }
.line-overlay .wl { fill: none; stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.wl.c0 { stroke: #facc15; } .wl.c1 { stroke: #22d3ee; } .wl.c2 { stroke: #f472b6; } .wl.c3 { stroke: #4ade80; } .wl.c4 { stroke: #fb923c; } .wl.c5 { stroke: #a78bfa; }
.slot-win { min-height: 1.6em; text-align: center; font-weight: 900; color: #fde68a; margin-top: 8px; font-size: 1.05rem; }
.spin-btn { min-width: 160px; }
.big-win { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(124,58,237,.88), rgba(0,0,0,.88)); color: #fde68a; border-radius: 14px; z-index: 30; animation: bw-in .4s ease-out; }
.big-win b { font-size: clamp(2rem, 9vw, 4rem); letter-spacing: .06em; text-shadow: 0 0 18px #f59e0b; animation: pulse .5s infinite alternate; }
.big-win .bw-amt { font-size: 2rem; font-weight: 900; color: #fff; }
.big-win.mega b { color: #fff; text-shadow: 0 0 24px #ec4899; }
@keyframes bw-in { from { opacity: 0; scale: .6; } }
#game { position: relative; }

/* roulette */
.rt-top { display: grid; gap: 14px; align-items: start; }
@media (min-width: 700px) { .rt-top { grid-template-columns: minmax(220px, 320px) 1fr; } }
.rt-wheel-wrap { position: relative; }
.rt-wheel { width: 100%; max-width: 320px; aspect-ratio: 1; display: block; margin: 0 auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.rt-result { position: absolute; top: 6px; right: 6px; }
.rt-num { display: inline-flex; min-width: 46px; height: 46px; padding: 0 6px; border-radius: 50%; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 1.3rem; animation: chip-in .3s ease-out; }
.rt-num.small { min-width: 26px; height: 26px; font-size: .8rem; animation: none; }
.rt-num.red { background: #b91c1c; } .rt-num.black { background: #111827; } .rt-num.green { background: #15803d; }
.rt-history { display: flex; flex-wrap: wrap; gap: 4px; }
.rt-side h3 { margin: 0 0 6px; font-size: .95rem; }
.rt-scroll { overflow-x: auto; margin-top: 12px; padding-bottom: 6px; }
.rt-board { position: relative; width: 100%; min-width: 600px; aspect-ratio: 100 / 40; background: #1f6b4e; border: 6px solid #5b3a21; border-radius: 10px; box-sizing: content-box; }
.rt-cell { position: absolute; border: 1px solid #e5e7eb88; color: #fff; font-weight: 800; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 0; }
.rt-cell .rt-label { pointer-events: none; }
.rt-cell.red .rt-label, .rt-cell.black .rt-label, .rt-cell.green .rt-label { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; }
.rt-cell.red .rt-label { background: #b91c1c; } .rt-cell.black .rt-label { background: #111827; } .rt-cell.green .rt-label { background: #15803d; border-radius: 8px; }
.rt-cell:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.rt-cell.outside.red .rt-label { background: none; color: #ef4444; font-size: 1.6rem; } .rt-cell.outside.black .rt-label { background: none; color: #000; font-size: 1.6rem; }
.rt-cell.winning { box-shadow: inset 0 0 0 3px #facc15; animation: sym-hit .5s infinite alternate; z-index: 2; }
.rt-cell.won { background: rgba(250,204,21,.3); }
.rt-cell .chip-stack, .rt-spot .chip-stack { right: auto; bottom: auto; left: 50%; top: 50%; translate: -50% -50%; }
.rt-spot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; z-index: 3; padding: 0; }
.rt-spot:hover:not(:disabled), .rt-spot:focus-visible { background: rgba(250,204,21,.6); }
.rt-spot.won .chip-stack { box-shadow: 0 0 0 3px #22c55e; }

/* pachinko */
.pachi-wrap { display: flex; justify-content: center; }
.pachi-canvas { width: 100%; max-width: 420px; aspect-ratio: 360 / 520; border-radius: 18px; box-shadow: 0 8px 20px rgba(0,0,0,.35); touch-action: manipulation; background: #120c22; }
.pachi-controls input[type="range"] { width: min(360px, 100%); accent-color: #e11d48; }
.fire-btn { min-width: 200px; touch-action: none; user-select: none; -webkit-user-select: none; }
.fire-btn.on { background: #e11d48; border-color: #e11d48; box-shadow: 0 0 0 4px rgba(225,29,72,.3); }
.pachi-str { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .chip-stack, .free-banner, .big-win, .big-win b, .sym.hit-line, .sym.hit, .rt-cell.winning, .rt-num { animation: none !important; } }
.reel { container-type: size; }
.strip .sym { height: 33.3333cqh; }
.game > .wallet, .game > .slot-machine, .game > .casino-controls, .game > .roads, .game > .felt, .game > .rt-top, .game > .rt-scroll, .game > .pachi-wrap, .game > .play-money, .game > p.muted { flex: 1 1 100%; }
.slot-machine { max-width: 640px; margin-inline: auto; }

/* ===================== puzzle games: arcade cabinet ===================== */
.game > .arcade, .game > #np-rank, .game > #mg-rank, .game > #mn-rank, .game > #sl-rank, .game > #gm-rank, .game > #lt-rank { flex: 1 1 100%; }
.arcade { --neon1: #ff3df2; --neon2: #29e7ff; --neon3: #ffe14d; --scr: #0b0a1d; position: relative; width: 100%; max-width: 620px; margin: 0 auto; padding: 14px 14px 10px; border-radius: 22px 22px 14px 14px;
  background: linear-gradient(180deg, #2a1550 0%, #160b2e 60%, #0f0820 100%); color: #f4f1ff;
  box-shadow: 0 0 0 3px #3b1d6e, 0 0 0 5px var(--neon1), 0 0 22px rgba(255,61,242,.45), 0 12px 30px rgba(0,0,0,.35); }
.arc-marquee { text-align: center; margin: -2px 0 10px; padding: 6px 10px; border-radius: 10px; background: radial-gradient(120% 140% at 50% 0%, #4b1d8c 0%, #1a0b37 70%);
  border: 2px solid var(--neon2); box-shadow: inset 0 0 14px rgba(41,231,255,.35), 0 0 10px rgba(41,231,255,.4); }
.arc-marquee span { font: 900 clamp(1rem, 4.2vw, 1.45rem)/1.2 ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; letter-spacing: .08em; color: #fff;
  text-shadow: 0 0 4px #fff, 0 0 10px var(--neon1), 0 0 20px var(--neon1); animation: arc-flicker 6s infinite; }
@keyframes arc-flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .55; } 94% { opacity: 1; } 96% { opacity: .7; } }
.arc-hud { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; margin-bottom: 8px; }
.arc-stat { flex: 1 1 0; min-width: 76px; text-align: center; padding: 4px 6px; border-radius: 8px; background: #07061a; border: 1px solid #3a2a6a; }
.arc-k { display: block; font: 700 .68rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--neon2); }
.arc-v { display: block; font: 800 1.15rem/1.3 ui-monospace, Menlo, Consolas, monospace; color: var(--neon3); text-shadow: 0 0 6px rgba(255,225,77,.6); font-variant-numeric: tabular-nums; }
.arc-screen { position: relative; padding: 12px; border-radius: 14px; background: var(--scr); border: 3px solid #050414; box-shadow: inset 0 0 30px rgba(41,231,255,.12), inset 0 0 0 1px #2c2457; overflow: hidden; }
.arc-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px); border-radius: inherit; }
.arc-deck { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; height: 26px; }
.arc-stick { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a8a, #c0142b); box-shadow: 0 6px 0 -3px #333; }
.arc-btn { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); }
.arc-btn.a { background: var(--neon1); } .arc-btn.b { background: var(--neon2); } .arc-btn.c { background: var(--neon3); }
.arc-banner { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; text-align: center; gap: 6px; background: rgba(5,4,20,.72); animation: arc-in .35s ease-out; pointer-events: none; }
.arc-banner b { font: 900 clamp(1.6rem, 8vw, 2.8rem)/1.1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: #fff; text-shadow: 0 0 6px #fff, 0 0 18px var(--neon2), 0 0 30px var(--neon2); animation: arc-blink 1s steps(2) 3; }
.arc-banner.over b { text-shadow: 0 0 6px #fff, 0 0 18px var(--neon1), 0 0 30px var(--neon1); }
.arc-banner span { font: 700 1.05rem ui-monospace, Menlo, Consolas, monospace; color: var(--neon3); }
@keyframes arc-in { from { opacity: 0; transform: scale(1.15); } }
@keyframes arc-blink { 50% { opacity: .25; } }
.arc-rank { max-width: 620px; margin: 14px auto 0; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.arc-rank h3 { margin: 0 0 6px; font-size: 1rem; } .arc-rank ol { margin: 0; padding-inline-start: 1.6em; }
.arc-rank li span { margin-inline-start: 10px; }
.arc-toggle { display: block; margin: 10px auto 0; background: #1c1646; color: #fff; border-color: var(--neon2); }
.arc-toggle[aria-pressed="true"] { background: #4a1240; border-color: var(--neon1); }
.arcade button:focus-visible { outline: 3px solid var(--neon3); outline-offset: 1px; }

/* number place */
.np-board { display: grid; grid-template-columns: repeat(9, 1fr); width: min(100%, 470px); margin: 0 auto; border: 3px solid var(--neon2); border-radius: 6px; background: #1a1640; box-shadow: 0 0 12px rgba(41,231,255,.35); }
.np-cell { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-right: 1px solid #3a3470; border-bottom: 1px solid #3a3470; background: #100d2c; color: #8ff3ff; font: 700 clamp(.95rem, 4.4vw, 1.5rem)/1 ui-monospace, Menlo, Consolas, monospace; cursor: pointer; position: relative; }
.np-cell.given { color: #fff; }
.np-cell.br { border-right: 2px solid var(--neon2); } .np-cell.bb { border-bottom: 2px solid var(--neon2); }
.np-cell.peer { background: #1b1748; } .np-cell.same { background: #3a2a7a; } .np-cell.sel { background: #5a2a8a; box-shadow: inset 0 0 0 2px var(--neon3); }
.np-cell.bad { color: #ff6b8b; background: #3b0f2a; }
.np-notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); font-size: clamp(.45rem, 1.6vw, .62rem); color: #b9a8ff; line-height: 1; }
.np-notes i { font-style: normal; display: grid; place-items: center; }
.np-pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; width: min(100%, 470px); margin: 10px auto 0; }
.np-key { padding: 6px 0 2px; border-radius: 8px; border: 1px solid #4a3c8f; background: #1c1646; color: #fff; cursor: pointer; display: grid; line-height: 1.1; }
.np-key b { font: 800 1.2rem ui-monospace, Menlo, Consolas, monospace; } .np-key small { font-size: .65rem; color: var(--neon2); }
.np-key.done { opacity: .35; } .np-key.wide { grid-column: span 3; padding: 8px 4px; font-weight: 700; }
.np-key.on { background: #4a1240; border-color: var(--neon1); }

/* merge numbers */
.mg-grid { --gap: 8px; position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 0 auto; border-radius: 12px; background: #1a1640; box-shadow: 0 0 14px rgba(255,61,242,.3); }
.mg-bg { position: absolute; inset: var(--gap); display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: var(--gap); }
.mg-cell { border-radius: 8px; background: #0e0b26; }
.mg-tile { --cs: calc((100% - var(--gap) * (var(--n) + 1)) / var(--n)); position: absolute; width: var(--cs); height: var(--cs); left: calc(var(--gap) + (var(--cs) + var(--gap)) * var(--x)); top: calc(var(--gap) + (var(--cs) + var(--gap)) * var(--y));
  display: grid; place-items: center; border-radius: 8px; font: 900 clamp(1rem, 6vw, 2rem)/1 ui-monospace, Menlo, Consolas, monospace; transition: left .1s ease-out, top .1s ease-out; color: #0b0a1d; }
.mg-tile.small { font-size: clamp(.8rem, 4.4vw, 1.5rem); }
.mg-tile.v2 { background: #8ff3ff; } .mg-tile.v4 { background: #6ce0ff; } .mg-tile.v8 { background: #ffd36b; } .mg-tile.v16 { background: #ffb347; } .mg-tile.v32 { background: #ff8a5c; }
.mg-tile.v64 { background: #ff5c7a; color: #fff; } .mg-tile.v128 { background: #ff3df2; color: #fff; box-shadow: 0 0 10px #ff3df2; } .mg-tile.v256 { background: #c13dff; color: #fff; box-shadow: 0 0 12px #c13dff; }
.mg-tile.v512 { background: #7d4dff; color: #fff; box-shadow: 0 0 14px #7d4dff; } .mg-tile.v1024 { background: #3d7dff; color: #fff; box-shadow: 0 0 16px #3d7dff; } .mg-tile.v2048 { background: #ffe14d; box-shadow: 0 0 22px #ffe14d; }
.mg-tile.v4096, .mg-tile.v8192 { background: #fff; box-shadow: 0 0 24px #fff; }
.mg-tile.new { animation: mg-new .18s ease-out; } .mg-tile.pop { animation: mg-pop .2s ease-out; }
@keyframes mg-new { from { transform: scale(0); } } @keyframes mg-pop { 50% { transform: scale(1.18); } }
.mg-arrows { display: grid; grid-template-columns: repeat(3, 52px); grid-template-areas: ". up ." "left down right"; gap: 6px; justify-content: center; margin-top: 10px; }
.mg-arrow { height: 44px; border-radius: 10px; border: 1px solid #4a3c8f; background: #1c1646; color: var(--neon2); font-size: 1.1rem; cursor: pointer; }
.mg-arrow.up { grid-area: up; } .mg-arrow.left { grid-area: left; } .mg-arrow.down { grid-area: down; } .mg-arrow.right { grid-area: right; }

/* mines */
.mn-wrap { overflow: auto; max-width: 100%; }
.mn-board { display: grid; grid-template-columns: repeat(var(--w), minmax(22px, 1fr)); width: min(100%, calc(var(--w) * 36px)); min-width: calc(var(--w) * 22px + (var(--w) - 1) * 2px); margin: 0 auto; gap: 2px; }
.mn-cell { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 4px; background: linear-gradient(180deg, #3c3290, #2a2370); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); color: #fff; font: 800 clamp(.7rem, 2.6vw, 1rem)/1 ui-monospace, Menlo, Consolas, monospace; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mn-cell.open { background: #0e0b26; box-shadow: none; cursor: default; }
.mn-cell.n1 { color: #29e7ff; } .mn-cell.n2 { color: #6bff8a; } .mn-cell.n3 { color: #ff6b8b; } .mn-cell.n4 { color: #c18bff; } .mn-cell.n5 { color: #ffb347; } .mn-cell.n6 { color: #5ff7d0; } .mn-cell.n7 { color: #fff; } .mn-cell.n8 { color: #aaa; }
.mn-cell.mine { background: #2b0d1d; color: #ff3df2; } .mn-cell.boom { background: #ff3d5e; color: #fff; animation: mn-boom .5s ease-out; } .mn-cell.wrong { background: #3b2a0d; color: #ffb347; }
@keyframes mn-boom { 0% { transform: scale(1.6); box-shadow: 0 0 30px #ff3d5e; } }

/* sliding puzzle */
.sl-board { --gap: 6px; position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 0 auto; border-radius: 12px; background: #0e0b26; box-shadow: inset 0 0 0 2px #2c2457; }
.sl-tile { --cs: calc((100% - var(--gap) * (var(--n) + 1)) / var(--n)); position: absolute; width: var(--cs); height: var(--cs); left: calc(var(--gap) + (var(--cs) + var(--gap)) * var(--x)); top: calc(var(--gap) + (var(--cs) + var(--gap)) * var(--y));
  border: 0; border-radius: 10px; background: linear-gradient(160deg, #4b2aa0, #2a1a6a); color: #fff; font: 900 clamp(1rem, 6vw, 2rem)/1 ui-monospace, Menlo, Consolas, monospace; box-shadow: inset 0 -4px 0 rgba(0,0,0,.35), 0 0 0 1px #6b4ad0; transition: left .12s ease-out, top .12s ease-out; cursor: pointer; }
.sl-tile.home { background: linear-gradient(160deg, #1aa6c4, #145c8a); box-shadow: inset 0 -4px 0 rgba(0,0,0,.35), 0 0 10px rgba(41,231,255,.5); }
.sl-tile[aria-disabled="true"] { cursor: default; }

/* gem match */
.gm-bar { height: 8px; border-radius: 4px; background: #1a1640; margin-bottom: 8px; overflow: hidden; } .gm-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--neon1), var(--neon3)); transition: width .1s linear; }
.gm-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; width: min(100%, 440px); margin: 0 auto; padding: 4px; border-radius: 10px; background: #120f33; overflow: hidden; }
.gm-cell { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 8px; background: #1c1748; cursor: pointer; display: grid; place-items: center; transition: transform .12s; }
.gm-gem { font-size: clamp(1.3rem, 7.2vw, 2.5rem); line-height: 1; filter: drop-shadow(0 0 4px currentColor); }
.gm-cell.g0 { color: #ff4d6d; } .gm-cell.g1 { color: #29e7ff; } .gm-cell.g2 { color: #6bff8a; } .gm-cell.g3 { color: #ffe14d; } .gm-cell.g4 { color: #c18bff; } .gm-cell.g5 { color: #ffffff; }
.gm-cell.sel { background: #4a1f80; box-shadow: inset 0 0 0 2px var(--neon3); transform: scale(1.06); }
.gm-cell.hint { animation: gm-hint .6s ease-in-out 3; } @keyframes gm-hint { 50% { background: #5a4a10; } }
.gm-cell.clear .gm-gem { animation: gm-clear .22s ease-in forwards; } @keyframes gm-clear { to { transform: scale(1.8); opacity: 0; } }
.gm-gem.fall { animation: gm-fall .26s cubic-bezier(.3,.7,.4,1); } @keyframes gm-fall { from { transform: translateY(calc(var(--fall) * -110%)); } }
.gm-combo { min-height: 1.6em; text-align: center; margin-top: 6px; font: 900 1.1rem ui-monospace, Menlo, Consolas, monospace; color: var(--neon3); text-shadow: 0 0 8px var(--neon1); }

/* light flip */
.lt-board { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; width: min(100%, 400px); margin: 0 auto; }
.lt-lamp { aspect-ratio: 1; min-width: 0; border-radius: 50%; border: 2px solid #3a3470; background: radial-gradient(circle at 40% 35%, #2a2560, #0e0b26); cursor: pointer; transition: background .15s, box-shadow .15s; }
.lt-lamp.on { border-color: #fff4b0; background: radial-gradient(circle at 40% 35%, #fffbe0, #ffe14d 45%, #ff9f1a); box-shadow: 0 0 16px #ffe14d, 0 0 32px rgba(255,159,26,.6); }
.lt-lamp.sol { outline: 3px dashed var(--neon2); outline-offset: 2px; }
.lt-lamp.flash { animation: lt-flash .2s ease-out; } @keyframes lt-flash { 50% { transform: scale(.9); } }

@media (prefers-reduced-motion: reduce) { .arc-marquee span, .arc-banner, .arc-banner b, .mg-tile, .gm-gem, .gm-cell, .mn-cell, .lt-lamp { animation: none !important; transition: none !important; } }
@media (max-width: 600px) { .arcade { padding: 10px 8px 8px; border-radius: 16px 16px 10px 10px; } .arc-screen { padding: 8px; } .arc-stat { min-width: 64px; } .arc-v { font-size: 1rem; } }

/* ===================== action games ===================== */
.act-canvas { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 8px; background: #07051a; touch-action: none; outline: none; }
.act-canvas.tall { max-width: 360px; }
.act-canvas:focus-visible { box-shadow: 0 0 0 3px var(--neon3); }
.act-start { white-space: nowrap; position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 2; font: 900 1.4rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; padding: 12px 30px; box-shadow: 0 0 18px var(--neon1); animation: arc-blink 1.2s steps(2) infinite; }
.act-touch-note { margin: 8px 0 0; text-align: center; font-size: .85rem; color: var(--neon2); }
.act-pads { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; user-select: none; -webkit-user-select: none; }
.act-pads.desk .act-pad { min-height: 38px; font-size: .8rem; }
.act-dpad, .act-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.act-btns { justify-content: flex-end; }
.act-pad { min-width: 54px; min-height: 50px; padding: 6px 10px; border-radius: 12px; border: 1px solid #4a3c8f; background: #1c1646; color: #fff; font: 800 .95rem ui-monospace, Menlo, Consolas, monospace; touch-action: none; -webkit-touch-callout: none; cursor: pointer; }
.act-pad.on { background: #4a1f80; box-shadow: 0 0 10px var(--neon1); }
.act-pad.a { background: #6a1250; border-color: var(--neon1); } .act-pad.b { background: #113a5a; border-color: var(--neon2); } .act-pad.c { background: #4a3c10; border-color: var(--neon3); }
@media (max-width: 600px) { .act-pad { min-width: 46px; min-height: 48px; padding: 4px 6px; font-size: .8rem; } .act-pads { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .act-start { animation: none; } }

/* ===== slot: lever, stop buttons, chance action, lights out ===== */
.game > .slot-cabinet { flex: 1 1 100%; }
.slot-cabinet { display: flex; align-items: stretch; justify-content: center; gap: 6px; max-width: 700px; margin-inline: auto; }
.slot-cabinet .slot-machine { flex: 1 1 auto; min-width: 0; margin: 0; }
.slot-lamps { display: flex; justify-content: space-between; margin: 0 4px 6px; }
.slot-lamps i { width: 10px; height: 10px; border-radius: 50%; background: #fde68a; box-shadow: 0 0 6px #f59e0b; animation: lamp 1.6s ease-in-out infinite; }
.slot-lamps i:nth-child(2n) { animation-delay: .4s; } .slot-lamps i:nth-child(3n) { animation-delay: .8s; }
@keyframes lamp { 50% { opacity: .35; } }
.stop-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.stop-btn { min-height: 44px; border-radius: 50% / 40%; border: 3px solid #7f1d1d; background: radial-gradient(circle at 40% 30%, #fecaca, #dc2626 55%, #7f1d1d); color: #fff; font: 900 .78rem system-ui, sans-serif; letter-spacing: .06em; cursor: pointer; box-shadow: 0 4px 0 #450a0a; touch-action: manipulation; }
.stop-btn:disabled { background: radial-gradient(circle at 40% 30%, #9ca3af, #4b5563 60%, #1f2937); border-color: #1f2937; box-shadow: 0 1px 0 #111; color: #d1d5db; cursor: default; transform: translateY(3px); }
.stop-btn:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #450a0a; }
.slot-lever { position: relative; width: 54px; flex: 0 0 54px; border: 0; background: none; padding: 0; cursor: grab; touch-action: none; }
.slot-lever:disabled { cursor: default; opacity: .7; }
.slot-lever.grab { cursor: grabbing; }
.lever-base { position: absolute; left: 6px; right: 6px; top: 42%; height: 56px; border-radius: 10px; background: linear-gradient(90deg, #6b7280, #e5e7eb 45%, #6b7280); box-shadow: inset 0 0 0 2px #374151; }
.lever-arm { --pull: 0; position: absolute; left: 50%; width: 10px; margin-left: -5px; top: calc(14% + var(--pull) * 36%); height: calc(42% - var(--pull) * 36% + 28px); background: linear-gradient(90deg, #9ca3af, #f3f4f6, #9ca3af); border-radius: 5px; z-index: 1; }
.lever-knob { position: absolute; left: 50%; top: -22px; width: 38px; height: 38px; margin-left: -19px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fecaca, #ef4444 50%, #7f1d1d); box-shadow: 0 3px 8px rgba(0,0,0,.4); }
@property --pull { syntax: '<number>'; inherits: true; initial-value: 0; }
.slot-machine .chance-pop { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 4; }
.chance-pop b { font: 900 clamp(1.8rem, 9vw, 3.4rem) system-ui, sans-serif; color: #fff; letter-spacing: .06em; padding: .1em .5em; border-radius: 12px; background: linear-gradient(135deg, #f59e0b, #dc2626); text-shadow: 0 2px 0 #7f1d1d; box-shadow: 0 0 0 4px #fde68a, 0 0 30px #f59e0b; animation: chance-in 1s ease-out; }
@keyframes chance-in { 0% { transform: scale(2.2) rotate(-8deg); opacity: 0; } 20% { transform: scale(1) rotate(0); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.9); } }
.slot-machine.chance { animation: chance-flash .25s steps(2) 4; }
@keyframes chance-flash { 50% { box-shadow: inset 0 0 40px #fde047, 0 0 30px #f59e0b; } }
.slot-machine.blackout { background: #050505 !important; border-color: #222; box-shadow: inset 0 0 30px #000; transition: background .4s, border-color .4s; }
.slot-machine.blackout .slot-title, .slot-machine.blackout .slot-lamps i { color: #222; text-shadow: none; background: #222; box-shadow: none; animation: none; }
.slot-machine.blackout .reels { filter: brightness(.18); transition: filter .4s; }
.slot-machine.blackout::after { content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none; box-shadow: inset 0 0 0 2px #111; }
.slot-machine.relight { animation: relight 1.4s ease-out; }
@keyframes relight { 0% { box-shadow: 0 0 0 0 #fde047, inset 0 0 80px #fff; filter: brightness(2); } 30% { filter: brightness(1.4); box-shadow: 0 0 50px 10px #fde047; } 100% { filter: none; } }
@media (max-width: 600px) { .slot-lever { width: 42px; flex-basis: 42px; } .lever-knob { width: 30px; height: 30px; margin-left: -15px; top: -16px; } .stop-btn { min-height: 40px; font-size: .66rem; } }
@media (prefers-reduced-motion: reduce) { .slot-lamps i, .chance-pop b, .slot-machine.chance, .slot-machine.relight { animation: none !important; } }

/* ===== pachinko: turning handle ===== */
.pachi-handle-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.pachi-handle-info { display: grid; gap: 6px; justify-items: start; max-width: 260px; }
.pachi-handle-info p { margin: 0; }
.pachi-handle { width: 132px; height: 132px; touch-action: none; cursor: grab; border-radius: 50%; user-select: none; -webkit-user-select: none; }
.pachi-handle.grab { cursor: grabbing; }
.pachi-handle svg { width: 100%; height: 100%; display: block; }
.pachi-handle .ph-ring { fill: #1f1630; stroke: #b8bcc6; stroke-width: 3; }
.pachi-handle .ph-track { fill: none; stroke: #3b2a6a; stroke-width: 7; stroke-linecap: round; }
.pachi-handle .ph-arc { fill: none; stroke: #e11d48; stroke-width: 7; stroke-linecap: round; }
.pachi-handle.firing .ph-arc { stroke: #facc15; filter: drop-shadow(0 0 4px #facc15); }
.pachi-handle .ph-body { fill: url(#none); fill: #c9ced6; stroke: #6b7280; stroke-width: 2; }
.pachi-handle .ph-notch { fill: #6b7280; }
.pachi-handle .ph-cap { fill: #e11d48; stroke: #7f1d1d; stroke-width: 2; }
.pachi-handle .ph-pointer { fill: #fde047; stroke: #92400e; stroke-width: 1; }
.pachi-handle:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (max-width: 600px) { .pachi-handle { width: 150px; height: 150px; } }

/* ===== driving: steering wheel, gear lever, pedals (left thumb / middle finger / right thumb) ===== */
.dr-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin-top: 10px; user-select: none; -webkit-user-select: none; }
.dr-controls.rail { grid-template-columns: 1fr auto 1fr; }
.dr-controls.rail .dr-slot.mid { grid-column: 1; justify-self: center; }
.dr-slot { display: grid; justify-items: center; gap: 4px; }
.dr-slot.left { justify-self: start; } .dr-slot.right { justify-self: end; }
.dr-cap { font: 700 .7rem ui-monospace, Menlo, Consolas, monospace; color: var(--neon2); letter-spacing: .06em; }
.dr-wheel { width: 128px; height: 128px; touch-action: none; cursor: grab; border-radius: 50%; }
.dr-wheel.grab { cursor: grabbing; }
.dr-wheel svg { width: 100%; height: 100%; display: block; }
.dr-wheel .wh-rim { fill: none; stroke: #2b2b33; stroke-width: 12; }
.dr-wheel.yoke .wh-rim { fill: #2b2b33; stroke: none; }
.dr-wheel .wh-inner { fill: none; stroke: #3b3b45; stroke-width: 2; }
.dr-wheel .wh-spoke { stroke: #3b3b45; stroke-width: 9; stroke-linecap: round; }
.dr-wheel .wh-hub { fill: #1c1c22; stroke: var(--neon2); stroke-width: 2; }
.dr-wheel .wh-mark { fill: var(--neon3); }
.dr-wheel .wh-grip { fill: #3b3b45; stroke: var(--neon2); stroke-width: 2; }
.dr-wheel .wh-col { fill: #444; }
.dr-wheel:focus-visible { outline: 3px solid var(--neon3); outline-offset: 2px; }
.dr-lever { --n: 5; position: relative; width: 64px; padding: 6px 0; border-radius: 12px; background: #120f2e; box-shadow: inset 0 0 0 2px #3a3470; }
.dr-gate { display: grid; gap: 4px; }
.dr-gear-pos { position: relative; z-index: 1; height: 30px; margin: 0 8px; border: 0; border-radius: 8px; background: transparent; color: #8f86c9; font: 900 .85rem ui-monospace, Menlo, Consolas, monospace; cursor: pointer; touch-action: manipulation; }
.dr-gear-pos[aria-checked="true"] { color: #0b0a1d; }
.dr-gear-pos:disabled { cursor: default; }
.dr-gear-pos:not(:disabled):hover { background: #2a2360; }
.dr-knob { --pos: 1; position: absolute; left: 8px; right: 8px; height: 30px; top: calc(6px + var(--pos) * (100% - 42px)); border-radius: 8px; background: radial-gradient(circle at 40% 30%, #fff6c2, var(--neon3) 55%, #b48a00); box-shadow: 0 0 10px var(--neon3); transition: top .12s ease-out; pointer-events: none; }
.dr-pedals { display: flex; align-items: flex-end; gap: 8px; }
.dr-pedal { touch-action: none; border: 0; cursor: pointer; border-radius: 10px 10px 16px 16px; color: #fff; font: 900 .7rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; display: grid; place-items: center; box-shadow: inset 0 -6px 0 rgba(0,0,0,.35), 0 4px 0 #050414; transition: transform .06s; -webkit-touch-callout: none; }
.dr-pedal span { writing-mode: horizontal-tb; }
.dr-pedal.brake { width: 66px; height: 74px; background: repeating-linear-gradient(0deg, #4b5563 0 6px, #374151 6px 10px); }
.dr-pedal.gas { width: 50px; height: 104px; background: repeating-linear-gradient(0deg, #6b7280 0 6px, #4b5563 6px 10px); box-shadow: inset 0 -6px 0 rgba(0,0,0,.35), 0 4px 0 #050414, 0 0 0 2px var(--neon1); }
.dr-pedal.on { transform: translateY(5px) scaleY(.94); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35), 0 0 12px var(--neon3); }
.dr-pedal:focus-visible { outline: 3px solid var(--neon3); outline-offset: 2px; }
@media (max-width: 600px) {
  .dr-controls { gap: 6px; }
  .dr-wheel { width: 118px; height: 118px; }
  .dr-lever { width: 54px; }
  .dr-gear-pos { height: 26px; font-size: .75rem; margin: 0 6px; }
  .dr-knob { height: 26px; left: 6px; right: 6px; top: calc(6px + var(--pos) * (100% - 38px)); }
  .dr-pedal.brake { width: 58px; height: 70px; } .dr-pedal.gas { width: 50px; height: 98px; }
}
@media (prefers-reduced-motion: reduce) { .dr-knob, .dr-pedal { transition: none; } }

/* ===== three-finger touch controls (left thumb joystick, right thumb + third finger buttons) ===== */
.act-pads.three { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin-top: 10px; }
.joy { position: relative; width: 132px; height: 132px; touch-action: none; border-radius: 50%; -webkit-touch-callout: none; }
.joy-ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, #1c1646 0 55%, #0e0b26 56%); box-shadow: inset 0 0 0 2px #4a3c8f, 0 0 12px rgba(41,231,255,.2); }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #8ff3ff, #29e7ff 50%, #136a8a); box-shadow: 0 4px 10px rgba(0,0,0,.4); pointer-events: none; transition: transform .05s; }
.joy.on .joy-ring { box-shadow: inset 0 0 0 2px var(--neon2), 0 0 16px rgba(41,231,255,.5); }
.act-btns.arc { display: grid; grid-template-columns: repeat(2, auto); grid-template-areas: "c b" ". a"; justify-content: end; align-items: end; gap: 8px; }
.act-btns.arc > :nth-child(1) { grid-area: c; } .act-btns.arc > :nth-child(2) { grid-area: b; } .act-btns.arc > :nth-child(3) { grid-area: a; }
.act-btns.arc .act-pad { width: 66px; height: 66px; min-width: 0; border-radius: 50%; padding: 0; font-size: .74rem; }
.act-btns.arc .act-pad.big { width: 84px; height: 84px; font-size: .86rem; }
.act-pads.three:not(.fight) .act-btns.arc { grid-template-areas: "c a"; }
.act-pad.auto.on { background: #6a1250; border-color: var(--neon1); box-shadow: 0 0 10px var(--neon1); }
@media (max-width: 600px) { .joy { width: 124px; height: 124px; } .joy-knob { width: 54px; height: 54px; margin: -27px 0 0 -27px; } }
@media (prefers-reduced-motion: reduce) { .joy-knob { transition: none; } }

/* ===== phone-friendly touch for every game ===== */
.game button, .game [data-cell], .game .card, .game canvas, .toolbar button, .setup button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.game { -webkit-user-select: none; user-select: none; }
@media (pointer: coarse) {
  .btn, .chip-btn, .np-key, .mg-arrow, .stop-btn { min-height: 44px; }
  .toolbar .btn { min-height: 44px; padding-inline: 14px; }
  .mg-arrows { grid-template-columns: repeat(3, 64px); } .mg-arrow { height: 54px; font-size: 1.3rem; }
  .np-pad { gap: 6px; } .np-key { padding: 8px 0 4px; }
  .arc-toggle { min-height: 48px; padding-inline: 20px; }
}
.dr-pedal span { white-space: nowrap; font-size: .62rem; }
@media (max-width: 600px) { .dr-pedal span { font-size: .56rem; } }

/* ===== vertical shooter: fit the whole cabinet in the phone screen height ===== */
.act-canvas.tall { width: auto; max-width: 100%; height: clamp(240px, calc(100svh - 340px), 640px); }
@media (max-width: 600px) {
  .arcade:has(.act-canvas.tall) { padding-top: 6px; padding-bottom: 6px; }
  .arcade:has(.act-canvas.tall) .arc-marquee { margin-bottom: 6px; padding: 3px 8px; }
  .arcade:has(.act-canvas.tall) .arc-hud { margin-bottom: 6px; }
  .arcade:has(.act-canvas.tall) .arc-stat { padding: 2px 4px; }
  .arcade:has(.act-canvas.tall) .arc-deck, .arcade:has(.act-canvas.tall) .act-touch-note { display: none; }
  .arcade:has(.act-canvas.tall) .act-pads.three { margin-top: 6px; }
  .arcade:has(.act-canvas.tall) .joy { width: 108px; height: 108px; }
  .arcade:has(.act-canvas.tall) .act-btns.arc .act-pad { width: 58px; height: 58px; }
  .arcade:has(.act-canvas.tall) .act-btns.arc .act-pad.big { width: 74px; height: 74px; }
}
@media (max-width: 600px) { .act-canvas.tall { height: clamp(220px, calc(100svh - 400px), 640px); } .arcade:has(.act-canvas.tall) { scroll-margin-top: 64px; scroll-margin-bottom: 8px; } }

/* ===== sports games (2026-11-28) ===== */
.cat-nav ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0 4px; }
.cat-nav a { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 700; font-size: .9rem; }
.cat-nav a:hover, .cat-nav a:focus-visible { border-color: var(--neon2, #29e7ff); }
.cat-nav .muted { font-weight: 400; margin-inline-start: 2px; }
.sp-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.sp-row .btn { min-height: 48px; min-width: 96px; touch-action: manipulation; }
.sp-row .sp-big { min-width: 140px; font-size: 1.05rem; }
.sp-row .sp-label { pointer-events: none; background: transparent; border-color: transparent; color: var(--neon3, #ffe14d); font-weight: 800; }
.act-pads.three.nostick { grid-template-columns: 1fr auto; }
.act-pads.sp-pin { justify-content: space-between; margin-top: 8px; }
.act-pads.sp-pin .act-pad { width: 84px; height: 64px; border-radius: 16px; }

/* ---------- naval gunnery / dungeon explorer (2026-11-28) ---------- */
.nv-canvas, .dg-canvas { touch-action: none; -webkit-user-select: none; user-select: none; cursor: crosshair; }
.dg-canvas { cursor: default; }
.nv-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; user-select: none; -webkit-user-select: none; }
.nv-side { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.nv-btn { min-height: 48px; padding: 6px 12px; touch-action: manipulation; font-weight: 700; }
.nv-ctrl .act-pad.big { width: 92px; height: 92px; min-width: 0; border-radius: 50%; padding: 0; font-size: .9rem; flex: none; }
.nv-ctrl .act-pad.nv-fire { background: radial-gradient(circle at 40% 35%, #c3361f, #6a1208); border-color: #ff9a6a; box-shadow: 0 0 0 3px rgba(255,120,80,.25); }
.nv-ctrl .act-pad.dg-swing { background: radial-gradient(circle at 40% 35%, #6a7a8a, #2a3038); border-color: #cfd8e2; }
.dg-tip { align-self: center; }
@media (max-width: 600px) {
  .nv-ctrl { gap: 6px; }
  .nv-btn { min-height: 46px; padding: 4px 8px; font-size: .82rem; flex: 1 1 auto; }
  .nv-ctrl .act-pad.big { width: 80px; height: 80px; }
  .dg-tip { display: none; }
}

/* ---------- janken ---------- */
.jk-cab .jk-canvas { border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
/* player 1 is always drawn on the left, so the score bar keeps that order in right-to-left languages too */
.jk-cab .arc-hud { direction: ltr; }
.jk-cab .arc-hud .arc-stat { direction: inherit; }
.jk-cab .arc-hud .arc-k, .jk-cab .arc-hud .arc-v { unicode-bidi: plaintext; }
.jk-side { display: grid; gap: 8px; padding-top: 10px; -webkit-user-select: none; user-select: none; touch-action: none; -webkit-touch-callout: none; }
.jk-p2.jk-side { padding: 0 0 10px; }
.jk-flip { transform: rotate(180deg); }
.jk-name { display: none; align-items: center; gap: 6px; justify-content: center; font: 800 .85rem/1.2 system-ui, sans-serif; color: #fff; letter-spacing: .04em; }
.jk-two .jk-name { display: flex; }
.jk-dot { width: 12px; height: 12px; border-radius: 50%; background: #e2483d; box-shadow: 0 0 6px #e2483d; }
.jk-p2 .jk-dot { background: #2f7fd8; box-shadow: 0 0 6px #2f7fd8; }
.jk-prompt { margin: 0; min-height: 1.45em; text-align: center; font: 800 1rem/1.4 system-ui, sans-serif; color: #e8e4ff; }
.jk-prompt[data-kind="good"] { color: #7cff9b; text-shadow: 0 0 8px rgba(124,255,155,.5); }
.jk-prompt[data-kind="bad"] { color: #ff9a8a; text-shadow: 0 0 8px rgba(255,120,100,.45); }
.jk-prompt[data-kind="info"] { color: #ffe14d; }
.jk-hands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jk-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jk-hand, .jk-act { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; margin: 0; padding: 6px 4px;
  border-radius: 16px; border: 0; cursor: pointer; color: #fff; font: 800 1rem/1.15 system-ui, sans-serif; letter-spacing: .02em; touch-action: none; -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, filter .15s ease, opacity .15s ease, box-shadow .15s ease; }
.jk-hand { min-height: 62px; background: linear-gradient(180deg, #4a3f8f, #2c2463); box-shadow: inset 0 2px 0 rgba(255,255,255,.22), 0 4px 0 #17123a, 0 6px 12px rgba(0,0,0,.35); }
.jk-hand[aria-pressed="true"] { background: linear-gradient(180deg, #ffe06b, #f0a920); color: #3a2200; box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 4px 0 #9a5f00, 0 0 0 3px #fff6c2, 0 0 18px rgba(255,214,90,.7); }
.jk-act { min-height: 88px; font-size: 1.3rem; }
.jk-hit { background: radial-gradient(120% 90% at 50% 0%, #ff8a7a, #e2332b 55%, #a61a14); box-shadow: inset 0 3px 0 rgba(255,255,255,.3), 0 5px 0 #6e0d09, 0 8px 16px rgba(0,0,0,.4); }
.jk-guard { background: radial-gradient(120% 90% at 50% 0%, #f2cf9a, #c98a48 55%, #8a5523); box-shadow: inset 0 3px 0 rgba(255,255,255,.3), 0 5px 0 #4e2d0e, 0 8px 16px rgba(0,0,0,.4); text-shadow: 0 1px 2px rgba(60,30,0,.6); }
.jk-emo { font-size: 1.55rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.jk-act .jk-emo { font-size: 2rem; }
.jk-hand.jk-down, .jk-act.jk-down { transform: translateY(3px) scale(.97); box-shadow: inset 0 2px 0 rgba(255,255,255,.2), 0 1px 0 rgba(0,0,0,.6); }
.jk-off { opacity: .48; filter: saturate(.45); }
.jk-hand:focus-visible, .jk-act:focus-visible { outline: 3px solid #ffe14d; outline-offset: 2px; }
.jk-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin-top: 10px; }
.jk-stats > span { display: inline-flex; align-items: baseline; gap: 4px; }
.jk-two .arc-deck { display: none; }
.jk-two .jk-hand { min-height: 50px; }
.jk-two .jk-act { min-height: 66px; font-size: 1.1rem; }
.jk-two .jk-act .jk-emo { font-size: 1.5rem; }
.jk-two .jk-side { gap: 6px; }
@media (max-width: 600px) {
  .jk-cab .arc-marquee { margin-bottom: 6px; padding: 3px 8px; }
  .jk-cab .arc-hud { margin-bottom: 6px; }
  .jk-cab .arc-deck { display: none; }
  .jk-two .jk-canvas { max-height: 30svh; width: auto; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .jk-hand, .jk-act { transition: none; } }

/* ---------- bomb ---------- */
.bm-layout { display: grid; gap: 8px; }
.bm-canvas { max-width: 420px; cursor: crosshair; }
.bm-manual { position: relative; z-index: 1; padding: 8px 10px 6px; border-radius: 6px; color: #1d1b16; font-size: .84rem; line-height: 1.32;
  background: linear-gradient(180deg, #fbf6e6, #f1e8cc); box-shadow: 0 2px 0 #c9b98a, 0 6px 14px rgba(0,0,0,.35); border-left: 5px solid #c0283a; }
.bm-manual p, .bm-manual ul, .bm-manual h3 { margin: 0; }
.bm-man-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1.5px dashed #b9a77a; font-size: .8rem; }
.bm-man-head b { font-size: .92rem; letter-spacing: .02em; }
.bm-man-head span { font-weight: 700; color: #7a5b17; white-space: nowrap; }
.bm-step { margin: 3px 0 5px; }
.bm-step h3 { display: flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 800; margin-bottom: 2px; }
.bm-step h3 i { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; background: #1d1b16; color: #fbf6e6; font-style: normal; font-size: .78rem; }
.bm-manual ul { padding-inline-start: 1.25em; }
.bm-manual li { font-weight: 700; }
.bm-manual ul.keep li { color: #a11a26; }
.bm-k { font-size: .78rem; color: #4d4430; }
.bm-k.keep { color: #a11a26; font-weight: 700; margin-top: 2px; }
.bm-if { font-weight: 800; color: #1f4fae; margin-top: 2px; }
.bm-branch { padding-inline-start: 10px; border-inline-start: 2px solid #c9b98a; }
.bm-note { font-size: .74rem; color: #5b5240; margin-top: 2px; }
.bm-note.small { font-size: .7rem; opacity: .9; border-top: 1px dotted #c9b98a; padding-top: 3px; }
.bm-stage { display: grid; gap: 8px; justify-items: center; }
.bm-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; width: 100%; max-width: 420px; }
.bm-ctrl .btn { min-height: 52px; touch-action: manipulation; }
.bm-cut { min-width: 132px; font-size: 1.08rem; font-weight: 800; background: linear-gradient(180deg, #ff5a4a, #c1271c); color: #fff; border-color: #7d140d; box-shadow: 0 3px 0 #7d140d; }
.bm-cut:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.bm-cut:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #7d140d; }
.bm-tip { flex: 1 1 160px; margin: 0; font-size: .8rem; color: #cfd6ff; line-height: 1.3; }
.bm-next { min-width: 200px; font-size: 1.1rem; }
.bm-final, .bm-title { margin: 0; text-align: center; font-weight: 800; color: var(--neon3, #ffe14d); }
.bm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) {
  .arcade.bm-arcade { padding: 8px 5px 6px; }
  .bm-arcade .arc-screen { padding: 5px; }
  .bm-arcade .arc-deck { display: none; }
  .bm-manual { font-size: .78rem; line-height: 1.26; padding: 5px 8px 4px; }
  .bm-note.small { display: none; }
  .bm-step h3 { font-size: .82rem; }
}
@media (min-width: 760px) { .arcade.bm-arcade { max-width: 900px; } }
.bm-arcade .arc-screen { container-type: inline-size; }
@container (min-width: 560px) {
  .bm-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 52%); align-items: start; }
  .bm-manual { font-size: .88rem; }
}
@container (min-width: 760px) { .bm-layout { grid-template-columns: minmax(0, 1fr) 400px; } .bm-manual { font-size: .92rem; } }
@media (prefers-reduced-motion: reduce) { .bm-cut:not(:disabled):active { transform: none; } }
.bm-layout.party { grid-template-columns: 1fr; }
.bm-layout.party .bm-manual { display: none; }

/* ---------- blacksmith ---------- */
.game > .sm-col { flex: 1 1 100%; }
.arcade.sm-cab { --neon1: #ff8a3a; --neon2: #ffd27a; --neon3: #ffe7b0; --scr: #120b07; background: linear-gradient(180deg, #4a3020, #2a1a10 60%, #1c110a); border: 2px solid #120a05; box-shadow: inset 0 2px 0 rgba(255,200,140,.18), 0 10px 26px rgba(0,0,0,.35); }
.sm-cab .arc-marquee { background: linear-gradient(180deg, #6a4428, #3a2414); border-color: #a87a4a; color: #ffe7b0; text-shadow: 0 0 8px rgba(255,140,40,.7); }
.sm-cab .arc-screen { border-color: #0a0603; box-shadow: inset 0 0 30px rgba(255,120,30,.12), inset 0 0 0 1px #4a3020; }
.sm-cab .arc-screen::after { display: none; }
.sm-cab .arc-deck { display: none; }
.sm-cab .arc-stat { background: linear-gradient(180deg, #2a1a10, #140c06); border-color: #6a4a2a; }
.sm-cab .arc-k { color: #e8c48a; }
.sm-cab .arc-v { color: #ffe7b0; text-shadow: 0 0 6px rgba(255,150,50,.5); }
.sm-canvas { background: #120b07; touch-action: none; -webkit-user-select: none; user-select: none; cursor: pointer; }
.sm-panel { margin-top: 10px; color: #f3e6d2; font-size: .92rem; }
.sm-panel .btn { min-height: 48px; touch-action: manipulation; }
.sm-panel .btn.primary { background: linear-gradient(180deg, #e2702a, #a8420f); border-color: #ffb070; color: #fff; }
.sm-order { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: linear-gradient(180deg, #e9d6ae, #cdb184); color: #2a1a0c; border: 1px solid #8a6a3a; box-shadow: inset 0 0 12px rgba(120,80,30,.35); }
.sm-who { font-size: 1.6rem; line-height: 1; }
.sm-order-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sm-reqs { display: flex; flex-wrap: wrap; gap: 4px; }
.sm-req { font-size: .82rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(80,40,10,.15); border: 1px solid rgba(80,40,10,.3); }
.sm-reward { font-weight: 800; white-space: nowrap; }
.sm-shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.sm-ing { display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 72px; padding: 4px 2px; border-radius: 10px; border: 1px solid #5a3a22; background: radial-gradient(circle at 50% 30%, #3a2618, #1e130b); color: #f3e6d2; font: inherit; font-size: .72rem; line-height: 1.15; cursor: grab; touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.sm-ing:active { cursor: grabbing; transform: scale(.96); }
.sm-ing:focus-visible { outline: 3px solid #ffd27a; outline-offset: 1px; }
.sm-ing.fx { border-color: #6a5aa8; background: radial-gradient(circle at 50% 30%, #2e2446, #150f22); }
.sm-ing img { width: 48px; height: 32px; pointer-events: none; }
.sm-ing-n { font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.sm-ing-c { opacity: .8; font-size: .68rem; }
.sm-ghost { position: fixed; width: 72px; height: 48px; margin: -36px 0 0 -36px; pointer-events: none; z-index: 50; filter: drop-shadow(0 8px 6px rgba(0,0,0,.5)); }
.sm-pot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; min-height: 36px; }
.sm-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 10px; border-radius: 99px; border: 1px solid #6a4a2a; background: #2a1a10; color: #f3e6d2; font: inherit; font-size: .82rem; cursor: pointer; touch-action: manipulation; }
.sm-chip i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0,0,0,.5); }
.sm-chip.clr { background: transparent; border-style: dashed; }
.sm-stats { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid #3a2616; }
.sm-alloy { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sm-sw { width: 22px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.6); }
.sm-bar { display: grid; grid-template-columns: 6.5em 1fr 2.6em; align-items: center; gap: 6px; font-size: .78rem; }
.sm-bar i { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.sm-bar i b { display: block; height: 100%; background: linear-gradient(90deg, #a8420f, #ffb34a); border-radius: inherit; transition: width .25s; }
.sm-bar em { font-style: normal; text-align: end; font-variant-numeric: tabular-nums; }
.sm-notes { margin: 6px 0 0; padding: 0; list-style: none; font-size: .78rem; }
.sm-notes li::before { content: "\25CF  "; }
.sm-notes .good { color: #a9f0a0; } .sm-notes .bad { color: #ffab8a; }
.sm-pred { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sm-pc { padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.07); }
.sm-pc.ok { color: #a9f0a0; } .sm-pc.ng { color: #ffab8a; }
.sm-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sm-row .sm-go { flex: 1 1 60%; font-size: 1.05rem; }
.sm-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; -webkit-user-select: none; user-select: none; }
.sm-ctrl .act-pad.big { width: 96px; height: 96px; min-width: 0; padding: 0; border-radius: 50%; font-size: .9rem; flex: none; }
.sm-ctrl .act-pad.sm-heat { background: radial-gradient(circle at 40% 35%, #c84a14, #5a1606); border-color: #ffa060; }
.sm-ctrl .act-pad.sm-heat.on { background: radial-gradient(circle at 40% 35%, #ffb040, #c8400a); box-shadow: 0 0 18px rgba(255,140,40,.8); }
.sm-ctrl .act-pad.sm-heat.small { width: auto; height: auto; min-height: 52px; border-radius: 12px; padding: 4px 16px; }
.sm-ctrl .act-pad.sm-hit { background: radial-gradient(circle at 40% 35%, #8a929c, #2a3038); border-color: #dfe6ee; width: 112px; height: 112px; }
.sm-ctrl .act-pad.sm-hit:active { transform: scale(.95); }
.sm-ctrl .sm-go { flex: 1; }
.sm-blows { font-weight: 800; color: #ffe7b0; text-align: center; flex: 1; }
.sm-qtitle { margin: 4px 0; font-weight: 800; color: #ffe7b0; }
.sm-qs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sm-q { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 84px; padding: 6px 4px; text-align: center; line-height: 1.2; background: #22160e; color: #f3e6d2; border-color: #6a4a2a; }
.sm-risk { color: #ffcf9a; font-weight: 700; }
.sm-res { padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.32); border: 1px solid #3a2616; }
.sm-name { margin: 0 0 6px; font-size: 1.05rem; }
.sm-rar { display: inline-block; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--rc); color: var(--rc); font-size: .8rem; font-weight: 800; }
.sm-tab { width: 100%; border-collapse: collapse; font-size: .85rem; }
.sm-tab th { text-align: start; font-weight: 600; opacity: .8; padding: 1px 0; }
.sm-tab td { text-align: end; font-weight: 800; font-variant-numeric: tabular-nums; }
.sm-checks { margin: 6px 0 0; padding: 0; list-style: none; font-size: .85rem; }
.sm-checks .ok, .sm-pay.ok { color: #a9f0a0; } .sm-checks .ng, .sm-pay.ng { color: #ffab8a; }
.sm-pay { margin: 6px 0 0; font-weight: 800; }
.sm-col { margin-top: 12px; }
.sm-col summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.sm-col ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.sm-col li { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #3a2a20, #120a06); color: #f3e6d2; border: 1px solid var(--rc); font-size: .78rem; line-height: 1.25; }
.sm-col canvas { width: 88px; height: 88px; }
@media (max-width: 600px) {
  .sm-shelf { gap: 4px; }
  .sm-ing { min-height: 66px; font-size: .66rem; }
  .sm-ing img { width: 40px; height: 27px; }
  .sm-ctrl .act-pad.big { width: 86px; height: 86px; }
  .sm-ctrl .act-pad.sm-hit { width: 100px; height: 100px; }
  .sm-q { min-height: 78px; font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) { .sm-bar i b { transition: none; } .sm-ing:active, .sm-ctrl .act-pad.sm-hit:active { transform: none; } }

/* ---------- toothbrush ---------- */
.tb-cab .arc-screen { padding: 8px; background: radial-gradient(circle at 50% 30%, #1a1228, #0b0a1d 70%); }
.tb-cab .arc-deck { display: none; }
.tb-canvas { max-width: min(520px, calc((100svh - 340px) * 420 / 480)); min-width: min(280px, 100%); touch-action: none; -webkit-user-select: none; user-select: none; cursor: none; background: #12040a; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.tb-views { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 auto 8px; max-width: 520px; }
.tb-view { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border-radius: 10px; border: 1px solid #3a2a6a; background: linear-gradient(#211a3d, #120e26); color: #dcd6ff; font: 700 .78rem/1.1 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
.tb-view[aria-selected="true"] { background: linear-gradient(#5d3fb0, #3a2577); border-color: #b9a2ff; color: #fff; box-shadow: 0 0 0 2px rgba(185,162,255,.35); }
.tb-view canvas { width: 30px; height: 21px; }
.tb-vbadge { position: absolute; top: -6px; right: -4px; min-width: 18px; padding: 1px 4px; border-radius: 9px; font: 800 .7rem/1.3 system-ui, sans-serif; font-style: normal; background: #ffd54a; color: #3a2a00; }
.tb-vbadge:empty { display: none; }
.tb-vbadge[data-state="ok"] { background: #4cd07a; color: #04300f; }
.tb-vbadge[data-state="germ"] { background: #ff7aa8; color: #3a0018; }
.tb-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px auto 0; max-width: 520px; user-select: none; -webkit-user-select: none; }
.tb-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 64px; padding: 4px 2px; border-radius: 14px; border: 2px solid #3d4f7a; background: linear-gradient(#24345c, #121b33); color: #e6eeff; font: 700 .74rem/1.1 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
.tb-tool canvas { width: 36px; height: 36px; }
.tb-tool[aria-pressed="true"] { border-color: #7fe0ff; background: linear-gradient(#2a77a8, #164b72); color: #fff; box-shadow: 0 0 12px rgba(127,224,255,.45); }
.tb-tool.rinse { border-color: #3a7fb0; background: linear-gradient(#1f5d8c, #0f3354); }
.tb-tool:disabled { opacity: .45; cursor: not-allowed; }
.tb-tool:active, .tb-view:active { transform: scale(.96); }
.tb-card { position: absolute; inset: 64px 12px auto; z-index: 4; max-width: 420px; margin: 0 auto; padding: 16px 18px; border-radius: 18px; background: rgba(250,252,255,.97); color: #1b2333; box-shadow: 0 10px 40px rgba(0,0,0,.55); animation: tb-pop .28s ease-out; text-align: center; }
.tb-card[hidden] { display: none; }
.tb-card h3 { margin: .2em 0 .5em; font-size: 1.2rem; }
.tb-k { margin: 0; font: 800 .85rem system-ui, sans-serif; color: #5d3fb0; letter-spacing: .02em; }
.tb-goals { text-align: start; margin: .4em auto .6em; padding-inline-start: 1.3em; max-width: 320px; }
.tb-goals li { margin: .15em 0; }
.tb-tip { margin: .6em 0; padding: 8px 10px; border-radius: 10px; background: #eef6ff; color: #23405e; font-size: .9rem; text-align: start; }
.tb-go { min-height: 48px; min-width: 60%; font-size: 1.05rem; }
.tb-stars { margin: .2em 0; font-size: 2.6rem; line-height: 1; letter-spacing: .1em; }
.tb-stars span { color: #d6dbe3; display: inline-block; }
.tb-stars span.on { color: #ffbf1f; text-shadow: 0 0 10px rgba(255,191,31,.6); animation: tb-star .45s ease-out both; }
.tb-rows { margin: .4em auto; max-width: 300px; }
.tb-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed #d0d8e6; font-size: .95rem; }
.tb-row:last-child { border-bottom: 0; font-size: 1.05rem; }
#tb-t.tb-low { color: #ff6b6b; }
@keyframes tb-pop { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tb-star { 0% { transform: scale(.2) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1); } }
@media (max-width: 600px) {
  .tb-cab .arc-screen { padding: 6px; }
  .tb-views { gap: 4px; margin-bottom: 6px; }
  .tb-view { min-height: 48px; font-size: .7rem; }
  .tb-tools { gap: 4px; }
  .tb-tool { min-height: 60px; font-size: .68rem; border-radius: 12px; }
  .tb-tool canvas { width: 32px; height: 32px; }
  .tb-card { inset: 56px 6px auto; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .tb-card, .tb-stars span.on { animation: none; } .tb-tool:active, .tb-view:active { transform: none; } }

/* ---------- gargle ---------- */
.arcade .act-canvas.tall.gg-cv { height: clamp(240px, calc(100svh - 430px), 600px); background: #cfe3ea; }
.gg-row { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.gg-cups { flex-wrap: nowrap; }
.gg-cup { position: relative; flex: 1 1 0; min-width: 0; min-height: 52px; padding: 4px 2px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; border: 1px solid #2f4f86; background: linear-gradient(#20325e, #142247); color: #eaf2ff; font: 700 .74rem system-ui, sans-serif; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gg-cup:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.gg-cup.on { border-color: #7fd1ff; box-shadow: 0 0 0 2px rgba(127,209,255,.45) inset; }
.gg-cup:disabled { opacity: .4; cursor: not-allowed; }
.gg-glass { display: block; width: 16px; height: 20px; border-radius: 2px 2px 5px 5px; border: 1.5px solid rgba(255,255,255,.85); border-top-width: 0; background: linear-gradient(transparent 30%, var(--c) 30%); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }
.gg-cup-n { line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-left { position: absolute; top: 2px; right: 5px; font-size: .66rem; color: #ffe14d; }
.gg-cup kbd { position: absolute; top: 2px; left: 5px; font: 600 .6rem ui-monospace, monospace; color: #8aa3cc; }
.gg-vow { flex: 1 1 0; min-width: 0; min-height: 54px; padding: 3px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 14px; border: 1px solid #6b3d8f; background: linear-gradient(#3a1f58, #24123b); color: #fff; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gg-vow b { font: 900 1.15rem system-ui, sans-serif; line-height: 1.1; }
.gg-vow small { font: 600 .62rem system-ui, sans-serif; color: #d9c7f0; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-vow[aria-pressed="true"] { background: linear-gradient(#ffe36b, #f2b72e); border-color: #fff3b0; color: #3a2400; box-shadow: 0 0 12px rgba(255,225,77,.6); }
.gg-vow[aria-pressed="true"] small { color: #5c3d00; }
.gg-act { align-items: center; justify-content: space-between; }
.gg-spit { min-width: 92px; min-height: 64px; padding: 6px 12px; border-radius: 16px; border: 1px solid #2a8f9e; background: linear-gradient(#1c6c7a, #114650); color: #fff; font: 800 1rem system-ui, sans-serif; cursor: pointer; touch-action: manipulation; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gg-spit:active { transform: scale(.96); }
.gg-keys { flex: 1 1 auto; margin: 0 6px; text-align: center; font-size: .72rem; }
.act-pad.gg-hold { width: 104px; height: 104px; min-width: 0; border-radius: 50%; padding: 6px; font: 900 .9rem system-ui, sans-serif; line-height: 1.15; background: radial-gradient(circle at 35% 30%, #5ab6ff, #1c5fc4 70%); border: 3px solid #a8dcff; box-shadow: 0 6px 0 #0d3577, 0 8px 18px rgba(0,0,0,.35); user-select: none; -webkit-user-select: none; }
.act-pad.gg-hold.on { transform: translateY(5px); box-shadow: 0 1px 0 #0d3577, 0 0 22px rgba(120,200,255,.8); background: radial-gradient(circle at 35% 30%, #8fd0ff, #2a76e0 70%); }
.gg-spit, .gg-vow, .gg-cup { -webkit-user-select: none; user-select: none; }
.gg-spit:focus-visible, .gg-vow:focus-visible, .gg-cup:focus-visible, .act-pad.gg-hold:focus-visible { outline: 3px solid #ffe14d; outline-offset: 2px; }
@media (pointer: coarse) { .gg-keys, .gg-cup kbd { display: none; } }
@media (max-width: 600px) {
  .arcade .act-canvas.tall.gg-cv { height: clamp(220px, calc(100svh - 470px), 560px); }
  .gg-row { gap: 4px; margin-top: 6px; }
  .gg-cup { min-height: 48px; font-size: .68rem; }
  .gg-vow { min-height: 50px; } .gg-vow b { font-size: 1.05rem; }
  .act-pad.gg-hold { width: 92px; height: 92px; font-size: .82rem; }
  .gg-spit { min-height: 58px; min-width: 84px; }
}
@media (prefers-reduced-motion: reduce) { .act-pad.gg-hold, .gg-cup, .gg-spit { transition: none; } }

/* ---------- robotwar ---------- */
.rb-wrap { position: relative; touch-action: none; -webkit-user-select: none; user-select: none; }
.rb-canvas { touch-action: none; cursor: crosshair; -webkit-tap-highlight-color: transparent; }
.rb-pads { position: absolute; right: 8px; bottom: 8px; width: 210px; height: 200px; pointer-events: none; }
.rb-pad { position: absolute; pointer-events: auto; display: grid; place-items: center; align-content: center; width: 62px; height: 62px; min-width: 0; padding: 0; border-radius: 50%;
  font-size: 1.35rem; line-height: 1; color: #fff; border: 2px solid rgba(190,230,255,.55); background: radial-gradient(circle at 38% 32%, rgba(90,110,140,.78), rgba(18,24,36,.78));
  box-shadow: 0 3px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.25); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); --cd: 0; overflow: hidden; }
.rb-pad small { display: block; font: 800 .52rem/1 system-ui, sans-serif; letter-spacing: .02em; margin-top: 3px; opacity: .9; max-width: 56px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-pad::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: conic-gradient(rgba(0,0,0,.62) calc(var(--cd) * 360deg), transparent 0); }
.rb-pad.on { transform: scale(.93); border-color: #fff; box-shadow: 0 0 14px rgba(120,220,255,.8), inset 0 0 12px rgba(120,220,255,.5); }
.rb-pad.locked { opacity: .45; filter: grayscale(1); }
.rb-pad.locked::before { content: "🔒"; position: absolute; top: 4px; right: 8px; font-size: .62rem; }
.rb-fire { right: 0; bottom: 0; width: 92px; height: 92px; font-size: 1.9rem; border-color: rgba(255,170,140,.8); background: radial-gradient(circle at 38% 32%, rgba(220,80,60,.85), rgba(90,18,10,.85)); }
.rb-mis { right: 100px; bottom: 6px; background: radial-gradient(circle at 38% 32%, rgba(230,120,60,.8), rgba(80,30,10,.8)); }
.rb-can { right: 92px; bottom: 76px; background: radial-gradient(circle at 38% 32%, rgba(210,170,70,.8), rgba(70,50,10,.8)); }
.rb-dash { right: 24px; bottom: 102px; background: radial-gradient(circle at 38% 32%, rgba(80,170,230,.8), rgba(10,40,80,.8)); }
.rb-shd { right: 150px; bottom: 132px; width: 56px; height: 56px; background: radial-gradient(circle at 38% 32%, rgba(80,200,200,.8), rgba(10,60,70,.8)); }
.rb-pads.desk { transform: scale(.8); transform-origin: right bottom; opacity: .85; }
.rb-bar { display: flex; gap: 8px; margin-top: 8px; }
.rb-bar-btn { flex: 1 1 0; min-height: 46px; padding: 4px 8px; font-weight: 800; background: #1c1646; color: #fff; border-color: #4a3c8f; touch-action: manipulation; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-garage { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(10,14,26,.97), rgba(6,8,16,.98)); color: #e8f0ff; border-radius: 14px; overflow: hidden; animation: arc-in .25s ease-out; }
.rb-ghead { display: flex; gap: 10px; padding: 10px; border-bottom: 1px solid rgba(120,200,255,.25); align-items: flex-start; }
.rb-preview { width: 44%; max-width: 220px; height: auto; aspect-ratio: 8 / 5; border-radius: 10px; border: 1px solid rgba(120,200,255,.35); flex: none; }
.rb-gtitle { flex: 1; min-width: 0; }
.rb-gtitle h3 { margin: 0 0 2px; font: 900 1.1rem ui-monospace, Menlo, Consolas, monospace; color: #9fe3ff; }
.rb-pw { margin: 0 0 6px; font: 700 .8rem ui-monospace, Menlo, Consolas, monospace; color: #ffe27a; }
.rb-mats { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; font: 700 .74rem ui-monospace, Menlo, Consolas, monospace; }
.rb-mat { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rb-mat i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); display: inline-block; transform: rotate(45deg); }
.rb-mat.short { color: #ff8a7a; }
.rb-weps { display: flex; flex-wrap: wrap; gap: 4px; }
.rb-weps .btn { min-height: 40px; padding: 2px 8px; font-size: .78rem; background: #1a2236; color: #fff; border-color: #3a4a6a; }
.rb-weps .btn[aria-pressed="true"] { background: #0f5a7a; border-color: #7fe0ff; box-shadow: 0 0 8px rgba(127,224,255,.5); }
.rb-glist { list-style: none; margin: 0; padding: 6px 10px; overflow-y: auto; flex: 1; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.rb-part { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.rb-part.locked .rb-icon { opacity: .5; }
.rb-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(160deg, #2a3a52, #121a28); border: 1px solid rgba(127,224,255,.35); font-size: 1.05rem; color: #9fe3ff; }
.rb-pinfo { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rb-pinfo b { font-size: .9rem; }
.rb-lv { font: 700 .72rem ui-monospace, Menlo, Consolas, monospace; color: #ffe27a; }
.rb-desc { font-size: .72rem; color: #a8b6cc; line-height: 1.3; }
.rb-stat { font: 600 .7rem ui-monospace, Menlo, Consolas, monospace; color: #cfe8ff; line-height: 1.35; overflow-wrap: anywhere; }
.rb-pips { display: flex; gap: 2px; }
.rb-pips i { flex: 1; max-width: 9px; height: 4px; border-radius: 1px; background: rgba(255,255,255,.12); }
.rb-pips i.on { background: linear-gradient(90deg, #4fd0ff, #ffe27a); }
.rb-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rb-cost { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 6px; max-width: 120px; font: 700 .7rem ui-monospace, Menlo, Consolas, monospace; }
.rb-cost.max { color: #ffe27a; }
.rb-up { min-height: 44px; min-width: 76px; padding: 4px 10px; font-size: .82rem; }
.rb-gfoot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid rgba(120,200,255,.25); }
.rb-gfoot .rb-close { min-height: 48px; flex: 1; max-width: 260px; }
.rb-gfoot .btn.ghost { color: #a8b6cc; border-color: rgba(255,255,255,.2); }
@media (max-width: 600px) {
  .rb-pads { width: 190px; height: 186px; right: 4px; bottom: 4px; }
  .rb-pad { width: 56px; height: 56px; font-size: 1.2rem; }
  .rb-fire { width: 84px; height: 84px; }
  .rb-mis { right: 90px; bottom: 4px; } .rb-can { right: 84px; bottom: 68px; } .rb-dash { right: 20px; bottom: 92px; } .rb-shd { right: 136px; bottom: 122px; width: 52px; height: 52px; }
  .rb-ghead { gap: 8px; padding: 8px; } .rb-preview { width: 38%; aspect-ratio: 1 / 1; } .rb-gtitle h3 { font-size: 1rem; } .rb-mats { font-size: .68rem; gap: 2px 8px; } .rb-weps .btn { min-height: 44px; font-size: .72rem; padding: 2px 6px; }
  .rb-bar-btn { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) { .rb-garage { animation: none; } .rb-pad.on { transform: none; } }

/* ---------- quizzes ---------- */
.qz { --qz-bg1: #14183a; --qz-bg2: #0a0c22; --qz-gold: #ffd166; --qz-ok: #2fd39a; --qz-ng: #ff5d73; position: relative; max-width: 640px; margin: 0 auto; padding: 14px 14px 16px; border-radius: 22px;
  background: radial-gradient(120% 70% at 50% -10%, #3a3f8f 0%, var(--qz-bg1) 45%, var(--qz-bg2) 100%); color: #eef1ff; box-shadow: 0 18px 40px rgba(10,12,40,.45), inset 0 0 0 1px rgba(255,255,255,.08); overflow: hidden; isolation: isolate; }
.qz::before { content: ""; position: absolute; inset: -40% -20% auto; height: 70%; background: conic-gradient(from 200deg at 50% 100%, transparent 0 40deg, rgba(255,255,255,.07) 50deg, transparent 60deg 120deg, rgba(255,255,255,.06) 130deg, transparent 140deg); pointer-events: none; z-index: -1; }
.qz.flash-ok { animation: qz-flash-ok .5s ease-out; } .qz.flash-ng { animation: qz-flash-ng .5s ease-out; }
@keyframes qz-flash-ok { 0% { box-shadow: 0 0 0 4px var(--qz-ok), 0 18px 40px rgba(10,12,40,.45); } 100% { box-shadow: 0 0 0 0 transparent, 0 18px 40px rgba(10,12,40,.45); } }
@keyframes qz-flash-ng { 0% { box-shadow: 0 0 0 4px var(--qz-ng), 0 18px 40px rgba(10,12,40,.45); } 100% { box-shadow: 0 0 0 0 transparent, 0 18px 40px rgba(10,12,40,.45); } }
.qz-marquee { text-align: center; margin: 0 0 10px; } .qz-marquee span { display: inline-block; padding: 4px 16px; border-radius: 999px; font-weight: 800; letter-spacing: .04em; color: #1b1440; background: linear-gradient(180deg, #ffe9a6, var(--qz-gold)); box-shadow: 0 2px 0 #b8892a, 0 0 18px rgba(255,209,102,.45); }
.qz-hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.qz-stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 4px 6px; text-align: center; min-width: 0; }
.qz-k { display: block; font-size: .68rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .qz-v { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.qz-feedback .qz-k { white-space: normal; }
.qz-progress { display: flex; gap: 5px; justify-content: center; margin: 2px 0 8px; } .qz-progress i { width: 12px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.18); transition: background .3s, width .3s; }
.qz-progress i.now { width: 22px; background: var(--qz-gold); } .qz-progress i.ok { background: var(--qz-ok); } .qz-progress i.ng { background: var(--qz-ng); }
.qz-timer { height: 8px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; margin-bottom: 10px; } .qz-timer[hidden] { display: none; }
.qz-timer i { display: block; height: 100%; transform-origin: left; background: linear-gradient(90deg, #4ce0b3, #ffd166); } .qz-timer i[data-low="1"] { background: linear-gradient(90deg, #ff5d73, #ff9f40); }
[dir="rtl"] .qz-timer i { transform-origin: right; }
.qz-stage { margin-bottom: 10px; }
.qz-qbox { text-align: center; margin: 4px 0 12px; } .qz-prompt { margin: 0; font-size: .9rem; color: var(--qz-gold); font-weight: 700; } .qz-question { margin: 4px 0 0; font-size: 1.22rem; font-weight: 800; line-height: 1.35; text-wrap: balance; } .qz-question:empty { display: none; }
.qz-answers { display: grid; gap: 10px; } .qz-answers.n4 { grid-template-columns: 1fr 1fr; } .qz-answers.n4.events, .qz-answers.n4.castles { grid-template-columns: 1fr; }
@media (min-width: 560px) { .qz-answers.n4.castles { grid-template-columns: 1fr 1fr; } }
.qz-ans { position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border-radius: 16px; border: 0; cursor: pointer; text-align: start; color: #18143a; font: inherit; font-weight: 700; line-height: 1.3;
  background: linear-gradient(180deg, #ffffff, #dfe4ff); box-shadow: 0 4px 0 #8f97d6, 0 8px 16px rgba(0,0,0,.25); transition: transform .08s, box-shadow .08s, opacity .25s; }
.qz-ans:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 0 #8f97d6, 0 10px 18px rgba(0,0,0,.28); }
.qz-ans:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #8f97d6, 0 4px 8px rgba(0,0,0,.25); }
.qz-ans:focus-visible { outline: 3px solid var(--qz-gold); outline-offset: 2px; }
.qz-ans:disabled { cursor: default; }
.qz-letter { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; color: #fff; background: linear-gradient(180deg, #6a72e0, #3c42a8); }
.qz-ans-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qz-ans.right { background: linear-gradient(180deg, #b8ffe3, #43d9a0); box-shadow: 0 4px 0 #1f9b6c, 0 0 22px rgba(47,211,154,.6); }
.qz-ans.right .qz-letter { background: #0f7a52; color: transparent; } .qz-ans.right .qz-letter::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1rem; }
.qz-ans.wrong { background: linear-gradient(180deg, #ffd0d6, #ff6f84); box-shadow: 0 4px 0 #b4384c; } .qz-ans.wrong .qz-letter { background: #9b2236; }
.qz-ans.dim { opacity: .45; }
.qz-feedback { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.qz-feedback[hidden] { display: none; }
.qz-verdict { margin: 0 0 6px; font-size: 1.15rem; font-weight: 900; } .qz-verdict.ok { color: var(--qz-ok); } .qz-verdict.ng { color: var(--qz-ng); }
.qz-feedback p { margin: 6px 0; } .qz-feedback .small { font-size: .8rem; opacity: .8; }
.qz-next { display: block; width: 100%; min-height: 52px; margin-top: 10px; font-size: 1.05rem; }
.qz-src { display: inline-block; margin-top: 4px; padding: 6px 0; font-size: .8rem; color: #a9c4ff; }
.qz-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.qz-miniflag { vertical-align: middle; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); flex: none; }
.qz-result { text-align: center; padding: 18px 10px; } .qz-big { font-size: 3rem; font-weight: 900; margin: 0; color: var(--qz-gold); text-shadow: 0 0 22px rgba(255,209,102,.5); } .qz-big small { font-size: 1rem; color: #eef1ff; }
.qz-stars { margin: 0; font-size: 2.4rem; letter-spacing: .1em; } .qz-stars span { display: inline-block; color: rgba(255,255,255,.18); } .qz-stars span.on { color: var(--qz-gold); text-shadow: 0 0 14px rgba(255,209,102,.8); animation: qz-pop .5s backwards; }
.qz-stars span.on:nth-child(2) { animation-delay: .15s; } .qz-stars span.on:nth-child(3) { animation-delay: .3s; }
@keyframes qz-pop { from { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.3); } to { transform: none; } }
.qz-rate { font-weight: 800; }
#qz-rank { max-width: 640px; margin: 10px auto 0; }
/* history */
.qzh-card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; padding: 10px 14px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, #f4e4bd, #d9bd85); color: #3b2a12; box-shadow: inset 0 0 22px rgba(120,80,20,.35), 0 6px 14px rgba(0,0,0,.3); }
.qzh-era { font: 900 2rem/1 Georgia, "Times New Roman", serif; letter-spacing: .06em; color: #6b4612; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.qzh-country { display: flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; } .qzh-country span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qzh-scroll { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(120,80,20,.06) 22px 23px); pointer-events: none; }
.qzh-year { font-size: 1.35rem; font-variant-numeric: tabular-nums; } .qzh-opt { display: flex; align-items: center; gap: 8px; }
.qzh-fact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .qzh-list { margin: 6px 0; padding-inline-start: 18px; font-size: .9rem; } .qzh-list li.hit { color: var(--qz-gold); font-weight: 700; }
.qzh-timeline { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; position: relative; padding-top: 8px; font-size: .78rem; }
.qzh-timeline::before { content: ""; position: absolute; top: 3px; left: 8%; right: 8%; height: 2px; background: rgba(255,255,255,.3); }
.qzh-timeline .tl { position: relative; padding: 6px; border-radius: 10px; background: rgba(255,255,255,.06); line-height: 1.3; overflow-wrap: anywhere; } .qzh-timeline .tl small { display: block; font-weight: 800; color: #a9c4ff; font-size: .8rem; }
.qzh-timeline .tl.now { background: rgba(255,209,102,.16); } .qzh-timeline .tl.now small { color: var(--qz-gold); } .qzh-timeline .tl.empty { background: none; }
/* castles */
.qzc-scene { position: relative; } .qzc-canvas { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.qzc-pts { position: absolute; top: 8px; inset-inline-end: 8px; padding: 3px 10px; border-radius: 999px; background: rgba(10,12,34,.72); color: var(--qz-gold); font-weight: 800; font-size: .85rem; }
.qzc-hints { list-style: none; margin: 10px 0 8px; padding: 0; display: grid; gap: 6px; }
.qzc-hint { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.08); border-inline-start: 4px solid var(--qz-gold); line-height: 1.4; }
.qzc-ic { flex: none; width: 1.6em; text-align: center; } .qzc-ht { flex: 1; min-width: 0; }
.qzc-lab { font-weight: 800; color: var(--qz-gold); margin-inline-end: 6px; } .qzc-ja { font-weight: 800; margin-inline-end: 6px; } .qzc-ro { opacity: .8; font-size: .9em; } .qzc-mean { display: block; font-size: .85em; opacity: .85; }
.qzc-more { width: 100%; min-height: 48px; } .qzc-opt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; } .qzc-opt .qzc-ja { font-size: 1.15rem; } .qz-ans .qzc-ro { color: #4a4f80; opacity: 1; }
.qzc-answer { font-size: 1.2rem; }
/* greetings */
.qzg-scene { position: relative; border-radius: 16px; overflow: hidden; padding: 6px 6px 10px; background: linear-gradient(180deg, #87c7f0, #d9f0ff); }
.qzg-scene.sit-m { background: linear-gradient(180deg, #ffb48a, #ffe6b8); } .qzg-scene.sit-e { background: linear-gradient(180deg, #1d2357, #6b4f9a); } .qzg-scene.sit-t { background: linear-gradient(180deg, #ffd6e7, #fff1d6); }
.qzg-flag { display: block; width: 100%; height: auto; }
.qzg-meta { text-align: center; color: #10173a; } .qzg-scene.sit-e .qzg-meta { color: #fff; }
.qzg-country { display: block; font-size: 1.35rem; } .qzg-lang { font-size: .85rem; opacity: .8; }
.qzg-sit { display: inline-block; padding: 3px 12px; border-radius: 999px; background: rgba(255,209,102,.16); }
.qz-answers.n2 { grid-template-columns: 1fr 1fr; } .qz-answers.greets .qz-ans { min-height: 92px; justify-content: center; }
.qz-answers.greets .qz-letter { position: absolute; top: 8px; inset-inline-start: 8px; width: 24px; height: 24px; font-size: .72rem; }
.qzg-greet { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; } .qzg-greet b { font-size: 1.35rem; line-height: 1.25; } .qzg-ro { font-weight: 600; opacity: .75; font-size: .82rem; }
.qzg-explain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .qzg-explain .qzg-greet { align-items: flex-start; text-align: start; }
.qzg-listen { margin-top: 4px; min-height: 44px; }
@media (max-width: 600px) {
  .qz { padding: 10px 8px 12px; border-radius: 16px; } .qz-hud { gap: 4px; } .qz-k { font-size: .62rem; } .qz-v { font-size: .95rem; }
  .qz-question { font-size: 1.08rem; } .qzh-era { font-size: 1.5rem; } .qz-ans { min-height: 54px; padding: 9px 10px; }
  .qz-answers.greets .qz-ans { min-height: 84px; padding-top: 22px; } .qzg-greet b { font-size: 1.12rem; }
}
@media (prefers-reduced-motion: reduce) { .qz.flash-ok, .qz.flash-ng, .qz-stars span.on { animation: none; } .qz-ans, .qz-progress i { transition: none; } }
.qz-feedback .qzc-scene { margin: 4px 0 8px; } .qzc-pts[hidden] { display: none; }

/* ---------- TOMU’S GAME LAND: logo, dream-world hero, top page (2026-11-28) ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand .gl-mark { flex: none; filter: drop-shadow(0 2px 4px rgba(124,58,237,.35)); }
.brand-word { font-weight: 900; letter-spacing: .02em; background: linear-gradient(90deg, #db2777, #7c3aed 55%, #0891b2); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.brand-word b { font-weight: 900; }
@media (prefers-color-scheme: dark) { .brand-word { background: linear-gradient(90deg, #f9a8d4, #c4b5fd 55%, #67e8f9); -webkit-background-clip: text; background-clip: text; } }

body.home { background: linear-gradient(180deg, #ede4ff 0, #fdeef8 380px, var(--bg) 900px) no-repeat, var(--bg); }
@media (prefers-color-scheme: dark) { body.home { background: linear-gradient(180deg, #1c1240 0, #1a1430 420px, var(--bg) 900px) no-repeat, var(--bg); } }
.gl-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; margin: 14px 0 10px; min-height: 440px; color: #fff; box-shadow: 0 18px 40px -18px rgba(76,29,149,.55); }
.gl-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.gl-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(20,11,58,.78) 0, rgba(20,11,58,.5) 42%, rgba(20,11,58,.05) 72%, transparent); }
.gl-hero-in { position: relative; padding: 30px clamp(18px, 4vw, 40px) 26px; max-width: 720px; }
.gl-logo-row { margin: 0 0 6px; }
.gl-logo { display: inline-flex; align-items: center; gap: 14px; }
.gl-logo .gl-mark { filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); animation: glbob 4.5s ease-in-out infinite; }
.gl-word { display: flex; flex-direction: column; line-height: 1; }
.gl-w1 { font-weight: 800; letter-spacing: .32em; font-size: clamp(.9rem, 2.2vw, 1.15rem); color: #fde68a; text-shadow: 0 2px 6px rgba(0,0,0,.45); }
.gl-w2 { font-weight: 900; font-size: clamp(2.1rem, 7.2vw, 3.6rem); letter-spacing: .02em; background: linear-gradient(90deg, #fde047, #fb7185 45%, #c084fc 70%, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(30,10,70,.65)) drop-shadow(0 8px 18px rgba(0,0,0,.35)); padding-bottom: .06em; }
.gl-hero h1 { color: #fff; font-size: clamp(1.1rem, 2.8vw, 1.55rem); margin: .5em 0 .35em; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.gl-hero .lead { color: #f5f3ff; text-shadow: 0 1px 6px rgba(0,0,0,.55); font-size: 1rem; }
.gl-hero .facts li { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #fff; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.gl-hero .cat-nav a { background: rgba(255,255,255,.94); color: #4c1d95; border-color: transparent; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.gl-hero .cat-nav a:hover, .gl-hero .cat-nav a:focus-visible { background: #fde68a; }
.gl-hero .cat-nav .muted { color: #7c3aed; }
.gl-f { transform-box: fill-box; transform-origin: center; animation: glfloat 6s ease-in-out infinite; }
.gl-tw { animation: gltw 3.2s ease-in-out infinite; }
.gl-cloud { animation: gldrift 26s ease-in-out infinite alternate; }
.gl-cloud2 { animation-duration: 34s; animation-direction: alternate-reverse; }
@keyframes glfloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(3deg); } }
@keyframes gltw { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes gldrift { from { transform: translateX(-24px); } to { transform: translateX(24px); } }
@keyframes glbob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .gl-f, .gl-tw, .gl-cloud, .gl-logo .gl-mark { animation: none; } }
body.home .arcade-section h2, body.home section > h2 { position: relative; }
body.home .game-card a { transition: transform .18s, box-shadow .18s, border-color .18s; }
body.home .game-card a:hover, body.home .game-card a:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 24px -12px rgba(124,58,237,.5); border-color: #a78bfa; }
@media (max-width: 600px) {
  .brand-word { font-size: .92rem; }
  .gl-hero { min-height: 0; border-radius: 16px; margin-top: 10px; background: linear-gradient(180deg, #3b1d78 0, #2a1458 55%, #1e1046 100%); }
  .gl-art { height: 250px; bottom: auto; }
  .gl-hero::before { background: linear-gradient(180deg, rgba(20,11,58,0) 0, rgba(20,11,58,0) 120px, rgba(42,20,88,.85) 215px, #2a1458 250px); }
  .gl-hero-in { padding: 150px 16px 18px; }
  .gl-logo { gap: 10px; }
  .gl-logo .gl-mark { width: 58px; height: 58px; }
}

/* ---------- sumo ---------- */
.act-canvas.sumo-cv { width: min(100%, max(250px, calc((100svh - 330px) * .8333)), 500px); height: auto; cursor: pointer; }
.sumo-hit { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; max-width: 420px; min-height: 92px; margin: 10px auto 0; padding: 10px 16px;
  border: 0; border-radius: 999px; color: #2a1206; cursor: pointer; touch-action: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; user-select: none;
  background: radial-gradient(120% 140% at 50% 20%, #ffe9a8 0%, #f2b33d 45%, #c46a16 100%);
  box-shadow: 0 7px 0 #7a3a0c, 0 12px 22px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.6); transition: transform .05s, box-shadow .05s; }
.sumo-hit b { font: 900 clamp(1.5rem, 7vw, 2rem)/1.1 system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif; letter-spacing: .04em; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.sumo-keys { font: 700 .72rem/1.2 system-ui, sans-serif; opacity: .7; }
.sumo-hit.on, .sumo-hit:active { transform: translateY(6px); box-shadow: 0 1px 0 #7a3a0c, 0 4px 10px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.5); }
.sumo-hit:focus-visible { outline: 3px solid var(--neon2, #29e7ff); outline-offset: 3px; }
.sumo-cal { display: grid; grid-template-columns: minmax(0, 1fr); box-sizing: border-box; width: 100%; gap: 6px; max-width: 420px; margin: 14px auto 2px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid #2c2457; color: #e8e4ff; font-size: .9rem; }
.sumo-cal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; } .sumo-cal-head label { font-weight: 800; }
.sumo-cal-row { display: flex; align-items: center; gap: 8px; }
.sumo-cal-row input[type=range] { flex: 1; min-width: 0; height: 32px; accent-color: #f2b33d; }
.sumo-step { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.3rem; line-height: 1; }
.sumo-off-v { flex: none; min-width: 4.2em; white-space: nowrap; text-align: end; font: 800 .95rem ui-monospace, Menlo, Consolas, monospace; color: #ffe14d; }
.sumo-cal-help { margin: 0; color: #bdb6e6; }
.sumo-cal-btn { justify-self: start; min-height: 44px; }
@media (max-width: 600px) {
  .arcade:has(.sumo-cv) .arc-deck { display: none; }
  .arcade:has(.sumo-cv) .arc-marquee { margin-bottom: 6px; padding: 3px 8px; }
  .arcade:has(.sumo-cv) .arc-hud { margin-bottom: 6px; }
  .act-canvas.sumo-cv { width: min(100%, max(240px, calc((100svh - 350px) * .8333))); }
  .sumo-hit { min-height: 86px; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .sumo-hit { transition: none; } }

/* ---------- tightrope ---------- */
.arcade .act-canvas.tall.tw-cv { background: #7ec8ff; touch-action: none; }
.tw-start { top: 46%; }
.tw-ctrl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 8px; }
.tw-seg { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tw-seg .btn { min-height: 40px; padding: 6px 12px; }
.tw-seg .btn[aria-pressed="true"] { border-color: var(--neon2, #29e7ff); box-shadow: 0 0 0 2px var(--neon2, #29e7ff) inset; }
@media (max-width: 600px) { .tw-ctrl { gap: 6px; margin-top: 6px; } .tw-seg .btn { min-height: 38px; padding: 4px 10px; font-size: .85rem; } }

/* ---------- shotput ---------- */
.arcade .act-canvas.tall.shot-cv { background: #5aa7e6; touch-action: none; cursor: grab; }
.arcade .act-canvas.tall.shot-cv:active { cursor: grabbing; }

/* ---------- eyetest ---------- */
.et-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: #fff4d6; color: #6b4a00; font-size: .9rem; font-weight: 700; }
.et-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: start; }
.et-chart { min-height: 320px; }
.et-board { background: #fff; color: #111; border-radius: 14px; border: 1px solid #d8dde3; padding: 16px; text-align: center; box-shadow: inset 0 0 0 6px #f2f4f6; }
.et-board-test { padding: 10px; }
.et-big { font: 900 96px/1 system-ui, sans-serif; margin: 10px 0; }
.et-h { font-size: 1.15rem; font-weight: 800; margin: 6px 0 12px; }
.et-eye { font-size: 1.3rem; font-weight: 900; margin: 4px 0; }
.et-info { margin: 0 0 6px; font-weight: 700; color: #334; }
.et-cv { display: block; margin: 0 auto; background: #fff; touch-action: none; border-radius: 8px; }
.et-cv.flash { animation: et-in .18s ease-out; }
@keyframes et-in { from { opacity: 0; } to { opacity: 1; } }
.et-doc { position: relative; display: flex; flex-direction: column; align-items: center; }
.et-docsvg { width: 100%; max-width: 190px; height: auto; display: block; }
.et-bubble { position: relative; margin: 0 0 8px; padding: 10px 12px; background: #fff; color: #222; border: 2px solid #2f5f9e; border-radius: 14px; font-size: .92rem; line-height: 1.5; min-height: 3em; width: 100%; box-sizing: border-box; }
.et-bubble::after { content: ''; position: absolute; left: 50%; bottom: -10px; border: 8px solid transparent; border-top-color: #2f5f9e; border-bottom: 0; transform: translateX(-50%); }
.et-bubble.pop { animation: et-pop .25s ease-out; }
@keyframes et-pop { from { transform: scale(.96); opacity: .5; } to { transform: none; opacity: 1; } }
.et-ctrl { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.et-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.et-row input[type=range] { flex: 1 1 160px; max-width: 340px; }
.et-step { min-width: 46px; min-height: 46px; font-size: 1.3rem; }
.et-cardbox { overflow: hidden; padding: 8px; display: flex; justify-content: center; }
.et-card { box-sizing: border-box; border: 2px dashed #2f5f9e; border-radius: 3.2% / 5%; background: linear-gradient(135deg, #e6f0fb, #cfe0f4); display: flex; align-items: center; justify-content: center; color: #2f5f9e; font-weight: 700; font-size: .85rem; padding: 6px; text-align: center; }
.et-dists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 auto 10px; max-width: 420px; }
.et-dists .btn { display: flex; flex-direction: column; gap: 2px; min-height: 60px; justify-content: center; }
.et-pad { display: grid; grid-template-columns: repeat(3, 72px); grid-template-rows: repeat(3, 60px); gap: 8px; justify-content: center; }
.et-a { font-size: 1.7rem; font-weight: 900; min-height: 56px; }
.et-up { grid-column: 2; grid-row: 1; } .et-left { grid-column: 1; grid-row: 2; } .et-unk { grid-column: 2; grid-row: 2; font-size: .8rem; font-weight: 700; line-height: 1.2; } .et-right { grid-column: 3; grid-row: 2; } .et-down { grid-column: 2; grid-row: 3; }
.et-resrow { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.et-res { display: flex; flex-direction: column; align-items: center; min-width: 120px; padding: 10px 14px; border-radius: 12px; background: #eef4fb; }
.et-res b { font-size: 2.6rem; line-height: 1.1; color: #2f5f9e; }
.et-warn { font-weight: 800; color: #a33; background: #fff0f0; border-radius: 10px; padding: 8px 10px; }
.et-hist { text-align: left; margin: 6px 0 0; }
@media (max-width: 600px) {
  .et-wrap { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .et-doc { order: -1; flex-direction: row; align-items: center; gap: 6px; }
  .et-docsvg { width: 84px; max-width: 84px; flex: 0 0 84px; }
  .et-bubble { margin: 0; font-size: .82rem; padding: 6px 9px; min-height: 0; flex: 1 1 auto; }
  .et-bubble::after { left: auto; right: -10px; bottom: auto; top: 50%; transform: translateY(-50%); border: 8px solid transparent; border-left-color: #2f5f9e; border-right: 0; }
  .et-chart { min-height: 240px; }
  .et-big { font-size: 64px; }
  .et-pad { grid-template-columns: repeat(3, 76px); grid-template-rows: repeat(3, 62px); }
}
.et-pad { width: 100%; }
.et-ctrl { width: 100%; }

/* ===== app-like phone UI for game pages (2026-11-29) — desktop unchanged ===== */
.appbar { display: none; }
.sheet-bg { display: none; }
@media (max-width: 700px) {
  html:has(body.game-page) { overscroll-behavior-y: none; }
  body.game-page { -webkit-tap-highlight-color: transparent; padding-bottom: env(safe-area-inset-bottom); }
  body.game-page .site-header { display: none; }
  body.game-page .appbar { position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 44px 1fr 44px 44px; align-items: center; gap: 4px;
    min-height: 52px; padding: env(safe-area-inset-top) 6px 0; background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
  body.game-page .appbar a, body.game-page .appbar button { color: var(--text); }
  .ab-back, .ab-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; padding: 0; text-decoration: none; cursor: pointer; }
  .ab-back:active, .ab-btn:active { background: var(--surface2); transform: scale(.92); }
  .ab-back svg, .ab-btn svg { width: 24px; height: 24px; }
  .ab-title { font-weight: 800; font-size: 1.02rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; justify-content: center; }
  .ab-icon { font-size: 1.15rem; }
  /* game first, the page text below it */
  body.game-page main { display: flex; flex-direction: column; padding: 8px 10px 16px; }
  body.game-page main > .play { order: -1; margin: 0 0 18px; padding: 8px; border-radius: 16px; box-shadow: 0 6px 22px rgba(0,0,0,.08); }
  body.game-page main > .crumbs { display: none; }
  body.game-page main > h1 { font-size: 1.25rem; margin: 8px 0 6px; }
  body.game-page .status { margin: 2px 4px 6px; font-size: .95rem; min-height: 1.4em; }
  body.game-page #game { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  body.game-page .toolbar { justify-content: center; }
  body.game-page .toolbar .btn, body.game-page #game .btn { min-height: 44px; }
  body.game-page .btn:active { transform: scale(.96); }
  /* settings: a bottom sheet opened from the app bar */
  body.game-page .setup-box:not([open]) { display: none; }
  body.game-page .setup-box[open] { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; margin: 0; max-height: 78vh; overflow: auto;
    background: var(--surface); border-radius: 20px 20px 0 0; padding: 6px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.25);
    animation: sheet-up .22s cubic-bezier(.2,.8,.2,1); }
  body.game-page .setup-box[open] summary { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0 8px; position: sticky; top: -6px; background: var(--surface); }
  body.game-page .setup-box[open] summary::-webkit-details-marker { display: none; }
  body.game-page .setup-box[open] summary::before { content: ''; width: 42px; height: 5px; border-radius: 3px; background: var(--line); }
  body.game-page .setup-box .setup-actions .btn { width: 100%; min-height: 50px; font-size: 1.05rem; }
  body.sheet-open .sheet-bg { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.38); animation: fade-in .2s; }
  body.sheet-open { overflow: hidden; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.game-page .setup-box[open], body.sheet-open .sheet-bg { animation: none; } }
@media (max-width: 700px) {
  body.game-page .arcade .arc-marquee, body.game-page .arcade .arc-deck { display: none; }
  body.game-page .arcade { padding: 8px; border-radius: 18px; }
  body.game-page main > .play:has(.arcade) { background: transparent; border: 0; box-shadow: none; padding: 0; }
}

/* ---------- hourglass ---------- */
.hg-wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.hg-stage { position: relative; border-radius: 18px; overflow: hidden; background: #2a2230; box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06); }
.hg-cv { display: block; width: 100%; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.hg-cv:active { cursor: grabbing; }
.hg-cv:focus-visible { outline: 3px solid #ffd58a; outline-offset: -3px; border-radius: 18px; }
.hg-time { position: absolute; inset-inline-end: 12px; bottom: 8px; margin: 0; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.28); color: rgba(255,240,220,.78); font: 600 .95rem/1.6 ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; letter-spacing: .04em; pointer-events: none; }
.hg-bar { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.hg-flip { min-height: 56px; font-size: 1.1rem; font-weight: 800; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; touch-action: manipulation; }
.hg-flip:active { transform: scale(.98); }
.hg-ico { font-size: 1.5rem; line-height: 1; }
.hg-colbox { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.hg-colors { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hg-sw { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(0,0,0,.25); cursor: pointer; padding: 0; touch-action: manipulation;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.75), rgba(255,255,255,0) 45%), var(--hg-c, #e6dbc3); box-shadow: inset 0 -4px 8px rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.2); transition: transform .12s; }
.hg-sw-rainbow { background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.7), rgba(255,255,255,0) 45%), conic-gradient(#e5484d, #f08c2e, #f2cc3d, #4cb35e, #3d8fd6, #5a5bc9, #a35bc9, #e5484d); }
.hg-sw[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 3px; transform: scale(1.06); }
.hg-sw:active { transform: scale(.92); }
.hg-histbox { font-size: .92rem; }
.hg-histbox summary { cursor: pointer; padding: 10px 0; }
.hg-hist { margin: 4px 0 0; padding-inline-start: 1.4em; line-height: 1.8; }
/* the omikuji slip */
.hg-slip { position: absolute; left: 50%; bottom: 10px; width: min(78%, 300px); max-height: calc(100% - 20px); overflow: auto; transform: translate(-50%, 0); z-index: 2; }
.hg-slip.show { animation: hg-rise .7s cubic-bezier(.2,.8,.25,1) both; }
.hg-slip.show .hg-paper { animation: hg-unfold .55s .35s cubic-bezier(.2,.8,.25,1) both; transform-origin: 50% 0; }
.hg-slip.show .hg-slipbtns { animation: hg-fade .3s .85s both; }
@keyframes hg-rise { from { transform: translate(-50%, 115%) rotate(-4deg); opacity: 0; } to { transform: translate(-50%, 0) rotate(0); opacity: 1; } }
@keyframes hg-unfold { from { transform: scaleY(.18); filter: brightness(.85); } to { transform: none; filter: none; } }
@keyframes hg-fade { from { opacity: 0; } to { opacity: 1; } }
.hg-paper { position: relative; background: linear-gradient(180deg, #fffdf6, #f6efdc); color: #2a1a10; border-radius: 4px; padding: 12px 16px 10px; text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.45), inset 0 0 0 1px rgba(120,60,20,.15); border-top: 6px solid #b8322a; border-bottom: 6px solid #b8322a;
  background-image: linear-gradient(180deg, #fffdf6, #f6efdc), repeating-linear-gradient(90deg, rgba(120,90,40,.04) 0 2px, transparent 2px 5px); background-blend-mode: multiply; }
.hg-sh { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: .78rem; font-weight: 700; color: #8a2a22; letter-spacing: .08em; }
.hg-rank { margin: 2px auto 0; font: 900 3.1rem/1.1 "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; color: #b8322a; }
.hg-rank[data-rank="kyo"] { color: #3d3a4a; }
.hg-rank[data-rank="daikichi"] { text-shadow: 0 0 12px rgba(230,170,40,.55); }
.hg-rname { margin: 0 0 6px; font-weight: 800; font-size: .95rem; }
.hg-msg { margin: 0 0 8px; font-size: .92rem; line-height: 1.6; text-align: start; }
.hg-lucky { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 6px; font-size: .85rem; text-align: start; }
.hg-lucky dt { color: #8a2a22; font-weight: 700; } .hg-lucky dd { margin: 0; }
.hg-fnote { margin: 4px 0 0; font-size: .7rem; color: #7a6a5a; }
.hg-slipbtns { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.hg-slipbtns .btn { min-height: 46px; flex: 1 1 0; }
@media (max-width: 600px) {
  .hg-wrap { gap: 10px; }
  .hg-stage { border-radius: 14px; }
  .hg-slip { width: 86%; }
  .hg-rank { font-size: 2.6rem; }
  .hg-colors { gap: 5px; flex-wrap: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .hg-slip.show, .hg-slip.show .hg-paper, .hg-slip.show .hg-slipbtns { animation: none; }
}

/* ---------- gacha ---------- */
.gc-app { width: 100%; display: flex; flex-direction: column; gap: 8px; --th1: #16324f; --th2: #2f7fbf; --th3: #8fe3ff; }
.gc-app[data-m="monster"] { --th1: #2a1640; --th2: #6d3aa3; --th3: #b7ff6b; }
.gc-app[data-m="gem"] { --th1: #3a0c24; --th2: #b0245f; --th3: #ffd1ec; }
.gc-app[data-m="mascot"] { --th1: #6b2d14; --th2: #f0874f; --th3: #fff0a8; }
.gc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gc-coins { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border-radius: 999px; background: linear-gradient(180deg, #2b2b33, #15151a); color: #ffe48a; font-weight: 800; font-size: 1.05rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 6px rgba(0,0,0,.25); font-variant-numeric: tabular-nums; }
.gc-coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c4, #ffcf3f 45%, #b37b0c 100%); box-shadow: inset 0 0 0 2px rgba(120,70,0,.45); }
.gc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.gc-free { border-radius: 999px; }
.gc-free.nudge { animation: gc-nudge .5s ease 2; border-color: #e0a800; }
@keyframes gc-nudge { 50% { transform: scale(1.08); } }
.gc-pulls { margin-inline-start: auto; }
.gc-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gc-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 6px 4px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; font-weight: 700; font-size: .82rem; line-height: 1.15; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gc-tab[aria-selected="true"] { border-color: var(--th2); background: linear-gradient(180deg, color-mix(in srgb, var(--th2) 22%, var(--surface)), var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--th2) 35%, transparent); }
.gc-tab:disabled { opacity: .45; }
.gc-tabart { width: 56px; height: 41px; border-radius: 6px; }
.gc-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface2); padding: 4px; border-radius: 12px; }
.gc-vbtn { min-height: 40px; border: 0; background: transparent; border-radius: 9px; }
.gc-vbtn[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.18); color: var(--text); }
.gc-stage { position: relative; height: clamp(420px, 64vh, 600px); border-radius: 16px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer;
  background: radial-gradient(120% 80% at 50% 20%, color-mix(in srgb, var(--th2) 70%, #000) 0%, var(--th1) 55%, #05060a 100%); box-shadow: inset 0 0 60px rgba(0,0,0,.6), 0 6px 20px rgba(0,0,0,.25); }
.gc-app[data-view="book"] .gc-stage, .gc-app[data-view="rates"] .gc-stage { display: none; }
.gc-stage::before { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(transparent, rgba(0,0,0,.55)); pointer-events: none; }
.gc-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gc-layer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; }
.gc-hint { position: absolute; inset: auto 0 8px 0; margin: 0; text-align: center; color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 600; text-shadow: 0 1px 3px #000; pointer-events: none; }
.gc-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: #fff; }
.gc-flash.on { animation: gc-flash .7s ease-out; }
.gc-flash.on[data-rank="SSS"] { background: radial-gradient(circle, #fff 0%, #fff3b0 40%, #ff9de6 100%); animation-duration: 1.2s; }
@keyframes gc-flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.gc-show { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gc-rateline { color: rgba(255,255,255,.8); font-size: .78rem; text-align: center; max-width: 34ch; line-height: 1.4; }
/* pack */
.gc-pack { position: relative; width: 190px; aspect-ratio: 0.68; filter: drop-shadow(0 18px 18px rgba(0,0,0,.5)); }
.gc-pack-top, .gc-pack-body { position: absolute; left: 0; right: 0; background: linear-gradient(115deg, var(--th1), var(--th2) 45%, color-mix(in srgb, var(--th3) 60%, var(--th2)) 52%, var(--th2) 60%, var(--th1)); }
.gc-pack-top { top: 0; height: 12%; clip-path: polygon(0 18%, 4% 0, 8% 18%, 12% 0, 16% 18%, 20% 0, 24% 18%, 28% 0, 32% 18%, 36% 0, 40% 18%, 44% 0, 48% 18%, 52% 0, 56% 18%, 60% 0, 64% 18%, 68% 0, 72% 18%, 76% 0, 80% 18%, 84% 0, 88% 18%, 92% 0, 96% 18%, 100% 0, 100% 100%, 0 100%); border-bottom: 2px dashed rgba(255,255,255,.55); transition: transform .5s cubic-bezier(.3,.7,.3,1), opacity .5s; }
.gc-pack-body { top: 12%; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 10px 18px; clip-path: polygon(0 0, 100% 0, 100% 96%, 96% 100%, 92% 96%, 88% 100%, 84% 96%, 80% 100%, 76% 96%, 72% 100%, 68% 96%, 64% 100%, 60% 96%, 56% 100%, 52% 96%, 48% 100%, 44% 96%, 40% 100%, 36% 96%, 32% 100%, 28% 96%, 24% 100%, 20% 96%, 16% 100%, 12% 96%, 8% 100%, 4% 96%, 0 100%); transition: transform .55s cubic-bezier(.5,0,.7,.4), opacity .55s; }
.gc-pack-brand { font-weight: 900; letter-spacing: .25em; font-size: .7rem; color: rgba(255,255,255,.85); }
.gc-pack-win { width: 82%; aspect-ratio: 300/220; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 3px rgba(255,255,255,.75), 0 0 18px color-mix(in srgb, var(--th3) 80%, transparent); }
.gc-packart { width: 100%; height: 100%; display: block; }
.gc-pack-name { font-weight: 900; font-size: 1.05rem; color: #fff; text-align: center; line-height: 1.15; text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 12px var(--th3); }
.gc-pack-sub { font-size: .68rem; color: rgba(255,255,255,.8); font-weight: 700; letter-spacing: .05em; text-align: center; }
.gc-pack-gloss { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 42%, transparent 54%); background-size: 260% 100%; animation: gc-gloss 3.2s linear infinite; mix-blend-mode: overlay; clip-path: inset(12% 0 0 0); }
@keyframes gc-gloss { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.gc-pack.float { animation: gc-float 3.4s ease-in-out infinite; }
@keyframes gc-float { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
.gc-pack.drop { animation: gc-drop .6s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes gc-drop { from { transform: translateY(-120%) rotate(-12deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.gc-pack.shake { animation: gc-shake .45s ease; }
@keyframes gc-shake { 20% { transform: translateX(-6px) rotate(-3deg); } 40% { transform: translateX(6px) rotate(3deg); } 60% { transform: translateX(-4px) rotate(-2deg) scale(1.03); } 80% { transform: translateX(3px) rotate(1deg); } }
.gc-pack.open .gc-pack-top { transform: translate(calc(var(--dir, 1) * 140%), -90%) rotate(calc(var(--dir, 1) * 40deg)); opacity: 0; }
.gc-pack.open .gc-pack-body { transform: translateY(70%); opacity: 0; transition-delay: .1s; }
.gc-pack.open .gc-pack-gloss { display: none; }
/* card */
.gc-card { --w: 240px; position: relative; width: var(--w); aspect-ratio: 63/88; container-type: inline-size; perspective: 900px; flex: none; --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg; --ho: .5;
  --f1: #efe8d8; --f2: #d8cdb5; --ink: #3b3326; --edge: #b9ae98; --bad: #8a7d62; }
.gc-in { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s cubic-bezier(.2,.8,.3,1); }
.gc-card.tilting .gc-in { transition: transform .08s linear; }
.gc-front, .gc-back { position: absolute; inset: 0; border-radius: 4.5cqw; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.gc-front { background: linear-gradient(145deg, var(--f1), var(--f2)); box-shadow: 0 2px 0 rgba(255,255,255,.35) inset, 0 8px 22px rgba(0,0,0,.45); padding: 4.5cqw; border: .8cqw solid var(--edge); }
.gc-back { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw; border: 2.5cqw solid #e9e4d8;
  background: radial-gradient(circle at 50% 45%, var(--th3) 0, var(--th2) 22%, var(--th1) 60%, #07080c 100%), var(--th1); box-shadow: 0 8px 22px rgba(0,0,0,.45); }
.gc-back::before { content: ""; position: absolute; inset: 4cqw; border-radius: 3cqw; border: .6cqw solid rgba(255,255,255,.35); background: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255,255,255,.07) 0 6deg, transparent 6deg 12deg); }
.gc-back-logo { position: relative; font-size: 22cqw; line-height: 1; color: #fff; text-shadow: 0 0 6cqw var(--th3); }
.gc-back-txt { position: relative; color: #fff; font-weight: 900; font-size: 6cqw; text-align: center; padding: 0 8cqw; line-height: 1.15; }
.gc-card.is-back .gc-in { transform: rotateY(180deg); }
.gc-card.flipped .gc-in { animation: gc-flip .6s cubic-bezier(.3,.7,.3,1); }
@keyframes gc-flip { from { transform: rotateY(180deg) scale(1.05); } 60% { transform: rotateY(-12deg) scale(1.08); } to { transform: rotateY(0) scale(1); } }
.gc-card.charge .gc-in { animation: gc-charge .65s ease-in infinite; }
@keyframes gc-charge { 0%, 100% { transform: rotateY(180deg) translateX(0); } 25% { transform: rotateY(180deg) translateX(-3px) scale(1.02); } 75% { transform: rotateY(180deg) translateX(3px) scale(1.04); } }
.gc-card.deal { animation: gc-deal .45s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes gc-deal { from { transform: translateY(50%) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.gc-face { position: relative; height: 100%; display: flex; flex-direction: column; gap: 1.6cqw; color: var(--ink); }
.gc-head { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; }
.gc-name { font-weight: 900; font-size: 6.6cqw; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.gc-badge { flex: none; min-width: 13cqw; padding: .6cqw 2cqw; border-radius: 99px; text-align: center; font-weight: 900; font-size: 6cqw; line-height: 1.2; color: #fff; background: var(--bad); box-shadow: inset 0 -1px 0 rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.3); font-family: Georgia, "Times New Roman", serif; }
.gc-win { position: relative; border-radius: 2cqw; overflow: hidden; aspect-ratio: 300/220; box-shadow: 0 0 0 .8cqw var(--edge), inset 0 0 0 1px rgba(0,0,0,.3); background: #000; flex: none; }
.gc-art { width: 100%; height: 100%; display: block; }
.gc-typeline { display: flex; justify-content: space-between; gap: 2cqw; font-size: 4.2cqw; font-weight: 800; padding: .6cqw 2cqw; border-radius: 1.5cqw; background: rgba(0,0,0,.1); }
.gc-typeline span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-no { font-variant-numeric: tabular-nums; opacity: .75; white-space: nowrap; }
.gc-flav { margin: 0; flex: 1; min-height: 0; font-size: 4.1cqw; line-height: 1.35; font-style: italic; opacity: .9; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.gc-stats { display: grid; gap: .8cqw; }
.gc-stat { display: grid; grid-template-columns: 26cqw 1fr 8cqw; align-items: center; gap: 1.5cqw; font-size: 3.6cqw; font-weight: 700; line-height: 1.1; }
.gc-stat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-stat i { height: 1.8cqw; border-radius: 9px; background: linear-gradient(90deg, var(--edge) calc(var(--v) * 1%), rgba(0,0,0,.15) 0); }
.gc-stat b { text-align: end; font-variant-numeric: tabular-nums; }
.gc-foot { display: flex; justify-content: space-between; gap: 2cqw; font-size: 2.8cqw; opacity: .65; white-space: nowrap; overflow: hidden; }
.gc-foil, .gc-glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.gc-glare { background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.38), transparent 45%); opacity: 0; mix-blend-mode: soft-light; transition: opacity .3s; }
.gc-card.tilting .gc-glare, .gc-card.gc-big .gc-glare { opacity: 1; }
.gc-new, .gc-count { position: absolute; z-index: 2; font-weight: 900; border-radius: 99px; padding: .5cqw 3cqw; font-size: 5cqw; line-height: 1.4; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.gc-new { top: -2.5cqw; inset-inline-start: -2.5cqw; background: linear-gradient(180deg, #ff5b5b, #c0122b); color: #fff; transform: rotate(-8deg); }
.gc-card.is-back .gc-new { display: none; }
.gc-count { bottom: -2cqw; inset-inline-end: -2cqw; background: #111; color: #ffe48a; }
/* rank frames */
.gc-card[data-rank="F"] { --f1: #e4e8ec; --f2: #b9c0c7; --ink: #263038; --edge: #8b949d; --bad: #6d7781; }
.gc-card[data-rank="E"] { --f1: #f1d2b2; --f2: #c08655; --ink: #3b2212; --edge: #8f5a30; --bad: #9b5f2d; }
.gc-card[data-rank="D"] { --f1: #d7f0dc; --f2: #7cc493; --ink: #10301b; --edge: #2f8a50; --bad: #2f8a50; }
.gc-card[data-rank="C"] { --f1: #d6ecfb; --f2: #73b7e8; --ink: #0d2a40; --edge: #2a78b8; --bad: #2a78b8; }
.gc-card[data-rank="B"] { --f1: #e8dcff; --f2: #a27ae6; --ink: #24104a; --edge: #6d43c4; --bad: #6d43c4; }
.gc-card[data-rank="A"] { --f1: #f7f9fc; --f2: #b7c3d2; --ink: #1b2531; --edge: #8392a5; --bad: linear-gradient(180deg, #c9d2dd, #66748a); }
.gc-card[data-rank="S"] { --f1: #fff4c9; --f2: #e2ad3b; --ink: #3a2500; --edge: #b47d12; --bad: linear-gradient(180deg, #ffe48a, #b07812); }
.gc-card[data-rank="SS"] { --f1: #fde9ff; --f2: #c7b6ff; --ink: #2a0b3a; --edge: #b45cd8; --bad: linear-gradient(90deg, #ff5bc5, #ffb347, #5ee7ff, #a77bff); }
.gc-card[data-rank="SSS"] { --f1: #2a2112; --f2: #0b0906; --ink: #fff3cf; --edge: #e8b93b; --bad: linear-gradient(90deg, #ffe48a, #fff, #ffcf3f, #ff9de6, #8fe3ff, #ffe48a); }
.gc-card[data-rank="SSS"] .gc-typeline { background: rgba(255,220,120,.14); }
.gc-card[data-rank="SSS"] .gc-badge, .gc-card[data-rank="SS"] .gc-badge, .gc-card[data-rank="S"] .gc-badge { color: #2a1700; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.gc-card[data-rank="SSS"] .gc-badge { background-size: 300% 100%; animation: gc-badge 3s linear infinite; }
@keyframes gc-badge { to { background-position: 300% 0; } }
.gc-card[data-rank="A"] .gc-front { border-color: #d7dde6; box-shadow: 0 0 0 .6cqw #7c899b inset, 0 8px 22px rgba(0,0,0,.45); }
.gc-card[data-rank="S"] .gc-front, .gc-card[data-rank="SS"] .gc-front, .gc-card[data-rank="SSS"] .gc-front { box-shadow: 0 0 0 .5cqw rgba(255,255,255,.4) inset, 0 8px 24px rgba(0,0,0,.5), 0 0 6cqw color-mix(in srgb, var(--edge) 70%, transparent); }
/* foil: A silver sheen, S gold sheen, SS prism, SSS holographic + sparkles; follows --mx/--my */
.gc-card[data-rank="A"] .gc-foil { background: linear-gradient(115deg, transparent calc(var(--mx) - 30%), rgba(255,255,255,.55) var(--mx), transparent calc(var(--mx) + 30%)); mix-blend-mode: overlay; }
.gc-card[data-rank="S"] .gc-foil { background: linear-gradient(115deg, transparent calc(var(--mx) - 28%), rgba(255,240,170,.75) var(--mx), transparent calc(var(--mx) + 28%)); mix-blend-mode: overlay; }
.gc-card[data-rank="SS"] .gc-foil, .gc-card[data-rank="SSS"] .gc-foil {
  background: repeating-linear-gradient(115deg, #ff7ad9 0%, #ffd36b 2.5%, #7dffb2 5%, #6bd5ff 7.5%, #b58bff 10%, #ff7ad9 12.5%), repeating-linear-gradient(25deg, rgba(255,255,255,.0) 0 3px, rgba(255,255,255,.18) 3px 4px);
  background-size: 400% 400%, auto; background-position: var(--mx) var(--my), 0 0;
  mix-blend-mode: soft-light; opacity: calc(var(--ho) * .9); }
.gc-card[data-rank="SSS"] .gc-foil { mix-blend-mode: screen; opacity: calc(var(--ho) * .28); }
.gc-card[data-rank="SSS"] .gc-glare { background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.6), transparent 40%), radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 15%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 85% 60%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 35% 80%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 55% 50%, #fff 50%, transparent 51%); opacity: 1; mix-blend-mode: screen; }
.gc-card[data-rank="SSS"]:not(.tilting) .gc-foil, .gc-card[data-rank="SS"]:not(.tilting) .gc-foil { animation: gc-holo 6s ease-in-out infinite; }
@keyframes gc-holo { 0%, 100% { background-position: 0% 30%; } 50% { background-position: 100% 70%; } }
.gc-card.gc-big { filter: drop-shadow(0 14px 22px rgba(0,0,0,.55)); }
.gc-progress { position: absolute; top: 10px; inset-inline: 10px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 800; text-shadow: 0 1px 3px #000; }
.gc-skip { background: rgba(0,0,0,.45); color: #fff; border-color: rgba(255,255,255,.4); border-radius: 99px; min-width: 88px; }
/* summary */
.gc-summary { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 28px; touch-action: pan-y; }
.gc-sumh { margin: 0; color: #fff; font-weight: 800; display: flex; gap: 8px; align-items: center; text-shadow: 0 1px 3px #000; }
.gc-newn { font-size: .8rem; background: #e11d48; padding: 2px 8px; border-radius: 99px; }
.gc-sumgrid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 4px; margin: auto 0; }
.gc-sumgrid .gc-card { animation: gc-deal .4s cubic-bezier(.2,.9,.3,1.1) both; }
.gc-cardbtn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
.gc-cardbtn:active .gc-card { transform: scale(.96); }
/* actions bar */
.gc-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; position: sticky; bottom: 8px; z-index: 3; }
.gc-pull { min-height: 60px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; font-size: 1.08rem; font-weight: 900; box-shadow: 0 4px 0 rgba(0,0,0,.25), 0 6px 16px rgba(0,0,0,.2); transition: transform .08s; }
.gc-pull small { font-weight: 700; font-size: .78rem; opacity: .85; }
.gc-pull:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.gc-ten { background: linear-gradient(180deg, #ffd65a, #f39a12); color: #3a2000; border-color: #c97a00; }
.btn.gc-one { background: linear-gradient(180deg, color-mix(in srgb, var(--th2) 85%, #fff), var(--th2)); color: #fff; border-color: var(--th1); }
.gc-app[data-view="book"] .gc-actions, .gc-app[data-view="rates"] .gc-actions { position: static; }
/* book */
.gc-page:empty { display: none; }
.gc-bookhead h3 { margin: 4px 0; }
.gc-meter { height: 10px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.gc-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--th2), var(--th3)); }
.gc-book { display: grid; grid-template-columns: repeat(var(--cols), max-content); justify-content: center; gap: 8px; margin-top: 8px; }
.gc-slot { width: var(--w); aspect-ratio: 63/88; border-radius: 10px; border: 2px dashed var(--line); background: repeating-linear-gradient(45deg, var(--surface2) 0 8px, var(--surface) 8px 16px); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.gc-slot b { font-family: Georgia, serif; font-size: 1.1rem; }
.gc-slot span { font-size: 1.6rem; font-weight: 900; line-height: 1; }
/* rates */
.gc-tablewrap { overflow-x: auto; }
.gc-rates table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; }
.gc-rates th, .gc-rates td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: end; white-space: nowrap; }
.gc-rates th[scope="row"], .gc-rates thead th:first-child { text-align: start; }
.gc-rk { display: inline-block; min-width: 42px; text-align: center; font-weight: 900; font-family: Georgia, serif; padding: 1px 8px; border-radius: 99px; color: #fff; background: #8a7d62; }
.gc-rk[data-rank="F"] { background: #6d7781; } .gc-rk[data-rank="E"] { background: #9b5f2d; } .gc-rk[data-rank="D"] { background: #2f8a50; } .gc-rk[data-rank="C"] { background: #2a78b8; } .gc-rk[data-rank="B"] { background: #6d43c4; }
.gc-rk[data-rank="A"] { background: linear-gradient(180deg, #c9d2dd, #66748a); } .gc-rk[data-rank="S"] { background: linear-gradient(180deg, #ffe48a, #b07812); color: #2a1700; }
.gc-rk[data-rank="SS"] { background: linear-gradient(90deg, #ff5bc5, #ffb347, #5ee7ff, #a77bff); color: #2a0b3a; } .gc-rk[data-rank="SSS"] { background: linear-gradient(90deg, #ffe48a, #fff, #ff9de6, #8fe3ff); color: #2a1700; box-shadow: 0 0 8px #ffd24a; }
/* detail dialog */
.gc-detail { border: 0; padding: 14px; background: rgba(8,9,14,.94); color: #fff; width: min(100vw, 520px); max-width: 100vw; max-height: 100dvh; border-radius: 18px; text-align: center; overflow: hidden; }
.gc-detail::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.gc-drow { display: flex; align-items: center; justify-content: center; gap: 6px; }
.gc-dhold { touch-action: none; padding: 10px 0; }
.gc-dnav { min-width: 44px; min-height: 64px; font-size: 1.6rem; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); padding: 0; }
.gc-dclose { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 3; min-width: 44px; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); border-radius: 99px; }
.gc-dinfo { margin: 6px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.gc-tilthint { margin: 2px 0 0; color: rgba(255,255,255,.65); }
@media (max-width: 560px) {
  .gc-stage { height: min(60svh, 520px); min-height: 380px; border-radius: 14px; }
  .gc-tab { font-size: .74rem; min-height: 58px; }
  .gc-tabart { width: 48px; height: 35px; }
  .gc-pack { width: 170px; }
  .gc-detail { padding: 10px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .gc-pack.float, .gc-pack-gloss, .gc-card .gc-foil, .gc-card .gc-badge, .gc-sumgrid .gc-card, .gc-card.deal, .gc-card.flipped .gc-in, .gc-card.charge .gc-in { animation: none !important; }
  .gc-in, .gc-pack-top, .gc-pack-body { transition: none; }
}

/* ---------- yarn ---------- */
.yn-wrap { position: relative; width: 100%; max-width: 760px; margin: 0 auto; border-radius: 20px; overflow: hidden; background: #2a1f2b; box-shadow: 0 10px 28px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,230,200,.12); }
.yn-stage { position: relative; height: min(66svh, 128vw, 640px); min-height: 300px; }
.yn-cv { display: block; width: 100%; height: 100%; touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; }
.yn-cv:focus-visible { box-shadow: inset 0 0 0 3px #ffd79a; }
.yn-pops { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.yn-pop { position: absolute; transform: translate(-50%, -50%); font: 900 clamp(1.3rem, 6vw, 2.2rem)/1 system-ui, sans-serif; color: #fff7ea; letter-spacing: .04em; white-space: normal; width: max-content; max-width: 86%; text-align: center;
  text-shadow: 0 2px 0 #d9779a, 0 0 14px rgba(255,190,220,.9), 0 4px 14px rgba(0,0,0,.35); animation: yn-pop 1.7s ease-out forwards; }
@keyframes yn-pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
.yn-paused { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; pointer-events: none; opacity: 0; transition: opacity .2s; background: rgba(20,10,20,.28); color: #fff3e2; }
.yn-paused span { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: rgba(255,240,225,.18); backdrop-filter: blur(4px); font-size: 2rem; letter-spacing: -.1em; }
.yn-paused b { font-size: 1rem; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.yn-pause .yn-paused { opacity: 1; }
.yn-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(#3a2a33, #2a1f26); border-top: 1px solid rgba(255,230,200,.12); }
.yn-play { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.25rem; letter-spacing: -.12em; color: #3a2210;
  background: radial-gradient(circle at 35% 30%, #fff3d6, #f2b56b 70%, #c98236); box-shadow: 0 3px 0 #8a5222, 0 6px 12px rgba(0,0,0,.35); -webkit-tap-highlight-color: transparent; }
.yn-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a5222, 0 3px 8px rgba(0,0,0,.35); }
.yn-seg { display: flex; flex: 1 1 auto; min-width: 0; background: rgba(0,0,0,.25); border-radius: 14px; padding: 3px; }
.yn-seg button { flex: 1 1 0; min-width: 0; min-height: 48px; border: 0; border-radius: 11px; background: transparent; color: #f3e3d3; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.1; -webkit-tap-highlight-color: transparent; }
.yn-seg button .yn-ic { font-size: 1.15rem; }
.yn-seg button[aria-pressed="true"] { background: #f6e2c8; color: #3a2210; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.yn-swatches { display: flex; gap: 6px; flex: none; }
.yn-sw { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); background: var(--sw); cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
.yn-sw[aria-pressed="true"] { border-color: #fff4e0; box-shadow: 0 0 0 2px #e79a5a; }
.yn-fs { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,230,200,.25); background: rgba(255,255,255,.06); color: #f3e3d3; font-size: 1.3rem; cursor: pointer; }
.yn-isfs { max-width: none; border-radius: 0; height: 100%; display: flex; flex-direction: column; }
.yn-isfs .yn-stage { flex: 1 1 auto; height: auto; }
@media (max-width: 560px) {
  .yn-wrap { border-radius: 16px; }
  .yn-bar { flex-wrap: wrap; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; }
  .yn-seg { order: 3; flex-basis: 100%; }
  .yn-swatches { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .yn-pop { animation-duration: .9s; } }

/* ---------- ninja ---------- */
.nj-cab .arc-screen.nj-screen { padding: 8px; }
.nj-stagebox { position: relative; }
.arcade .act-canvas.nj-cv { width: 100%; max-width: 720px; background: #0b0d1e; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.nj-start { top: 50%; }
.nj-stagebox .arc-banner { border-radius: 8px; }
.nj-stagebox .arc-banner b { font-size: clamp(1.2rem, 6vw, 2.2rem); }
.nj-stagebox .arc-banner span { font-size: .95rem; }
.nj-deck { direction: ltr; margin-top: 8px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.nj-deck.desk { touch-action: auto; }
.nj-skills { display: flex; justify-content: center; gap: 8px; }
.nj-btn { position: relative; display: grid; place-items: center; align-content: center; gap: 0; border-radius: 50%; border: 2px solid #3d3470; color: #fff; cursor: pointer; padding: 0; touch-action: none; -webkit-tap-highlight-color: transparent; background: radial-gradient(circle at 40% 30%, #3a3170, #16122e 70%); box-shadow: 0 3px 0 #07051a, 0 4px 10px rgba(0,0,0,.45); transition: transform .06s, filter .2s; }
.nj-btn .nj-ring { position: absolute; inset: -2px; border-radius: 50%; pointer-events: none; background: conic-gradient(rgba(5,4,20,.72) calc(var(--cd, 0) * 360deg), transparent 0); }
.nj-btn .nj-ic { position: relative; font: 900 1.15rem/1 "Hiragino Mincho ProN", "Yu Mincho", serif; text-shadow: 0 1px 2px #000; }
.nj-btn small { position: relative; font: 700 .58rem/1.1 system-ui, sans-serif; opacity: .9; max-width: 64px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nj-btn kbd { position: absolute; right: -4px; top: -6px; font: 700 .55rem ui-monospace, monospace; background: #0d0b22; border: 1px solid #4a3c8f; border-radius: 4px; padding: 0 3px; color: #cfc8ff; }
.nj-btn.sk { width: 58px; height: 58px; }
.nj-btn.on { transform: translateY(2px) scale(.95); box-shadow: 0 1px 0 #07051a, 0 0 14px rgba(255,214,106,.6); }
.nj-btn.off { filter: grayscale(.8) brightness(.6); }
.nj-btn.ready { border-color: #ffd66a; box-shadow: 0 3px 0 #07051a, 0 0 14px rgba(255,214,106,.55); }
.nj-btn.nj-suiton.ready, .nj-btn.nj-suiton.up { border-color: #7fd4ff; box-shadow: 0 3px 0 #07051a, 0 0 14px rgba(127,212,255,.6); }
.nj-btn.nj-frog.ready { animation: nj-pulse 1s ease-in-out infinite; }
@keyframes nj-pulse { 50% { box-shadow: 0 3px 0 #07051a, 0 0 22px rgba(255,214,106,.95); } }
.nj-btn.nj-smoke { background: radial-gradient(circle at 40% 30%, #6a6a7a, #262632 70%); }
.nj-btn.nj-suiton { background: radial-gradient(circle at 40% 30%, #2f6a9a, #0c2238 70%); }
.nj-btn.nj-clone { background: radial-gradient(circle at 40% 30%, #4a5ad0, #161c4a 70%); }
.nj-btn.nj-frog { background: radial-gradient(circle at 40% 30%, #7a8f34, #263010 70%); }
.nj-btn.nj-dash { background: radial-gradient(circle at 40% 30%, #3a4a6a, #121a2c 70%); }
.nj-pad { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin-top: 10px; }
.nj-pad .joy { width: 136px; height: 136px; }
.nj-acts { justify-self: end; display: grid; grid-template-columns: 64px 88px; grid-template-rows: 64px 88px; grid-template-areas: "ku ju" "sh sl"; gap: 6px 8px; align-items: center; justify-items: center; }
.nj-btn.act { width: 62px; height: 62px; }
.nj-btn.nj-slash { grid-area: sl; width: 84px; height: 84px; background: radial-gradient(circle at 40% 30%, #a8283a, #3e0a14 70%); border-color: #ff6a7a; }
.nj-btn.nj-slash .nj-ic { font-size: 1.6rem; }
.nj-btn.nj-shuriken { grid-area: sh; background: radial-gradient(circle at 40% 30%, #5a6a80, #1a2230 70%); }
.nj-btn.nj-kunai { grid-area: ku; background: radial-gradient(circle at 40% 30%, #6a5a40, #241c10 70%); }
.nj-btn.nj-jump { grid-area: ju; background: radial-gradient(circle at 40% 30%, #2a7a6a, #0a2a24 70%); }
.nj-keys { text-align: center; margin: 8px 0 0; color: #c9c2ee; }
@media (max-width: 400px) {
  .nj-skills { gap: 5px; } .nj-btn.sk { width: 54px; height: 54px; }
  .nj-pad .joy { width: 124px; height: 124px; }
  .nj-acts { grid-template-columns: 60px 82px; grid-template-rows: 60px 82px; gap: 4px 6px; }
  .nj-btn.act { width: 56px; height: 56px; } .nj-btn.nj-slash { width: 78px; height: 78px; }
}
/* phones held sideways: stick left, canvas middle, buttons right */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .nj-cab .arc-screen.nj-screen { display: grid; grid-template-columns: 1fr; }
  .nj-cab .arc-marquee, .nj-cab .arc-deck { display: none; }
  .arcade .act-canvas.nj-cv { width: min(100%, calc((100svh - 120px) * 1.5)); }
  .nj-deck.touch { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 8px; }
  .nj-deck.touch .nj-skills { grid-column: 2; grid-row: 1; align-self: center; }
  .nj-deck.touch .nj-pad { display: contents; }
  .nj-deck.touch .nj-pad .joy { grid-column: 1; grid-row: 1; }
  .nj-deck.touch .nj-acts { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) { .nj-btn { transition: none; } .nj-btn.nj-frog.ready { animation: none; } }

/* ---------- atlas (encyclopedia) ---------- */
.atlas-page main{padding-bottom:72px}
.atlas-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin:12px 0 24px}
.atlas-card{display:flex;flex-direction:column;gap:6px;padding:16px;border-radius:14px;background:#fff;border:1px solid rgba(0,0,0,.08);text-decoration:none;color:inherit;box-shadow:0 2px 8px rgba(0,0,0,.05);transition:transform .15s}
.atlas-card:hover{transform:translateY(-2px)}
.atlas-card b{font-size:1.1rem}.atlas-card span:last-child{font-size:.9rem;opacity:.8}
.atlas-ic{font-size:1.8rem}
.atlas-search{display:flex;flex-direction:column;gap:4px;max-width:420px;margin:12px 0}
.atlas-search input,.atlas-tool input,.atlas-tool textarea,.aq-type input,.aq-setup select{font:inherit;padding:10px 12px;border-radius:10px;border:1px solid rgba(0,0,0,.2);width:100%;box-sizing:border-box;background:#fff;color:#111}
.atlas-tool label{display:flex;flex-direction:column;gap:4px}
.atlas-tool .atlas-row label{flex-direction:row;align-items:center;gap:6px}
.atlas-tool input[type=range]{width:140px;padding:0}
.pt-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:8px 0}
.pt-grid{display:grid;grid-template-columns:repeat(18,minmax(44px,1fr));grid-template-rows:repeat(7,auto) 14px auto auto;gap:3px;min-width:820px}
.pt-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px 2px;border-radius:6px;text-decoration:none;color:#111;font-size:.62rem;line-height:1.15;min-height:52px;transition:opacity .2s,transform .15s;text-align:center;overflow:hidden}
.pt-cell b{font-size:1.05rem}.pt-cell small{font-size:.6rem;opacity:.75}.pt-cell span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
a.pt-cell:hover,a.pt-cell:focus-visible{transform:scale(1.12);z-index:2;box-shadow:0 4px 12px rgba(0,0,0,.25)}
.pt-cell.dim{opacity:.15}.pt-cell.here{outline:3px solid #111;transform:scale(1.08);z-index:2}
.pt-ph{background:repeating-linear-gradient(45deg,#eee,#eee 4px,#f8f8f8 4px,#f8f8f8 8px);font-weight:700}
.pt-flabel{align-self:center;font-size:.7rem;opacity:.7}
.pt-mini .pt-grid{min-width:640px;grid-template-columns:repeat(18,minmax(34px,1fr))}.pt-mini .pt-cell{min-height:36px}.pt-mini .pt-cell span,.pt-mini .pt-cell small{display:none}
.cat-alkali{background:#ffb3a7}.cat-alkalineEarth{background:#ffd8a0}.cat-transition{background:#ffe9a8}.cat-postTransition{background:#cfe8c4}.cat-metalloid{background:#bfe3df}
.cat-nonmetal{background:#b9dcff}.cat-halogen{background:#d6c8ff}.cat-noble{background:#f3c1e6}.cat-lanthanoid{background:#ffc9d5}.cat-actinoid{background:#e8c3bf}.cat-unknown{background:#dcdcdc}
.pt-legend{display:flex;flex-wrap:wrap;gap:8px 14px;list-style:none;padding:0;font-size:.85rem}
.pt-sw{display:inline-block;width:14px;height:14px;border-radius:3px;margin-right:5px;vertical-align:-2px}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.atlas-table{border-collapse:collapse;width:100%;font-size:.92rem;margin:8px 0 20px}
.atlas-table th,.atlas-table td{border-bottom:1px solid rgba(0,0,0,.1);padding:6px 8px;text-align:left}
.atlas-table thead th{position:sticky;top:0;background:#f2f5f3}
.atlas-kv th{width:40%;font-weight:600}
.rn-list{max-height:480px;overflow-y:auto}
.el-hero{display:inline-grid;justify-items:center;padding:14px 26px;border-radius:16px;margin:10px 0;box-shadow:0 6px 18px rgba(0,0,0,.12);animation:elpop .5s ease-out;color:#111}
.el-hero b{font-size:3.2rem;line-height:1}.el-hero small{justify-self:start}.el-hero em{font-style:normal;font-size:.85rem;opacity:.8}
@keyframes elpop{from{transform:scale(.85) rotate(-3deg);opacity:0}to{transform:none;opacity:1}}
.chip-list{display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:0}
.chip-list a{display:inline-block;padding:6px 12px;border-radius:999px;background:#eef4f1;text-decoration:none}
.el-nav{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.atlas-faq dt{font-weight:700;margin-top:10px}.atlas-faq dd{margin:4px 0 0}
.atlas-sources{margin-top:28px;font-size:.88rem}
.atlas-tool{padding:14px;border-radius:14px;background:#f5f8f6;margin:14px 0;display:grid;gap:10px;color:#111}
.atlas-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.morse-lamp{width:46px;height:46px;border-radius:50%;background:#444;box-shadow:inset 0 0 8px #000;transition:background .03s}
.morse-lamp.on,.morse-play.on{background:#ffd34d;box-shadow:0 0 18px #ffd34d}
.morse-play{font:inherit;font-size:1.05rem;letter-spacing:.12em;padding:4px 10px;border-radius:8px;border:1px solid rgba(0,0,0,.15);background:#fff;color:#111;cursor:pointer;min-height:40px}
.morse-key{width:min(100%,320px);height:120px;border-radius:24px;border:0;background:#1f5f4a;color:#fff;font-size:1.2rem;touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer;box-shadow:0 6px 0 #123b2e}
.morse-key.on{transform:translateY(5px);box-shadow:0 1px 0 #123b2e;background:#2b7d62}
.morse-out{font-size:1.4rem;min-height:2em;word-break:break-all}
.atlas-quiz{padding:14px;border-radius:16px;background:#f5f8f6;margin:14px 0;color:#111}
.aq-setup{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;align-items:end}
.aq-setup label{display:flex;flex-direction:column;gap:4px;font-size:.88rem}
.aq-stage{margin-top:16px}
.aq-hud{font-weight:700}.aq-q{font-size:1.35rem;font-weight:700;margin:8px 0 14px}
.aq-bar{height:8px;border-radius:4px;background:#dde5e1;overflow:hidden;margin-bottom:10px}.aq-bar i{display:block;height:100%;background:#1f8f6a;width:100%}
.aq-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.aq-choice{font:inherit;font-size:1.05rem;padding:14px;border-radius:12px;border:2px solid rgba(0,0,0,.12);background:#fff;color:#111;cursor:pointer;text-align:left;min-height:54px;transition:transform .1s}
.aq-choice:active{transform:scale(.97)}.aq-choice.ok{border-color:#1f8f6a;background:#d8f3e6}.aq-choice.ng{border-color:#c0392b;background:#fadbd8}
.aq-fb{min-height:1.6em;font-weight:700}
.aq-type{display:flex;gap:8px}.aq-type input{flex:1}
.aq-mem{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-width:520px}
.aq-card{aspect-ratio:3/4;border-radius:12px;border:0;background:linear-gradient(135deg,#1f5f4a,#2f8f6f);color:transparent;font:inherit;font-size:1rem;font-weight:700;cursor:pointer;transition:transform .35s,background .35s;padding:4px;word-break:break-word}
.aq-card.up{background:#fff;color:#111;transform:rotateY(180deg)}.aq-card.up span{display:inline-block;transform:rotateY(180deg)}.aq-card.ok{background:#d8f3e6}
.aq-result{text-align:center}.aq-big{font-size:1.6rem;font-weight:800}
.atlas-tabbar{position:fixed;left:0;right:0;bottom:0;display:flex;justify-content:space-around;background:rgba(255,255,255,.96);border-top:1px solid rgba(0,0,0,.1);padding:6px 0 calc(6px + env(safe-area-inset-bottom));z-index:50;backdrop-filter:blur(8px)}
.atlas-tabbar a{display:flex;flex-direction:column;align-items:center;font-size:.72rem;text-decoration:none;color:#234;min-width:72px;padding:2px 8px}
.atlas-tabbar a span{font-size:1.25rem}.atlas-tabbar a[aria-current]{color:#1f8f6a;font-weight:700}
@media (min-width:900px){.atlas-tabbar{display:none}.atlas-page main{padding-bottom:0}}
@media (prefers-reduced-motion:reduce){.el-hero{animation:none}.aq-card,.pt-cell{transition:none}}

/* ---------- atlas-math (math formulas & physics laws) ---------- */
.sci-catnav{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.sci-catnav a{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;min-height:44px;box-sizing:border-box;border-radius:999px;background:#eef4f1;text-decoration:none;color:#123;font-size:.92rem}
.sci-catnav a[aria-current]{background:#1f5f4a;color:#fff}
.sci-sec{margin:20px 0}.sci-sec h2 a{text-decoration:none;color:inherit}
.sci-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;margin:10px 0}
.sci-card{display:flex;flex-direction:column;gap:6px;padding:14px;border-radius:14px;background:#fff;border:1px solid rgba(0,0,0,.08);text-decoration:none;color:inherit;box-shadow:0 2px 8px rgba(0,0,0,.05);transition:transform .15s,box-shadow .15s;min-width:0}
.sci-card:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.1)}
.sci-card code,.sci-ftable code{font-family:"Cambria Math","STIX Two Math","Times New Roman",serif;font-size:.95rem;color:#1f5f4a;overflow-wrap:anywhere;white-space:normal}
.sci-formula{font-family:"Cambria Math","STIX Two Math","Times New Roman",serif;font-size:clamp(1.15rem,4.6vw,1.7rem);line-height:1.5;text-align:center;padding:18px 14px;margin:14px 0;border-radius:16px;background:linear-gradient(135deg,#0f1d2b,#1b3a55);color:#e2e8f0;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 8px 24px rgba(15,29,43,.25);overflow-wrap:anywhere}
.sci-tool h3{margin:6px 0 0;font-size:1rem}
.sci-ins{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.sci-ins label{font-size:.88rem}
.sci-ins input{min-height:44px}
.sci-outs{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
.sci-out{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border-radius:12px;background:#fff;border:1px solid rgba(0,0,0,.08);min-width:0}
.sci-out span{font-size:.8rem;opacity:.75}.sci-out output{font-size:1.3rem;font-weight:800;color:#1f5f4a;overflow-wrap:anywhere}.sci-out output.na{color:#999}
.sci-vizbox,.sci-sim{margin:16px 0}
.sci-canvas{display:block;width:100%;height:auto;aspect-ratio:16/10;border-radius:16px;background:#0f1d2b;box-shadow:0 10px 30px rgba(15,29,43,.3);touch-action:none;user-select:none;-webkit-user-select:none}
.sci-code{background:#0f1d2b;color:#cfe8ff;padding:12px 14px;border-radius:12px;overflow-x:auto;font-size:.85rem;line-height:1.5}
.sci-models{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin:14px 0}
.sci-model{padding:14px;border-radius:16px;background:#f5f8f6;border-top:5px solid #4fd1c5;color:#111;min-width:0}.sci-model.gm{border-top-color:#f6ad55}
.sci-model h2{margin:0 0 6px;font-size:1.05rem}.sci-model .sci-formula{font-size:clamp(1rem,4vw,1.3rem);margin:8px 0;padding:12px}
.sci-ideal{font-size:.88rem;padding:10px 12px;border-radius:10px;background:#fff8e6;border:1px solid #f6d58a;color:#5a4300}
.sci-simbar{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.sci-seg{font:inherit;font-size:.9rem;min-height:44px;padding:8px 14px;border-radius:999px;border:2px solid #1f5f4a;background:#fff;color:#1f5f4a;cursor:pointer}
.sci-seg[data-mode=tb]{border-color:#2c9c91;color:#1d6f67}.sci-seg[data-mode=gm]{border-color:#d9822b;color:#8a4b0c}
.sci-seg[aria-pressed=true]{background:#1f5f4a;color:#fff;border-color:#1f5f4a}
.sci-readout{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:10px 0}
.sci-readout div{display:flex;flex-direction:column;padding:8px 10px;border-radius:10px;background:#f5f8f6;min-width:0}
.sci-readout span{font-size:.78rem;opacity:.75}.sci-readout b{font-size:1.1rem;overflow-wrap:anywhere}
.sci-ctrl{display:flex;gap:8px;flex-wrap:wrap}.sci-ctrl .btn{min-height:44px}
.sci-params{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:12px 0;padding:12px;border-radius:14px;background:#f5f8f6;color:#111}
.sci-params label{display:flex;flex-direction:column;gap:4px;font-size:.88rem}
.sci-slider{display:flex;align-items:center;gap:10px}.sci-slider input{flex:1;min-width:0;height:44px;accent-color:#1f5f4a}.sci-slider output{min-width:3.5em;text-align:right;font-weight:700}
.sci-ftable td,.sci-ftable th{vertical-align:top}
@media (prefers-reduced-motion:reduce){.sci-card{transition:none}}

/* ---------- atlas-creatures (dinosaurs, dog & cat breeds, insects) ---------- */
.cr-art{display:block;width:100%;height:auto}
.cr-fig{margin:4px 0 12px}.cr-fig figcaption{font-size:.78rem;opacity:.7;margin-top:4px}
.cr-hero{max-width:520px}.cr-hero .cr-art{border-radius:16px;box-shadow:0 6px 18px rgba(0,0,0,.08)}
.cr-tools{display:grid;gap:8px;margin:12px 0}
.cr-chips{display:flex;flex-wrap:wrap;gap:6px}
.cr-chip{font:inherit;font-size:.85rem;min-height:40px;padding:6px 12px;border-radius:999px;border:1px solid rgba(0,0,0,.18);background:#fff;color:#123;cursor:pointer}
.cr-chip[aria-pressed=true]{background:#1f5f4a;border-color:#1f5f4a;color:#fff}
.cr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin:12px 0 18px}
.cr-mini{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))}
.cr-card{display:flex;flex-direction:column;gap:3px;padding:6px 6px 10px;border-radius:14px;background:#fff;border:1px solid rgba(0,0,0,.08);text-decoration:none;color:inherit;box-shadow:0 2px 8px rgba(0,0,0,.05);transition:transform .15s,box-shadow .15s}
.cr-card[hidden]{display:none}
.cr-card:hover,.cr-card:focus-visible{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.12)}
.cr-card .cr-art{border-radius:10px}.cr-card b{font-size:.95rem;line-height:1.3;padding:0 4px}.cr-card span{font-size:.78rem;opacity:.75;padding:0 4px}
.aq-q .aq-pic{max-width:360px;margin:8px auto 0}
.aq-pic .cr-art{border-radius:14px}
.aq-mem.pics .aq-card{aspect-ratio:1;padding:2px}.aq-mem.pics .aq-pic{width:100%}
.aq-card .aq-pic{display:none}.aq-card.up .aq-pic{display:block;transform:rotateY(180deg)}
@media (max-width:480px){.cr-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.aq-q .aq-pic{max-width:100%}}
@media (prefers-reduced-motion:reduce){.cr-card{transition:none}}

/* ---------- atlas-board (board-game encyclopedia) ---------- */
.ab-demo,.ab-prob{margin:18px 0;padding:14px;border-radius:16px;background:#f5f8f6;color:#111;border:1px solid rgba(0,0,0,.06)}
.ab-stage{max-width:560px;margin:0 auto;touch-action:manipulation}
.ab-svg{display:block;width:100%;height:auto;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.ab-svg:focus{outline:3px solid #1e6fff;outline-offset:3px;border-radius:8px}
.ab-svg [data-cell],.ab-svg [data-hand]{cursor:pointer}
.ab-co{font:600 13px system-ui,sans-serif;fill:#6b5a46;text-anchor:middle}
.ab-ch{text-anchor:middle;font-family:"Segoe UI Symbol","Noto Sans Symbols2","DejaVu Sans","Apple Symbols",serif;pointer-events:none}
.ab-ch.w{fill:#fffdf6;stroke:#2a2118;stroke-width:1.6;paint-order:stroke}
.ab-ch.b{fill:#1b1712;stroke:#000;stroke-width:.6}
.ab-pc{pointer-events:none}
.ab-kj{text-anchor:middle;font-family:"Yu Mincho","Hiragino Mincho ProN","Noto Serif JP","MS Mincho",serif;font-weight:700;fill:#1a1209;pointer-events:none}
.ab-kj.red{fill:#b3261e}
.ab-hl{font:700 22px system-ui,sans-serif;fill:#5b3a22}
.ab-hn{font:700 16px system-ui,sans-serif;fill:#5b3a22}
.ab-rest{font:600 15px system-ui,sans-serif;fill:#5b3a22}
.ab-hand.sel polygon{stroke:#1e6fff;stroke-width:3}
.ab-gl{font:700 12px system-ui,sans-serif;fill:#3a2a14;text-anchor:middle}
.ab-arrow{stroke-dasharray:900;stroke-dashoffset:900;animation:ab-draw .6s ease-out forwards}
@keyframes ab-draw{to{stroke-dashoffset:0}}
.ab-disc{transform-box:fill-box;transform-origin:center}
.ab-flip{animation:ab-flip .38s ease-in-out both}
@keyframes ab-flip{0%{transform:scaleX(1)}50%{transform:scaleX(.05)}100%{transform:scaleX(1)}}
.ab-demo figcaption{max-width:560px;margin:8px auto 0}
.ab-note{min-height:3em;font-weight:600;margin:6px 0}
.ab-ctrl{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.ab-ctrl .btn,.ab-pbtn .btn,.ab-promo .btn{min-height:44px;min-width:44px}
.ab-pos{margin-left:auto}
.ab-steps{max-width:560px;margin:8px auto 0}.ab-steps ol{margin:6px 0 0;padding-left:1.4em}
.ab-choose{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.ab-pick{font:inherit;font-size:.92rem;min-height:44px;padding:6px 12px;border-radius:999px;border:1px solid rgba(0,0,0,.18);background:#fff;color:#123;cursor:pointer}
.ab-pick.on{background:#1f5f4a;border-color:#1f5f4a;color:#fff}
.ab-namelist{padding-left:1.2em}.ab-namelist li{margin:4px 0}
.ab-prob h3{display:flex;gap:8px;align-items:center;margin:0 0 10px;font-size:1.05rem}
.ab-tick{flex:0 0 22px;height:22px;border-radius:50%;border:2px solid #9bb3a8}
.ab-prob.done .ab-tick{background:#1f8f6a;border-color:#1f8f6a;box-shadow:inset 0 0 0 4px #fff}
.ab-msg{min-height:1.6em;font-weight:700;margin:10px 0 6px;max-width:560px;margin-inline:auto}
.ab-msg.ok{color:#14704f}.ab-msg.ng{color:#b3261e}.ab-msg.info{color:#234}
.ab-pbtn{display:flex;flex-wrap:wrap;gap:8px;max-width:560px;margin:0 auto}
.ab-promo{display:flex;gap:8px;align-items:center;justify-content:center;margin:6px 0}
.ab-ans{max-width:560px;margin:10px auto 0}
.ab-progress{font-weight:700}
.ab-card{--w:44px;display:inline-flex;flex-direction:column;justify-content:space-between;width:var(--w);height:calc(var(--w)*1.4);margin-right:-6px;padding:3px 4px;box-sizing:border-box;border-radius:6px;background:linear-gradient(#fff,#f1f1ee);border:1px solid rgba(0,0,0,.25);box-shadow:0 2px 4px rgba(0,0,0,.18);color:#111;font:700 15px/1 system-ui,sans-serif;position:relative;vertical-align:middle}
.ab-card.red{color:#c0262d}.ab-card i{font-style:normal;font-size:13px}
.ab-card em{position:absolute;right:4px;bottom:3px;font-style:normal;font-size:20px;opacity:.9}
.ab-hand{display:inline-flex;white-space:nowrap;padding-right:6px}
.ab-hand.pre .ab-card{opacity:0}
.ab-hand.dealt .ab-card{animation:ab-deal .42s cubic-bezier(.2,.8,.3,1.2) both;animation-delay:calc(var(--i)*70ms)}
@keyframes ab-deal{from{opacity:0;transform:translate(-60px,-30px) rotate(-25deg)}to{opacity:1;transform:none}}
.ab-pk td,.ab-pk th{vertical-align:middle}
.ab-pkq{padding:14px;border-radius:16px;background:#f5f8f6;color:#111;margin:18px 0}
.ab-pkopts{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ab-pkopt{font:inherit;display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 6px;border-radius:14px;border:2px solid rgba(0,0,0,.12);background:#fff;color:#111;cursor:pointer;min-height:110px}
.ab-pkopt.ok{border-color:#1f8f6a;background:#d8f3e6}.ab-pkopt.ng{border-color:#c0392b;background:#fadbd8}
.ab-pkopt small{font-weight:700;min-height:1.2em}
.ab-rules{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.ab-rule{padding:14px;border-radius:14px;background:#fff;border:1px solid rgba(0,0,0,.08);color:#111}
.ab-rule h3{margin:0 0 6px}
@media (max-width:480px){.ab-demo,.ab-prob,.ab-pkq{padding:10px;margin-inline:-6px}.ab-card{--w:34px;font-size:12px}.ab-card em{font-size:15px}.ab-card i{font-size:11px}.ab-pkopts{grid-template-columns:1fr}.ab-pk td:nth-child(4){font-size:.85rem}}
@media (prefers-reduced-motion:reduce){.ab-arrow{animation:none;stroke-dashoffset:0}.ab-flip,.ab-hand.dealt .ab-card{animation:none}}

/* ---------- 3D board view (board3d.js) ---------- */
.v3d-bar{display:flex;gap:8px;justify-content:flex-end;margin:0 0 8px}
.v3d-bar .btn{min-width:48px;font-weight:700}
.v3d-toggle[aria-pressed="true"]{background:#1f5f4a;color:#fff}
.v3d-stage{position:relative;width:100%;border-radius:16px;overflow:hidden;background:radial-gradient(ellipse at 50% 30%,#3a4a5a,#141b22);margin-bottom:10px;box-shadow:inset 0 0 40px rgba(0,0,0,.35)}
.v3d-stage canvas{display:block;width:100%;cursor:grab}
.v3d-stage canvas:active{cursor:grabbing}
.v3d-on .board-wrap,.v3d-on > .grid.othello{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap}

/* ---------- share / embed / result (share.js) ---------- */
.share-box{margin:16px 0;padding:12px 14px;border-radius:14px;background:#f5f8f6;border:1px solid rgba(0,0,0,.08)}
.share-box summary{cursor:pointer;font-weight:700}
.share-box h3{font-size:1rem;margin:14px 0 6px}
.share-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}
.share-row label{display:flex;gap:6px;align-items:center;font-size:.9rem}
.share-row select{font:inherit;padding:6px 8px;border-radius:8px}
.share-box .btn.sns{text-decoration:none}
.share-code{display:block;white-space:pre-wrap;word-break:break-all;font-size:.8rem;background:#fff;border:1px solid rgba(0,0,0,.12);border-radius:8px;padding:8px;margin:6px 0;max-height:7.5em;overflow:auto}
.embed-preview{margin-top:8px;border:1px dashed rgba(0,0,0,.25);border-radius:10px;padding:6px;overflow:auto}
.result-share{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:8px 0}
.challenge-banner{margin:0 0 10px;padding:10px 14px;border-radius:12px;background:linear-gradient(90deg,#fff3c4,#ffe0ec);color:#3b2a00;font-size:.95rem;word-break:break-word}
.challenge-banner .cta{font-weight:700}
.embed-bar{display:none}
html.embed .embed-bar{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 10px;background:#1f2a33;color:#fff;font-size:.85rem;position:sticky;top:0;z-index:60}
html.embed .embed-bar a{color:#ffd54a}
html.embed .site-header,html.embed .site-footer,html.embed .crumbs,html.embed .appbar,html.embed .atlas-tabbar,html.embed .share-box,html.embed .rules,html.embed main>section:not(#play):not(.atlas-quiz),html.embed main>article,html.embed main>h1,html.embed main>.lead,html.embed main>p,html.embed main>nav,html.embed .history-link,html.embed .toc,html.embed .challenge-banner{display:none!important}
html.embed main{padding:8px!important;max-width:none!important;margin:0!important}
html.embed body{padding-bottom:0!important}

/* ---------- katana ---------- */
.arcade.kt-cab { --neon1: #ff9a4a; --neon2: #ffd27a; --neon3: #ffe7b0; --scr: #140c07; background: linear-gradient(180deg, #3a2418, #22150d 60%, #170e08); border: 2px solid #0f0805; box-shadow: inset 0 2px 0 rgba(255,210,150,.16), 0 10px 26px rgba(0,0,0,.35); }
.kt-cab .arc-marquee { background: linear-gradient(180deg, #5a1e1e, #2e0e0e); border-color: #b0864a; color: #ffe7b0; text-shadow: 0 0 8px rgba(255,140,40,.6); }
.kt-cab .arc-screen { border-color: #0a0603; box-shadow: inset 0 0 30px rgba(255,120,30,.12), inset 0 0 0 1px #4a3020; }
.kt-cab .arc-screen::after, .kt-cab .arc-deck { display: none; }
.kt-cab .arc-stat { background: linear-gradient(180deg, #2a1a10, #140c06); border-color: #6a4a2a; }
.kt-cab .arc-k { color: #e8c48a; }
.kt-cab .arc-v { color: #ffe7b0; text-shadow: 0 0 6px rgba(255,150,50,.5); font-variant-numeric: tabular-nums; }
.kt-canvas { background: #140c07; touch-action: none; -webkit-user-select: none; user-select: none; cursor: crosshair; }
.kt-cab .arc-banner { inset: 12px 12px auto; padding: 12px 10px; border-radius: 10px; background: rgba(20,6,4,.78); animation: arc-in .35s ease-out, kt-fade .6s ease-in 3.5s forwards; }
.kt-cab .arc-banner b { font-size: clamp(1.3rem, 6vw, 2rem); }
@keyframes kt-fade { to { opacity: 0; visibility: hidden; } }
.kt-panel { margin-top: 10px; color: #f3e6d2; font-size: .92rem; }
.kt-panel .btn { min-height: 48px; touch-action: manipulation; }
.kt-panel .btn.primary { background: linear-gradient(180deg, #c8442a, #7e1d10); border-color: #ff9a70; color: #fff; }
.kt-panel .btn:disabled { opacity: .45; }
.kt-panel .btn:not(.primary) { background: linear-gradient(180deg, #3a2618, #22150d); border-color: #6a4a2a; color: #f3e6d2; }
.kt-panel .btn.on { border-color: #ffd27a; box-shadow: 0 0 0 2px #ffd27a inset; color: #ffe7b0; }
.kt-h { margin: 6px 0; font-size: .95rem; color: #ffe7b0; }
.kt-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.kt-cards.lams { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kt-card { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 92px; padding: 6px 4px; border-radius: 10px; border: 1px solid #5a3a22; background: radial-gradient(circle at 50% 25%, #3a2618, #1a100a); color: #f3e6d2; font: inherit; font-size: .78rem; line-height: 1.2; cursor: pointer; touch-action: manipulation; text-align: center; }
.kt-card img { width: 100%; max-width: 140px; height: auto; pointer-events: none; }
.kt-card.lam img { width: 48px; }
.kt-card b { font-size: .9rem; }
.kt-card .small { opacity: .8; font-size: .7rem; overflow-wrap: anywhere; }
.kt-card.on { border-color: #ffd27a; box-shadow: 0 0 0 2px #ffd27a inset, 0 0 12px rgba(255,180,80,.35); }
.kt-card:focus-visible, .kt-shape:focus-visible { outline: 3px solid #ffd27a; outline-offset: 1px; }
.kt-note { margin: 8px 0 0; color: #e8d8c0; }
.kt-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.kt-row .kt-go { flex: 1 1 60%; font-size: 1.02rem; }
.kt-row.folds .btn, .kt-row.shapes .btn { flex: 1 1 40%; }
.kt-shape { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.kt-shape.on { border-color: #ffd27a; box-shadow: 0 0 0 2px #ffd27a inset; }
.kt-row.pres .btn { flex: 1 1 18%; min-width: 4.5em; padding-inline: 6px; }
.kt-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; -webkit-user-select: none; user-select: none; }
.kt-ctrl.one { justify-content: center; }
.kt-ctrl .act-pad.big { width: 96px; height: 96px; min-width: 0; padding: 0; border-radius: 50%; font-size: .86rem; flex: none; line-height: 1.15; }
.kt-heat { background: radial-gradient(circle at 40% 30%, #ff9a4a, #a83a10); border-color: #ffc890; }
.kt-heat.on { box-shadow: 0 0 22px rgba(255,140,40,.8); transform: scale(.96); }
.kt-hit { background: radial-gradient(circle at 40% 30%, #9aa6b4, #3a434e); border-color: #c8d2de; }
.kt-blows { flex: 1; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: #ffe7b0; }
.kt-info { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 6px 8px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid #3a2616; }
.kt-i { display: inline-flex; gap: 5px; align-items: baseline; padding: 1px 8px; border-radius: 99px; background: rgba(255,255,255,.06); font-size: .8rem; }
.kt-i em { font-style: normal; opacity: .75; }
.kt-i b { font-variant-numeric: tabular-nums; }
.kt-now { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.kt-cs { padding: 1px 8px; border-radius: 99px; font-size: .76rem; }
.kt-cs.ok { background: rgba(120,220,120,.15); color: #b9f0b0; }
.kt-cs.ng { background: rgba(255,120,90,.15); color: #ffb39a; }
.kt-qres { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 10px; border: 1px solid #5a3a22; background: rgba(0,0,0,.3); }
.kt-qres.ok b { color: #b9f0b0; }
.kt-qres.ng b { color: #ffab8a; }
.kt-res { padding: 8px 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(60,20,20,.5), rgba(20,8,6,.5)); border: 1px solid #6a3a2a; }
.kt-name { margin: 0; font-size: 1.02rem; }
.kt-grade { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .8rem; font-weight: 800; background: #6a4a2a; color: #fff; }
.kt-grade.g-s { background: linear-gradient(90deg, #c9952a, #ffe08a); color: #2a1a00; }
.kt-grade.g-a { background: #b8442a; }
.kt-grade.g-cracked { background: #444; }
.kt-score { margin: 4px 0 6px; font-weight: 800; font-size: 1.2rem; color: #ffe7b0; }
.kt-tab { width: 100%; border-collapse: collapse; font-size: .82rem; }
.kt-tab th { text-align: start; white-space: nowrap; padding: 3px 8px 3px 0; color: #e8c48a; font-weight: 600; vertical-align: top; }
.kt-tab td { padding: 3px 0; overflow-wrap: anywhere; }
.kt-tab tr + tr { border-top: 1px solid rgba(255,255,255,.07); }
.kt-bars { margin-top: 8px; display: grid; gap: 4px; }
.kt-bar { display: grid; grid-template-columns: 8em 1fr 2.2em; align-items: center; gap: 6px; font-size: .78rem; }
.kt-bar i { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.kt-bar i b { display: block; height: 100%; background: linear-gradient(90deg, #7e1d10, #ffc06a); border-radius: inherit; }
.kt-bar em { font-style: normal; text-align: end; font-variant-numeric: tabular-nums; }
.kt-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; font-size: .74rem; }
.kt-steps li { display: flex; justify-content: space-between; gap: 4px; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.05); }
.kt-notes { margin: 8px 0 0; padding-inline-start: 1.2em; font-size: .8rem; color: #ffcfae; }
.game > .kt-col, .game > .kt-src { flex: 1 1 100%; }
.kt-col, .kt-src { margin-top: 12px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line, #ddd); }
.kt-col summary, .kt-src summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.kt-dex { display: grid; gap: 6px; margin: 6px 0; }
.kt-dexrow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .8rem; }
.kt-dexrow > b { min-width: 3.5em; }
.kt-chip { padding: 1px 8px; border-radius: 99px; border: 1px dashed currentColor; opacity: .55; }
.kt-chip.got { opacity: 1; border-style: solid; background: rgba(200,140,60,.15); }
.kt-made { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kt-made li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.kt-made canvas { width: 100%; max-width: 360px; height: auto; border-radius: 8px; background: #1a0c0c; }
.kt-src ol { margin: 6px 0; padding-inline-start: 1.4em; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .kt-cards.lams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kt-ctrl .act-pad.big { width: 84px; height: 84px; }
  .kt-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kt-bar { grid-template-columns: 6.5em 1fr 2.2em; }
}
@media (prefers-reduced-motion: reduce) { .kt-heat.on { transform: none; } }
