/* ==========================================================================
   HAPPY DIWALI — LIGHTS & CELEBRATION BINGO
   Aesthetic: Hand-Inked Watercolor Illustration on Warm Handmade Paper
   Inspired by the "Happy Diwali - Lights & Celebration" artwork
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Kalam:wght@400;700&family=Quicksand:wght@500;600;700&display=swap');

:root {
  /* Paper & Watercolor Surfaces */
  --paper-bg: #FAF5EA;
  --paper-warm: #F5ECD9;
  --paper-card: #FFFDF8;
  --paper-highlight: #FFF7E2;

  /* Watercolor Wash Palette */
  --wash-gold: #FCE092;
  --wash-marigold: #F9B852;
  --wash-amber: #F59342;
  --wash-terracotta: #EC7347;
  --wash-peach: #FDE5C3;

  /* Hand-Inked Line & Typography Palette */
  --ink-dark: #331F17;
  --ink-brown: #4E3227;
  --ink-muted: #7C5A4B;
  --ink-light: #A58574;

  /* Accents & Festive Status */
  --marigold: #F09819;
  --marigold-soft: #FFF0BD;
  --marigold-deep: #D97208;
  --kumkum: #D6492C;
  --kumkum-red: #D6492C;
  --kumkum-dark: #8F2118;
  --kumkum-soft: #FBE4DC;
  --diya-flame: #FFAE19;
  --diya-glow: rgba(255, 178, 36, 0.45);
  --mehendi-green: #2E7D47;
  --mehendi-soft: #E5F5EA;

  /* Sketch Borders & Shadows */
  --border-ink: 2px solid var(--ink-dark);
  --border-ink-thick: 2.5px solid var(--ink-dark);
  --shadow-sketch: 3px 4px 0px rgba(51, 31, 23, 0.85);
  --shadow-sketch-sm: 2px 3px 0px rgba(51, 31, 23, 0.8);
  --shadow-sketch-lg: 5px 6px 0px rgba(51, 31, 23, 0.88);
  --shadow-warm-glow: 0 10px 30px rgba(240, 152, 25, 0.22);

  /* Typography */
  --font-display: 'Amatic SC', cursive, sans-serif;
  --font-hand: 'Kalam', cursive, sans-serif;
  --font-body: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radii - organic hand-drawn feel */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --radius-full: 999px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--paper-bg);
  color: var(--ink-dark);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Handmade Watercolor Paper Texture & Wash Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 65% 55% at 50% 28%, rgba(252, 224, 146, 0.65) 0%, rgba(249, 184, 82, 0.35) 38%, rgba(236, 115, 71, 0.16) 65%, transparent 85%),
    radial-gradient(circle at 18% 22%, rgba(245, 147, 66, 0.28) 0%, transparent 45%),
    radial-gradient(circle at 82% 25%, rgba(252, 224, 146, 0.45) 0%, transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(249, 184, 82, 0.25) 0%, transparent 55%),
    var(--paper-bg);
}

/* Subtle organic paper grain overlay using SVG noise */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.18'/%3E%3C/svg%3E");
}

/* ==========================================================================
   TYPOGRAPHY matching "HAPPY DIWALI / LIGHTS & CELEBRATION"
   ========================================================================== */

.display-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dark);
  line-height: 0.95;
}

.display-subtitle {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-brown);
  line-height: 1.05;
}

.hand-note {
  font-family: var(--font-hand);
  color: var(--ink-brown);
}

/* ==========================================================================
   FLOATING SPARKLES & WATERCOLOR STARS
   ========================================================================== */

.sparkle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sketch-star {
  position: absolute;
  color: var(--ink-dark);
  opacity: 0.75;
  animation: twinkleFloat 5s ease-in-out infinite;
}

@keyframes twinkleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-6px) rotate(6deg) scale(1.08); }
}

/* ==========================================================================
   TOP NAVIGATION / HEADER BAR
   ========================================================================== */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.55rem 1.35rem;
  background: rgba(250, 245, 234, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: var(--border-ink);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-diya-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(255, 174, 25, 0.5));
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-titles h1 {
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 0.95;
  color: var(--ink-dark);
  white-space: nowrap;
}

.brand-titles span {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--kumkum);
  white-space: nowrap;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Connection Badge */
.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.3rem 0.72rem;
  background: var(--paper-card);
  border: var(--border-ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-dark);
  box-shadow: 1px 2px 0 var(--ink-dark);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.conn-pill:hover {
  transform: translate(-1px, -1px);
  background: var(--paper-highlight);
}

.conn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mehendi-green);
  border: 1.5px solid var(--ink-dark);
  flex-shrink: 0;
}

.conn-pill.http-sync {
  background: #E8F6F3;
  border-color: #1E8A8A;
}

.conn-pill.http-sync .conn-dot {
  background: #1E8A8A;
}

.conn-pill.disconnected {
  background: #FFEBEE;
  border-color: var(--kumkum);
}

.conn-pill.disconnected .conn-dot {
  background: var(--kumkum);
  animation: pulseDot 0.9s ease-in-out infinite alternate;
}

/* ==========================================================================
   HAND-INKED BUTTONS & CONTROLS
   ========================================================================== */

.btn-sketch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-dark);
  background: var(--paper-card);
  border: var(--border-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sketch-sm);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.btn-sketch:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sketch);
  background: var(--paper-highlight);
}

.btn-sketch:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 0px 1px 0px var(--ink-dark);
}

.btn-sketch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sketch.btn-toggle-active {
  background: #FFF0BD;
  border-color: var(--marigold);
  box-shadow: 2px 2px 0 var(--marigold);
  color: var(--ink-dark);
}

.btn-locked-action {
  background: linear-gradient(135deg, #F5ECD9 0%, #FFE082 100%);
  color: var(--ink-dark);
  border: 2px dashed var(--kumkum-dark);
}

.disabled-hint {
  opacity: 0.85;
  background: var(--paper-warm);
}

.btn-primary {
  background: linear-gradient(135deg, #FFD269 0%, #F59E2D 100%);
  color: var(--ink-dark);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #FFDC85 0%, #F7AA42 100%);
}

.btn-festive {
  background: linear-gradient(135deg, #F06A43 0%, #D6492C 100%);
  color: #FFFDF8;
}

.btn-festive:hover:not(:disabled) {
  background: linear-gradient(135deg, #F57B56 0%, #DF5538 100%);
  color: #FFFDF8;
}

.btn-lg {
  padding: 0.85rem 1.65rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
  border: var(--border-ink-thick);
  box-shadow: var(--shadow-sketch);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   WATERCOLOR CARDS & CONTAINERS
   ========================================================================== */

.sketch-card {
  position: relative;
  background: var(--paper-card);
  border: var(--border-ink-thick);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sketch);
  padding: 1.35rem;
}

.sketch-card-warm {
  background:
    radial-gradient(circle at top right, rgba(252, 224, 146, 0.4), transparent 60%),
    radial-gradient(circle at bottom left, rgba(249, 184, 82, 0.22), transparent 55%),
    var(--paper-card);
}

/* ==========================================================================
   VIEW 1: LANDING / ROLE SELECTION LOBBY (SEAMLESS WATERCOLOR STAGE)
   ========================================================================== */

.main-container {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 2.25rem;
}

.lobby-poster-stage {
  max-width: 960px;
  margin: 0 auto 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.poster-title-block {
  text-align: center;
  margin-bottom: -0.35rem;
  position: relative;
  z-index: 2;
}

.poster-main-heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.2vw, 4.25rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 0.9;
  color: var(--ink-dark);
}

.poster-sub-heading {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-brown);
  margin-top: 0.15rem;
}

/* ==========================================================================
   DUAL-MODE ARTWORK STAGE: LIGHTWEIGHT STATIC VS. 3D PARALLAX DEPTH
   ========================================================================== */

.static-scene-stage {
  position: relative;
  width: 100%;
  max-width: 490px;
  aspect-ratio: 800 / 705;
  max-height: 295px;
  margin: -0.15rem auto -0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  user-select: none;
}

.static-scene-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.parallax-scene-stage {
  position: relative;
  width: 100%;
  max-width: 490px;
  aspect-ratio: 800 / 705;
  max-height: 295px;
  margin: -0.15rem auto -0.6rem;
  isolation: isolate;
  pointer-events: none;
  z-index: 1;
  user-select: none;
}

/* Toggle visibility and GPU layer promotion based on data-depth-mode */
body[data-depth-mode="off"] .parallax-scene-stage,
body[data-depth-mode="off"] .picker-watermark-wash {
  display: none !important;
}

body[data-depth-mode="on"] .static-scene-stage {
  display: none !important;
}

body[data-depth-mode="on"] .parallax-layer {
  will-change: transform;
}

/* ==========================================================================
   LOBBY CENTERPIECE: 3D THREE.JS ROLLER VS. CLASSIC ARTWORK
   ========================================================================== */

.lobby-showcase-bar {
  position: relative;
  z-index: 5;
  margin: 0.9rem auto 0.9rem;
  display: flex;
  justify-content: center;
}

.lobby-mode-pills {
  display: inline-flex;
  padding: 0.3rem 0.35rem;
  background: var(--paper-warm);
  border: 2px solid var(--ink-dark);
  border-radius: var(--radius-pill);
  box-shadow: 2px 3px 0 var(--ink-dark);
  gap: 0.35rem;
}

.lobby-3d-stage {
  width: 100%;
  max-width: 540px;
  margin: 0 auto 1.25rem;
  position: relative;
  z-index: 3;
}

#lobby-roller-wrapper {
  max-width: 540px;
  margin: 0 auto;
}

#lobby-roller-canvas {
  max-width: 520px;
  height: 310px;
}

.lobby-art-stage {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 0.85rem;
  position: relative;
  z-index: 2;
}

/* Active navigation tab highlight */
body[data-view="lobby"] #btn-switch-lobby,
body[data-view="host"] #btn-switch-host,
body[data-view="player"] #btn-switch-player {
  background: var(--paper-highlight) !important;
  border-color: var(--kumkum-red) !important;
  color: var(--ink-dark) !important;
  font-weight: 700;
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.08), 2px 2px 0 var(--ink-dark);
}

.scene-mode-bar {
  position: relative;
  z-index: 4;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: center;
}

.scene-depth-pill {
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.95rem;
  font-size: 0.8rem;
  background: var(--paper-card);
}

body[data-depth-mode="on"] .scene-depth-pill {
  background: var(--kumkum-soft);
  border-color: var(--kumkum-red);
  color: var(--kumkum-dark);
}

.parallax-plane {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.layer-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Plane 1: Deep Background Pink & Golden Watercolor Cloud (Soft Depth-of-Field Blur) */
.plane-wash {
  z-index: 1;
}

.layer-wash-img {
  transform: scale(1.06);
  filter: blur(1px) saturate(1.06);
  opacity: 0.96;
}

/* Plane 2: Mid-Background Floating Hand-Inked Stars & Warm Glow Halo */
.plane-mid-stars {
  z-index: 2;
}

.scene-star {
  position: absolute;
  filter: drop-shadow(0 2px 6px rgba(255, 190, 60, 0.55));
  animation: twinkleFloat 4.5s ease-in-out infinite;
}

.cage-warm-halo {
  position: absolute;
  top: 26%;
  left: 34%;
  width: 32%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 130, 0.85) 0%, rgba(255, 165, 45, 0.35) 55%, transparent 75%);
  filter: blur(14px);
}

/* Plane 3: Focal Plane — Crisp Hand-Inked Festive Table & Rotary Bingo Cage */
.plane-table {
  z-index: 3;
}

.layer-table-img {
  filter: drop-shadow(0 12px 24px rgba(51, 31, 23, 0.18));
}

/* Plane 4: Foreground Out-of-Focus Bokeh Sparkles & Floating Petals */
.plane-foreground {
  z-index: 4;
}

.fg-bokeh-sparkle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFFFF 0%, #FFE082 55%, rgba(255, 174, 25, 0) 100%);
  box-shadow: 0 0 14px 3px rgba(255, 200, 70, 0.75);
  filter: blur(0.6px);
  animation: bokehPulse 3.2s ease-in-out infinite alternate;
}

.fg-petal {
  position: absolute;
  filter: blur(0.7px) drop-shadow(0 4px 8px rgba(51, 31, 23, 0.16));
}

@keyframes bokehPulse {
  0% { opacity: 0.65; transform: scale(0.88); }
  100% { opacity: 1; transform: scale(1.18); }
}

.lobby-actions-grid {
  position: relative;
  z-index: 3;
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.35rem;
  align-items: stretch;
}

/* Layered Parallax Watermarks inside Host Number Picker Stage */
.picker-watermark-wash {
  position: absolute;
  top: -18px;
  left: 50%;
  margin-left: -165px;
  width: 330px;
  opacity: 0.25;
  filter: blur(1.5px);
  pointer-events: none;
  z-index: 0;
}

.picker-watermark-art {
  position: absolute;
  top: -12px;
  left: 50%;
  margin-left: -155px;
  width: 310px;
  opacity: 0.13;
  pointer-events: none;
  z-index: 0;
}

.picker-stage > *:not(.picker-watermark-art):not(.picker-watermark-wash) {
  position: relative;
  z-index: 1;
}

.role-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.35rem;
}

.role-box-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: var(--border-ink);
  background: var(--wash-gold);
  box-shadow: 2px 2px 0 var(--ink-dark);
  font-size: 1.35rem;
}

.role-box h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.lobby-host-gate-note {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink-dark);
  background: var(--paper-warm);
  color: var(--ink-brown);
  font-size: 0.78rem;
  font-weight: 700;
}

.lobby-host-gate-note.unlocked {
  background: #E8F5E9;
  color: #1B5E20;
  border-color: #2E7D32;
}

.input-sketch {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-dark);
  background: #FFFFFF;
  border: var(--border-ink);
  border-radius: var(--radius-md);
  box-shadow: inset 1px 2px 4px rgba(51, 31, 23, 0.08);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-sketch:focus {
  border-color: var(--marigold-deep);
  box-shadow: 0 0 0 3px rgba(240, 152, 25, 0.25);
}

/* ==========================================================================
   VIEW 2: CENTRAL HOST ("NUMBER PICKER" SHOWCASE SCREEN)
   ========================================================================== */

.host-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.host-locked-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.05rem;
  background: linear-gradient(135deg, #FFF3D6 0%, #FFE082 100%);
  border: var(--border-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sketch-sm);
  color: var(--ink-dark);
  font-size: 0.9rem;
}

.host-locked-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.host-locked-banner-text span {
  font-size: 0.82rem;
  color: var(--ink-brown);
}

/* Left Column: Active Number Picker Drum, Callout, Controls & QR Join Card */
.host-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.picker-stage {
  text-align: center;
  padding: 1.5rem 1.25rem;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 224, 130, 0.75) 0%, rgba(249, 184, 82, 0.35) 50%, transparent 78%),
    var(--paper-card);
  position: relative;
  overflow: hidden;
}

.mode-pill-selector {
  display: inline-flex;
  background: var(--paper-warm);
  border: var(--border-ink);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-bottom: 1rem;
  box-shadow: 1px 2px 0 var(--ink-dark);
}

.mode-tab {
  border: none;
  background: transparent;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-brown);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-tab.active {
  background: var(--wash-gold);
  color: var(--ink-dark);
  border: 1.5px solid var(--ink-dark);
  box-shadow: 1px 1px 0 var(--ink-dark);
}

/* ==========================================================================
   3D ROTARY BINGO CAGE & BALL SELECTION STAGE
   ========================================================================== */
.roller-3d-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0.1rem auto 0.9rem;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 32%, #FFFDF7 0%, #FDF4DE 58%, #F7E5BC 100%);
  border: 2px solid var(--ink-dark);
  box-shadow: inset 0 2px 8px rgba(51, 31, 23, 0.08), 2px 3px 0 var(--ink-dark);
  padding: 0.35rem 0.4rem 0.6rem;
  cursor: grab;
  user-select: none;
  overflow: hidden;
}

.roller-3d-stage:active {
  cursor: grabbing;
}

.roller-3d-stage.is-roll-locked,
.roller-3d-stage.is-roll-locked:active {
  cursor: not-allowed;
}

.roller-stage-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(253, 248, 238, 0.94);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  pointer-events: all;
}

.roller-stage-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.roller-spinner-diya {
  font-size: 2.4rem;
  animation: diyaSpinPulse 1.2s ease-in-out infinite;
  display: inline-block;
}

@keyframes diyaSpinPulse {
  0% { transform: scale(0.9) rotate(0deg); filter: drop-shadow(0 0 4px rgba(255, 174, 25, 0.4)); }
  50% { transform: scale(1.2) rotate(180deg); filter: drop-shadow(0 0 18px rgba(255, 174, 25, 0.95)); }
  100% { transform: scale(0.9) rotate(360deg); filter: drop-shadow(0 0 4px rgba(255, 174, 25, 0.4)); }
}

.roller-loader-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--ink-dark);
  font-weight: 700;
  text-align: center;
  max-width: 80%;
}

.roller-3d-canvas {
  display: block;
  width: 100%;
  max-width: 420px;
  height: 290px;
  margin: 0 auto;
  touch-action: none;
}

.roller-stage-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.25rem 0.45rem 0.1rem;
  margin-top: -0.35rem;
  position: relative;
  z-index: 3;
}

.roller-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.32rem 0.7rem;
  background: var(--paper-highlight);
  border: 2px solid var(--ink-dark);
  border-radius: var(--radius-pill);
  box-shadow: 1px 2px 0 var(--ink-dark);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-brown);
  text-align: left;
  max-width: 175px;
  line-height: 1.2;
}

.roller-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--marigold);
  border: 1.5px solid var(--ink-dark);
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.roller-status-pill.is-rolling .roller-status-dot {
  background: var(--kumkum);
  animation: pulseDot 0.45s ease-in-out infinite alternate;
}

.roller-status-pill.is-reading .roller-status-dot {
  background: #22A06B;
  transform: scale(1.2);
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* Picked-Up 3D Ball Presentation Medallion */
.drawn-ball-medallion {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 36%, #FFFDF8 0%, #FFF9EC 56%, var(--ball-accent-band, #FFE082) 63%, var(--ball-accent-dark, #8A4800) 100%);
  border: 3.5px solid var(--ink-dark);
  box-shadow:
    3px 4px 0 var(--ink-dark),
    inset -6px -8px 14px rgba(122, 58, 12, 0.28),
    0 0 24px var(--ball-accent-glow, rgba(255, 174, 25, 0.5));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.3s ease;
}

.ball-3d-shine {
  position: absolute;
  top: 10px;
  left: 16px;
  width: 28px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  transform: rotate(-28deg);
  pointer-events: none;
}

.drawn-ball-medallion.rolling {
  animation: drumRollBounce 0.32s ease-in-out infinite alternate;
}

.drawn-ball-medallion.pickup-lift {
  animation: ballPickedUpAndRead 0.78s cubic-bezier(0.22, 1.35, 0.5, 1);
}

.drawn-ball-medallion.pop {
  animation: ballPopIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes drumRollBounce {
  0% { transform: scale(0.92) rotate(-8deg) translateY(2px); }
  100% { transform: scale(0.98) rotate(8deg) translateY(-2px); }
}

@keyframes ballPickedUpAndRead {
  0% {
    transform: translate(-55px, -38px) scale(0.32) rotate(-220deg);
    opacity: 0.35;
  }
  58% {
    transform: translate(0px, -8px) scale(1.18) rotate(8deg);
    opacity: 1;
    box-shadow:
      4px 8px 0 var(--ink-dark),
      0 0 42px rgba(255, 196, 37, 0.9);
  }
  82% {
    transform: translate(0px, 2px) scale(0.96) rotate(-3deg);
  }
  100% {
    transform: translate(0px, 0px) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes ballPopIn {
  0% { transform: scale(0.45) rotate(-25deg); opacity: 0.4; }
  65% { transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.drawn-letter-badge {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--kumkum);
  line-height: 1;
  margin-bottom: -2px;
  position: relative;
  z-index: 1;
}

.drawn-number-value {
  font-family: var(--font-body);
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--ink-dark);
  line-height: 1;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.drawn-ball-sub {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-brown);
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.callout-banner {
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  margin-bottom: 1rem;
  background: var(--paper-highlight);
  border: var(--border-ink);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 #fff;
}

.callout-title {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--kumkum);
  line-height: 1.2;
}

.callout-desc {
  font-size: 0.86rem;
  color: var(--ink-brown);
  margin-top: 0.15rem;
}

/* Host Stage Navigation Tabs */
.host-stage-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  background: var(--paper-warm);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--ink-dark);
  box-shadow: 2px 2px 0 var(--ink-dark);
}

.host-tab-btn {
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.host-tab-btn:hover {
  color: var(--ink-dark);
  background: rgba(255, 255, 255, 0.45);
}

.host-tab-btn.active {
  background: #fff;
  color: var(--ink-dark);
  box-shadow: 1px 2px 0 var(--ink-dark);
  border-color: var(--ink-dark);
}

.host-tab-panel.hidden {
  display: none !important;
}

.picker-controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.picker-quick-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.picker-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

/* Host Settings Dedicated Panel */
.host-settings-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: fadeIn 0.2s ease-out;
  padding: 0.25rem 0;
}

.settings-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1.5px dashed var(--ink-light);
}

.settings-panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink-dark);
  margin: 0;
  line-height: 1.2;
}

.settings-panel-sub {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0.2rem 0 0 0;
  line-height: 1.35;
}

.settings-group {
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  box-shadow: 2px 2px 0 var(--ink-dark);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.settings-group-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dark);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(45, 26, 17, 0.12);
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-field-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.settings-field-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-dark);
}

.settings-field-hint {
  font-size: 0.74rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.settings-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.settings-field-compact {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.settings-field-compact .settings-field-name {
  font-size: 0.78rem;
}

/* Recent History Strip */
.recent-strip {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1.5px dashed var(--ink-light);
}

.recent-strip-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.recent-balls-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-height: 40px;
}

.mini-ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper-warm);
  border: 2px solid var(--ink-dark);
  box-shadow: 1px 2px 0 var(--ink-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-dark);
}

.mini-ball:first-child {
  background: var(--wash-gold);
  transform: scale(1.08);
}

/* QR Code & Cloudflare Tunnel Card on Host Sidebar */
.qr-tunnel-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.qr-card-header h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.05em;
}

.qr-display-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.qr-svg-box {
  width: 116px;
  height: 116px;
  flex-shrink: 0;
  background: #FFFFFF;
  border: var(--border-ink);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-sketch-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-svg-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.join-url-box {
  font-size: 0.78rem;
  font-family: monospace;
  background: var(--paper-warm);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  word-break: break-all;
  color: var(--ink-dark);
}

/* Right Column: Master Caller Board & Connected Players / Claims */
.host-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.board-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.board-header-row h2 {
  font-family: var(--font-display);
  font-size: 2.35rem;
  letter-spacing: 0.05em;
}

.board-stats {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.stat-badge {
  padding: 0.35rem 0.85rem;
  background: var(--paper-warm);
  border: var(--border-ink);
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 1px 2px 0 var(--ink-dark);
}

/* 75-Ball B-I-N-G-O Master Board (5 rows x 16 cols with letter header) */
.master-board-75 {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bingo-master-row {
  display: grid;
  grid-template-columns: 48px repeat(15, minmax(0, 1fr));
  gap: 0.38rem;
  align-items: center;
}

.bingo-row-letter {
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--kumkum);
  color: #FFFDF8;
  border: 2px solid var(--ink-dark);
  box-shadow: 2px 2px 0 var(--ink-dark);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 90-Ball Tambola Master Grid (9 rows x 10 cols) */
.master-board-90 {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.42rem;
}

.board-cell {
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--paper-bg);
  border: 1.5px solid rgba(51, 31, 23, 0.35);
  color: var(--ink-muted);
  font-size: 0.96rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-cell.called {
  background: linear-gradient(135deg, #FFE082 0%, #F59E2D 100%);
  border: 2px solid var(--ink-dark);
  color: var(--ink-dark);
  box-shadow: 2px 2px 0 var(--ink-dark);
  transform: scale(1.03);
}

.board-cell.latest {
  background: linear-gradient(135deg, #FF7043 0%, #D6492C 100%);
  color: #FFFDF8;
  transform: scale(1.12);
  box-shadow: 2px 3px 0 var(--ink-dark), 0 0 14px rgba(214, 73, 44, 0.6);
  z-index: 2;
}

/* Prizes & Connected Players Panel */
.host-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.prizes-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.prize-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--paper-bg);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.prize-item.claimed {
  background: var(--wash-gold);
  box-shadow: 2px 2px 0 var(--ink-dark);
}

.prize-winner-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--kumkum);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.players-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.8rem;
  background: var(--paper-highlight);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 1px 2px 0 var(--ink-dark);
}

/* ==========================================================================
   VIEW 3: PLAYER BINGO CARD VIEW (MOBILE-FIRST ERGONOMIC DESIGN)
   ========================================================================== */

.player-layout {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.player-layout .player-caller-bar {
  margin-bottom: 0;
}

.player-layout .midround-notice-banner {
  margin: 0;
}

/* Live Caller Banner on Player Screen */
.player-caller-bar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1.05rem;
  margin-bottom: 0.85rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at left center, rgba(252, 224, 146, 0.78), transparent 68%),
    var(--paper-card);
}

.player-caller-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.player-live-ball {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.player-ball-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 36%, #FFFDF8 0%, #FFF9EC 56%, var(--ball-accent-band, #FFE082) 63%, var(--ball-accent-dark, #D97208) 100%);
  border: 2.5px solid var(--ink-dark);
  box-shadow:
    var(--shadow-sketch-sm),
    0 0 16px var(--ball-accent-glow, rgba(255, 174, 25, 0.4));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.player-ball-circle.rolling {
  animation: rollDiyaSpin 0.9s linear infinite;
  box-shadow: 0 0 20px rgba(255, 174, 25, 0.85), var(--shadow-sketch-sm);
}

@keyframes rollDiyaSpin {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg); }
}

.player-ball-circle.pop {
  animation: ballPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-ball-circle .letter {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--kumkum);
  line-height: 0.9;
}

.player-ball-circle .num {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
}

.player-callout-text {
  min-width: 0;
  flex: 1;
}

.player-caller-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.player-callout-text .callout-title {
  font-size: 1.08rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.player-caller-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.player-lit-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: var(--paper-warm);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-dark);
}

.player-recent-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.5rem;
  border-top: 1.5px dashed rgba(51, 31, 23, 0.2);
  overflow-x: auto;
  scrollbar-width: none;
}

.player-recent-bar::-webkit-scrollbar {
  display: none;
}

.player-recent-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding-top: 0.4rem;
  border-top: 1.5px dashed rgba(51, 31, 23, 0.2);
}

.player-recent-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.player-recent-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  padding: 2px 0;
}

.player-recent-pills::-webkit-scrollbar {
  display: none;
}

.recent-num-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--paper-warm);
  border: 1.5px solid var(--ink-dark);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-dark);
  flex-shrink: 0;
}

.recent-num-chip:first-child {
  background: var(--wash-gold);
}

/* Player Bingo Card Ticket */
.bingo-ticket-card {
  padding: 1.15rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(252, 224, 146, 0.45), transparent 65%),
    var(--paper-card);
  border: 3px solid var(--ink-dark);
  border-radius: 22px;
  box-shadow: var(--shadow-sketch-lg);
}

.ticket-top-ornament {
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px dashed rgba(51, 31, 23, 0.22);
}

.ticket-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ticket-top-ornament h2 {
  font-family: var(--font-display);
  font-size: 2.35rem;
  letter-spacing: 0.07em;
  line-height: 0.95;
}

.ticket-subtitle-tag {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--kumkum);
}

.ticket-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.28rem 0.55rem;
  font-size: 0.82rem;
  color: var(--ink-brown);
  margin-top: 0.25rem;
}

/* 5x5 Classic 75-Ball Player Grid */
.ticket-grid-75 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.ticket-grid-headers {
  margin-bottom: 0.4rem;
}

.ticket-col-header {
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--kumkum);
  color: #FFFDF8;
  border: 2px solid var(--ink-dark);
  box-shadow: 2px 2px 0 var(--ink-dark);
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticket-cell,
.tambola-cell,
.btn-sketch {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ticket-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 56px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  border: 2.5px solid var(--ink-dark);
  box-shadow: 2px 3px 0 var(--ink-dark);
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 4.8vw, 1.55rem);
  font-weight: 700;
  color: var(--ink-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, background-color 0.15s ease, box-shadow 0.1s ease;
  overflow: hidden;
  padding: 0;
}

.ticket-cell:active {
  transform: scale(0.94) translate(1px, 2px);
  box-shadow: 1px 1px 0 var(--ink-dark);
}

/* Marked with Festive Diya / Watercolor Kumkum Stamp */
.ticket-cell.marked {
  background:
    radial-gradient(circle at 50% 50%, #FFE596 0%, #F7A73B 100%);
  color: var(--ink-dark);
  border-color: var(--ink-dark);
}

.ticket-cell.marked:not(.free-space)::after {
  content: '🪔';
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: clamp(0.75rem, 2.8vw, 0.95rem);
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Subtle shimmer ring when a number has been called by Host (if assist enabled) */
.ticket-cell.called-hint:not(.marked) {
  background: #FFF9E6;
  box-shadow: 2px 3px 0 var(--ink-dark), inset 0 0 0 2.5px var(--marigold);
}

.ticket-cell.free-space {
  background: linear-gradient(135deg, #FCE092 0%, #F59342 100%);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  letter-spacing: 0.05em;
}

/* 3x9 Tambola Player Grid (90-Ball Mode) — Fits 100% width with NO horizontal scroll */
.ticket-grid-90-wrap {
  width: 100%;
}

.tambola-col-guides {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.28rem;
  margin-bottom: 0.3rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.ticket-grid-90 {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.32rem;
  width: 100%;
}

.tambola-cell {
  position: relative;
  height: 56px;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 2px solid var(--ink-dark);
  box-shadow: 2px 2px 0 var(--ink-dark);
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 3.8vw, 1.25rem);
  font-weight: 700;
  color: var(--ink-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, background-color 0.15s ease;
  padding: 0;
}

.tambola-cell:active:not(.empty) {
  transform: scale(0.93);
}

.tambola-cell.empty {
  background: var(--paper-warm);
  border-style: dashed;
  border-color: rgba(51, 31, 23, 0.3);
  box-shadow: none;
  cursor: default;
}

.tambola-cell.empty::before {
  content: '✦';
  color: rgba(51, 31, 23, 0.18);
  font-size: 0.75rem;
}

.tambola-cell.marked {
  background: radial-gradient(circle, #FFE596 0%, #F7A73B 100%);
}

.tambola-cell.marked::after {
  content: '🪔';
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 0.68rem;
  line-height: 1;
}

.tambola-cell.called-hint:not(.marked) {
  background: #FFF9E6;
  box-shadow: 2px 2px 0 var(--ink-dark), inset 0 0 0 2px var(--marigold);
}

/* Player Action Bar & Claim Section */
.player-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.claim-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.claim-buttons-grid .btn-sketch {
  white-space: normal;
  line-height: 1.25;
  text-align: center;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.player-Claim-Main {
  width: 100%;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 6vw, 2.05rem);
  letter-spacing: 0.08em;
  padding: 0.65rem 1rem;
}

.ticket-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.15rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ticket-tap-hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   CELEBRATION OVERLAY & MODAL (DIWALI FIREWORKS & WINNER ANNOUNCEMENT)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(51, 31, 23, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.celebration-modal {
  max-width: 520px;
  width: 100%;
  text-align: center;
  padding: 1.75rem 1.4rem;
  background:
    radial-gradient(circle at 50% 25%, #FFE082 0%, rgba(249, 184, 82, 0.35) 55%, var(--paper-card) 85%);
  border: 3px solid var(--ink-dark);
  border-radius: 26px;
  box-shadow: var(--shadow-sketch-lg), 0 0 60px rgba(255, 174, 25, 0.55);
  animation: ballPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration-modal h2 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  color: var(--kumkum);
  letter-spacing: 0.06em;
  line-height: 0.95;
  margin: 0.4rem 0;
}

.celebration-winner-name {
  font-family: var(--font-hand);
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--ink-dark);
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   TOAST NOTIFICATION ENGINE (Fixes N7)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 5.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: min(92vw, 480px);
  width: max-content;
  pointer-events: none;
}

.toast-bubble,
.sketch-toast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.25rem;
  background-color: #FFFDF8;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 238, 204, 0.45) 0%, transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #FFFDF8 100%);
  border: 2px solid #331F17;
  border-radius: 14px;
  box-shadow:
    0 10px 25px -4px rgba(51, 31, 23, 0.28),
    0 4px 10px -2px rgba(51, 31, 23, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: #331F17;
  line-height: 1.35;
  text-align: center;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
  animation: toastSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-bubble.toast-error,
.sketch-toast.toast-error {
  background-color: #FFF5F5;
  background-image: linear-gradient(180deg, #FFF9F9 0%, #FFF2F2 100%);
  border-color: #B71C1C;
  color: #900C0C;
  box-shadow:
    0 10px 25px -4px rgba(183, 28, 28, 0.25),
    0 4px 10px -2px rgba(183, 28, 28, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.toast-bubble.toast-success,
.sketch-toast.toast-success {
  background-color: #F4FBF4;
  background-image: linear-gradient(180deg, #FAFFFA 0%, #EEF9EE 100%);
  border-color: #1B5E20;
  color: #145A1A;
  box-shadow:
    0 10px 25px -4px rgba(27, 94, 32, 0.22),
    0 4px 10px -2px rgba(27, 94, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.toast-bubble.toast-info,
.sketch-toast.toast-info {
  background-color: #FFFDF8;
  border-color: #331F17;
  color: #331F17;
}

/* Host Mode Authentication Pill & Dimmed Button */
.host-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.26rem 0.65rem;
  background: var(--marigold-soft);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-dark);
}

.host-logout-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.76rem;
  color: var(--kumkum);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}
.host-logout-link:hover {
  color: #B71C1C;
}

.btn-dimmed,
.disabled-hint {
  opacity: 0.78;
  cursor: pointer !important;
  background: var(--paper-warm) !important;
  color: var(--ink-brown) !important;
  border-style: dashed !important;
}

.host-auth-error {
  animation: shakeX 0.3s ease-in-out;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ==========================================================================
   RESPONSIVE & MOBILE-FIRST OPTIMIZATIONS
   ========================================================================== */

@media (max-width: 1080px) {
  .host-layout {
    grid-template-columns: 1fr;
  }
  .host-Bottom-grid, .host-bottom-grid {
    grid-template-columns: 1fr;
  }
  .lobby-actions-grid {
    grid-template-columns: 1fr;
    max-width: 540px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  /* Streamlined Mobile Top Bar */
  .top-bar {
    padding: 0.38rem 0.65rem;
    gap: 0.3rem;
  }

  .top-bar:not(.play-top-bar) {
    flex-wrap: wrap;
  }

  .top-bar:not(.play-top-bar) .brand-cluster {
    width: 100%;
  }

  .top-bar:not(.play-top-bar) .top-bar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 0.3rem;
  }

  .play-top-bar {
    flex-wrap: nowrap;
    padding: 0.35rem 0.65rem;
  }

  .play-top-bar .top-bar-actions {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .brand-diya-icon {
    width: 28px;
    height: 28px;
  }

  .brand-titles h1 {
    font-size: 1.32rem;
  }

  .brand-titles span {
    font-size: 0.78rem;
  }

  .play-top-bar .brand-titles h1 {
    font-size: 1.18rem;
  }

  .play-top-bar .brand-titles span {
    font-size: 0.7rem;
  }

  /* On mobile main index view, keep navigation ultra-clean and hide verbose text badges */
  body[data-view="player"] #btn-switch-host,
  body[data-view="player"] #btn-switch-player,
  .top-bar:not(.play-top-bar) #connection-text,
  #sound-label {
    display: none;
  }

  .top-bar:not(.play-top-bar) .conn-pill {
    padding: 0.28rem 0.42rem;
    min-height: 36px;
  }

  .play-top-bar .conn-pill {
    padding: 0.24rem 0.5rem;
    font-size: 0.7rem;
    min-height: 34px;
  }

  .play-top-bar #connection-text {
    display: inline;
    font-size: 0.7rem;
  }

  #btn-sound-toggle {
    min-height: 36px;
    min-width: 36px;
    padding: 0.28rem 0.5rem;
  }

  .main-container {
    padding: 0.5rem 0.55rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
  }

  /* Compact Scene on Mobile so "Join on Your Phone" is immediately accessible */
  .static-scene-stage,
  .parallax-scene-stage {
    max-width: 320px;
    max-height: 215px;
    margin: -0.1rem auto -0.55rem;
  }

  .role-box {
    padding: 0.95rem;
  }

  /* Comfortable mobile touch targets */
  #avatar-selector .avatar-opt,
  .ticket-footer-row .btn-sm,
  .top-bar-actions .btn-sm {
    min-height: 38px;
    padding: 0.35rem 0.65rem;
  }

  /* Prevent iOS Safari zoom on input focus */
  .input-sketch {
    font-size: 16px;
    padding: 0.65rem 0.85rem;
  }

  /* Mobile Player View Ergonomics — Whole card + Claim button fit inside 390x844 */
  .play-main-container {
    padding: 0.45rem 0.55rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .player-layout {
    gap: 0.45rem;
  }

  .player-caller-bar {
    padding: 0.5rem 0.65rem;
    gap: 0.35rem;
    border-radius: 16px;
  }

  .player-caller-controls {
    gap: 0.25rem;
  }

  .player-caller-controls .btn-sm {
    min-height: 34px;
    padding: 0.22rem 0.52rem;
    font-size: 0.74rem;
  }

  .player-ball-circle {
    width: 48px;
    height: 48px;
  }

  .player-ball-circle .letter {
    font-size: 0.78rem;
  }

  .player-ball-circle .num {
    font-size: 1.32rem;
  }

  .player-callout-text .callout-title {
    font-size: 0.92rem;
  }

  .bingo-ticket-card {
    padding: 0.55rem 0.55rem 0.65rem;
    border-radius: 18px;
  }

  .ticket-top-ornament {
    margin-bottom: 0.38rem;
    padding-bottom: 0.3rem;
  }

  .ticket-top-ornament h2 {
    font-size: 1.68rem;
  }

  .ticket-subtitle-tag {
    font-size: 1.05rem;
  }

  .ticket-meta-row {
    font-size: 0.76rem;
    margin-top: 0.15rem;
  }

  /* 5x5 Classic Grid on Phone */
  .ticket-grid-headers {
    margin-bottom: 0.28rem;
  }

  .ticket-grid-75 {
    gap: 0.28rem;
  }

  .ticket-col-header {
    height: 29px;
    font-size: 1.35rem;
  }

  .ticket-cell {
    aspect-ratio: auto;
    height: 48px;
    min-height: 46px;
    border-width: 2px;
    border-radius: 10px;
    box-shadow: 1.5px 2px 0 var(--ink-dark);
    font-size: 1.18rem;
  }

  .ticket-cell.free-space {
    font-size: 0.92rem;
  }

  /* 3x9 Tambola Grid on Phone — All 9 columns visible with zero horizontal scroll! */
  .ticket-grid-90 {
    gap: 3px;
  }

  .tambola-col-guides {
    gap: 2px;
    font-size: 0.58rem;
  }

  .tambola-cell {
    height: 46px;
    border-width: 1.5px;
    border-radius: 6px;
    box-shadow: 1px 1.5px 0 var(--ink-dark);
    font-size: 0.95rem;
  }

  .tambola-cell.marked::after {
    font-size: 0.58rem;
    bottom: 1px;
    right: 1px;
  }

  .player-actions-bar {
    gap: 0.42rem;
    margin-top: 0.55rem;
  }

  .player-Claim-Main {
    font-size: 1.38rem;
    letter-spacing: 0.05em;
    padding: 0.44rem 0.65rem;
    min-height: 42px;
    white-space: nowrap;
  }

  /* Responsive 2-column prize grid on mobile so all chips are visible without sideways scrolling */
  .claim-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.32rem;
    overflow-x: visible;
    width: 100%;
  }

  .claim-buttons-grid .btn-sketch {
    width: 100%;
    min-height: 36px;
    padding: 0.28rem 0.4rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
  }

  /* Place Toast notifications cleanly below the mobile top bar */
  .toast-container {
    top: 6.35rem;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 92vw;
    width: max-content;
  }

  .play-page .toast-container {
    top: 3.85rem;
  }

  .bingo-master-row {
    grid-template-columns: 34px repeat(5, 1fr);
  }
  .bingo-row-letter {
    grid-row: span 3;
    height: 100%;
  }
}

/* ==========================================================================
   ENHANCEMENTS: LOCALHOST WARNING, ALL-CALLED MODAL & PLAY PAGE
   ========================================================================== */

.localhost-warning-badge {
  margin-top: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: #FFF3CD;
  color: #856404;
  border: 1.5px solid #FFEEBA;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.4;
  font-weight: 600;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
}

.all-called-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.all-called-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.all-called-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.55rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink-dark);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-dark);
  background: var(--paper-warm);
  box-shadow: 2px 2px 0 var(--ink-dark);
}

.all-called-ball.latest {
  background: var(--kumkum);
  color: #FFFFFF;
  border-color: var(--ink-dark);
  box-shadow: 2px 2px 0 var(--ink-dark), 0 0 10px rgba(184, 29, 19, 0.35);
}

.all-called-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--paper-warm);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
}

/* Dedicated mobile player page ergonomics */
.play-page {
  padding-bottom: 2.5rem;
}

.play-top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper-warm);
  border-bottom: 2px solid var(--ink-dark);
  padding: 0.45rem 0.85rem;
}

.play-main-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 0.75rem 0.65rem;
}

.play-section {
  width: 100%;
}

.play-join-card {
  margin: 0.5rem auto;
  max-width: 480px;
}

.play-avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.play-avatar-grid .avatar-opt {
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Live Room & Mid-Round Status Banners */
.room-status-banner {
  margin: 0 auto 0.75rem auto;
  max-width: 960px;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--ink-dark);
  box-shadow: 2px 2px 0 var(--ink-dark);
  background: var(--paper-highlight);
  color: var(--ink-dark);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.room-status-banner.status-live {
  background: #FFF3D6;
  border-color: #B8650B;
}

.room-status-banner.status-hosted {
  background: #E8F6F3;
  border-color: #1E8A8A;
}

.midround-notice-banner {
  margin: 0.55rem 0;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1.5px solid #B8650B;
  background: #FFF3D6;
  color: #5C3200;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 1px 2px 0 rgba(51, 31, 23, 0.2);
}

/* ==========================================================================
   MULTI-ROOM SYSTEM: OPEN ROOMS DIRECTORY, LOBBY GATE & ROOM PICKER
   ========================================================================== */

.nav-room-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.68rem;
  background: linear-gradient(135deg, var(--paper-highlight) 0%, var(--wash-gold) 100%);
  border: var(--border-ink);
  border-radius: var(--radius-pill);
  box-shadow: 1px 2px 0 var(--ink-dark);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-dark);
  white-space: nowrap;
}

.nav-room-pill strong {
  font-family: monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--kumkum-dark);
}

.open-rooms-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: rgba(245, 236, 217, 0.58);
  border: 1.5px dashed rgba(51, 31, 23, 0.38);
  border-radius: var(--radius-md);
}

.open-rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.open-rooms-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-brown);
}

.room-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.55rem;
  background: var(--paper-card);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-dark);
}

.rooms-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.48rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
  -webkit-overflow-scrolling: touch;
}

.room-pill-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.52rem 0.65rem;
  text-align: left;
  font-family: var(--font-body);
  background: var(--paper-card);
  border: 2px solid var(--ink-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sketch-sm);
  cursor: pointer;
  color: var(--ink-dark);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.room-pill-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sketch);
  background: var(--paper-highlight);
}

.room-pill-card:active {
  transform: translate(1px, 2px);
  box-shadow: 0 1px 0 var(--ink-dark);
}

.room-pill-card.selected {
  background: linear-gradient(135deg, #FFF3CE 0%, var(--wash-gold) 100%);
  border-color: var(--kumkum);
  box-shadow: 2px 3px 0 var(--kumkum-dark);
}

.room-pill-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.room-pill-code {
  font-family: monospace;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-pill-mode {
  flex-shrink: 0;
  padding: 0.08rem 0.42rem;
  border-radius: var(--radius-pill);
  background: var(--paper-warm);
  border: 1px solid rgba(51, 31, 23, 0.45);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-brown);
}

.room-pill-card.selected .room-pill-mode {
  background: var(--kumkum);
  border-color: var(--ink-dark);
  color: #FFFDF8;
}

.room-pill-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.rooms-empty-note {
  grid-column: 1 / -1;
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  line-height: 1.35;
}

.input-code-uppercase {
  text-transform: uppercase;
  font-family: monospace;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.input-code-uppercase::placeholder,
.input-pin-code::placeholder {
  text-transform: none;
  font-family: var(--font-body);
  letter-spacing: normal;
  font-weight: 500;
  font-size: 0.86rem;
}

.input-pin-code {
  font-family: monospace;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.room-lookup-pill {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.24rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(51, 31, 23, 0.25);
  background: var(--paper-warm);
  color: var(--ink-brown);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.room-lookup-pill.found {
  background: var(--mehendi-soft);
  border-color: var(--mehendi-green);
  color: #145A1A;
}

.room-lookup-pill.error {
  background: #FFF0F0;
  border-color: #D32F2F;
  color: #B71C1C;
}

/* Lobby Host Card: Create Room & Unlock Existing Tabs */
.active-host-resume-box {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  padding: 0.7rem 0.82rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #F0FAF3 0%, var(--mehendi-soft) 100%);
  border: 2px solid var(--mehendi-green);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sketch-sm);
}

.host-lobby-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.42rem;
  margin-bottom: 0.78rem;
  padding: 0.25rem;
  background: var(--paper-warm);
  border: 2px solid var(--ink-dark);
  border-radius: var(--radius-md);
  box-shadow: 2px 2px 0 var(--ink-dark);
}

.host-lobby-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.host-lobby-tab-btn:hover {
  color: var(--ink-dark);
  background: rgba(255, 255, 255, 0.48);
}

.host-lobby-tab-btn.active {
  background: var(--paper-card);
  color: var(--ink-dark);
  border-color: var(--ink-dark);
  box-shadow: 1px 2px 0 var(--ink-dark);
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.field-label-row label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-brown);
}

.field-hint-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.input-with-action {
  display: flex;
  align-items: stretch;
  gap: 0.42rem;
}

.input-with-action .input-sketch {
  flex: 1;
  min-width: 0;
}

.btn-input-addon {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.45rem 0.72rem;
}

#panel-host-create .mode-pill-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin-bottom: 0;
}

#panel-host-create .mode-tab {
  padding: 0.42rem 0.5rem;
  font-size: 0.78rem;
  text-align: center;
}

.checkbox-sketch-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.52rem 0.68rem;
  background: var(--paper-warm);
  border: 1.5px dashed rgba(51, 31, 23, 0.38);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-brown);
  line-height: 1.35;
  cursor: pointer;
}

.checkbox-sketch-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 0.1rem;
  accent-color: var(--kumkum);
  flex-shrink: 0;
  cursor: pointer;
}

.host-quick-rooms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.host-quick-room-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.24rem 0.6rem;
  background: var(--paper-warm);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-dark);
  box-shadow: 1px 1.5px 0 var(--ink-dark);
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.12s ease;
}

.host-quick-room-chip:hover {
  background: var(--wash-gold);
  transform: translate(-1px, -1px);
}

/* Host Screen Sidebar Room Banner & Private State */
.host-room-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.82rem 1rem;
  background: linear-gradient(135deg, var(--paper-highlight) 0%, rgba(252, 224, 146, 0.55) 100%);
}

#btn-host-visibility-toggle.is-private {
  background: var(--kumkum-soft);
  border-color: var(--kumkum);
  color: var(--kumkum-dark);
}

.room-code-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.75rem;
  margin-bottom: 0.65rem;
  background: var(--wash-gold);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-dark);
}

.room-code-modal-badge strong {
  font-family: monospace;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.room-tag-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.1rem 0.48rem;
  background: var(--wash-gold);
  border: 1.5px solid var(--ink-dark);
  border-radius: var(--radius-pill);
  font-family: monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-dark);
}

.ticket-meta-row > span {
  white-space: nowrap;
}

/* Mobile Player (/play) Selected Room Banner, Picker & Ticket Footer */
.play-selected-room-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.6rem 0.82rem;
  background: linear-gradient(135deg, var(--paper-highlight) 0%, rgba(252, 224, 146, 0.45) 100%);
  border: var(--border-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sketch-sm);
}

.play-room-picker {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ticket-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .nav-room-pill {
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
  }

  .rooms-list-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-height: 185px;
    gap: 0.38rem;
  }

  .room-pill-card {
    padding: 0.44rem 0.55rem;
  }

  .host-lobby-tab-btn {
    font-size: 0.8rem;
    padding: 0.42rem 0.45rem;
  }

  #panel-host-create .mode-tab {
    font-size: 0.72rem;
    padding: 0.38rem 0.3rem;
  }

  .ticket-footer-actions .btn-sm {
    min-height: 36px;
    padding: 0.3rem 0.62rem;
  }
}

