/* =========================================================================
   Playhouse — design tokens
   Theme: a theater marquee crossed with an arcade ticket booth.
   ========================================================================= */

:root {
  --ink: #14121c;
  --ink-raised: #201b2c;
  --velvet: #241f33;
  --velvet-line: #362f49;
  --cream: #f5efe6;
  --cream-dim: #cfc7ba;
  --gold: #ffc93c;
  --gold-dim: #b98f2a;
  --curtain: #e8435b;
  --teal: #2ec4b6;
  --purple-accent: #8c7ae6;

  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Work Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-deep: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

.hidden {
  display: none !important;
}


html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(140, 122, 230, 0.12), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(232, 67, 91, 0.10), transparent 40%);
  min-height: 100vh;
}

a { color: inherit; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

.mono { font-family: var(--font-mono); }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--purple-accent);
  outline-offset: 2px;
}

input {
  font-family: var(--font-body);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------------
   Marquee title + chase-light border (the signature element)
   --------------------------------------------------------------------- */

.marquee-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 201, 60, 0.5), 0 0 4px rgba(255, 201, 60, 0.8);
  line-height: 1;
}



.marquee-sub {
  text-align: center;
  color: var(--cream-dim);
  font-size: 1rem;
  margin-top: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chase-frame {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 3px;
  background: var(--ink-raised);
}

.chase-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0 14px,
    transparent 14px 28px
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: chase 1.4s linear infinite;
  opacity: 0.9;
}

@keyframes chase {
  to { background-position: 28px 0; }
}

/* ---------------------------------------------------------------------
   Layout shells
   --------------------------------------------------------------------- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 18px; align-items: center; }

.card {
  background: var(--velvet);
  border: 1px solid var(--velvet-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-deep);
}

/* ---------------------------------------------------------------------
   Ticket booth: create / join panel
   --------------------------------------------------------------------- */

.booth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

@media (max-width: 720px) {
  .booth { grid-template-columns: 1fr; }
}

.ticket {
  position: relative;
  background: var(--velvet);
  border: 1px solid var(--velvet-line);
  border-radius: var(--radius-md);
  padding: 28px 26px;
}

.ticket--stub {
  border-left: 3px dashed var(--gold-dim);
}

.ticket h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.ticket p.hint {
  color: var(--cream-dim);
  font-size: 0.9rem;
  margin: 0 0 18px;
}

.field {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--velvet-line);
  background: var(--ink);
  color: var(--cream);
  font-size: 1rem;
  margin-bottom: 12px;
}

.field--code {
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
  font-size: 1.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:active { transform: scale(0.98); }

.btn--gold {
  background: var(--gold);
  color: #2a1d05;
  box-shadow: 0 8px 22px rgba(255, 201, 60, 0.25);
}
.btn--gold:hover { box-shadow: 0 10px 26px rgba(255, 201, 60, 0.4); }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--velvet-line);
  color: var(--cream);
}
.btn--ghost:hover { border-color: var(--gold-dim); }

.btn--small { width: auto; padding: 10px 16px; font-size: 0.9rem; }
.btn--danger { background: var(--curtain); color: white; }

.error-text {
  color: var(--curtain);
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* ---------------------------------------------------------------------
   Game cabinets (landing page game picker)
   --------------------------------------------------------------------- */

.cabinets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 820px) {
  .cabinets { grid-template-columns: 1fr; }
}

.cabinet {
  background: var(--ink-raised);
  border-radius: var(--radius-md);
  padding: 22px;
  border-top: 4px solid var(--stripe, var(--gold));
  cursor: default;
}

.cabinet .kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.cabinet h3 { font-size: 1.25rem; margin: 6px 0 8px; }
.cabinet p { color: var(--cream-dim); font-size: 0.9rem; line-height: 1.5; margin: 0; }

.cabinet--doodle { --stripe: var(--teal); }
.cabinet--trivia { --stripe: var(--gold); }
.cabinet--wordbomb { --stripe: var(--curtain); }

/* selectable variant used inside the room lobby */
.cabinet--selectable { cursor: pointer; border: 1px solid var(--velvet-line); border-top: 4px solid var(--stripe, var(--gold)); transition: transform .12s ease, border-color .12s ease; }
.cabinet--selectable:hover { transform: translateY(-2px); }
.cabinet--selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }

/* ---------------------------------------------------------------------
   Room screen
   --------------------------------------------------------------------- */

.room-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  height: calc(100vh - 48px);
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .room-shell { grid-template-columns: 1fr; height: auto; padding: 12px; }
}

.panel {
  background: var(--velvet);
  border: 1px solid var(--velvet-line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--shadow-deep);
}

.sidebar-panel { height: 100%; overflow: hidden; }

.game-stage-panel {
  position: relative;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--velvet-line);
}

.panel h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream-dim);
  margin-bottom: 14px;
}

.room-code-badge {
  font-family: var(--font-mono);
  background: var(--ink);
  border: 1px dashed var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  letter-spacing: 0.2em;
  font-size: 0.95rem;
  text-align: center;
  color: var(--gold);
}

.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--ink-raised);
}

.player-row.is-me { border: 1px solid var(--gold-dim); }
.player-row.is-disconnected { opacity: 0.4; }

.avatar-dot {
  width: 14px; height: 14px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.player-name { flex: 1; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-score { font-family: var(--font-mono); font-size: 0.85rem; color: var(--cream-dim); }
.host-tag { font-size: 0.65rem; background: var(--gold); color: #2a1d05; padding: 2px 6px; border-radius: 6px; font-weight: 700; }

.game-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.game-status-label {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--cream);
}

.lobby-view-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 12px;
}

/* Cabinet Big Icons */
.cabinet-icon-large {
  font-size: 3rem;
  margin-bottom: 6px;
  line-height: 1;
}

/* Selected Cabinet Glowing Border */
.cabinet--selected {
  border-color: var(--gold) !important;
  box-shadow: 0 0 20px rgba(255, 201, 60, 0.4), 0 0 0 2px var(--gold) inset !important;
}

/* Continuous Gold Badge Pulse */
.coins-badge, .room-code-badge {
  animation: badgePulse 3s ease-in-out infinite alternate;
}

/* Home Page Booth Tabs */
.home-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.coins-badge {
  font-family: var(--font-mono);
  background: var(--ink-raised);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.booth-tabs-container {
  margin-top: 32px;
  background: var(--velvet);
  border: 1px solid var(--velvet-line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-deep);
}

.booth-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--velvet-line);
  padding-bottom: 12px;
}

.booth-tab-btn {
  background: var(--ink);
  color: var(--cream-dim);
  border: 1px solid var(--velvet-line);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.booth-tab-btn.active, .booth-tab-btn:hover {
  background: var(--gold);
  color: #2a1d05;
  border-color: var(--gold);
}

/* Animations */
.animate-pop {
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animate-fadeup {
  animation: fadeUp 0.5s ease-out;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------------------------------------------------------------
   Doodle Game & Interactive Top Dashes Typing
   --------------------------------------------------------------------- */

.masked-word-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.masked-word {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  letter-spacing: 0.4em;
  text-align: center;
  color: var(--gold);
  background: var(--ink);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--gold);
  width: 100%;
  max-width: 680px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.masked-word-container:hover .masked-word,
.masked-word-container.focused .masked-word {
  border-color: var(--teal);
  box-shadow: 0 0 16px rgba(46, 196, 182, 0.4);
}

.masked-word-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.doodle-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--ink-raised); border-radius: var(--radius-sm); border: 1px solid var(--velvet-line); }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.1s; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--cream); box-shadow: 0 0 0 2px var(--gold); }

.size-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--velvet); border: 1px solid var(--velvet-line); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.size-btn.active { border-color: var(--gold); background: var(--ink); box-shadow: 0 0 0 1px var(--gold); }
.size-dot { background: var(--cream); border-radius: 50%; display: block; }

.canvas-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--ink);
  border-radius: var(--radius-md);
  padding: 6px;
  border: 1px solid var(--velvet-line);
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.canvas-wrapper::-webkit-scrollbar,
.doodle-board::-webkit-scrollbar {
  display: none;
}

#doodle-canvas, #solo-doodle-canvas {
  background: var(--cream);
  border-radius: var(--radius-sm);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  width: 100%;
  max-width: 900px;
  height: auto;
  aspect-ratio: 900 / 540;
  display: block;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .canvas-wrapper {
    padding: 4px;
    height: 380px !important;
    max-height: 58vh !important;
    border-radius: 14px;
  }

  #doodle-canvas, #solo-doodle-canvas {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    object-fit: contain;
  }

  .masked-word {
    font-size: 1.4rem;
    letter-spacing: 0.25em;
    padding: 8px 12px;
  }

  .doodle-toolbar {
    padding: 6px;
    gap: 6px;
    justify-content: center;
  }
}

.masked-word { font-family: var(--font-mono); font-size: 1.8rem; letter-spacing: 0.35em; text-align: center; color: var(--gold); background: var(--ink); padding: 8px 14px; border-radius: var(--radius-sm); border: 1px dashed var(--gold-dim); }

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* Modal Backdrop & Overlay System */
.gif-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease;
}

.gif-modal-backdrop.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.gif-modal-content {
  background: var(--velvet-card);
  border: 2px solid var(--teal);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(46, 196, 182, 0.3);
  position: relative;
  z-index: 100000;
}

.gif-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gif-close-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--cream);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}

.gif-close-btn:hover {
  background: rgba(255, 71, 87, 0.6);
  transform: scale(1.1);
}

#doodle-rankings-btn {
  position: relative;
  z-index: 500 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.word-choice-btn { padding: 12px 18px; border-radius: var(--radius-sm); background: var(--ink-raised); color: var(--cream); border: 1px solid var(--velvet-line); font-size: 1rem; cursor: pointer; }
.word-choice-btn:hover { border-color: var(--gold); }

/* Dedicated Guesser Input */
.doodle-guesser-box {
  background: var(--ink-raised);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid var(--velvet-line);
  margin-top: 6px;
}

.guesser-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.guesser-input {
  flex: 1;
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------
   Trivia game
   --------------------------------------------------------------------- */

.trivia-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .trivia-options { grid-template-columns: 1fr; } }

.trivia-option {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--ink-raised);
  border: 1px solid var(--velvet-line);
  font-size: 1rem;
  text-align: left;
  color: var(--cream);
  cursor: pointer;
  transition: border-color 0.12s;
}
.trivia-option:hover { border-color: var(--purple-accent); }
.trivia-option.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.trivia-option.correct { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal) inset; }
.trivia-option.wrong { border-color: var(--curtain); box-shadow: 0 0 0 2px var(--curtain) inset; opacity: 0.75; }

/* ---------------------------------------------------------------------
   Word Bomb
   --------------------------------------------------------------------- */

.bomb-combo { font-family: var(--font-mono); font-size: 3rem; text-align: center; letter-spacing: 0.2em; color: var(--curtain); text-shadow: 0 0 16px rgba(232, 67, 91, 0.5); }
.bomb-timer-bar { height: 10px; border-radius: 6px; background: var(--ink-raised); overflow: hidden; }
.bomb-timer-fill { height: 100%; background: var(--curtain); transition: width 0.2s linear; }
.lives-row { display: flex; gap: 4px; }
.life-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--curtain); }
.life-dot.spent { background: var(--velvet-line); }

/* ---------------------------------------------------------------------
   Shared: timer, banners, leaderboard
   --------------------------------------------------------------------- */

.timer-badge {
  font-family: var(--font-mono);
  align-self: center;
  background: var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.95rem;
  color: var(--gold);
}

.banner {
  text-align: center;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--ink-raised);
  font-size: 1.05rem;
}

.leaderboard-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ink-raised); }
.leaderboard-rank { font-family: var(--font-mono); color: var(--gold); width: 24px; }
.leaderboard-name { flex: 1; }
.leaderboard-score { font-family: var(--font-mono); color: var(--cream-dim); }

.hidden { display: none !important; }
.score-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.solo-tab-btn {
  background: var(--ink);
  color: var(--cream-dim);
  border: 1px solid var(--velvet-line);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.solo-tab-btn.active, .solo-tab-btn:hover {
  background: var(--gold);
  color: #2a1d05;
  border-color: var(--gold);
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 14px;
  top: -20px;
  opacity: 0.9;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ---------------------------------------------------------------------
   Floating / Separate Chat Drawer
   --------------------------------------------------------------------- */

/* Modal overlay backdrops (Chat, GIF, Invite, Practice) */
.gif-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}


/* ---------------------------------------------------------------------
   Flying Coin Particles & Badge Pulse Animation
   --------------------------------------------------------------------- */

.flying-coin {
  position: fixed;
  pointer-events: none;
  z-index: 3000;
  font-size: 1.5rem;
  line-height: 1;
  user-select: none;
  filter: drop-shadow(0 2px 8px rgba(255, 201, 60, 0.8));
  will-change: transform, opacity;
}

.coins-badge-pulse {
  animation: coinsBadgeBounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes coinsBadgeBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.22); border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 201, 60, 0.7); }
  100% { transform: scale(1); }
}



.chat-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--velvet-line);
  margin-bottom: 8px;
}

.chat-close-btn {
  background: transparent;
  color: var(--cream-dim);
  font-size: 1.1rem;
  padding: 4px 8px;
  cursor: pointer;
}
.chat-close-btn:hover { color: var(--gold); }

.chat-badge {
  background: var(--curtain);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
  font-size: 0.88rem;
}

.chat-line .who { color: var(--gold); font-weight: 600; }
.chat-line.system { color: var(--cream-dim); font-style: italic; }
.chat-line.correct { color: var(--teal); font-weight: 600; }

.chat-input-row { display: flex; gap: 8px; margin-top: 10px; }
.chat-input-row .field { margin-bottom: 0; }
.chat-input-row .field:disabled {
  background: var(--ink);
  color: var(--cream-dim);
  cursor: not-allowed;
  opacity: 0.65;
  border-color: var(--velvet-line);
}
.chat-input-row .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.8);
}


/* ---------------------------------------------------------------------
   GIF Roast Modal & Cards
   --------------------------------------------------------------------- */

.gif-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 16px;
}

.gif-modal-content {
  background: var(--velvet);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.gif-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.gif-modal-header h3 { font-size: 1.2rem; color: var(--gold); }

.gif-close-btn {
  background: transparent;
  color: var(--cream-dim);
  font-size: 1.2rem;
  cursor: pointer;
}
.gif-close-btn:hover { color: var(--curtain); }

.gif-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.gif-cat-btn {
  background: var(--ink);
  color: var(--cream-dim);
  border: 1px solid var(--velvet-line);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
}
.gif-cat-btn.active, .gif-cat-btn:hover {
  background: var(--gold);
  color: #2a1d05;
  border-color: var(--gold);
  font-weight: 600;
}

.gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.gif-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--velvet-line);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.gif-card:hover {
  transform: scale(1.04);
  border-color: var(--gold);
  z-index: 2;
}

.gif-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gif-card-title {
  position: absolute;
  bottom: 0;
  inset-x: 0;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  font-size: 0.72rem;
  padding: 3px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Live GIF Toast Notifications */
.gif-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1200;
  pointer-events: none;
}

.gif-toast {
  background: var(--ink-raised);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 240px;
  animation: toastPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPop {
  from { transform: scale(0.6) translateY(-20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.gif-toast-header {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.gif-toast img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------------
   Crazy Canvas Background FX
   --------------------------------------------------------------------- */
#crazy-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: -1 !important;
  display: block !important;
  opacity: 0.85;
}

/* Ensure containers float over background canvas */
.home-page-container, .room-shell, .chat-drawer, .gif-modal-backdrop {
  position: relative;
  z-index: 2;
}


/* Crazy Neon Glowing Border Animation */
.chase-frame, .cabinet--selectable:hover, .room-shell {
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.3), 0 0 30px rgba(78, 205, 196, 0.2);
}

/* ---------------------------------------------------------------------
   Android / iOS App Style Opening Splash Overlay
   --------------------------------------------------------------------- */
.splash-screen-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: radial-gradient(circle at center, #261935 0%, #0a0812 100%) !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 24px !important;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.splash-screen-overlay.splash-hidden {
  opacity: 0 !important;
  transform: scale(1.1) !important;
  pointer-events: none !important;
  display: none !important;
}

.splash-content {
  text-align: center;
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-icon-wrapper {
  position: relative;
  margin-bottom: 24px;
}

.splash-big-icon {
  font-size: 6.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 25px rgba(255, 230, 109, 0.6));
  animation: splashPulse 2.5s ease-in-out infinite alternate;
}

@keyframes splashPulse {
  0% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 20px rgba(255, 230, 109, 0.5)); }
  100% { transform: scale(1.08) translateY(-8px); filter: drop-shadow(0 0 40px rgba(255, 230, 109, 0.9)); }
}

.splash-coins-ring {
  font-size: 2rem;
  margin-top: 8px;
  filter: drop-shadow(0 0 10px #ffb703);
  animation: coinsFloat 1.8s ease-in-out infinite alternate;
}

@keyframes coinsFloat {
  0% { transform: translateY(0) scale(0.95); }
  100% { transform: translateY(-5px) scale(1.08); }
}

.splash-app-title {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 6px;
  margin: 12px 0 6px;
  text-shadow: 0 0 30px rgba(255, 230, 109, 0.9), 0 4px 15px rgba(0,0,0,0.9);
}

.splash-tagline {
  font-size: 0.95rem;
  color: var(--cream-dim);
  margin-bottom: 28px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.splash-loader {
  width: 220px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--gold);
  border-radius: 999px;
  overflow: hidden;
}

.splash-loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 3s ease-in-out;
}

/* =========================================================================
   Guaranteed Modal Overlay Styles & Hidden Override
   ========================================================================= */

.gif-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(5px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  padding: 16px !important;
}

.gif-modal-backdrop.hidden,
.hidden {
  display: none !important;
}





