/* Tom Pearl: Typing Mayhem. A filthy toilet fight pit: black, hazard tape, white gloves, hot pink, blood red (no yellow/green UI: owner 11-25). */
@font-face { font-family: 'TM Display'; src: url('/TomGames/fonts/Bungee-Regular.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'Bungee'; src: url('/TomGames/fonts/Bungee-Regular.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'TM Type'; src: url('/TomGames/fonts/ChakraPetch-SemiBold.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'TM Bold'; src: url('/TomGames/fonts/ChakraPetch-Bold.ttf') format('truetype'); font-display: swap; }

:root {
  --ink: #08080a; --slab: #121115; --line: #2a2830;
  --glove: #ff2f8f; --bile: #ffffff; --hot: #ff2238; --pink: #ff2fd0; --cyan: #35d6ff;
  --paper: #f4f1ea; --dim: #8d8a93;
  --tint: #ff3b47;
  --vh: 100dvh;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); overflow: hidden; overscroll-behavior: none; }
body { font: 16px/1.4 'TM Bold', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font: 11px/1 'TM Bold', monospace; padding: 3px 6px; border: 1px solid currentColor; border-radius: 4px; opacity: .65; margin-left: 8px; vertical-align: middle; }

.tm { position: fixed; inset: 0; height: var(--vh); display: flex; flex-direction: column; }

/* ---------- arena ---------- */
.stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#arena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tm.is-menu #arena { filter: saturate(.7) brightness(.55); }
.tm.is-gagged .stage { animation: gagshake .09s linear infinite; }
@keyframes gagshake { 0% { transform: translate(4px, -3px); } 50% { transform: translate(-5px, 4px); } 100% { transform: translate(3px, 2px); } }

/* HUD: slanted life bars */
.hud { position: absolute; left: 0; right: 0; top: 0; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 14px;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  background: linear-gradient(#000c, #0000); z-index: 3; pointer-events: none; }
.hud button { pointer-events: auto; }
.hp { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-width: 0; }
.hp--foe { grid-template-columns: auto 1fr auto; direction: rtl; }
.hp--foe > * { direction: ltr; }
.hp__name { font: 15px/1 'TM Display', Impact, sans-serif; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.hp--you .hp__name { color: var(--glove); }
.hp--foe .hp__name { color: var(--tint); }
.hp__bar { position: relative; height: 22px; transform: skewX(-18deg); background: #000; border: 2px solid #fff; box-shadow: 0 0 0 2px #000, 4px 4px 0 #000; overflow: hidden; }
.hp--foe .hp__bar { transform: skewX(18deg); }
.hp__bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; transform-origin: left; }
.hp--foe .hp__bar i { left: auto; right: 0; transform-origin: right; }
.hp__bar .lag { background: #fff; transition: transform .6s .25s cubic-bezier(.2, .7, .2, 1); }
.hp__bar .fill { transition: transform .08s; }
.hp--you .fill { background: repeating-linear-gradient(90deg, var(--glove) 0 18px, #d81b72 18px 20px); }
.hp--foe .fill { background: repeating-linear-gradient(90deg, var(--tint) 0 18px, color-mix(in srgb, var(--tint) 70%, #000) 18px 20px); }
.hp.is-low .fill { animation: lowhp .5s steps(2) infinite; }
@keyframes lowhp { 50% { filter: brightness(1.8); } }
.hp__n { font: 15px/1 'TM Display', Impact, sans-serif; min-width: 3ch; text-align: center; }
.hud__mid { text-align: center; line-height: 1; }
.hud__mid small { display: block; font: 11px/1 'TM Bold', sans-serif; letter-spacing: .2em; color: var(--dim); }
.hud__mid strong { font: 24px/1.1 'TM Display', Impact, sans-serif; }
.hud__tools { display: flex; gap: 8px; }
.icon { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #ffffff55; background: #000a; display: grid; place-items: center; padding: 0; }
.icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon .cross { display: none; }
.icon[aria-pressed="true"] .cross { display: inline; }
.icon[aria-pressed="true"] .wave { display: none; }

/* wind-up warning */
.incoming { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%) scale(.8); opacity: 0; transition: opacity .06s, transform .06s; z-index: 3;
  display: grid; justify-items: center; gap: 5px; pointer-events: none; }
.incoming.is-on { opacity: 1; transform: translateX(-50%) scale(1); }
.incoming b { font: 22px/1 'TM Display', Impact, sans-serif; color: #fff; background: var(--hot); padding: 6px 14px 4px; transform: skewX(-12deg); box-shadow: 4px 4px 0 #000; animation: warn .18s steps(2) infinite; }
@keyframes warn { 50% { box-shadow: 4px 4px 0 #000, 0 0 0 4px #fff; } }
.incoming__bar { width: min(320px, 60vw); height: 8px; background: #000; border: 2px solid #fff; overflow: hidden; }
.incoming__bar i { display: block; height: 100%; width: 100%; background: var(--hot); transform-origin: left; transform: scaleX(0); }
.incoming small { font: 11px/1 'TM Bold', sans-serif; letter-spacing: .16em; color: #fff; text-shadow: 0 2px 0 #000; }
.incoming.is-grab b { background: var(--cyan); color: #000; animation: none; }

/* big stamped calls: FIGHT!, K.O., COUNTER, GAGGED */
.call { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 4; }
.call span { font: clamp(48px, 13vw, 150px)/0.9 'TM Display', Impact, sans-serif; color: var(--c, #fff); text-align: center;
  -webkit-text-stroke: clamp(3px, .8vw, 8px) #000; paint-order: stroke fill; text-shadow: 8px 8px 0 #000;
  animation: stamp .9s cubic-bezier(.2, 1.6, .4, 1) both; transform: rotate(-6deg); }
.call span.small { font-size: clamp(28px, 7vw, 72px); }
.call span.hold { animation: stampin .4s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { 0% { transform: rotate(-6deg) scale(3); opacity: 0; } 18% { transform: rotate(-6deg) scale(.95); opacity: 1; } 75% { transform: rotate(-6deg) scale(1); opacity: 1; } 100% { transform: rotate(-6deg) scale(1.1); opacity: 0; } }
@keyframes stampin { 0% { transform: rotate(-6deg) scale(3); opacity: 0; } 100% { transform: rotate(-6deg) scale(1); opacity: 1; } }

/* ---------- typing panel ---------- */
.panel { position: relative; flex: none; background: var(--slab); padding: 16px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 10px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--glove) 0 14px, #000 14px 28px) 10; z-index: 2; }
.panel.is-hit { animation: panelhit .25s; }
@keyframes panelhit { 20% { transform: translate(-6px, 3px); background: #3a0c12; } 50% { transform: translate(5px, -2px); } }
.panel__stats { display: flex; gap: clamp(10px, 3vw, 34px); justify-content: center; margin-bottom: 10px; }
.st { display: flex; align-items: baseline; gap: 7px; }
.st small { font: 11px/1 'TM Bold', sans-serif; letter-spacing: .18em; color: var(--dim); }
.st b { font: 22px/1 'TM Display', Impact, sans-serif; font-variant-numeric: tabular-nums; }
.st--combo b { color: var(--pink); }
.st--combo em { font: 13px/1 'TM Bold', sans-serif; font-style: normal; color: var(--pink); }
.st--combo.is-pop b { animation: pop .25s; }
@keyframes pop { 40% { transform: scale(1.5); } }
.st--score b { color: var(--glove); min-width: 6ch; }

.phrase { font: clamp(24px, 3.3vw, 44px)/1.35 'TM Type', ui-monospace, monospace; text-align: center; letter-spacing: .01em; max-width: 1200px; margin: 0 auto; min-height: 1.35em; word-break: normal; }
.phrase .w { display: inline-block; white-space: nowrap; }
.phrase .c { position: relative; display: inline-block; color: #ffffff8c; transition: color .05s; white-space: pre; }
.phrase .c.done { color: var(--glove); }
.phrase .c.auto { color: #ffffff40; }
.phrase .c.done.auto { color: #ff2f8f66; }
.phrase .c.cur { color: #000; background: #fff; border-radius: 3px; box-shadow: 0 0 0 2px #fff; animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { background: #ffffffb0; box-shadow: 0 0 0 2px #ffffffb0; } }
.phrase .c.bad { color: #fff; background: var(--hot); box-shadow: 0 0 0 2px var(--hot); }
.phrase .c.bad::after { content: attr(data-typed); position: absolute; left: 50%; top: -1.05em; transform: translateX(-50%); font-size: .55em; color: var(--hot); }
@keyframes bad { 25% { transform: translateX(-4px) rotate(-6deg); } 75% { transform: translateX(4px) rotate(5deg); } }
.phrase.is-new { animation: newline .22s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes newline { from { transform: translateY(16px) scale(.96); opacity: 0; } }
.phrase.is-shake { animation: pshake .2s; }
@keyframes pshake { 30% { text-shadow: 0 0 14px var(--hot); } }
.panel__next { margin: 10px 0 0; text-align: center; font: 14px/1.3 'TM Bold', sans-serif; color: #ffffff59; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel__next span { font-size: 10px; letter-spacing: .2em; border: 1px solid #ffffff40; padding: 2px 5px; border-radius: 3px; margin-right: 6px; }
.panel__next i { font-style: normal; }
.typer { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; font-size: 16px; border: 0; padding: 0; pointer-events: none; }
.tap-type { display: none; position: absolute; inset: 0; background: #000c; border: 0; font: 18px/1 'TM Display', Impact, sans-serif; color: var(--glove); }
.tm.is-touch.needs-tap .tap-type { display: block; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; z-index: 10; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 3px solid #000; border-radius: 0; padding: 14px 26px 12px; font: 22px/1 'TM Display', Impact, sans-serif;
  transform: skewX(-8deg); box-shadow: 6px 6px 0 #000; transition: transform .08s, box-shadow .08s; }
.btn:active { transform: skewX(-8deg) translate(4px, 4px); box-shadow: 2px 2px 0 #000; }
.btn--go { background: var(--glove); color: #000; }
.btn--go:hover { background: #fff; }
.btn--go:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.btn--quiet { background: #23212a; color: #fff; border-color: #000; font-size: 16px; padding: 12px 18px 10px; }
.btn--quiet:hover { background: #34313d; }
.link { background: none; border: 0; padding: 6px 0; color: #fff; font: 15px/1.2 'TM Bold', sans-serif; text-decoration: underline; text-decoration-color: #ffffff55; text-underline-offset: 4px; }
.link:hover { color: var(--glove); }
.link b { color: var(--glove); }

/* title */
.menu { overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 24px max(18px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 75% 40%, transparent 0 30%, #08080acc 70%); display: flex; flex-direction: column; }
.menu__back { color: #fff; opacity: .7; text-decoration: none; font-size: 14px; }
.menu__back:hover { opacity: 1; }
.menu__grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 520px); gap: clamp(16px, 4vw, 60px); align-items: center; max-width: 1200px; width: 100%; margin: 0 auto; padding: 18px 0; }
.logo { margin: 0; line-height: .86; font-weight: 400; transform: rotate(-4deg); transform-origin: left center; }
.logo small { display: block; font: clamp(18px, 2.6vw, 32px)/1 'TM Display', Impact, sans-serif; color: var(--paper); margin-bottom: 8px; }
.logo span, .logo em { display: block; font: clamp(58px, 10.5vw, 150px)/0.86 'TM Display', Impact, sans-serif; font-style: normal; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.logo span { color: var(--glove); text-shadow: 7px 7px 0 #000, 10px 10px 0 var(--hot); }
.logo em { color: var(--bile); text-shadow: 7px 7px 0 #000, 10px 10px 0 var(--pink); margin-left: .3em; animation: jitter 2.4s infinite; }
@keyframes jitter { 0%, 92%, 100% { transform: none; } 94% { transform: translate(3px, -2px) rotate(1deg); } 96% { transform: translate(-3px, 2px) rotate(-1deg); } }
.menu__tag { font: clamp(18px, 2vw, 24px)/1.25 'TM Bold', sans-serif; margin: 26px 0 14px; }
.menu__rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 520px; color: #ffffffc0; font-size: 15px; }
.menu__rules li { padding-left: 22px; position: relative; }
.menu__rules li::before { content: ''; position: absolute; left: 0; top: .45em; width: 11px; height: 11px; background: var(--glove); transform: skewX(-12deg); }
.menu__rules b { color: #fff; }
.menu__card { background: #0d0c10e6; border: 2px solid #000; box-shadow: 0 0 0 2px #ffffff1c, 10px 10px 0 #000; padding: 20px; display: grid; gap: 14px; }
.menu__h { margin: 0; font: 15px/1 'TM Display', Impact, sans-serif; letter-spacing: .04em; color: var(--dim); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { position: relative; text-align: left; background: #1b1a20; border: 2px solid #000; box-shadow: 0 0 0 2px #ffffff14; padding: 12px 12px 10px; display: grid; gap: 4px; min-height: 96px; }
.mode b { font: 20px/1 'TM Display', Impact, sans-serif; }
.mode span { font-size: 12.5px; line-height: 1.25; color: #ffffffa8; }
.mode small { font-size: 12px; color: var(--glove); }
.mode[aria-checked="true"] { background: var(--glove); color: #000; box-shadow: 0 0 0 2px var(--glove), 5px 5px 0 #000; }
.mode[aria-checked="true"] span { color: #000c; }
.mode[aria-checked="true"] small { color: #fff; }
.mode[data-mode="insane"] b { color: var(--hot); }
.mode[data-mode="insane"][aria-checked="true"] { background: var(--hot); box-shadow: 0 0 0 2px var(--hot), 5px 5px 0 #000; }
.mode[data-mode="insane"][aria-checked="true"] b { color: #fff; }
.mode.is-locked { opacity: .55; cursor: not-allowed; }
.mode.is-locked b::after { content: ' 🔒'; font-size: 15px; }
.menu__links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.menu .btn--go { width: 100%; font-size: 30px; padding: 18px; }
.menu__nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 14px; }
.menu__nav a { color: #ffffff99; text-decoration: none; }
.menu__nav a:hover { color: #fff; }
.menu aside[data-tg-ad] { max-width: 520px; margin: 6px auto 12px; width: 100%; }

/* VS slam */
.vs { display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.vs__slab { position: relative; text-align: center; padding: 26px 8vw 22px; background: var(--tint); color: #000; transform: skewY(-6deg); box-shadow: 0 14px 0 #000;
  animation: slab .5s cubic-bezier(.2, 1.4, .4, 1) both; width: 140vw; }
.vs__slab small { font: clamp(14px, 2vw, 20px)/1 'TM Display', Impact, sans-serif; letter-spacing: .12em; }
.vs__slab h2 { margin: 6px 0 4px; font: clamp(52px, 11vw, 140px)/.9 'TM Display', Impact, sans-serif; font-weight: 400; color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 6px 6px 0 #000; }
.vs__slab p { margin: 0; font: clamp(16px, 2vw, 22px)/1.2 'TM Bold', sans-serif; }
.vs__vs { position: absolute; top: 12%; left: 10%; font: clamp(60px, 12vw, 150px)/1 'TM Display', Impact, sans-serif; color: var(--glove); -webkit-text-stroke: 4px #000; paint-order: stroke fill; transform: rotate(-12deg); animation: stamp 1.6s cubic-bezier(.2, 1.6, .4, 1) both .15s; }
@keyframes slab { from { transform: skewY(-6deg) translateX(-110%); } }
.vs.is-out .vs__slab { transition: transform .25s ease-in; transform: skewY(-6deg) translateX(120%); }

/* modals */
.modal { display: grid; place-items: center; padding: 16px; background: #000b; overflow-y: auto; }
.card { position: relative; width: min(480px, 100%); background: #121115; border: 3px solid #000; box-shadow: 0 0 0 2px #ffffff22, 12px 12px 0 #000; padding: 24px 22px 20px; display: grid; gap: 12px; text-align: center; animation: cardin .3s cubic-bezier(.2, 1.3, .4, 1); }
.card--wide { width: min(760px, 100%); }
@keyframes cardin { from { transform: translateY(30px) rotate(-2deg); opacity: 0; } }
.kicker { font: 12px/1 'TM Bold', sans-serif; letter-spacing: .2em; color: var(--dim); }
.result__title { margin: 0; font: clamp(44px, 9vw, 76px)/0.95 'TM Display', Impact, sans-serif; font-weight: 400; color: var(--glove); -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 5px 5px 0 #000; transform: rotate(-3deg); }
.card--over.is-loss .result__title { color: var(--bile); text-shadow: 5px 5px 0 #000, 8px 8px 0 #5a3a14; }
.result__line { margin: 0; color: #ffffffb8; font-size: 15px; }
.rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 4px 0 0; text-align: left; font-size: 15px; }
.rows dt { color: #ffffffb0; }
.rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rows dd b { color: var(--glove); }
.rows dt, .rows dd { opacity: 0; animation: rowin .25s forwards; animation-delay: calc(var(--i) * 90ms); }
@keyframes rowin { from { transform: translateX(-10px); } to { opacity: 1; } }
.result__total { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 0; padding-top: 10px; border-top: 2px dashed #ffffff26; }
.result__total span { font: 14px/1 'TM Display', Impact, sans-serif; color: var(--dim); }
.result__total b { font: 38px/1 'TM Display', Impact, sans-serif; color: var(--glove); }
.result__note { margin: 0; font-size: 14px; color: #ffffffb0; }
.result__note.is-best { color: var(--bile); font: 18px/1.2 'TM Display', Impact, sans-serif; }
.result__unlock { margin: 0; padding: 10px; background: var(--hot); color: #fff; font: 17px/1.2 'TM Display', Impact, sans-serif; transform: skewX(-8deg); }
.result__btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.close { position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 32px; line-height: 1; color: #fff; opacity: .7; }
.close:hover { opacity: 1; }

.sound-set { display: grid; gap: 10px; text-align: left; }
.sound-set label { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; font-size: 14px; }
.sound-set input[type=range] { accent-color: var(--glove); width: 100%; }
.check { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 14px; }
.check input, .sound-set input[type=checkbox] { accent-color: var(--glove); width: 18px; height: 18px; }

.tapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 56vh; overflow-y: auto; text-align: left; }
.tapes li button { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; background: #1d1c22; border: 2px solid #000; padding: 9px 10px; font-size: 14px; line-height: 1.25; }
.tapes li button:hover { background: #2a2830; }
.tapes li button i { flex: none; width: 26px; height: 26px; display: grid; place-items: center; background: var(--glove); color: #000; font-style: normal; font-size: 12px; }
.tapes li.is-locked button { color: #ffffff4d; cursor: default; }
.tapes li.is-locked button i { background: #333; color: #777; }

.loading { position: absolute; inset: 0; z-index: 20; display: grid; place-content: center; gap: 16px; background: var(--ink); text-align: center; font: 20px/1 'TM Display', Impact, sans-serif; color: var(--glove); }
.loading[hidden] { display: none; }

/* leaderboard dressed for this game */
.tgb--typing, .tgb--typing .tgb { --tgb-font: 'TM Bold', system-ui, sans-serif; --tgb-tab-on: #ff2f8f; --tgb-me: #ff2f8f33; }
.tgb--typing .tgb-title { font: 26px/1.05 'TM Display', Impact, sans-serif; color: #ff2f8f; }
.tgb--typing .tgb-tab[aria-selected="true"] { color: #000; }

/* phones */
@media (max-width: 760px) {
  .menu__grid { grid-template-columns: 1fr; padding: 8px 0; gap: 18px; }
  .menu__rules { display: none; }
  .menu__tag { margin: 18px 0 0; }
  .hud { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .hud__mid { grid-column: 1 / -1; grid-row: 2; display: none; }
  .hud__tools { position: absolute; right: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 36px); }
  .hp__bar { height: 16px; }
  .hp__name, .hp__n { font-size: 12px; }
  .hp__n { display: none; }
  .icon { width: 34px; height: 34px; }
  .panel { padding-top: 10px; }
  .panel__stats { margin-bottom: 6px; gap: 12px; }
  .st b { font-size: 17px; }
  .st small { font-size: 9px; letter-spacing: .1em; }
  .phrase { font-size: clamp(20px, 6vw, 28px); }
  .panel__next { display: none; }
  .incoming b { font-size: 16px; }
  .incoming small { display: none; }
}
@media (max-height: 520px) {
  .panel__next { display: none; }
  .panel__stats { margin-bottom: 4px; }
  .phrase { font-size: clamp(18px, 4.5vh, 30px); }
}
@media (prefers-reduced-motion: reduce) {
  .logo em, .incoming b, .phrase .c.cur { animation: none; }
}

/* ---------- Time Attack (11-25) ---------- */
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 2px solid #000; box-shadow: 0 0 0 2px #ffffff14; }
.kinds button { font: 17px/1 'TM Display', Impact, sans-serif; letter-spacing: .03em; padding: 11px 8px 9px; background: #121116; color: #ffffff8c; border: 0; cursor: pointer; }
.kinds button + button { border-left: 2px solid #000; }
.kinds button[aria-selected="true"] { background: var(--hot); color: #fff; }
.kinds button:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.menu__rules--ta { display: none; }
.menu-ta .menu__rules--battle { display: none; }
.menu-ta .menu__rules--ta { display: grid; }
.menu-ta .modes { grid-template-columns: 1fr 1fr 1fr; }
.menu-ta .mode { min-height: 84px; }
.is-ta .hp { visibility: hidden; }
.is-ta .incoming { display: none; }
.is-ta #st-mult { display: none; }
.is-ta .hud__mid strong { font-size: 40px; }
.is-ta.ta-warn .hud__mid strong { color: var(--hot); animation: lowhp .5s steps(2) infinite; }
@media (max-width: 560px) {
  .menu-ta .modes { grid-template-columns: 1fr; }
  .menu-ta .mode { min-height: 0; }
}

/* ---------- keycaps (11-25): every button is a fat keyboard key, not a slanted box ---------- */
.btn, .mode, .kinds, .tapes li button { --cap: #26242c; --edge: #0a090c; }
.btn { border: 2px solid #000; border-radius: 16px; transform: none; padding: 14px 28px 16px;
  background: linear-gradient(#ffffff1f, #ffffff00 45%), var(--cap);
  box-shadow: inset 0 -7px 0 #0000003d, inset 0 2px 0 #ffffff40, 0 7px 0 var(--edge), 0 10px 18px #0008;
  transition: transform .06s, box-shadow .06s, background-color .1s; }
.btn:active { transform: translateY(5px); box-shadow: inset 0 -3px 0 #0000003d, inset 0 2px 0 #ffffff40, 0 2px 0 var(--edge), 0 3px 8px #0008; }
.btn--go { --cap: var(--glove); --edge: #6e0033; color: #fff; text-shadow: 0 2px 0 #0004; }
.btn--go:hover { --cap: #ff55a6; background-color: #ff55a6; }
.btn--quiet { --cap: #2b2932; color: #fff; padding: 12px 20px 14px; }
.btn--quiet:hover { --cap: #393641; }
.btn kbd { border-radius: 6px; }
.menu .btn--go { border-radius: 20px; padding: 18px 18px 22px; }

.kinds { border: 2px solid #000; border-radius: 999px; padding: 4px; gap: 4px; background: #0b0a0e; box-shadow: inset 0 3px 8px #000a; }
.kinds button { border-radius: 999px; background: transparent; padding: 10px 8px; transition: background-color .12s, color .12s; }
.kinds button + button { border-left: 0; }
.kinds button[aria-selected="true"] { background: var(--hot); color: #fff; box-shadow: inset 0 -4px 0 #0000004d, inset 0 2px 0 #ffffff4d, 0 3px 0 #5c0010; }
.kinds button:focus-visible { outline-offset: -4px; border-radius: 999px; }

.mode { border-radius: 16px; border: 2px solid #000; padding: 12px 14px 16px;
  background: linear-gradient(#ffffff14, #ffffff00 50%), var(--cap);
  box-shadow: inset 0 -6px 0 #00000045, inset 0 2px 0 #ffffff22, 0 6px 0 var(--edge);
  transition: transform .06s, box-shadow .06s; }
.mode:hover:not(.is-locked) { --cap: #2f2d36; }
.mode[aria-checked="true"] { color: #fff; --cap: var(--glove); --edge: #6e0033; background: linear-gradient(#ffffff40, #ffffff00 50%), var(--glove);
  transform: translateY(4px); box-shadow: inset 0 -3px 0 #00000040, inset 0 2px 0 #ffffff66, 0 2px 0 var(--edge); }
.mode[data-mode="insane"][aria-checked="true"] { --edge: #5c0010; background: linear-gradient(#ffffff33, #ffffff00 50%), var(--hot);
  box-shadow: inset 0 -3px 0 #00000040, inset 0 2px 0 #ffffff55, 0 2px 0 #5c0010; }
.mode:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.menu__card { border-radius: 24px; box-shadow: 0 0 0 2px #ffffff1a, 0 18px 40px #000c; }
.card { border-radius: 24px; box-shadow: 0 0 0 2px #ffffff22, 0 20px 50px #000d; }
.tapes li button { border-radius: 12px; box-shadow: inset 0 -4px 0 #00000045, 0 3px 0 #000; }
.tapes li button i { border-radius: 8px; }
.menu__rules li::before { border-radius: 4px; transform: none; }
.result__unlock { border-radius: 12px; transform: none; }

/* ---------- menu demo (11-25): a real line typing itself + a keyboard, so it reads as a typing game at a glance ---------- */
.demo { margin: 26px 0 0; display: grid; gap: 14px; max-width: 560px; }
.demo__line { margin: 0; min-height: 1.3em; padding: 12px 16px; border-radius: 14px; background: #000b; border: 2px solid #ffffff1f;
  font: clamp(20px, 2.2vw, 28px)/1.3 'TM Type', monospace; color: #ffffff59; white-space: pre; overflow: hidden; }
.demo__line .d { color: var(--glove); }
.demo__line .k { color: #000; background: #fff; border-radius: 3px; }
.demo__kb { display: grid; gap: 6px; }
.demo__kb div { display: flex; gap: 6px; }
.demo__kb div:nth-child(2) { padding-left: 18px; }
.demo__kb div:nth-child(3) { padding-left: 40px; }
.demo__kb div:nth-child(4) { padding-left: 110px; }
.demo__kb i { font: 14px/1 'TM Display', Impact, sans-serif; font-style: normal; width: 38px; height: 36px; display: grid; place-items: center; border-radius: 8px;
  background: linear-gradient(#ffffff1a, #ffffff00 50%), #26242c; color: #ffffffa0; border: 1.5px solid #000; box-shadow: inset 0 -4px 0 #0005, 0 4px 0 #0a090c;
  transition: transform .05s, background-color .05s; }
.demo__kb i.sp { width: 236px; }
.demo__kb i.on { transform: translateY(3px); background: var(--glove); color: #fff; box-shadow: inset 0 -2px 0 #0004, 0 1px 0 #6e0033; }
@media (max-width: 760px) {
  .demo { margin: 14px 0 0; gap: 0; }
  .demo__line { font-size: 17px; padding: 9px 12px; }
  .demo__kb { display: none; }
}
@media (max-height: 640px) and (min-width: 761px) { .demo__kb { display: none; } }

/* logo sized to its own column so MAYHEM never runs under the menu card (owner 11-25) */
.menu__brand { container-type: inline-size; min-width: 0; }
.logo span, .logo em { font-size: clamp(44px, 16cqi, 150px); }
.logo em { margin-left: .2em; }

/* ---------- online duel (11-25) ---------- */
.kinds { grid-template-columns: 1fr 1fr 1fr; }
.kinds button { font-size: 15px; }
.online-live { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font: 13px/1.3 'TM Bold', sans-serif; color: #fff; }
.online-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--glove); box-shadow: 0 0 0 4px #ff2f8f33; flex: none; animation: livepulse 1.6s ease-in-out infinite; }
.online-live.is-empty { color: #ffffff8c; }
.online-live.is-empty i { background: #ffffff55; box-shadow: none; animation: none; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 7px #ff2f8f00; } }
.tm .tp-online i { background: var(--glove); box-shadow: 0 0 0 3px #ff2f8f40; }
.menu-online .modes { grid-template-columns: 1fr 1fr; }
.menu-online .mode { min-height: 70px; }
.menu-online .mode:last-child { grid-column: span 2; }
.fighter b { color: #fff; text-shadow: 0 2px 0 #000; }
.fighter[aria-checked="true"] b { text-shadow: 0 2px 0 #0005; }
.room-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.room-row .btn { padding: 11px 12px 13px; font-size: 14px; }
.join { display: flex; gap: 8px; min-width: 0; }
.join input { flex: 1; min-width: 0; width: 6ch; font: 20px/1 'TM Display', Impact, sans-serif; letter-spacing: .18em; text-align: center; text-transform: uppercase;
  color: #fff; background: #0b0a0e; border: 2px solid #000; border-radius: 14px; box-shadow: inset 0 3px 8px #000a, 0 0 0 2px #ffffff14; padding: 8px 6px; }
.join input:focus { outline: 3px solid var(--glove); outline-offset: 1px; }
.join input::placeholder { color: #ffffff40; }
.lobby__code { margin: 6px 0 0; font: 64px/1 'TM Display', Impact, sans-serif; letter-spacing: .14em; color: var(--glove); text-shadow: 0 5px 0 #000;
  user-select: all; }
#lobby .card { text-align: center; display: grid; gap: 14px; justify-items: center; }
#lobby .result__note { min-height: 1.4em; }
.is-duel #st-mult, .is-duel .st--score { display: none; }
/* their progress through their line: a thin bar right under their health bar (fills = they punch) */
.is-duel .incoming, .is-duel .incoming.is-on { left: auto; right: 118px; bottom: auto; top: 46px; transform: none; }
.is-duel .incoming b, .is-duel .incoming small { display: none; }
.is-duel .incoming__bar { width: min(420px, 33vw); height: 6px; border: 0; border-radius: 3px; background: #ffffff26; }
.is-duel .incoming__bar i { background: #fff; }
.is-duel.ta-warn .hud__mid strong { color: var(--hot); animation: lowhp .5s steps(2) infinite; }
@media (max-width: 560px) {
  .kinds button { font-size: 12.5px; padding: 9px 4px; }
  .room-row { grid-template-columns: 1fr; }
  .lobby__code { font-size: 48px; }
  .is-duel .incoming, .is-duel .incoming.is-on { right: 12px; top: 40px; }
  .is-duel .incoming__bar { width: 42vw; }
}

/* Sushida-style: this month's place, big, the moment the run ends */
.month { display: grid; grid-template-columns: auto auto; align-items: baseline; justify-content: center; column-gap: 10px; margin: 10px 0 0;
  padding: 10px 16px 12px; border-radius: 16px; background: #000; box-shadow: inset 0 0 0 2px var(--glove); }
.month small { grid-column: 1 / -1; text-align: center; font: 12px/1 'TM Bold', sans-serif; letter-spacing: .22em; color: var(--glove); margin-bottom: 4px; }
.month b { font: 52px/1 'TM Display', Impact, sans-serif; color: #fff; }
.month span { font: 18px/1 'TM Bold', sans-serif; color: #ffffffa8; }
.month.is-in { animation: monthin .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes monthin { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .month.is-in, .online-live i { animation: none; } }

/* ---- level rules + Tom tricks (11-25) ---- */
/* guard word: typed over his wind-up to block */
.guard { display: flex; gap: 2px; font: clamp(30px, 4.4vw, 52px)/1 'TM Type', ui-monospace, monospace; background: #fff; color: #0008; padding: 6px 14px 8px; border: 3px solid #000; border-radius: 10px; box-shadow: 5px 5px 0 #000; }
.guard[hidden] { display: none; }
.guard span { display: inline-block; }
.guard .done { color: var(--hot); }
.guard .cur { color: #000; text-decoration: underline 3px var(--hot); text-underline-offset: 6px; }
.guard.is-shake { animation: guardno .2s; }
@keyframes guardno { 50% { background: var(--hot); } }
.vs__rule { margin: 10px 0 0 !important; display: inline-block; background: #000; color: #fff; padding: 6px 14px 5px; font: clamp(15px, 1.8vw, 20px)/1 'TM Display', Impact, sans-serif !important; letter-spacing: .04em; }
.vs__rule:empty { display: none; }
/* HARD: the fire behind you (letters you typed turn to ash; nothing moves) */
.phrase .c.ash { color: #5a3a3a; }
.phrase .c.fire { color: #fff; text-shadow: 0 0 6px #ff2238, 0 0 14px #ff2238, 0 -4px 10px #ff6a00; }
/* INSANE: once he has read it, the letters fade (a letter missed twice shows) */
.phrase.is-listen .c:not(.done):not(.peek) { color: transparent; }
.phrase.is-listen .c:not(.done):not(.sp)::before { content: ''; position: absolute; left: 12%; right: 12%; bottom: .12em; height: 2px; background: #ffffff40; }
.phrase.is-listen .c.cur:not(.peek) { color: transparent; }
.phrase .c.peek { color: var(--hot); }
/* Dinner Tom: food on your words */
.phrase .c.goo { color: transparent; background: radial-gradient(circle at 40% 45%, #8a5226 0 45%, #5c3417 70%); border-radius: 45%; }
/* Aura Tom: grill flash glare */
.phrase.is-glare { animation: glare 1.5s ease-out; }
@keyframes glare { 0% { filter: brightness(3) blur(4px); opacity: .25; } 60% { filter: brightness(1.6) blur(2px); opacity: .6; } 100% { filter: none; opacity: 1; } }
/* Toilet Mouth: his drink timer */
.gulp { position: relative; height: 5px; max-width: 520px; margin: 6px auto 0; background: #ffffff1a; border-radius: 3px; }
.gulp::before { content: '🥤'; position: absolute; right: -26px; top: 50%; transform: translateY(-50%); font-size: 18px; line-height: 1; }
.gulp i { border-radius: 3px; }
.gulp[hidden] { display: none; }
.gulp i { display: block; height: 100%; background: var(--cyan); transform-origin: left; }
