/* ==========================================================================
   Keyboard Warrior Stickman - Authentic Steam 2.5D Beat 'Em Up Styling
   ========================================================================== */


:root {
  --font-mono: 'Share Tech Mono', monospace, 'Courier New';
  --font-display: 'Teko', sans-serif, Impact;
  --font-hand: 'Permanent Marker', cursive, sans-serif;
  --font-retro: 'VT323', monospace;

  --color-primary: #00f0ff;
  --color-gold: #ffd700;
  --color-red: #ff3344;
  --color-green: #00ff88;
  --bg-dark: #07090e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-mono);
  color: #ffffff;
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Three.js Canvas */
#game-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ==========================================================================
   Floating 2.5D Notebook Prompt
   ========================================================================== */
#floating-prompt-container {
  position: absolute;
  top: 104px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  max-width: 94vw;
}

#floating-prompt-paper {
  background: #ffffff;
  background-image: 
    linear-gradient(90deg, transparent 60px, #ffccd5 60px, #ffccd5 62px, transparent 62px),
    linear-gradient(#e1edf7 1px, transparent 1px);
  background-size: 100% 100%, 100% 36px;
  padding: 16px 34px 16px 70px;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 2px 4px rgba(0,0,0,0.4);
  border: 1px solid #d8d8d8;
  position: relative;
  transform: rotate(-0.5deg);
}

/* Paper torn edge effect */
#floating-prompt-paper::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
  background: radial-gradient(circle, transparent 4px, #ffffff 4px);
  background-size: 14px 6px;
}

#prompt-text-display {
  font-family: var(--font-mono);
  font-size: clamp(26px, 3.4vw, 50px);
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.25;
  color: #1a1e28;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  white-space: pre-wrap;
}

.word {
  display: inline-flex;
  white-space: nowrap;
}

.char {
  display: inline-block;
  position: relative;
  transition: color 0.1s ease;
}

.char-done {
  color: #9aaab8;
  opacity: 0.55;
  text-decoration: line-through;
}

.char-pending {
  color: #111520;
}

/* Authentic Steam RED CURSOR OUTLINE BOX on active letter */
.char-active {
  color: #000000;
}

.red-cursor-box {
  display: inline-block;
  padding: 0 2px;
  border-bottom: 5px solid #ffd23a;
  background: rgba(255, 210, 58, 0.22);
}

@keyframes cursor-pulse {
  from {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
  }
  to {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.95);
  }
}

/* ==========================================================================
   Bottom-Left Steam Authentic HUD
   ========================================================================== */
#steam-bottom-hud {
  position: absolute;
  bottom: 28px;
  left: 36px;
  z-index: 25;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

#steam-hud-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #e0e8f5;
  margin-bottom: 4px;
}

#steam-hud-metrics .hud-item .val {
  color: #ffffff;
  font-size: 20px;
}

#steam-hud-metrics .hud-item .lbl {
  color: #ffd23a;
  font-size: 14px;
  margin-left: 2px;
}

#steam-hud-metrics .hud-sep {
  color: rgba(255, 255, 255, 0.4);
}

#steam-score-counter {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffd700;
  line-height: 1;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.6), 0 2px 4px #000;
  margin-bottom: 6px;
}

#steam-progress-track {
  width: 280px;
  height: 6px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

#steam-progress-fill {
  width: 0%;
  height: 100%;
  background: #ffd23a;
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   DMC Style Rank Widget (Mid / Top Right)
   ========================================================================== */
#style-rank-widget {
  position: absolute;
  top: 96px;
  right: 48px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

#combo-counter-text {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  color: #ffaa00;
  letter-spacing: 2px;
  text-shadow: 0 0 14px rgba(255, 170, 0, 0.8), 0 2px 4px #000;
  animation: pop-bounce 0.15s ease-out;
  margin-bottom: -10px;
}

#combo-counter-text.hidden {
  display: none;
}

@keyframes pop-bounce {
  0% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

#rank-badge-letter {
  font-family: var(--font-display);
  font-size: 110px;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -2px;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.6), 0 4px 8px #000;
  transform: skew(-8deg);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#rank-badge-letter[data-rank="D"] { color: #8899aa; text-shadow: 0 0 12px #8899aa; }
#rank-badge-letter[data-rank="C"] { color: #00d2ff; text-shadow: 0 0 18px #00d2ff; }
#rank-badge-letter[data-rank="B"] { color: #00ff88; text-shadow: 0 0 20px #00ff88; }
#rank-badge-letter[data-rank="A"] { color: #ffaa00; text-shadow: 0 0 24px #ffaa00; }
#rank-badge-letter[data-rank="S"] { color: #ff3344; text-shadow: 0 0 28px #ff3344; }
#rank-badge-letter[data-rank="SS"] { color: #ff00bb; text-shadow: 0 0 32px #ff00bb; }
#rank-badge-letter[data-rank="SSS"] {
  background: linear-gradient(135deg, #ff0055, #ffd700, #00ffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 215, 0, 0.9));
  animation: sss-glow 0.8s infinite alternate ease-in-out;
}

@keyframes sss-glow {
  0% { transform: skew(-8deg) scale(1); }
  100% { transform: skew(-8deg) scale(1.12); }
}

#rank-title-text {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 2px 4px #000;
  margin-top: -4px;
}

#rank-meter-track {
  width: 90px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

#rank-meter-fill {
  width: 0%;
  height: 100%;
  background: #ff3344;
  transition: width 0.15s ease-out;
}

/* ==========================================================================
   Bottom Keybind Guide Bar
   ========================================================================== */
#keybind-guide-bar {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 25;
  pointer-events: none;
}

.k-chip {
  font-size: 12px;
  color: #adbcd0;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 1px;
}

.k-chip kbd {
  background: #1a2234;
  border: 1px solid #3d4f6d;
  border-bottom: 2px solid #233148;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: bold;
  color: #00f0ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Screen Feedback (Miss Flash & Rage Mode Aura)
   ========================================================================== */
#screen-miss-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  z-index: 50;
}

#screen-miss-flash.flash-active {
  animation: flash-anim 0.2s ease-out;
}

@keyframes flash-anim {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

#rage-aura-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  box-shadow: inset 0 0 120px 40px rgba(255, 0, 30, 0.6);
  pointer-events: none;
  opacity: 0;
  z-index: 45;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   Fight bars, power-form badge
   ========================================================================== */
#fight-bars {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(800px, calc(100vw - 420px));
  min-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  z-index: 24;
  pointer-events: none;
}

.bar-side { flex: 1; min-width: 0; }
.bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px #000;
}
.enemy-side .bar-head { flex-direction: row; }
#enemy-kos { color: #ffd23a; font-size: 16px; }

.hp-track {
  height: 16px;
  background: rgba(8, 10, 18, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}
.enemy-side .hp-track { transform: scaleX(-1); }
.hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #7dff9a, #19c45b);
  transition: width 0.12s ease-out;
}
.enemy-side .hp-fill { background: linear-gradient(180deg, #ff8d6a, #e3363b); }
.hp-fill.low { background: linear-gradient(180deg, #ffd36a, #ff7a1a); animation: hp-pulse 0.5s infinite alternate; }
@keyframes hp-pulse { to { filter: brightness(1.5); } }

#vs-badge {
  flex: 0 0 84px;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  margin-bottom: -15px; /* centres the clock on the health bars */
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: #ffd23a;
  text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, 0.8);
}

#form-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 10px;
  background: rgba(8, 10, 18, 0.7);
}
#form-chip.powered { animation: chip-glow 0.7s infinite alternate; }
@keyframes chip-glow { from { box-shadow: 0 0 4px currentColor; } to { box-shadow: 0 0 14px currentColor; } }

/* ==========================================================================
   Effects overlays: floating combat text, flash, form vignette
   ========================================================================== */
#fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 22;
  overflow: hidden;
}

.fx-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 3px;
  white-space: nowrap;
  text-shadow: 0 0 14px currentColor, 0 3px 0 #000, 2px 2px 0 #000, -2px -2px 0 #000;
  animation: fx-float 1.05s ease-out forwards;
}
.fx-text.fx-pop { animation: fx-pop 1.15s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
.fx-text.fx-big { animation-duration: 1.7s; }

@keyframes fx-float {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1.05); }
}
@keyframes fx-pop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.3) rotate(-6deg); }
  18% { opacity: 1; transform: translate(-50%, -60%) scale(1.25) rotate(2deg); }
  35% { transform: translate(-50%, -66%) scale(1) rotate(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}

#fx-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 55;
}

#form-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  transition: opacity 0.5s ease;
}

@media (max-width: 760px) {
  #fight-bars { width: calc(100vw - 24px); top: 56px; }
  #floating-prompt-container { top: 128px; }
  #style-rank-widget { top: 190px; right: 14px; transform: scale(0.7); transform-origin: top right; }
  .arena-grid { grid-template-columns: repeat(3, 1fr); }
  #steam-score-counter { font-size: 38px; }
  #keybind-guide-bar { display: none; }
}


/* ==========================================================================
   Meme overlay: floats over the head of the fighter it's about (positioned by JS)
   ========================================================================== */
#meme-tv {
  position: fixed;
  left: 50%;
  top: 40%;
  z-index: 18; /* above the fight, below every HUD element so typing stays readable */
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
  transition: opacity 0.12s ease;
  --meme-h: 160px;
  --tail: 50%;
}
#meme-tv.show { opacity: 1; }

.meme-tv-frame {
  position: relative;
  border: 4px solid #0d0f14;
  border-radius: 12px;
  background: #000;
  overflow: hidden;
  transform-origin: var(--tail) 100%;
  transform: scale(0.35) rotate(-4deg);
  transition: transform 0.28s cubic-bezier(0.2, 1.5, 0.4, 1);
  box-shadow: 0 0 0 2px #cfd6e4, 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 240, 255, 0.3);
}
#meme-tv.show .meme-tv-frame { transform: scale(1) rotate(0deg); }
#meme-tv.prio-2 .meme-tv-frame { box-shadow: 0 0 0 2px #ffd23a, 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 24px rgba(255, 210, 58, 0.5); }
#meme-tv.prio-3 .meme-tv-frame { box-shadow: 0 0 0 2px #ff4455, 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 28px rgba(255, 68, 85, 0.6); }
#meme-tv.phrase .meme-tv-frame { border-width: 5px; }

/* speech-bubble pointer aimed at the fighter's head */
#meme-tv::after {
  content: '';
  position: absolute;
  left: var(--tail);
  bottom: -12px;
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-top-color: #cfd6e4;
  border-bottom: 0;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s ease 0.1s;
}
#meme-tv.show::after { opacity: 1; }
#meme-tv.prio-2::after { border-top-color: #ffd23a; }
#meme-tv.prio-3::after { border-top-color: #ff4455; }

/* clip size comes from JS: a share of the screen, bigger for bigger moments */
#meme-video {
  display: block;
  height: var(--meme-h);
  width: auto;
  max-width: min(40vw, 480px);
  min-width: 60px;
  background: #000;
  object-fit: contain;
}

.meme-tv-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.12) 3px);
  mix-blend-mode: multiply;
}

.meme-tv-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  max-width: calc(100% - 10px);
  padding: 1px 7px;
  font-family: var(--font-display);
  font-size: clamp(11px, calc(var(--meme-h) * 0.1), 20px);
  letter-spacing: 2px;
  line-height: 1.25;
  color: #fff;
  background: rgba(220, 30, 60, 0.9);
  border-radius: 3px;
  text-shadow: 0 1px 2px #000;
}

/* Meme-throw cooldown chip and the secret-move codex */
#chip-meme { position: relative; opacity: 0.55; transition: opacity 0.2s ease; overflow: hidden; padding-bottom: 3px; }
#chip-meme.ready { opacity: 1; }
#chip-meme .chip-fill { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: #ffd23a; transform-origin: left; transform: scaleX(0); }


/* ==========================================================================
   Rounds: pips, clock, banner, match result
   ========================================================================== */
.pips { display: inline-flex; gap: 5px; margin: 0 8px; align-items: center; }
.pips i {
  width: 14px; height: 14px; transform: rotate(45deg);
  border: 2px solid rgba(255, 255, 255, 0.7); background: rgba(8, 10, 18, 0.7);
}
.pips i.won { background: #ffd23a; border-color: #ffd23a; box-shadow: 0 0 10px rgba(255, 210, 58, 0.8); }
#vs-badge.clock { font-size: 30px; min-width: 52px; text-align: center; color: #fff; }
#vs-badge.urgent { color: #ff5560; animation: hp-pulse 0.5s infinite alternate; }

#round-banner {
  position: absolute; left: 0; right: 0; top: 34%;
  text-align: center; pointer-events: none; z-index: 40;
  font-family: var(--font-display); letter-spacing: 6px; color: #fff;
  font-size: 0; opacity: 0;
  text-shadow: 0 4px 0 #000, 0 0 30px rgba(255, 210, 58, 0.5);
}
#round-banner.show { font-size: clamp(54px, 9vw, 120px); opacity: 1; animation: banner-pop 0.34s cubic-bezier(.2, 1.4, .4, 1); }
#round-banner.fight { color: #ffd23a; }
#round-banner.ko { color: #ff3344; }
#round-banner.sub { font-size: clamp(30px, 4.4vw, 56px); letter-spacing: 4px; color: #fff; }
@keyframes banner-pop { from { transform: scale(1.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#match-over {
  position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 7, 12, 0.72); backdrop-filter: blur(3px);
}
#match-over[hidden] { display: none; }
.mo-card { text-align: center; padding: 30px 40px; min-width: min(420px, 90vw); border: 2px solid rgba(255, 255, 255, 0.85); background: rgba(10, 13, 22, 0.94); }
.mo-kicker { margin: 0; font-family: var(--font-mono, monospace); letter-spacing: 4px; color: #9aa4b8; font-size: 13px; }
.mo-title { margin: 6px 0 4px; font-family: var(--font-display); font-size: 84px; letter-spacing: 6px; color: #ff5560; line-height: 1; }
#match-over.won .mo-title { color: #ffd23a; text-shadow: 0 0 24px rgba(255, 210, 58, 0.5); }
.mo-score { margin: 0 0 18px; font-family: var(--font-display); font-size: 26px; letter-spacing: 3px; }
.mo-actions { display: grid; gap: 10px; }
.mo-actions button:disabled { opacity: 0.5; cursor: wait; }
.mo-note { min-height: 18px; margin: 12px 0 0; color: #9aa4b8; font-size: 13px; }

#fatality-hint {
  position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); z-index: 41;
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
#fatality-hint[hidden] { display: none; }
.fh-label { font-family: var(--font-display); font-size: 30px; letter-spacing: 6px; color: #ff3344; text-shadow: 0 2px 0 #000; }
.fh-keys { display: flex; gap: 8px; }
.fh-keys kbd {
  font-family: var(--font-display); font-size: 22px; padding: 6px 12px; min-width: 40px; text-align: center;
  border: 2px solid #fff; background: rgba(8, 10, 18, 0.88); color: #fff;
}
#fatality-hint.ok .fh-keys kbd { border-color: #ffd23a; color: #ffd23a; }
.fh-bar { width: 260px; height: 6px; background: rgba(255, 255, 255, 0.2); }
.fh-bar i { display: block; height: 100%; width: 100%; background: #ff3344; }

/* ==========================================================================
   Online lobby
   ========================================================================== */
#online-lobby {
  position: absolute; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 7, 12, 0.86); backdrop-filter: blur(4px); padding: 16px; overflow: auto;
}
.ol-card { width: min(860px, 100%); border: 2px solid rgba(255, 255, 255, 0.85); background: rgba(10, 13, 22, 0.96); padding: 26px 30px; }
.ol-kicker { margin: 0; letter-spacing: 4px; font-size: 13px; color: #9aa4b8; }
.ol-title { margin: 4px 0 18px; font-family: var(--font-display); font-size: 52px; letter-spacing: 5px; line-height: 1; color: #ffd23a; }
.ol-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ol-opt { display: flex; flex-direction: column; gap: 10px; border-top: 2px solid rgba(255, 255, 255, 0.25); padding-top: 12px; }
.ol-opt h3 { margin: 0; font-family: var(--font-display); letter-spacing: 3px; font-size: 22px; }
.ol-opt p { margin: 0; font-size: 13px; color: #9aa4b8; min-height: 56px; }
.ol-code { font-family: var(--font-display); font-size: 54px; letter-spacing: 10px; color: #fff; line-height: 1; padding: 4px 0; }
.ol-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px; background: rgba(0, 0, 0, 0.5); color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6); font-family: var(--font-display); font-size: 32px; letter-spacing: 8px; text-align: center; text-transform: uppercase;
}
.ol-input:focus { outline: none; border-color: #ffd23a; }
.ol-link { background: none; border: 0; color: #9be8ff; text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; text-align: left; padding: 0; }
.ol-status { min-height: 22px; margin: 18px 0 8px; font-size: 14px; font-weight: bold; }
.ol-status.err { color: #ff7a85; }
.ol-status.ok { color: #7dff9a; }
.ol-foot { max-width: 220px; }
@media (max-width: 760px) { .ol-grid { grid-template-columns: 1fr; } .ol-title { font-size: 38px; } }

/* round introductions */
#round-bars i { position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 38; transition: height 0.45s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
#round-bars i:first-child { top: 0; }
#round-bars i:last-child { bottom: 0; }
#round-bars.on i { height: 11vh; }
#round-banner small, #round-banner b, #round-banner em { display: block; font-style: normal; }
#round-banner.round small { font-size: 0.26em; letter-spacing: 0.7em; color: #ffd23a; padding-left: 0.7em; animation: round-sweep 0.5s 0.05s both; }
#round-banner.round b { line-height: 0.95; animation: round-slam 0.5s cubic-bezier(.15, 1.5, .35, 1) both; }
#round-banner.round em { font-size: 0.22em; letter-spacing: 0.6em; color: #9aa4b8; padding-left: 0.6em; animation: round-sweep 0.5s 0.25s both; }
#round-banner.round.r2 b { color: #ffe27a; }
#round-banner.final { color: #ff3344; text-shadow: 0 4px 0 #000, 0 0 40px rgba(255, 51, 68, 0.8); animation: final-shake 0.5s; }
#round-banner.final small { color: #fff; }
@keyframes round-slam { 0% { transform: scale(4) rotate(-6deg); opacity: 0; filter: blur(14px); } 60% { transform: scale(0.92); filter: blur(0); opacity: 1; } 100% { transform: scale(1); } }
@keyframes round-sweep { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes final-shake { 0%, 100% { transform: translate(0); } 20% { transform: translate(-10px, 5px); } 40% { transform: translate(9px, -6px); } 60% { transform: translate(-6px, 4px); } 80% { transform: translate(4px, -3px); } }

#net-chip {
  position: absolute; left: 14px; top: 14px; z-index: 25; padding: 3px 9px; pointer-events: none;
  font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: 2px; color: #7dff9a;
  border: 1px solid rgba(125, 255, 154, 0.5); background: rgba(8, 10, 18, 0.7);
}
#net-chip.bad { color: #ff7a85; border-color: rgba(255, 122, 133, 0.6); }

#round-banner.count { color: #ffd23a; font-size: clamp(90px, 16vw, 200px); letter-spacing: 0; }


/* ==========================================================================
   Pause menu: the game's own paper-and-ink look (same parts as the landing page)
   ========================================================================== */
#meme-menu-modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5, 7, 12, 0.84);
}
#meme-menu-modal.hidden { display: none; }
.pm-wrap { filter: drop-shadow(8px 8px 0 rgba(0, 0, 0, 0.6)); width: min(860px, 100%); }
.pm-card {
  display: flex; flex-direction: column; max-height: calc(100vh - 40px); color: var(--ink); font-family: var(--font-mono);
  background:
    linear-gradient(90deg, transparent 38px, var(--margin) 38px 40px, transparent 40px),
    repeating-linear-gradient(transparent 0 27px, var(--rule) 27px 28px),
    var(--paper);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}
.pm-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 18px 22px 8px 62px; }
.pm-kicker { margin: 0; font-size: 12px; letter-spacing: 4px; color: #b3101f; font-weight: bold; }
.pm-title { margin: 0; font-family: var(--font-display); font-size: 58px; line-height: 0.95; letter-spacing: 2px; text-transform: uppercase; }
.pm-note { margin: 4px 0 0; font-size: 12px; color: var(--mute); }
.pm-close { background: none; border: 0; cursor: pointer; font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--ink); padding: 0 6px; }
.pm-close:hover { color: #b3101f; }

.pm-tabs { display: flex; gap: 4px; padding: 6px 22px 0 62px; border-bottom: 3px solid var(--ink); }
.pm-tab {
  cursor: pointer; border: 0; padding: 6px 16px 4px; font-family: var(--font-display); font-size: 24px; letter-spacing: 1.5px;
  color: var(--ink); background: rgba(8, 8, 11, 0.12);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}
.pm-tab:hover { background: rgba(8, 8, 11, 0.24); }
.pm-tab.active { background: var(--ink); color: var(--gold); }

.pm-panels { overflow-y: auto; padding: 14px 24px 14px 62px; min-height: 0; flex: 1; }
.pm-panel { display: none; flex-direction: column; gap: 18px; }
.pm-panel.active { display: flex; }
.menu-section { display: flex; flex-direction: column; gap: 8px; }
.section-title { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; line-height: 1; }
.section-title::after { content: ''; display: block; height: 3px; width: 34px; margin-top: 4px; background: var(--ink); }
#secret-count { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; color: #b3101f; letter-spacing: 1px; }
.tip-text { font-size: 12px; line-height: 1.45; color: var(--mute); }

.form-row, .preset-phrases-list { display: flex; flex-wrap: wrap; gap: 8px; }
.form-btn, .phrase-tag {
  cursor: pointer; padding: 6px 12px; font-family: var(--font-mono); font-size: 12px; font-weight: bold; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.form-btn:hover, .phrase-tag:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.form-btn:active, .phrase-tag:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.form-btn.active { background: var(--ink); color: var(--gold); }

.arena-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.arena-btn {
  cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 5px 5px 6px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: bold; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.arena-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.arena-btn.active { background: var(--ink); color: var(--gold); }
.arena-thumb { width: 100%; aspect-ratio: 16 / 10; background-size: cover; background-position: center; }

.prompt-input-row { display: flex; gap: 10px; }
#custom-phrase-input {
  flex: 1; min-width: 0; padding: 8px 12px; font-family: var(--font-mono); font-size: 15px; font-weight: bold; color: var(--ink);
  background: #fff; border: 2px solid var(--ink); outline: none;
}
#custom-phrase-input:focus { border-color: #b3101f; }
#apply-phrase-btn {
  cursor: pointer; padding: 0 16px; font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; color: var(--gold);
  background: var(--ink); border: 0; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
}
#apply-phrase-btn:hover { transform: translate(-1px, -1px); }

.slider-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; font-size: 13px; font-weight: bold; }
.slider-row input[type='range'] { width: 240px; accent-color: var(--ink); }

.attack-guide { display: flex; flex-direction: column; gap: 9px; }
.attack-guide > div { display: flex; gap: 12px; align-items: flex-start; font-size: 12px; line-height: 1.5; }
.attack-guide kbd {
  flex: 0 0 82px; text-align: center; padding: 3px 4px; font-size: 11px; font-weight: bold; color: var(--gold);
  background: var(--ink); font-family: var(--font-mono);
}
.attack-guide b { background: rgba(255, 210, 58, 0.55); font-weight: bold; }

.secret-list { display: flex; flex-direction: column; gap: 8px; }
.secret { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 12px; font-size: 12px; line-height: 1.45; border: 2px solid var(--ink); background: rgba(255, 255, 255, 0.7); }
.secret b { font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; }
.secret .code { font-weight: bold; letter-spacing: 4px; background: var(--ink); color: var(--gold); padding: 0 8px; }
.secret.found { box-shadow: 3px 3px 0 var(--ink); }
.secret.locked { border-style: dashed; color: var(--mute); font-style: italic; }

.pm-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 24px 18px 62px; border-top: 3px solid var(--ink); }
.pm-foot .menu-btn { width: auto; min-width: 200px; }
.pm-actions { display: flex; gap: 12px; }

@media (max-width: 720px) {
  .arena-grid { grid-template-columns: repeat(3, 1fr); }
  .pm-title { font-size: 40px; }
  .pm-head, .pm-tabs, .pm-panels, .pm-foot { padding-left: 52px; }
  .slider-row { flex-direction: column; align-items: stretch; }
  .slider-row input[type='range'] { width: 100%; }
}
.pm-foot .menu-btn { background: var(--ink); color: var(--paper); padding-top: 8px; padding-bottom: 8px; }
.pm-foot .menu-btn .mb-sub { display: none; }
.pm-foot .menu-btn .mb-label { color: var(--paper); }
.pm-foot .menu-btn .mb-key { background: var(--gold); color: var(--ink); }
.pm-foot .menu-btn::after { background: var(--gold); }


/* Fight bars: mirrored heads, evenly spaced */
.bar-head { gap: 10px; min-height: 28px; }
.hero-side .pips { margin-left: auto; }
.enemy-side .bar-head { flex-direction: row-reverse; }
.enemy-side .bar-name { order: 1; }
.enemy-side #enemy-kos { order: 2; }
.enemy-side .pips { order: 3; margin-right: auto; }
.bar-side { padding-top: 0; }
.pips { margin: 0; }
.hp-track { height: 18px; }
.bar-head > * { white-space: nowrap; }
.bar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 18px; }
#enemy-kos { font-size: 14px; }
#floating-prompt-container { top: 124px; }


/* Control hints: the game's ink-and-paper key caps (no blue) */
#keybind-guide-bar {
  left: 340px; right: 20px; transform: none; bottom: 20px;
  justify-content: center; flex-wrap: wrap; gap: 8px 16px;
}
.k-chip { font-family: var(--font-mono); font-size: 12px; font-weight: bold; color: #ecedf1; letter-spacing: 1px; text-shadow: 0 2px 0 #000; white-space: nowrap; }
.k-chip kbd {
  background: #ecedf1; color: #08080b; border: 0; border-radius: 0; padding: 3px 7px; font-size: 11px; font-weight: bold;
  font-family: var(--font-mono); box-shadow: 2px 2px 0 #000;
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
}
#chip-meme { padding-right: 4px; }


/* The typing paper sits a little lower, and the next key rises from the bottom */
#floating-prompt-container { top: 150px; }
#key-stream {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 24; pointer-events: none;
}
.kc {
  position: absolute; left: 50%; bottom: clamp(70px, 11vh, 120px); display: flex; align-items: center; justify-content: center;
  min-width: clamp(44px, 7vh, 72px); height: clamp(44px, 7vh, 72px); padding: 0 12px; box-sizing: border-box;
  font-family: var(--font-display); font-size: clamp(28px, 4.6vh, 48px); line-height: 1; color: #08080b; background: #ffd23a;
  transform: translateX(-50%); text-shadow: none; filter: drop-shadow(4px 4px 0 #000);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  animation: kc-slide 0.62s cubic-bezier(.2, .9, .3, 1) forwards;
}
.kc.wide { font-size: clamp(20px, 3vh, 30px); letter-spacing: 3px; padding: 0 22px; }
.kc.bad { background: #ecedf1; color: #6a7080; }
@keyframes kc-slide {
  0% { transform: translate(-50%, 140px); opacity: 0; }
  35% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -34px); opacity: 0; }
}


/* Arena picker (start screen and online lobby) */
.ap { margin: 16px auto 0; max-width: 860px; }
.ap-label { margin: 0 0 8px; font-family: var(--font-display); font-size: 20px; letter-spacing: 3px; color: #9aa4b8; text-align: left; }
.ap-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.ap-btn {
  cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 4px 4px 5px; text-align: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: bold; color: #ecedf1;
  background: rgba(8, 10, 18, 0.8); border: 2px solid rgba(255, 255, 255, 0.35);
}
.ap-btn:hover { border-color: #fff; }
.ap-btn.active { border-color: #ffd23a; color: #ffd23a; box-shadow: 3px 3px 0 #000; }
.ap-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; background-size: cover; background-position: center; }
.ap-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 760px) { .ap { margin-top: 8px; } .ap-label { font-size: 16px; margin-bottom: 4px; } }

/* Control hints: sharp, never double-struck (the label shadow must not reach the key caps) */
.k-chip kbd { text-shadow: none; font-size: clamp(10px, 1.5vh, 12px); }
.k-chip { font-size: clamp(10px, 1.6vh, 12px); }
#keybind-guide-bar { left: clamp(200px, 26vw, 340px); }


/* Room lobby */
.ol-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 6px 0 14px; }
.ol-slot { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 2px dashed rgba(255, 255, 255, 0.3); color: #9aa4b8; }
.ol-slot.in { border-style: solid; border-color: rgba(255, 255, 255, 0.85); color: #fff; }
.ol-slot.ready { border-color: #ffd23a; }
.ol-role { font-family: var(--font-display); font-size: 26px; letter-spacing: 3px; }
.ol-state { font-size: 12px; font-weight: bold; letter-spacing: 2px; }
.ol-slot.ready .ol-state { color: #ffd23a; }
.ol-share { display: flex; align-items: center; gap: 20px; margin-bottom: 4px; }
.ol-foot-row { max-width: none; display: flex; gap: 12px; }
.ol-foot-row .menu-btn { width: auto; min-width: 190px; }
@media (max-width: 760px) { .ol-slots { grid-template-columns: 1fr; } }


/* Health bars: segments, a draining damage trail and the exact numbers */
.hp-track { position: relative; }
.hp-ghost { position: absolute; left: 0; top: 0; height: 100%; width: 100%; background: #f3efe0; opacity: 0.85; transition: width 0.7s ease-out 0.35s; }
.hp-fill { position: relative; z-index: 1; }
.hp-ticks {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(0, 0, 0, 0.55) calc(10% - 2px) 10%);
}
.hp-num {
  position: absolute; right: 8px; top: 50%; z-index: 3; transform: translateY(-50%); pointer-events: none;
  font-family: var(--font-display); font-size: 14px; letter-spacing: 1px; line-height: 1; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000;
}
.enemy-side .hp-num { transform: translateY(-50%) scaleX(-1); right: auto; left: 8px; }
.hp-track { height: 22px; }

#round-banner.start { pointer-events: auto; cursor: pointer; font-size: clamp(40px, 6.5vw, 84px); letter-spacing: 4px; color: #ffd23a; }
#round-banner.start small { font-size: 0.3em; letter-spacing: 0.7em; color: #fff; padding-left: 0.7em; }
#round-banner.start b { animation: start-blink 1.1s ease-in-out infinite; }
#round-banner.start u { text-decoration: none; padding: 0 0.18em; color: #08080b; background: #ffd23a; }
@keyframes start-blink { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { #round-banner.start b { animation: none; } }


/* Tactical mode: three meme cards, each with a buff */
#tactical-choices {
  position: absolute; top: 112px; left: 50%; transform: translateX(-50%); z-index: 21; pointer-events: none;
  display: flex; gap: 14px; max-width: 96vw;
}
#tactical-choices[hidden] { display: none; }
.tc {
  position: relative; display: flex; flex-direction: column; gap: 3px; width: clamp(128px, 14vw, 196px); padding: 6px 6px 8px;
  background: #ecedf1; color: #08080b; box-shadow: 4px 4px 0 #000; font-family: var(--font-mono);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: opacity 0.25s ease, transform 0.25s ease;
  animation: tc-in 0.4s cubic-bezier(.2, 1.2, .4, 1) backwards;
}
.tc:nth-child(2) { animation-delay: 0.08s; }
.tc:nth-child(3) { animation-delay: 0.16s; }
@keyframes tc-in { from { transform: translateY(-40px); opacity: 0; } }
.tc img, .tc-nothumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.tc-buff { font-family: var(--font-display); font-size: clamp(18px, 2.2vh, 24px); letter-spacing: 2px; line-height: 1; padding: 2px 6px 0; color: #08080b; width: fit-content; }
.tc-attack .tc-buff { background: #ff9a3c; }
.tc-defense .tc-buff { background: #08080b; color: #ecedf1; }
.tc-health .tc-buff { background: #7dff9a; }
.tc-eff { font-size: 10px; font-weight: bold; color: #4a5060; line-height: 1.2; }
.tc-phrase { font-size: clamp(11px, 1.6vh, 13px); font-weight: bold; line-height: 1.25; letter-spacing: 0.5px; }
.tc-first { background: rgba(255, 210, 58, 0.7); }
.tc-first u { text-decoration: none; background: #08080b; color: #ffd23a; padding: 0 3px; margin-right: 1px; }
.tc.dim { opacity: 0.28; transform: scale(0.92); }
.tc.picked { transform: translateY(-4px) scale(1.04); outline: 3px solid #ffd23a; outline-offset: 2px; }
.tac-hint { font-family: var(--font-display); font-size: clamp(18px, 2.6vh, 28px); letter-spacing: 3px; color: #08080b; }
body.tactical #meme-queue { display: none; }
body.tactical #floating-prompt-container { top: calc(112px + clamp(172px, 23vh, 250px)); }
body.tactical #floating-prompt-paper { padding: 10px 28px 10px 54px; }
body.tactical #prompt-text-display { font-size: clamp(22px, 3vw, 42px); }

#buff-chips { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); z-index: 24; display: flex; gap: 8px; pointer-events: none; }
.bc { padding: 2px 10px 0; font-family: var(--font-display); font-size: 18px; letter-spacing: 2px; color: #08080b; box-shadow: 3px 3px 0 #000; }
.bc-attack { background: #ff9a3c; }
.bc-defense { background: #ecedf1; }

.bc-foe { background: #08080b; color: #ffd23a; }
.tc.best { outline: 3px solid #ffd23a; outline-offset: 2px; }
.tc.best::after { content: 'BEST NOW'; position: absolute; top: -9px; right: 8px; padding: 1px 6px 0; font-family: var(--font-display); font-size: 14px; letter-spacing: 2px; background: #ffd23a; color: #08080b; }
#buff-chips { flex-wrap: wrap; justify-content: center; max-width: 90vw; }


/* Tactical cards without the picture: bigger, readable names, and the typing paper sits higher */
#tactical-choices { gap: 16px; }
.tc { width: clamp(172px, 19vw, 270px); min-height: clamp(120px, 17vh, 168px); padding: 10px 12px 12px; gap: 6px; }
.tc-buff { font-size: clamp(22px, 3vh, 30px); }
.tc-eff { font-size: clamp(11px, 1.55vh, 14px); }
.tc-phrase { font-size: clamp(17px, 2.7vh, 26px); line-height: 1.2; letter-spacing: 0.5px; }
body.tactical #floating-prompt-container { top: calc(112px + clamp(120px, 17vh, 168px) + 24px); }
/* the cards are clipped, so highlights are drawn inside them */
.tc.picked, .tc.best { outline: none; box-shadow: inset 0 0 0 4px #ffd23a; }
.tc.best::after { top: 8px; right: 16px; font-size: 15px; }
.tc-buff { margin-right: 70px; }

/* Tactical cards, compact: readable but out of the way of the fight */
#tactical-choices { top: 104px; gap: 10px; }
.tc { width: clamp(138px, 14.5vw, 205px); min-height: clamp(92px, 12.5vh, 124px); padding: 7px 9px 8px; gap: 3px; }
.tc-buff { font-size: clamp(15px, 2vh, 20px); margin-right: 56px; padding: 1px 5px 0; }
.tc-eff { font-size: clamp(9px, 1.25vh, 11px); }
.tc-phrase { font-size: clamp(13px, 2vh, 18px); line-height: 1.18; }
.tc.best::after { top: 6px; right: 10px; font-size: 12px; }
body.tactical #floating-prompt-container { top: calc(104px + clamp(92px, 12.5vh, 124px) + 16px); }
body.tactical #prompt-text-display { font-size: clamp(20px, 2.8vw, 38px); }
.tac-hint { font-size: clamp(16px, 2.2vh, 22px); }

/* Match setup (bot level + arena) shown as soon as the game opens */
#arena-select { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; overflow-y: auto; background: rgba(8, 8, 11, 0.86); transition: opacity 0.35s; }
#arena-select.closing { opacity: 0; pointer-events: none; }
.as-wrap { width: min(1280px, 100%); margin: auto; text-align: center; }
.as-title { margin: 0; font-family: var(--font-display); font-size: clamp(30px, 5.5vh, 54px); letter-spacing: 4px; color: #ffd23a; text-shadow: 4px 4px 0 #000; }
.as-levels { display: flex; justify-content: center; gap: 8px; margin: 6px 0 4px; }
.as-lvl { min-width: 96px; padding: 8px 16px; font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; color: #c9d3e2; background: #14161f; border: 3px solid #2b2f3d; cursor: pointer; touch-action: manipulation; }
.as-lvl.on { color: #08080b; background: #ffd23a; border-color: #fff; box-shadow: 3px 3px 0 #000; }
.as-enter { margin: 8px 0 0; font-family: var(--font-display); font-size: clamp(24px, 4vh, 38px); letter-spacing: 3px; color: #fff; animation: ld-blink 1.4s ease-in-out infinite; }
.as-enter kbd { padding: 2px 12px; color: #08080b; background: #ffd23a; border: 2px solid #fff; }
.as-sub { margin: 6px 0 0; font-family: var(--font-display); font-size: 19px; letter-spacing: 2px; color: #9aa4b8; }
.as-sub b { color: #fff; }
.as-bar { height: 8px; margin: 10px 0 14px; background: #1b1d27; border: 2px solid #000; }
.as-bar span { display: block; height: 100%; background: #ffd23a; transform-origin: left; animation: as-drain linear forwards; }
@keyframes as-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.as-card { padding: 0; font: inherit; color: #c9d3e2; background: #0e1018; border: 3px solid #2b2f3d; cursor: pointer; overflow: hidden; touch-action: manipulation; transition: transform 0.12s, border-color 0.12s; }
.as-card:hover, .as-card:focus-visible { border-color: #fff; transform: translateY(-3px); }
.as-card.on { border-color: #ffd23a; box-shadow: 4px 4px 0 #000; transform: translateY(-3px) scale(1.03); }
.as-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; background-size: cover; background-position: center; }
.as-name { display: block; padding: 8px 6px; font-family: var(--font-display); font-size: 24px; letter-spacing: 1.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .as-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .as-enter { font-size: 22px; }
  .as-name { font-size: 16px; padding: 5px 4px; }
  .as-sub { font-size: 16px; }
  .as-lvl { min-width: 0; flex: 1; font-size: 18px; padding: 8px 6px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .as-title { display: none; }
  .as-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .as-bar { margin: 6px 0 8px; }
}

/* Phone controls */
#touch-controls { position: fixed; inset: 0; z-index: 40; pointer-events: none; -webkit-user-select: none; user-select: none; }
.tc-btn { pointer-events: auto; touch-action: none; -webkit-touch-callout: none; font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; color: #fff; background: rgba(20, 22, 31, 0.72); border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 12px; padding: 0; min-width: 58px; height: 52px; }
.tc-btn.down { background: #ffd23a; color: #08080b; border-color: #fff; }
.tc-pad { position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.tc-left { left: max(10px, env(safe-area-inset-left)); }
.tc-left .tc-btn { width: 72px; height: 64px; font-size: 26px; }
.tc-right { right: max(10px, env(safe-area-inset-right)); flex-wrap: wrap; justify-content: flex-end; width: 210px; }
.tc-type { position: absolute; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); min-width: 150px; height: 56px; font-size: 24px; color: #08080b; background: #ffd23a; border-color: #fff; }
.tc-type.pulse { animation: tc-pulse 1.2s ease-in-out infinite; }
@keyframes tc-pulse { 50% { transform: translateX(-50%) scale(1.08); } }
.tc-small { position: absolute; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); min-width: 48px; height: 40px; font-size: 18px; }
#tc-input { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0.01; border: 0; padding: 0; font-size: 16px; pointer-events: none; }
body.touch-ui .ld-start { display: none; }
@media (max-width: 480px) { .tc-right { width: 170px; } .tc-btn { min-width: 50px; height: 46px; font-size: 17px; } .tc-left .tc-btn { width: 60px; height: 58px; } .tc-type { min-width: 120px; font-size: 20px; } }
