/* =============================================================
   INTRO CINEMATIC · overlays the poker table on first visit
   ============================================================= */

.intro-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: #000;
  pointer-events: all;
  transition: opacity 1.1s ease;
}
.intro-overlay.done { opacity: 0; pointer-events: none; }

#intro-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

.intro-ui {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 2;
  font-family: 'Instrument Serif', 'Didot', Georgia, serif;
  color: #f5f0e1;
}

.intro-title {
  position: absolute;
  top: 42%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 72px;
  letter-spacing: 0.4em;
  color: #daa520;
  opacity: 0;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  animation: introTitle 3s ease forwards 0.3s;
  font-style: italic;
  font-weight: 400;
}
.intro-title small {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.35em;
  color: rgba(245,240,225,0.55);
  margin-top: 14px;
}
@keyframes introTitle {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
}

.intro-tagline {
  position: absolute;
  bottom: 72px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Instrument Serif', 'Didot', Georgia, serif;
  font-size: 20px; font-style: italic;
  color: #daa520;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
.intro-tagline.show { opacity: 1; }
.intro-tagline b { color: #f5f0e1; font-style: normal; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.3em; display:block; margin-top: 8px; }
@keyframes fadeInTag { to { opacity: 1; } }

.intro-skip {
  position: absolute;
  top: 24px; right: 24px;
  background: transparent;
  border: 1px solid rgba(245,240,225,0.25);
  color: rgba(245,240,225,0.65);
  padding: 8px 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  cursor: pointer;
  pointer-events: all;
  border-radius: 100px;
  opacity: 0;
  animation: fadeInTag 0.5s ease forwards 1.5s;
  text-transform: uppercase;
  z-index: 3;
}
.intro-skip:hover {
  color: #daa520;
  border-color: #daa520;
}

.intro-vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
  z-index: 1;
}

/* Rewind button — shows after intro played */
.intro-rewind {
  position: fixed;
  bottom: 20px; left: 30px;
  z-index: 40;
  background: rgba(6,30,21,0.85);
  border: 1px solid rgba(218,165,32,0.3);
  color: #f5f0e1;
  padding: 8px 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  cursor: pointer;
  border-radius: 100px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  display: none;
}
.intro-rewind:hover { color: #daa520; border-color: #daa520; }

/* Hide EVERY poker-table element while intro/world is active */
body.intro-playing .poker-root,
body.intro-playing .poker-root > .stage,
body.intro-playing .poker-root > .table-surface,
body.intro-playing .poker-root > .rail,
body.intro-playing .poker-root > .dealer-bubble,
body.intro-playing .poker-root > .sound-mini,
body.intro-playing .bottom-nav {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
body:not(.intro-playing) .poker-root,
body:not(.intro-playing) .poker-root > .stage,
body:not(.intro-playing) .poker-root > .table-surface,
body:not(.intro-playing) .poker-root > .rail,
body:not(.intro-playing) .poker-root > .sound-mini,
body:not(.intro-playing) .bottom-nav {
  opacity: 1;
  transition: opacity 1.2s ease 0.2s;
}

/* Also kill the bg-effects + vignette when intro is active */
body.intro-playing .bg-effects,
body.intro-playing .vignette,
body.intro-playing .noise-overlay { display: none; }

/* ============================================================
   WORLD HUDS (seated / walking / table-cam)
   ============================================================ */
.world-hud {
  position: fixed; z-index: 250; /* above .intro-overlay (z-index 200) */
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 0.2em;
  pointer-events: none;
}
.world-hud.seated {
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 14px;
  pointer-events: all;
}
.world-btn {
  background: rgba(6, 30, 21, 0.85);
  border: 1px solid rgba(218, 165, 32, 0.35);
  color: #f5f0e1;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 11px; letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.world-btn.primary {
  background: #daa520;
  color: #0f3d2e;
  border-color: #daa520;
  font-weight: 700;
}
.world-btn:hover { transform: translateY(-1px); color: #daa520; border-color: #daa520; }
.world-btn.primary:hover { color: #0f3d2e; background: #f0c808; border-color: #f0c808; }

.world-hud.walking {
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.crosshair {
  width: 4px; height: 4px;
  background: #daa520;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(218, 165, 32, 0.25);
}
.walk-help {
  position: absolute; top: 24px; left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 30, 21, 0.85);
  border: 1px solid rgba(218, 165, 32, 0.3);
  color: #f5f0e1;
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 10px; letter-spacing: 0.25em;
  backdrop-filter: blur(8px);
}
.click-label {
  position: absolute; top: 54%; left: 52%;
  font-size: 10px; letter-spacing: 0.2em;
  color: #daa520;
}

/* Tooltip that follows cursor on interactive hover */
.world-tooltip {
  position: fixed;
  background: rgba(6, 30, 21, 0.92);
  border: 1px solid rgba(218, 165, 32, 0.5);
  color: #daa520;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 0.2em;
  border-radius: 4px;
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.world-tooltip.show { opacity: 1; transform: translateY(0); }

/* Flash veil for portal transitions */
.world-veil {
  position: fixed; inset: 0;
  background: #faf6ef;
  z-index: 180;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

/* "Click to explore" prompt at end of short cinematic */
.world-hud.ready-walk {
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
  pointer-events: all;
  background: linear-gradient(180deg, transparent 0%, transparent 50%, rgba(6,30,21,0.35) 100%);
  animation: readyWalkIn 0.8s ease both;
}
@keyframes readyWalkIn { from { opacity: 0; } to { opacity: 1; } }
.ready-walk-title {
  font-family: 'Instrument Serif', 'Didot', Georgia, serif;
  font-style: italic;
  font-size: 40px;
  color: #daa520;
  text-shadow: 0 2px 20px rgba(0,0,0,0.7);
  letter-spacing: 0.02em;
  position: absolute; top: 38%; left: 50%; transform: translateX(-50%);
}
.world-hud.ready-walk .world-btn.primary {
  padding: 18px 36px;
  font-size: 13px;
  letter-spacing: 0.3em;
  box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.5), 0 12px 32px rgba(0,0,0,0.5);
  animation: ctaPulse 2s ease-in-out infinite;
  margin-top: 40px;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(218, 165, 32, 0), 0 12px 32px rgba(0,0,0,0.5); }
  50%      { box-shadow: 0 0 0 16px rgba(218, 165, 32, 0.12), 0 12px 32px rgba(0,0,0,0.5); }
}
.ready-walk-hint {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: rgba(245, 240, 225, 0.7);
  text-transform: uppercase;
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  max-width: 520px; text-align: center;
  line-height: 1.8;
}

/* Heffernan-style idle prompt: compact monospace pill, bottom center */
.world-hud.ready-walk.heff {
  justify-content: flex-end;
  padding-bottom: 72px;
  background: linear-gradient(180deg, transparent 0%, transparent 70%, rgba(0,0,0,0.25) 100%);
}
.heff-begin {
  background: #0a0a0a;
  color: #f5f5f5;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 10px 18px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
  text-transform: none;
  animation: heffIn 0.6s ease both;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.heff-begin:hover {
  background: #181818;
  color: #daa520;
  transform: translateY(-1px);
}
.heff-cursor {
  display: inline-block;
  margin-left: 2px;
  animation: heffBlink 1s steps(2) infinite;
}
@keyframes heffBlink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes heffIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Table-cam toggle button (visible on the 2D poker table) */
.table-cam-btn {
  position: fixed;
  bottom: 20px; left: 180px;
  z-index: 40;
  background: rgba(6, 30, 21, 0.85);
  border: 1px solid rgba(218, 165, 32, 0.3);
  color: #f5f0e1;
  padding: 8px 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 0.2em;
  cursor: pointer;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  text-transform: uppercase;
}
.table-cam-btn:hover { color: #daa520; border-color: #daa520; }
