:root {
  --cave-floor: #120c08;
  --cave-deep: #0b0705;
  --amber-glow: #f59e0b;
  --amber-bright: #fbbf24;
  --ochre-fire: #ea580c;
  --bone-cream: #f8eedc;
  --bone-muted: #b8a084;
  --moss-green: #22c55e;
  --bonk-red: #dc2626;
  --paper-cream: #f6ecd5;
  --paper-shade: #e6d4b1;
  --paper-ink: #1e150f;
  --stamp-red: #b91c1c;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 26% 24%, rgba(234, 88, 12, 0.14) 0%, transparent 46%),
    radial-gradient(circle at 50% 0%, #241810 0%, var(--cave-floor) 55%, var(--cave-deep) 100%);
  color: var(--bone-cream);
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
.brand-title,
.secret-word-display,
.bonk-burst,
.primary-send-btn,
.giant-bonk-btn,
.party-timer {
  font-family: "Lilita One", "Impact", "Trebuchet MS", sans-serif;
  letter-spacing: 0.03em;
  font-weight: 400;
}

@keyframes bonkShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-10px, 6px) rotate(-1.3deg); }
  30% { transform: translate(11px, -7px) rotate(1.3deg); }
  45% { transform: translate(-8px, 5px) rotate(-0.9deg); }
  60% { transform: translate(7px, -4px) rotate(0.7deg); }
  80% { transform: translate(-3px, 2px) rotate(-0.3deg); }
}

.bonk-shake {
  animation: bonkShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.app-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px 36px;
}

.cave-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* =========================================================
   BORDERLESS FLOATING TOP BAR (Zero container boxes!)
   ========================================================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
}

.brand-title {
  margin: 0;
  font-size: 1.42rem;
  color: var(--amber-bright);
  text-shadow: 0 2px 10px rgba(234, 88, 12, 0.35);
  line-height: 1;
}

/* Ink-Underline Mode Tabs (No pill boxes!) */
.mode-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mode-tab {
  position: relative;
  background: none;
  border: none;
  padding: 6px 2px;
  color: var(--bone-muted);
  font-family: "Lilita One", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s ease;
}

.mode-tab:hover {
  color: var(--bone-cream);
}

.mode-tab.active {
  color: var(--amber-bright);
}

.mode-tab.active::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0;
  height: 3.5px;
  background: var(--amber-bright);
  border-radius: 999px;
  transform: rotate(-1.2deg);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.45);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-ghost-btn,
.hud-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 238, 210, 0.06);
  border: none;
  border-radius: 999px;
  color: var(--bone-muted);
  padding: 6px 11px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}

.hud-icon-btn {
  padding: 6px 9px;
}

.hud-ghost-btn:hover,
.hud-icon-btn:hover {
  color: var(--amber-bright);
  background: rgba(251, 191, 36, 0.13);
}

.hud-icon-btn.muted {
  opacity: 0.45;
}

/* =========================================================
   OPEN CAVE SCENE LAYOUT (Hero Grog + Floating Scrap + Trough)
   ========================================================= */
.cave-scene {
  display: grid;
  grid-template-columns: 455px 1fr;
  gap: 34px;
  align-items: start;
}

/* HERO 1: FRAMELESS LIVING GROG WINDOW + SPEECH BALLOON */
.grog-hero-zone {
  position: relative;
}

.portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  overflow: hidden;
  background: #120c08;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 220, 175, 0.1);
  cursor: pointer;
}

.grog-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.grog-video,
.grog-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.07s linear;
}

.grog-video.underlay {
  opacity: 1;
  z-index: 2;
}

.grog-video.active,
.grog-portrait.active {
  opacity: 1;
  z-index: 3;
}

.cave-bottom-melt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28%;
  background: linear-gradient(to bottom, transparent 0%, rgba(18, 12, 8, 0.88) 100%);
  z-index: 4;
  pointer-events: none;
}

@keyframes lensSmackFlash {
  0% { opacity: 0; }
  12% { opacity: 0.78; }
  100% { opacity: 0; }
}

.lens-impact-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0;
  background: radial-gradient(circle at 50% 48%, rgba(254, 240, 138, 0.9) 0%, rgba(220, 38, 38, 0.5) 44%, transparent 75%);
}

.lens-impact-flash.fire {
  animation: lensSmackFlash 0.38s ease-out forwards;
}

@keyframes torchPulse {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.22; }
}

.torch-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: radial-gradient(circle at 28% 24%, rgba(251, 191, 36, 0.16), transparent 56%);
  pointer-events: none;
  animation: torchPulse 3.2s infinite ease-in-out;
}

@keyframes bonkPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-18deg); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(7deg); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(0.86) rotate(0deg); }
}

.bonk-burst {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bonk-red);
  color: #fffbeb;
  font-size: 2.35rem;
  padding: 6px 24px;
  border-radius: 16px;
  border: 4px solid #fef08a;
  box-shadow: 0 8px 0 #7f1d1d, 0 14px 30px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  display: none;
  opacity: 0;
  z-index: 10;
  white-space: nowrap;
}

.bonk-burst.fire {
  display: block;
  animation: bonkPop 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* REAL COMIC SPEECH BALLOON OVERLAPPING GROG'S WORKBENCH */
.grog-speech-bubble {
  position: relative;
  z-index: 12;
  margin: -34px 18px 0;
  background: #231811;
  border-radius: 22px;
  padding: 13px 18px;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 232, 198, 0.14);
}

/* Speech bubble tail pointing straight up at Grog! */
.grog-speech-bubble::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 44px;
  width: 22px;
  height: 22px;
  background: #231811;
  transform: rotate(45deg);
  border-radius: 3px;
}

.grog-thought-text {
  position: relative;
  font-family: "Patrick Hand", "Fredoka", cursive, sans-serif;
  font-size: 1.28rem;
  line-height: 1.28;
  color: var(--bone-cream);
  margin: 0;
}

.grog-guess-inline {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed rgba(251, 191, 36, 0.28);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
}

.guess-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bone-muted);
}

.guess-word {
  font-family: "Lilita One", sans-serif;
  font-size: 1.18rem;
  color: var(--amber-bright);
  letter-spacing: 0.03em;
}

.grog-guess-inline.win .guess-word {
  color: #4ade80;
}

.grog-guess-inline.miss .guess-word {
  color: #fca5a5;
}

.grog-dub-line {
  font-family: "Patrick Hand", cursive, sans-serif;
  font-size: 1.04rem;
  color: #fde68a;
}

/* =========================================================
   RIGHT / LOWER PLAY ZONE (Open Cave Wall — Zero Wrapper Boxes!)
   ========================================================= */
.play-zone {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 4px;
}

/* Whisper-Light Chalk Status Line (No background, no border!) */
.chalk-whisper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
  font-size: 0.84rem;
  color: var(--bone-muted);
}

.round-dots-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(197, 176, 148, 0.55);
}

.round-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(197, 176, 148, 0.28);
}

.round-dot.current {
  color: var(--amber-bright);
  font-weight: 700;
}

.round-dot.current::before {
  background: var(--amber-bright);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.7);
}

.round-dot.solved {
  color: #86efac;
}

.round-dot.solved::before {
  background: var(--moss-green);
}

.round-dot.skipped {
  color: #94a3b8;
  text-decoration: line-through;
}

.round-dot.skipped::before {
  background: #64748b;
}

.chalk-stats-inline {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
}

.chalk-stats-inline strong {
  color: var(--bone-cream);
}

.bonks-stat strong {
  color: #fca5a5;
}

.chalk-sep {
  opacity: 0.4;
}

/* Borderless Lab Strip */
.lab-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(197, 176, 148, 0.18);
}

.lab-pack-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pack-pill {
  background: none;
  border: none;
  padding: 2px 0;
  color: var(--bone-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.pack-pill.active {
  color: var(--amber-bright);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.lab-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chalk-pill-toggle {
  background: rgba(251, 191, 36, 0.12);
  border: none;
  border-radius: 999px;
  padding: 4px 11px;
  color: var(--amber-bright);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.word-picker-select {
  background: rgba(255, 255, 255, 0.06);
  color: var(--bone-cream);
  border: none;
  border-radius: 8px;
  padding: 5px 9px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
}

/* HERO 2: PINNED TORN FIELD SCRAP (Stands out dramatically against open dark rock!) */
.field-scrap-card {
  position: relative;
  background:
    radial-gradient(circle at 92% 88%, rgba(120, 53, 15, 0.15), transparent 38%),
    linear-gradient(168deg, var(--paper-cream) 0%, var(--paper-shade) 100%);
  color: var(--paper-ink);
  border-radius: 4px 12px 6px 10px;
  padding: 20px 24px 18px;
  transform: rotate(-1.1deg);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.62),
    0 2px 0 rgba(120, 82, 40, 0.4);
}

.field-scrap-card.mystery-scrap {
  background:
    radial-gradient(circle at 85% 20%, rgba(217, 119, 6, 0.18), transparent 44%),
    linear-gradient(168deg, #f4e5c3 0%, #dfc798 100%);
}

.masking-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(2.1deg);
  width: 104px;
  height: 21px;
  background: rgba(246, 231, 193, 0.76);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.scrap-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.scrap-stamp {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stamp-red);
}

.scrap-target-note {
  font-family: "Patrick Hand", cursive, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #6b4a2b;
}

.secret-word-display {
  font-size: 2.75rem;
  margin: 4px 0 2px;
  color: #1a110b;
  letter-spacing: 0.04em;
  line-height: 1.02;
}

.secret-word-display.mystery-slots {
  letter-spacing: 0.12em;
  color: #5c3a1b;
}

.scrap-subnote {
  font-family: "Patrick Hand", cursive, sans-serif;
  font-size: 1.08rem;
  color: #593e24;
}

/* Red Ink Crossed-Out Words (No pill boxes!) */
.taboo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 7px;
  font-family: "Patrick Hand", cursive, sans-serif;
  font-size: 1.05rem;
  color: var(--stamp-red);
  font-weight: 700;
}

.taboo-label {
  text-transform: uppercase;
  font-size: 0.82rem;
  font-family: "Fredoka", sans-serif;
  letter-spacing: 0.05em;
}

.taboo-pill {
  color: #991b1b;
  text-transform: uppercase;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

/* CHALK CLUE LOG DIRECTLY ON OPEN CAVE ROCK (Zero boxes!) */
.clue-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
}

.clue-history:empty {
  display: none;
}

.history-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(197, 176, 148, 0.16);
}

.history-clue {
  font-family: "Patrick Hand", cursive, sans-serif;
  font-size: 1.18rem;
  color: var(--bone-cream);
}

.history-miss {
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 600;
}

/* HERO 3: SINGLE RECESSED CHISELED TROUGH (Zero outer wrapper card!) */
.carving-zone {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rune-slate-trough {
  position: relative;
  overflow: hidden;
  min-height: 62px;
  background: rgba(8, 5, 3, 0.72);
  border-bottom: 3px solid #4a3525;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  cursor: text;
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.75);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rune-slate-trough:focus-within {
  border-bottom-color: var(--amber-bright);
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.75), 0 4px 18px rgba(245, 158, 11, 0.14);
}

.rune-slate-trough.bonk-flash {
  border-bottom-color: var(--bonk-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35);
}

.slab-crack-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.crack-line {
  fill: none;
  stroke: #ef4444;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.carving-zone[data-cracks="1"] .crack-1 { opacity: 0.55; }
.carving-zone[data-cracks="2"] .crack-1,
.carving-zone[data-cracks="2"] .crack-2 { opacity: 0.75; }
.carving-zone[data-cracks="3"] .crack-1,
.carving-zone[data-cracks="3"] .crack-2,
.carving-zone[data-cracks="3"] .crack-3 { opacity: 1; }

@keyframes chipPop {
  0% { transform: scale(0.75); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.rune-chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #332318;
  color: var(--amber-bright);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 2px 0 #0d0805;
  animation: chipPop 0.12s ease-out;
  user-select: none;
}

.rune-chip-remove {
  background: none;
  border: none;
  color: var(--bone-muted);
  font-size: 0.98rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}

.live-word-input,
.human-guess-input {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 140px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--bone-cream);
  font-family: inherit;
  font-size: 1.08rem;
  font-weight: 600;
  padding: 4px 2px;
}

.live-word-input::placeholder,
.human-guess-input::placeholder {
  color: #705946;
  font-weight: 500;
}

.live-beat-badge {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.live-beat-badge.safe {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.live-beat-badge.danger {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.25);
}

.bonk-warning-line {
  color: #fca5a5;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0 4px;
  display: none;
}

.bonk-warning-line.visible {
  display: block;
}

.reverse-feedback-line {
  color: #fde68a;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0 4px;
}

.trough-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

/* Quiet Borderless Chalk Action Links (Replaces 3 bulky button boxes!) */
.chalk-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chalk-link-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  color: var(--bone-muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.14s ease;
}

.chalk-link-btn:hover:not(:disabled) {
  color: var(--amber-bright);
}

.chalk-link-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chalk-link-btn.listening {
  color: #f87171;
}

.chalk-turn-note {
  font-size: 0.8rem;
  color: rgba(197, 176, 148, 0.65);
}

/* Single Tactile Hero CTA Button */
.primary-send-btn {
  white-space: nowrap;
  background: linear-gradient(180deg, #fbbf24 0%, #ea580c 100%);
  color: #1c0f06;
  border: none;
  border-bottom: 4px solid #7c2d12;
  border-radius: 999px;
  padding: 11px 26px;
  font-size: 1.12rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.primary-send-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-send-btn:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.primary-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Cub 6+ Tap-to-Guess Choice Pebbles */
.cub-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cub-choice-tile {
  background: #271b12;
  border: none;
  border-bottom: 3px solid #0e0805;
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--amber-bright);
  font-family: "Lilita One", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.cub-choice-tile:disabled {
  opacity: 0.3;
  text-decoration: line-through;
}

/* Open Result Strip (No green/red dashboard card box!) */
.round-result-strip {
  display: none;
  padding: 6px 2px;
}

.round-result-strip.visible {
  display: block;
}

.result-headline {
  margin: 0 0 4px;
  font-size: 1.65rem;
  color: #86efac;
}

.round-result-strip.giveup .result-headline {
  color: #fdba74;
}

.result-subtext {
  margin: 0;
  font-size: 0.95rem;
  color: var(--bone-cream);
}

.result-grog-dub {
  margin: 4px 0 0;
  font-family: "Patrick Hand", cursive, sans-serif;
  font-size: 1.2rem;
  color: #fde68a;
}

.sample-clue-line {
  margin: 10px 0 14px;
  font-size: 0.9rem;
  color: var(--bone-muted);
}

.result-actions-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* Shift Summary & Friend Riddle */
.shift-summary-card,
.riddle-challenge-card {
  background: rgba(32, 22, 15, 0.85);
  border-radius: 20px;
  padding: 18px 20px;
}

.shift-summary-card {
  display: none;
}

.shift-summary-card.visible {
  display: block;
}

.summary-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-title {
  margin: 0;
  color: var(--amber-bright);
  font-size: 1.55rem;
}

.rank-stamp-badge {
  color: #fde68a;
  font-weight: 700;
  font-size: 0.88rem;
}

.summary-totals {
  color: var(--bone-muted);
  font-size: 0.9rem;
  margin: 6px 0 10px;
}

.spoiler-toggle-label {
  font-size: 0.85rem;
  color: var(--bone-cream);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.share-preview-pre {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 12px;
  color: var(--bone-cream);
  font-family: "Patrick Hand", monospace;
  font-size: 1.08rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 10px 0 14px;
}

.riddle-eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--amber-bright);
}

.riddle-clue-quote {
  margin: 6px 0;
  font-family: "Patrick Hand", cursive, sans-serif;
  font-size: 1.3rem;
  color: #fde68a;
}

.riddle-meta-line {
  margin: 0 0 10px;
  font-size: 0.84rem;
  color: var(--bone-muted);
}

.riddle-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.riddle-guess-input {
  flex: 1;
  min-width: 165px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-bottom: 2px solid #573f2d;
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--bone-cream);
  font-family: inherit;
  font-size: 0.96rem;
}

.riddle-feedback {
  margin: 8px 0 0;
  font-weight: 700;
  font-size: 0.9rem;
}

/* =========================================================
   COUCH PARTY ZONE (Clean & Open!)
   ========================================================= */
.party-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.party-timer {
  font-size: 2.5rem;
  color: var(--amber-bright);
  line-height: 1;
}

.party-score-inline {
  display: flex;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--bone-muted);
}

.party-good { color: #4ade80; }
.party-bad { color: #fca5a5; }

.peek-shield-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--bone-muted);
  cursor: pointer;
}

.party-scrap-card {
  text-align: center;
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.party-taboo-center {
  justify-content: center;
}

.party-secret-content.masked {
  filter: blur(16px);
  opacity: 0.14;
  user-select: none;
  pointer-events: none;
}

.peek-leather-flap {
  position: absolute;
  inset: 10px;
  background: #332013;
  border: 2px dashed #fbbf24;
  border-radius: 8px;
  color: var(--bone-cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  z-index: 5;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.flap-title {
  font-family: "Lilita One", sans-serif;
  font-size: 1.4rem;
  color: var(--amber-bright);
}

.flap-sub {
  font-size: 0.82rem;
  font-weight: 700;
}

.party-start-btn {
  width: 100%;
  font-size: 1.2rem;
  padding: 15px;
}

.party-live-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.giant-bonk-btn {
  width: 100%;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  color: #fffbeb;
  border: none;
  border-bottom: 6px solid #631010;
  border-radius: 20px;
  padding: 18px;
  font-size: 1.7rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.35);
}

.party-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.party-pass-btn {
  font-size: 0.96rem;
  padding: 10px 14px;
}

.party-sub-btn {
  flex: 1;
}

/* =========================================================
   CLEAN SETTINGS & TROPHY SHEETS
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 2, 0.82);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-backdrop.visible {
  display: flex;
}

.modal-card {
  max-width: 480px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  background: #211710;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.82);
}

.trophy-modal-card {
  max-width: 700px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title {
  margin: 0;
  color: var(--amber-bright);
  font-size: 1.4rem;
}

.drawer-section {
  margin-bottom: 16px;
}

.drawer-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bone-muted);
  margin-bottom: 8px;
}

.brain-tier-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tier-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  color: var(--bone-muted);
  border: none;
  border-radius: 12px;
  padding: 9px 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.tier-pill.active {
  background: rgba(251, 191, 36, 0.2);
  color: var(--amber-bright);
}

.drawer-action-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--bone-cream);
  border: none;
  border-radius: 12px;
  padding: 11px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.rules-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
  font-size: 0.9rem;
  color: var(--bone-cream);
}

.rules-list li {
  margin-bottom: 7px;
}

.trophy-subtitle {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--bone-muted);
}

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.trophy-tile {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 10px;
}

.trophy-tile.unlocked {
  background: rgba(245, 158, 11, 0.12);
}

.trophy-word {
  font-family: "Lilita One", sans-serif;
  font-size: 0.98rem;
  color: var(--amber-bright);
}

.trophy-tile.locked .trophy-word {
  color: #5c4938;
}

.trophy-dub {
  font-family: "Patrick Hand", cursive, sans-serif;
  font-size: 0.96rem;
  color: var(--bone-cream);
}

.trophy-best {
  font-size: 0.72rem;
  color: #86efac;
  font-weight: 700;
  margin-top: 3px;
}

/* =========================================================
   PHONE LAYOUT (<= 840px):
   FULL-WIDTH CINEMATIC GROG STAGE (390px wide, ~9x bigger!)
   + ZERO BOX CLUTTER!
   ========================================================= */
@media (max-width: 840px) {
  .app-shell {
    padding: 6px 14px 28px;
  }

  .brand-desk-prefix {
    display: none;
  }

  .top-bar {
    padding: 4px 0 8px;
    gap: 6px;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .mode-tabs {
    gap: 9px;
  }

  .mode-tab {
    font-size: 0.84rem;
    padding: 4px 1px;
  }

  .tier-ghost-btn {
    display: none;
  }

  .header-actions {
    gap: 2px;
  }

  .hud-icon-btn {
    padding: 5px 6px;
  }

  .cave-scene {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* EDGE-TO-EDGE FULL-WIDTH GROG STAGE ON PHONE! */
  .portrait-frame {
    margin: 0 -14px;
    width: calc(100% + 28px);
    aspect-ratio: 16 / 12.5;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.65);
  }

  .grog-backdrop,
  .grog-video,
  .grog-portrait {
    object-position: center 36%;
  }

  .bonk-burst {
    font-size: 1.85rem;
    padding: 5px 18px;
  }

  .grog-speech-bubble {
    margin: -26px 4px 0;
    padding: 10px 14px;
    border-radius: 18px;
  }

  .grog-speech-bubble::before {
    left: 32px;
    top: -9px;
    width: 18px;
    height: 18px;
  }

  .grog-thought-text {
    font-size: 1.12rem;
    line-height: 1.22;
  }

  .play-zone {
    gap: 11px;
    padding-top: 0;
  }

  .chalk-whisper-bar {
    font-size: 0.78rem;
  }

  .field-scrap-card {
    padding: 13px 16px 12px;
    transform: rotate(-0.6deg);
  }

  .secret-word-display {
    font-size: 1.95rem;
    margin: 2px 0;
  }

  .scrap-subnote {
    font-size: 0.96rem;
  }

  .rune-slate-trough {
    min-height: 52px;
    padding: 8px 12px;
  }

  .primary-send-btn {
    padding: 10px 20px;
    font-size: 1.02rem;
  }
}
