:root {
  --bg-paper: #F2EEE4;
  --bg-paper-soft: #F7F5EE;
  --grid-line: #E2DCCE;
  --ink: #1E1D1A;
  --ink-pure: #141414;
  --card-white: #FFFDF8;
  --yellow: #FFD60A;
  --amber: #F2A33A;
  --vermilion: #F04E36;
  --emerald: #10B981;
  --shadow-offset: 4px 4px 0 var(--ink);
  --border-ink: 3px solid var(--ink);
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --vv-height: 100vh;
}

@supports (height: 100dvh) {
  :root {
    --vv-height: 100dvh;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: var(--vv-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--bg-paper);
  background-image:
    radial-gradient(rgba(30, 29, 26, 0.055) 1px, transparent 1px),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 23px,
      rgba(30, 29, 26, 0.025) 23px,
      rgba(30, 29, 26, 0.025) 24px
    );
  background-size: 16px 16px, auto;
  color: var(--ink);
  font-family: var(--font-display);
  touch-action: manipulation;
}

#stage {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: var(--vv-height, 100dvh);
  max-width: 1180px;
  margin: 0 auto;
  padding:
    max(8px, var(--safe-top))
    max(12px, var(--safe-right))
    max(8px, var(--safe-bottom))
    max(12px, var(--safe-left));
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

/* =========================================================
   TOP HUD BAR
   ========================================================= */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.hud-bar.hud-detached {
  transform: translateY(14px) rotate(-1.5deg);
}

.hud-bar.hud-flipped {
  transform: rotate(180deg);
}

.hud-bar.hud-hidden {
  opacity: 0;
  pointer-events: none;
}

.hud-left,
.hud-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.hud-home-btn {
  display: inline-flex;
  min-width: 36px;
}

.hud-brand-badge {
  appearance: none;
  background: var(--ink);
  color: var(--amber);
  border: var(--border-ink);
  box-shadow: 3px 3px 0 var(--vermilion);
  padding: 6px 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
}

.hud-brand-badge:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--vermilion);
}

.narrator-box {
  flex: 1;
  min-width: 0;
  background: var(--card-white);
  border: var(--border-ink);
  box-shadow: var(--shadow-offset);
  padding: 6px 11px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.narrator-tag {
  background: var(--ink);
  color: var(--yellow);
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

#hud-narrator-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.narrator-pop {
  animation: hudPop 0.22s ease;
}

@keyframes hudPop {
  0% {
    transform: scale(0.98);
    background-color: var(--yellow);
  }
  100% {
    transform: scale(1);
    background-color: var(--card-white);
  }
}

.death-pill {
  background: var(--card-white);
  border: var(--border-ink);
  box-shadow: var(--shadow-offset);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.death-skull {
  font-size: 0.88em;
}

.death-pill.death-hot {
  background: #FFE4E1;
  color: var(--vermilion);
}

.bp-pill {
  background: var(--card-white);
  border: var(--border-ink);
  box-shadow: var(--shadow-offset);
  padding: 6px 9px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.bp-pill.bp-garam {
  background: #FEF3C7;
  color: #92400E;
}

.bp-pill.bp-ambulance {
  background: #FFEDD5;
  color: #C2410C;
}

.bp-pill.bp-critical {
  background: var(--vermilion);
  color: #FFFFFF;
  animation: bpPulse 0.75s ease-in-out infinite;
}

@keyframes bpPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.ink-btn {
  appearance: none;
  background: var(--card-white);
  color: var(--ink);
  border: var(--border-ink);
  box-shadow: var(--shadow-offset);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.86rem;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.ink-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.ink-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.ink-btn:disabled {
  background: #D6D3CB;
  color: #57534E;
  cursor: not-allowed;
  transform: none;
  box-shadow: 2px 2px 0 var(--ink);
  opacity: 0.92;
}

.ui-widget--button {
  font-family: var(--font-mono);
  font-size: clamp(8.5px, 1.3cqw, 12px);
  line-height: 1.15;
  text-align: center;
  padding: clamp(5px, 1.2cqh, 9px) clamp(6px, 1.1cqw, 12px);
  min-height: clamp(28px, 6cqh, 42px);
  max-width: clamp(104px, 22cqw, 212px);
}

.ink-btn--yellow {
  background: var(--yellow);
}

.ink-btn--amber {
  background: var(--amber);
  color: var(--ink);
}

.ink-btn--white {
  background: var(--card-white);
  color: var(--ink);
}

.ink-btn--vermilion,
.ink-btn--danger {
  background: var(--vermilion);
  color: var(--card-white);
}

.ink-btn--emerald {
  background: var(--emerald);
  color: var(--card-white);
}

.ink-btn--icon {
  padding: 6px 9px;
  min-width: 36px;
  font-family: var(--font-mono);
}

.hud-roast-btn {
  background: #FFF3D6;
}

/* =========================================================
   HUD ROAST POPOVER
   ========================================================= */
.roast-popover {
  position: fixed;
  top: max(54px, calc(var(--safe-top) + 46px));
  right: max(12px, var(--safe-right));
  z-index: 68;
  width: min(290px, calc(100vw - 24px));
  background: var(--card-white);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roast-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roast-popover-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--ink);
  color: var(--amber);
  padding: 2px 7px;
}

.roast-close-btn {
  min-width: 28px;
  padding: 2px 7px;
}

.roast-popover-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-paper);
  border: 2.5px solid var(--ink);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.rank-title-chip {
  background: var(--vermilion);
  color: #FFFDF8;
  border: 2px solid var(--ink);
  padding: 2px 7px;
  font-weight: 800;
  font-size: 0.7rem;
}

/* =========================================================
   3-PAGE LEVEL SELECT ("3 SEASONS OF KALESH")
   ========================================================= */
.level-drawer {
  position: fixed;
  inset:
    max(10px, var(--safe-top))
    max(12px, var(--safe-right))
    max(10px, var(--safe-bottom))
    max(12px, var(--safe-left));
  margin: auto;
  width: min(960px, calc(100vw - 20px));
  max-height: calc(var(--vv-height, 100dvh) - 20px);
  background: var(--bg-paper);
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 14px;
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--ink);
  flex-shrink: 0;
}

.drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.drawer-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--vermilion);
  letter-spacing: 0.06em;
}

.drawer-header h2 {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drawer-share-btn {
  font-size: 0.78rem;
  padding: 6px 10px;
}

.level-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex-shrink: 0;
}

.level-tab-btn {
  padding: 8px 10px;
  background: var(--card-white);
  font-size: 0.84rem;
  justify-content: space-between;
}

.level-tab-btn.is-active {
  background: var(--amber);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.tab-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--ink);
  color: var(--card-white);
  padding: 1px 6px;
}

.level-pages-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  touch-action: pan-y;
  padding-right: 2px;
}

.level-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.season-banner {
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.season-banner--live {
  background: var(--card-white);
}

.season-banner--soon {
  background: #FFF1EE;
}

.season-banner--boss {
  background: #272522;
  color: var(--card-white);
}

.season-banner h3 {
  margin: 0 0 2px;
  font-size: clamp(0.88rem, 2vw, 1.05rem);
  font-weight: 800;
}

.season-banner p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.9;
}

.season-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  border: 2px solid var(--ink);
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.season-pill--live {
  background: var(--emerald);
  color: #FFFFFF;
}

.season-pill--vermilion {
  background: var(--vermilion);
  color: #FFFFFF;
}

.season-pill--dark {
  background: var(--amber);
  color: var(--ink);
}

/* Responsive Season 1 / 2 / 3 Grid: 5-col Desktop & Landscape, 3-col Portrait */
.level-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.level-item {
  width: 100%;
  min-height: 82px;
  padding: 8px 9px;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  text-align: left;
  gap: 5px;
  position: relative;
  background: var(--card-white);
}

.level-item.is-active {
  background: var(--yellow);
}

.level-item.is-cleared {
  background: #ECFDF5;
}

.level-item.is-active.is-cleared {
  background: var(--yellow);
}

.level-item.is-locked {
  background: #E2DDD0;
  color: #5C584F;
  cursor: pointer;
}

.level-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.level-code-tag {
  background: var(--ink);
  color: var(--card-white);
  padding: 1px 5px;
}

.level-item.is-active .level-code-tag {
  background: var(--vermilion);
}

.level-item-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.level-item-meta {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  opacity: 0.92;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.flawless-stamp {
  background: var(--amber);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 1px 4px;
  font-size: 0.6rem;
}

.check-stamp {
  background: var(--emerald);
  color: #FFFFFF;
  border: 1.5px solid var(--ink);
  padding: 0 4px;
  font-size: 0.65rem;
}

.season-stage-wrap {
  position: relative;
}

.slanted-stamp {
  position: sticky;
  top: 10px;
  z-index: 4;
  width: fit-content;
  margin: 0 auto -12px;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.7vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-2.2deg);
  pointer-events: none;
  text-align: center;
}

.slanted-stamp--vermilion {
  background: var(--vermilion);
  color: #FFFFFF;
}

.slanted-stamp--dark {
  background: var(--ink);
  color: var(--amber);
  border-color: var(--vermilion);
  box-shadow: 5px 5px 0 var(--vermilion);
}

.level-list--teaser {
  opacity: 0.92;
  padding-top: 8px;
}

.teaser-card {
  min-height: 74px;
  background: #EAE4D4;
  border: 2.5px dashed var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  color: #4A463F;
  cursor: default;
}

.teaser-card--boss {
  background: #2B2925;
  color: #E7E2D6;
  border: 3px solid var(--vermilion);
  box-shadow: 4px 4px 0 var(--vermilion);
  cursor: pointer;
}

.teaser-card--boss:hover {
  background: #3A3630;
}

.season-footer-bar {
  display: flex;
  justify-content: center;
  padding-top: 4px;
  padding-bottom: 2px;
}

.notify-btn {
  min-width: 200px;
  padding: 9px 18px;
  font-size: 0.9rem;
}

/* =========================================================
   16:9 GAME STAGE
   ========================================================= */
#stage-area {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage-wrapper {
  position: relative;
  box-sizing: content-box;
  aspect-ratio: 16 / 9;
  width: min(100%, calc((var(--vv-height, 100dvh) - 130px) * 16 / 9));
  max-width: 100%;
  max-height: 100%;
  background: var(--bg-paper);
  border: var(--border-ink);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* =========================================================
   FOURTH-WALL UI TRAP LAYER
   ========================================================= */
#ui-trap-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  container-type: size;
}

.ui-trap-popup {
  position: absolute;
  pointer-events: auto;
  background: var(--card-white);
  border: var(--border-ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 12px 14px;
  min-width: 210px;
  max-width: 290px;
  transform: translate(-50%, -50%);
}

.ui-trap-title {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ui-trap-body {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.35;
}

.ui-trap-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   LEVEL 1 FULL-SCREEN RAGE-BAIT PAYWALL OVERLAY
   ========================================================= */
.paywall-overlay {
  position: absolute;
  inset: 0;
  z-index: 22;
  pointer-events: auto;
  container-type: size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(26px, 8cqh, 44px) clamp(10px, 3cqw, 24px) clamp(8px, 3cqh, 20px);
  background-color: var(--bg-paper);
  background-image:
    radial-gradient(#D8D2C5 1.5px, transparent 1.5px),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 18px,
      rgba(20, 20, 20, 0.03) 18px,
      rgba(20, 20, 20, 0.03) 20px
    );
  background-size: 14px 14px, auto;
}

.paywall-ticker {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-bottom: 3px solid var(--ink);
  padding: clamp(3px, 1.1cqh, 7px) 44px clamp(3px, 1.1cqh, 7px) 10px;
  font-family: var(--font-mono);
  font-size: clamp(8.5px, 2.3cqh, 13px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: paywallTickerFlash 0.9s steps(2, start) infinite;
}

@keyframes paywallTickerFlash {
  0%, 49% {
    background: var(--ink);
    color: var(--yellow);
  }
  50%, 100% {
    background: var(--vermilion);
    color: var(--card-white);
  }
}

.paywall-real-close {
  position: absolute;
  top: clamp(3px, 1cqh, 7px);
  right: 6px;
  z-index: 6;
  width: 30px;
  height: 30px;
  appearance: none;
  background: var(--card-white);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.paywall-real-close:hover {
  background: var(--yellow);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.paywall-real-close.pw-pulse {
  animation: paywallRealXPulse 1.3s ease-in-out infinite;
}

@keyframes paywallRealXPulse {
  0%, 100% {
    transform: scale(1);
    background: var(--card-white);
    box-shadow: 2px 2px 0 var(--ink);
  }
  50% {
    transform: scale(1.1);
    background: var(--yellow);
    box-shadow: 3px 3px 0 var(--ink), 0 0 0 4px rgba(255, 214, 10, 0.45);
  }
}

.paywall-card {
  position: relative;
  width: min(88%, 480px);
  background: var(--card-white);
  border: var(--border-ink);
  box-shadow: clamp(4px, 1.3cqh, 7px) clamp(4px, 1.3cqh, 7px) 0 var(--ink);
  padding: clamp(8px, 3cqh, 20px) clamp(12px, 3cqw, 26px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(3px, 1.4cqh, 10px);
}

.paywall-card.pw-shaking {
  animation: paywallCardShake 0.34s ease;
}

@keyframes paywallCardShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  15% { transform: translateX(-7px) rotate(-2deg); }
  30% { transform: translateX(7px) rotate(1.8deg); }
  45% { transform: translateX(-5px) rotate(-1.3deg); }
  60% { transform: translateX(5px) rotate(1deg); }
  75% { transform: translateX(-2px) rotate(-0.5deg); }
}

.paywall-fake-close {
  position: absolute;
  top: clamp(4px, 1.1cqh, 8px);
  right: clamp(4px, 1.1cqh, 8px);
  width: clamp(18px, 3.8cqh, 22px);
  height: clamp(18px, 3.8cqh, 22px);
  appearance: none;
  background: #F0EDE5;
  color: #8A8478;
  border: 1.5px solid #C5BFB2;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.9cqh, 11px);
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.paywall-fake-close:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.paywall-title {
  margin: 0;
  padding-inline: 18px;
  font-size: clamp(13px, 4.5cqh, 25px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.paywall-subtitle {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(8.5px, 2.2cqh, 12.5px);
  font-weight: 600;
  line-height: 1.3;
  color: #3D3B36;
}

.paywall-pricing {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(5px, 1.4cqw, 10px);
  background: #FAF8F2;
  border: 2px solid var(--ink);
  padding: clamp(4px, 1.3cqh, 9px) clamp(8px, 2cqw, 14px);
  width: 100%;
}

.paywall-price-old {
  font-family: var(--font-mono);
  font-size: clamp(9.5px, 2.3cqh, 14px);
  font-weight: 700;
  color: #777;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.paywall-price-new {
  font-size: clamp(14px, 4.6cqh, 26px);
  font-weight: 800;
  color: var(--vermilion);
  line-height: 1;
}

.paywall-countdown {
  background: var(--ink);
  color: var(--yellow);
  padding: clamp(2px, 0.5cqh, 4px) clamp(5px, 1cqw, 8px);
  font-family: var(--font-mono);
  font-size: clamp(8px, 2cqh, 11.5px);
  font-weight: 700;
}

.paywall-social {
  background: #FFF9DB;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: clamp(2px, 0.7cqh, 4px) clamp(8px, 1.8cqw, 12px);
  font-family: var(--font-mono);
  font-size: clamp(8px, 2.1cqh, 11.5px);
  font-weight: 700;
  color: var(--ink);
}

.paywall-cta {
  width: 100%;
  justify-content: center;
  font-size: clamp(11px, 3cqh, 16px);
  padding: clamp(5px, 1.8cqh, 11px) 16px;
}

.paywall-toast {
  position: absolute;
  bottom: clamp(5px, 2cqh, 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 8;
  background: var(--vermilion);
  color: var(--card-white);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: clamp(3px, 1cqh, 6px) clamp(10px, 2cqw, 16px);
  font-family: var(--font-mono);
  font-size: clamp(9px, 2.3cqh, 13px);
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.paywall-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   SHAME REPLAY, DEATH SHARE PILL & CLEAR BANNERS
   ========================================================= */
.shame-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 25;
  background: var(--vermilion);
  color: var(--card-white);
  border: var(--border-ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.death-share-pill {
  position: absolute;
  bottom: clamp(6px, 1.5cqw, 12px);
  left: clamp(6px, 1.5cqw, 12px);
  z-index: 26;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: clamp(8.5px, 1.15cqw, 11px);
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--ink);
}

.fake-skip-pill {
  position: absolute;
  top: clamp(6px, 1.5cqw, 10px);
  left: clamp(6px, 1.5cqw, 10px);
  z-index: 26;
  padding: 5px 10px;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.25cqw, 11.5px);
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--ink);
}

.stage-banner {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(30, 29, 26, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.banner-card {
  background: var(--card-white);
  border: 3px solid var(--ink);
  box-shadow: 7px 7px 0 var(--ink);
  padding: clamp(12px, 2.4cqw, 22px) clamp(14px, 3cqw, 26px);
  max-width: min(94%, 560px);
  max-height: 94%;
  width: 100%;
  text-align: center;
  overflow-y: auto;
}

.banner-eyebrow {
  display: inline-block;
  background: var(--emerald);
  color: #FFFFFF;
  border: 2px solid var(--ink);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.banner-card h2 {
  margin: 0 0 6px;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  line-height: 1.2;
}

.banner-stats {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.5vw, 0.85rem);
  color: #333;
}

.season-complete-box {
  background: var(--bg-paper);
  border: 2.5px solid var(--ink);
  padding: 8px 10px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.banner-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   PORTRAIT ROTATE HINT, FOOTER HINT & TOUCH DECK
   ========================================================= */
.rotate-hint-pill {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-white);
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.rotate-hint-close {
  appearance: none;
  background: var(--bg-paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  padding: 0;
  cursor: pointer;
}

.controls-hint {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.85;
}

.touch-controls {
  display: none;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-group-left,
.touch-group-right {
  display: flex;
  gap: 12px;
  touch-action: none;
  align-items: flex-end;
}

.touch-btn {
  position: relative;
  appearance: none;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  border: var(--border-ink);
  box-shadow: var(--shadow-offset);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  width: 68px;
  height: 68px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: transform 60ms ease, box-shadow 60ms ease, opacity 60ms ease, background-color 60ms ease;
}

/* 12px invisible thumb hit-slop around every touch control */
.touch-btn::before {
  content: '';
  position: absolute;
  inset: -12px;
}

.touch-btn--jump {
  background: rgba(255, 214, 10, 0.92);
  width: 76px;
  height: 76px;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  transform: translateY(-12px);
}

.touch-btn.is-pressed {
  transform: scale(0.94);
  box-shadow: 1px 1px 0 var(--ink);
  background: var(--amber);
}

.touch-btn--jump.is-pressed {
  transform: translateY(-12px) scale(0.94);
  background: var(--emerald);
  color: #FFFFFF;
}

.hidden {
  display: none !important;
}

/* =========================================================
   HUD CLUE BUTTON, HINT PILL & PAPER-INK WIDGETS
   ========================================================= */
.hud-clue-slot {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ink-btn--clue {
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.76rem;
  padding: 5px 9px;
  animation: cluePopIn 0.24s cubic-bezier(0.22, 1.28, 0.36, 1) both;
}

.ink-btn--clue.is-revealed {
  background: var(--card-white);
}

@keyframes cluePopIn {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.86);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.clue-hint-pill {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: center;
  z-index: 24;
  pointer-events: none;
}

.clue-hint-card {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1cqw, 10px);
  max-width: min(68%, 500px);
  background: #FFF9DB;
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: clamp(4px, 0.9cqh, 6px) clamp(8px, 1cqw, 10px);
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 1.45vw, 0.78rem);
  font-weight: 700;
  line-height: 1.3;
  animation: cluePopIn 0.2s ease both;
}

.clue-hint-badge {
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 1px 6px;
  font-size: 0.72em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.clue-hint-close {
  pointer-events: auto;
  appearance: none;
  background: var(--card-white);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.clue-hint-close:hover {
  background: var(--vermilion);
  color: var(--card-white);
}

/* Interactive HUD / Stage Widgets */
.ui-widget {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  touch-action: none;
  user-select: none;
  z-index: 21;
}

.ui-widget--docked {
  position: static;
  transform: none;
}

.ui-widget--stacked {
  position: static;
  transform: none;
  pointer-events: auto;
  touch-action: none;
}

.ui-stack-tr {
  position: absolute;
  top: clamp(4px, 1.4cqh, 10px);
  right: clamp(6px, 1.2cqw, 12px);
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(3px, 1cqh, 6px);
  pointer-events: none;
}

.ui-widget-panel {
  background: var(--card-white);
  border: clamp(2px, 0.35cqw, 3px) solid var(--ink);
  box-shadow: clamp(2px, 0.45cqw, 4px) clamp(2px, 0.45cqw, 4px) 0 var(--ink);
  padding: clamp(4px, 1.1cqh, 8px) clamp(6px, 1.1cqw, 10px);
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.8cqh, 6px);
  font-family: var(--font-mono);
  font-size: clamp(8.5px, 2cqh, 12px);
  font-weight: 700;
  width: clamp(128px, 21cqw, 198px);
  max-width: clamp(128px, 32cqw, 198px);
}

@container (max-width: 520px) {
  .ui-widget-panel {
    width: clamp(102px, 31cqw, 148px) !important;
    max-width: 34cqw !important;
    padding: 3px 5px;
    gap: 2px;
    font-size: 8px;
  }

  .ui-widget-readout {
    font-size: 7.5px;
    padding: 0 3px;
  }

  .ui-slider-track {
    height: 11px;
  }

  .ui-slider-thumb {
    width: 11px;
    height: 16px;
  }

  .ui-widget--button {
    font-size: 8.5px;
    padding: 3px 6px;
    min-height: 24px;
  }

  .ui-bar-track {
    height: 8px;
  }
}

.ui-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(4px, 0.8cqw, 8px);
}

.ui-widget-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.ui-widget-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ui-widget-label {
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ui-widget-readout {
  background: var(--ink);
  color: var(--yellow);
  padding: 1px clamp(4px, 0.6cqw, 6px);
  font-size: clamp(8px, 1.85cqh, 11.5px);
  flex-shrink: 0;
}

.ui-slider-wave-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ui-slider-safe-tick {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translate(-50%, 100%);
  background: var(--emerald);
  color: var(--card-white);
  border: 1.5px solid var(--ink);
  padding: 0 3px;
  font-size: clamp(6.5px, 1.45cqh, 8.5px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes widgetDangerShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-2px, -1px); }
}

.ui-widget--danger-shake {
  border-color: var(--vermilion) !important;
  animation: widgetDangerShake 0.14s steps(2, start) infinite;
}

.ui-widget--danger-shake .ui-widget-icon svg {
  transform: scale(1.12);
}

.ui-widget--slider.is-safe .ui-widget-readout {
  background: var(--emerald);
  color: var(--card-white);
}

.ui-slider-track {
  position: relative;
  height: clamp(14px, 3.2cqh, 18px);
  background: #EAE5D9;
  border: 2.5px solid var(--ink);
  cursor: pointer;
  touch-action: none;
}

.ui-slider-track.has-safe-tick {
  margin-bottom: clamp(8px, 1.8cqh, 12px);
}

.ui-slider-track::before {
  content: '';
  position: absolute;
  inset: -12px -6px;
}

.ui-slider-safezone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(16, 185, 129, 0.34);
  border-left: 2.5px solid var(--emerald);
  border-right: 2.5px solid var(--emerald);
  pointer-events: none;
  z-index: 1;
}

.ui-slider-safezone.is-hinted {
  background: rgba(16, 185, 129, 0.56);
  box-shadow: inset 0 0 0 2px var(--emerald);
}

.ui-slider-fill {
  position: relative;
  height: 100%;
  background: var(--yellow);
  pointer-events: none;
  z-index: 2;
  opacity: 0.72;
}

.ui-slider-thumb {
  position: absolute;
  top: 50%;
  width: clamp(13px, 2cqw, 16px);
  height: clamp(20px, 4.4cqh, 25px);
  transform: translate(-50%, -50%);
  background: var(--card-white);
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  pointer-events: none;
  z-index: 3;
}

.ui-widget--slider.is-safe .ui-slider-thumb {
  background: var(--emerald);
}

.ui-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  background: var(--card-white);
  color: var(--ink);
  border: var(--border-ink);
  box-shadow: var(--shadow-offset);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.ui-toggle-pill {
  border: 2px solid var(--ink);
  padding: 1px 7px;
  background: #EAE5D9;
  color: var(--ink);
}

.ui-toggle-btn[aria-pressed='true'] .ui-toggle-pill {
  background: var(--emerald);
  color: var(--card-white);
}

.ui-bar-track {
  position: relative;
  height: clamp(10px, 2.3cqh, 14px);
  background: #EAE5D9;
  border: 2px solid var(--ink);
  overflow: hidden;
}

.ui-bar-fill {
  height: 100%;
  background: var(--emerald);
  transition: width 0.05s linear;
}

.ui-bar-fill--danger {
  background: var(--vermilion);
}

.ui-bar-fill--yellow {
  background: var(--yellow);
}

.ui-bar-fill--sannata {
  background: #6D28D9;
}

@keyframes widgetSlideInRight {
  0% {
    opacity: 0;
    transform: translateX(18px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pausePulse {
  0%, 100% { box-shadow: 4px 4px 0 var(--ink); }
  50% { box-shadow: 5px 5px 0 var(--ink), 0 0 0 2px var(--yellow); }
}

.pause-btn--pulse {
  animation: pausePulse 1.1s ease-in-out infinite;
}

.ui-bar-fill--blink {
  opacity: 0.25;
}

.ui-widget--slide-in {
  animation: widgetSlideInRight 0.24s cubic-bezier(0.22, 1.24, 0.36, 1) both;
}

/* =========================================================
   MAXIMUM-ROAST MAIN MENU ("KALESH" EDITORIAL COVER)
   ========================================================= */
.main-menu-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: var(--bg-paper);
  background-image:
    radial-gradient(rgba(30, 29, 26, 0.07) 1.2px, transparent 1.2px),
    linear-gradient(to right, rgba(30, 29, 26, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 29, 26, 0.045) 1px, transparent 1px);
  background-size: 14px 14px, 32px 32px, 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow-y: auto;
  touch-action: pan-y;
  padding:
    max(12px, var(--safe-top))
    max(14px, var(--safe-right))
    max(12px, var(--safe-bottom))
    max(14px, var(--safe-left));
}

.menu-top-strip {
  width: 100%;
  max-width: 980px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.menu-issue-stamp {
  background: var(--ink);
  color: var(--amber);
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--vermilion);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 1.5vw, 0.78rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.menu-rank-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-rank-badge {
  background: var(--card-white);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: clamp(0.66rem, 1.5vw, 0.8rem);
  font-weight: 800;
}

.rank-title-text {
  background: var(--amber);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 1px 6px;
  font-size: 0.92em;
}

.menu-mini-btn {
  min-width: 34px;
  height: 34px;
  padding: 4px 8px;
  font-size: 0.86rem;
}

.menu-reset-btn.is-confirm {
  background: var(--vermilion);
  color: #FFFFFF;
  min-width: 68px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.main-menu-card {
  width: min(96%, 540px);
  background: var(--card-white);
  border: 4px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
  padding: clamp(16px, 3vw, 28px) clamp(16px, 4vw, 34px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  flex-shrink: 0;
}

.main-menu-card.is-shaking {
  animation: menuScreenShake 0.36s ease;
}

@keyframes menuScreenShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  18% { transform: translate(-8px, 3px) rotate(-1.5deg); }
  36% { transform: translate(8px, -3px) rotate(1.5deg); }
  54% { transform: translate(-6px, -2px) rotate(-1deg); }
  72% { transform: translate(5px, 2px) rotate(0.8deg); }
}

.hero-masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 2px;
}

.peeking-hero-wrap {
  margin-bottom: -11px;
  z-index: 2;
  animation: heroPeekBob 2.4s ease-in-out infinite;
}

.peeking-hero-svg {
  display: block;
  width: clamp(68px, 14vw, 90px);
  height: auto;
  filter: drop-shadow(3px 3px 0 var(--ink));
}

.peeking-pupil {
  animation: heroPupilGlance 4s steps(1, end) infinite;
}

@keyframes heroPeekBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes heroPupilGlance {
  0%, 62% { transform: translateX(0); }
  65%, 80% { transform: translateX(1.6px); }
  82%, 95% { transform: translateX(-1.5px); }
  100% { transform: translateX(0); }
}

.title-logo {
  margin: 0;
  background: var(--amber);
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--vermilion);
  padding: 6px clamp(16px, 5vw, 34px);
  font-family: var(--font-display);
  font-size: clamp(38px, 8.5vw, 72px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-shadow: 3px 3px 0 #FFFDF8;
  transform: rotate(-1.2deg);
}

.menu-ticker-box {
  width: 100%;
  min-height: 40px;
  background: var(--bg-paper);
  border: 2.5px solid var(--ink);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-ticker-text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.76rem, 2vw, 0.94rem);
  font-weight: 700;
  color: var(--ink);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.menu-ticker-text.is-switching {
  opacity: 0;
  transform: translateY(-4px);
}

.menu-primary-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.title-cta {
  width: 100%;
  min-height: 50px;
  font-size: clamp(1rem, 2.5vw, 1.24rem);
  padding: 11px 20px;
  letter-spacing: 0.03em;
}

.menu-secondary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.menu-sec-btn {
  min-height: 44px;
  font-size: clamp(0.74rem, 1.8vw, 0.86rem);
  padding: 8px 10px;
}

.menu-troll-footer {
  width: 100%;
  padding-top: 8px;
  border-top: 2px dashed rgba(30, 29, 26, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.easy-mode-switch {
  appearance: none;
  background: var(--bg-paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.easy-mode-track {
  display: inline-flex;
  align-items: center;
  background: #DCD6C7;
  border: 2px solid var(--ink);
  padding: 1px 6px;
}

.easy-mode-switch[aria-pressed='true'] .easy-mode-track {
  background: var(--emerald);
  color: #FFFFFF;
}

.easy-mode-switch.is-rejected {
  background: #FFE4E1;
  border-color: var(--vermilion);
}

.report-bug-link {
  appearance: none;
  background: transparent;
  border: none;
  padding: 4px 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #615D54;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.report-bug-link:hover {
  color: var(--vermilion);
}

.menu-bottom-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #5C584F;
  flex-shrink: 0;
  text-align: center;
}

/* =========================================================
   SKIP BUTTON & CAMPAIGN OVERLAY
   ========================================================= */
.skip-meme-btn {
  position: absolute;
  bottom: clamp(6px, 1.5cqw, 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 36;
  min-height: clamp(26px, 3.8cqw, 40px);
  padding: clamp(4px, 0.8cqw, 9px) clamp(10px, 2cqw, 16px);
  font-family: var(--font-mono);
  font-size: clamp(9.5px, 1.4cqw, 14px);
  font-weight: 800;
  gap: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  touch-action: manipulation;
}

.skip-meme-btn:hover {
  transform: translateX(-50%) translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.skip-meme-btn:active {
  transform: translateX(-50%) translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.skip-key-tag {
  background: var(--ink);
  color: var(--yellow);
  padding: 1px 6px;
  font-size: 0.78em;
  letter-spacing: 0.05em;
}

.campaign-overlay {
  position: absolute;
  inset: 0;
  z-index: 32;
  background: rgba(242, 238, 228, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 1.5cqw, 16px);
  pointer-events: auto;
}

.campaign-card {
  background: var(--card-white);
  border: clamp(2px, 0.4cqw, 3px) solid var(--ink);
  box-shadow: clamp(4px, 0.8cqw, 8px) clamp(4px, 0.8cqw, 8px) 0 var(--ink);
  padding: clamp(10px, 2cqw, 20px) clamp(14px, 2.5cqw, 26px);
  max-width: min(94%, 720px);
  max-height: 92%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(5px, 1cqw, 10px);
  text-align: center;
  overflow-y: auto;
}

.campaign-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(16px, 2.8cqw, 28px);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.campaign-quote {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.35cqw, 13px);
  font-weight: 700;
  color: #475569;
}

.campaign-levels-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(3px, 0.55cqw, 6px);
}

.campaign-level-pill {
  background: #FAF8F2;
  border: 2px solid var(--ink);
  padding: clamp(2px, 0.4cqw, 4px) clamp(4px, 0.7cqw, 7px);
  font-family: var(--font-mono);
  font-size: clamp(7.5px, 0.98cqw, 10px);
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.campaign-replay-btn {
  margin-top: 2px;
  font-size: clamp(11px, 1.45cqw, 14px);
  padding: clamp(5px, 0.85cqw, 9px) clamp(16px, 2.5cqw, 24px);
}

/* =========================================================
   GLOBAL KALESH TOAST
   ========================================================= */
.kalesh-toast {
  position: fixed;
  top: max(16px, calc(var(--safe-top) + 12px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  max-width: min(92vw, 460px);
  background: var(--ink);
  color: var(--yellow);
  border: 3px solid var(--amber);
  box-shadow: 5px 5px 0 var(--vermilion);
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: clamp(0.74rem, 2vw, 0.86rem);
  font-weight: 800;
  text-align: center;
  pointer-events: none;
  animation: toastPop 0.18s ease both;
}

/* =========================================================
   SETTINGS & THERMAL RECEIPT MODALS
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(30, 29, 26, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(12px, var(--safe-top))
    max(12px, var(--safe-right))
    max(12px, var(--safe-bottom))
    max(12px, var(--safe-left));
}

.settings-card,
.receipt-card-dialog {
  width: min(100%, 440px);
  max-height: 92%;
  overflow-y: auto;
  background: var(--card-white);
  border: 3px solid var(--ink);
  box-shadow: 7px 7px 0 var(--ink);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--vermilion);
  letter-spacing: 0.08em;
}

.settings-head h2 {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

.modal-close-btn {
  min-width: 44px;
  min-height: 44px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 2px dashed rgba(30, 29, 26, 0.25);
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 2px dashed rgba(30, 29, 26, 0.25);
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
}

.settings-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #5C584F;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.seg-btn,
.settings-toggle-btn {
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.seg-btn.is-selected,
.settings-toggle-btn.is-selected {
  background: var(--emerald);
  color: #FFFFFF;
}

.receipt-preview-wrap {
  background: var(--bg-paper);
  border: 2.5px solid var(--ink);
  padding: 10px;
  display: flex;
  justify-content: center;
}

.receipt-preview-img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  border: 2px solid var(--ink);
}

.receipt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.receipt-actions a,
.receipt-actions button {
  min-height: 44px;
  text-decoration: none;
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

body.is-touch-hidden .touch-controls {
  display: none !important;
}

body.is-left-handed .touch-controls {
  flex-direction: row-reverse;
}

.menu-faq-details {
  width: min(100%, 560px);
  background: var(--card-white);
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.menu-faq-summary {
  padding: 6px 10px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-faq-summary::-webkit-details-marker {
  display: none;
}

.menu-faq-summary::after {
  content: '▾';
  font-size: 0.85rem;
}

.menu-faq-details[open] .menu-faq-summary::after {
  content: '▴';
}

.menu-faq-body {
  padding: 6px 10px 8px;
  border-top: 2px dashed rgba(30, 29, 26, 0.25);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-faq-body p {
  margin: 0;
}

.noscript-fallback {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono);
}

@keyframes toastPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =========================================================
   RESPONSIVE: SMALL VIEWPORTS & MOBILE PORTRAIT / LANDSCAPE
   ========================================================= */
@media (max-width: 767px) {
  .hud-brand-badge,
  .death-label,
  .skip-key-tag,
  .controls-hint,
  .drawer-share-btn .share-full-text {
    display: none;
  }

  .ink-btn,
  .death-pill {
    font-size: 0.76rem;
    padding: 5px 8px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .ink-btn--icon {
    min-width: 32px;
    min-height: 34px;
    padding: 4px 6px;
    position: relative;
  }

  .bp-pill {
    font-size: 0.64rem;
    padding: 4px 6px;
    box-shadow: 2px 2px 0 var(--ink);
  }

  .clue-hint-pill {
    top: 4px;
    left: 6px;
    right: 6px;
    justify-content: flex-start;
  }

  .clue-hint-card {
    max-width: 62%;
    font-size: clamp(7.5px, 2.1vw, 10px);
    padding: 4px 6px;
    gap: 5px;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--ink);
  }
}

/* Mobile Portrait (360x640, 390x844 and similar): upper 16:9 canvas + bottom control deck */
@media (max-width: 767px) and (orientation: portrait),
       (pointer: coarse) and (orientation: portrait) {
  #stage {
    padding:
      max(8px, var(--safe-top))
      max(8px, var(--safe-right))
      max(10px, var(--safe-bottom))
      max(8px, var(--safe-left));
    gap: 7px;
  }

  .hud-bar {
    flex-wrap: wrap;
    gap: 5px;
  }

  .hud-left,
  .hud-right {
    gap: 5px;
    flex-wrap: wrap;
  }

  .narrator-box {
    order: 3;
    flex-basis: 100%;
    font-size: 0.72rem;
    padding: 5px 8px;
  }

  #hud-narrator-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  #stage-area {
    flex: 0 0 auto;
    width: 100%;
  }

  #stage-wrapper {
    width: min(100%, calc(46dvh * 16 / 9));
  }

  .touch-controls {
    display: flex;
    width: 100%;
    margin-top: auto;
    background: #E6DFCF;
    border: 3px solid var(--ink);
    box-shadow: 5px 5px 0 var(--ink);
    padding: 16px 14px 10px;
  }

  .touch-btn {
    width: 68px;
    height: 68px;
  }

  .touch-btn--jump {
    width: 76px;
    height: 76px;
    transform: translateY(-10px);
  }

  .touch-btn--jump.is-pressed {
    transform: translateY(-10px) scale(0.94);
  }

  .level-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .level-item {
    min-height: 76px;
    padding: 6px 7px;
  }

  .level-item-name {
    font-size: 0.7rem;
  }

  .drawer-header {
    flex-wrap: wrap;
  }

  .level-tab-btn {
    padding: 6px 6px;
    font-size: 0.72rem;
    flex-direction: column;
    gap: 2px;
  }

  .menu-secondary-row {
    grid-template-columns: 1fr;
  }
}

/* Mobile Landscape (844x390, 932x430 and short coarse-pointer viewports):
   centered 16:9 canvas + Auto Outside gutters or translucent Overlay corner controls */
@media (orientation: landscape) and (max-height: 500px),
       (pointer: coarse) and (orientation: landscape) and (max-width: 960px) {
  #stage {
    padding:
      max(4px, var(--safe-top))
      max(10px, var(--safe-right))
      max(4px, var(--safe-bottom))
      max(10px, var(--safe-left));
    gap: 4px;
  }

  .hud-brand-badge,
  .death-label,
  .controls-hint,
  .rotate-hint-pill,
  .skip-key-tag {
    display: none !important;
  }

  .hud-bar {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .ink-btn,
  .death-pill,
  .bp-pill {
    font-size: 0.68rem;
    padding: 4px 6px;
    box-shadow: 2px 2px 0 var(--ink);
  }

  .ink-btn--icon {
    min-width: 30px;
    padding: 4px 6px;
  }

  .narrator-box {
    padding: 4px 8px;
    font-size: 0.7rem;
    box-shadow: 2px 2px 0 var(--ink);
  }

  .narrator-tag {
    display: none;
  }

  #stage-area {
    flex: 1;
    min-height: 0;
  }

  .touch-controls {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding:
      0
      max(10px, var(--safe-right))
      max(10px, var(--safe-bottom))
      max(10px, var(--safe-left));
    z-index: 35;
    pointer-events: none;
    align-items: flex-end;
    justify-content: space-between;
  }

  .touch-group-left,
  .touch-group-right {
    pointer-events: auto;
    gap: 8px;
  }

  .touch-btn {
    width: 68px;
    height: 68px;
    background: rgba(242, 238, 228, 0.92);
  }

  .touch-btn--jump {
    width: 76px;
    height: 76px;
    background: rgba(255, 214, 10, 0.94);
    transform: translateY(-12px);
  }

  .touch-btn--jump.is-pressed {
    transform: translateY(-12px) scale(0.94);
  }

  .level-drawer {
    padding: 10px 12px;
    gap: 6px;
  }

  .level-item {
    min-height: 66px;
  }

  /* Compact Main Menu for 390px-tall Landscape phones */
  .main-menu-screen {
    justify-content: flex-start;
    gap: 6px;
    padding-top: max(6px, var(--safe-top));
    padding-bottom: max(6px, var(--safe-bottom));
  }

  .main-menu-card {
    width: min(96%, 680px);
    padding: 10px 18px;
    gap: 8px;
  }

  .peeking-hero-wrap {
    margin-bottom: -9px;
  }

  .peeking-hero-svg {
    width: 58px;
  }

  .title-logo {
    font-size: 36px;
    padding: 4px 20px;
  }

  .menu-ticker-box {
    min-height: 30px;
    padding: 4px 10px;
  }

  .title-cta {
    min-height: 38px;
    padding: 6px 16px;
    font-size: 0.94rem;
  }

  .menu-sec-btn {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 0.74rem;
  }

  .menu-bottom-note {
    display: none;
  }
}

/* Explicit Outside vs Overlay Landscape Modes driven by syncStageLayout */
body.is-landscape-touch.touch-mode-outside #stage-area {
  padding-left: 164px;
  padding-right: 92px;
}

body.is-landscape-touch.touch-mode-outside.is-left-handed #stage-area {
  padding-left: 92px;
  padding-right: 164px;
}

body.is-landscape-touch.touch-mode-outside .touch-btn {
  opacity: 1;
}

body.is-landscape-touch.touch-mode-overlay #stage-area {
  padding-left: 0;
  padding-right: 0;
}

body.is-landscape-touch.touch-mode-overlay .touch-btn {
  opacity: 0.55;
}

body.is-landscape-touch.touch-mode-overlay .touch-btn.is-pressed {
  opacity: 0.90;
}
