/* ═══════════════════════════════════════════════════════
   WORST ONBOARDING EVER — Game Wrapper Styles
   The wrapper is BEAUTIFUL. The levels are TERRIBLE.
   That's the joke.
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;0,9..40,700;1,9..40,400&display=swap');

:root {
  --game-bg: #0a0a0c;
  --game-surface: #141418;
  --game-border: #2a2a32;
  --game-text: #e8e6e3;
  --game-text-dim: #6b6976;
  --game-accent: #ff4d4d;
  --game-accent-glow: rgba(255, 77, 77, 0.3);
  --game-success: #4dff91;
  --font-display: 'Instrument Serif', serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--game-bg);
  color: var(--game-text);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ── Title Screen ──────────────────────────────────── */
#title-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 77, 77, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(77, 150, 255, 0.05) 0%, transparent 50%),
    var(--game-bg);
}

.title-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid var(--game-border);
  border-radius: 100px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--game-text-dim);
  margin-bottom: 2rem;
}

.title-heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.05;
  font-weight: 400;
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.title-heading em {
  color: var(--game-accent);
  font-style: italic;
}

.title-tagline {
  font-size: 1.15rem;
  color: var(--game-text-dim);
  margin-bottom: 3rem;
  max-width: 420px;
  line-height: 1.6;
}

#start-btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem 3rem;
  background: var(--game-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 30px var(--game-accent-glow);
}

#start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px var(--game-accent-glow);
}

.title-best {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--game-text-dim);
}

.title-footer {
  position: absolute;
  bottom: 2rem;
  font-size: 0.75rem;
  color: var(--game-text-dim);
  opacity: 0.5;
}

.title-footer a {
  color: var(--game-text-dim);
  text-decoration: none;
}

.title-footer a:hover {
  color: var(--game-text);
}

/* ── HUD ───────────────────────────────────────────── */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: rgba(10, 10, 12, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--game-border);
  font-size: 0.85rem;
  font-weight: 500;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-label {
  color: var(--game-text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hud-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

#hud-clicks {
  color: var(--game-accent);
}

/* ── Transition Screen ─────────────────────────────── */
#transition-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--game-bg);
  animation: transitionIn 0.3s ease;
}

@keyframes transitionIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#transition-level-num {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--game-accent);
  margin-bottom: 1rem;
}

#transition-level-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  text-align: center;
}

#transition-level-desc {
  color: var(--game-text-dim);
  font-size: 1rem;
  font-style: italic;
}

/* ── End Screen ────────────────────────────────────── */
#end-screen {
  /* Normal flow with the BODY as scroller (same architecture as the site's
     /schedule-a-new-demo page): a fixed overflow div cannot be touch-scrolled
     on iOS when the finger lands on the HubSpot iframe, which made the
     calendar's Confirm button unreachable on phones. */
  position: relative;
  z-index: 9999;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(77, 255, 145, 0.06) 0%, transparent 50%),
    var(--game-bg);
}

#end-screen > * { flex-shrink: 0; }

.end-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 0.5rem;
}

.end-subtitle {
  color: var(--game-text-dim);
  font-size: 1rem;
  margin-bottom: 3rem;
}

.end-stats {
  display: flex;
  gap: 3rem;
  margin-bottom: 2rem;
}

.end-stat {
  text-align: center;
}

.end-stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.25rem;
}

.end-stat-label {
  font-size: 0.75rem;
  color: var(--game-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.end-patience-label {
  font-size: 1.1rem;
  color: var(--game-accent);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.end-best {
  font-size: 0.85rem;
  color: var(--game-text-dim);
  margin-bottom: 2.5rem;
}

.end-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

#share-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.85rem 2rem;
  background: var(--game-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

#share-btn:hover {
  box-shadow: 0 0 30px var(--game-accent-glow);
}

#play-again-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--game-text);
  border: 1px solid var(--game-border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

#play-again-btn:hover {
  border-color: var(--game-text-dim);
}

/* WOE 2 sequel cross-link — its own full-width line under the action buttons */
.end-woe2-link {
  flex-basis: 100%;
  margin-top: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--game-text);
  border: 1px solid var(--game-border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
}

.end-woe2-link:hover {
  border-color: var(--game-accent);
}

.end-cta {
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--game-text-dim);
}

.end-cta a {
  color: var(--game-text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.end-cta a:hover {
  color: var(--game-text);
}

/* ── Confetti ──────────────────────────────────────── */
#confetti-container {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confettiFall linear forwards;
}

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

/* ── Rage Click Flash ──────────────────────────────── */
.rage-flash {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--game-accent);
  animation: rageFloat 0.6s ease-out forwards;
}

@keyframes rageFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-30px) scale(0.7); }
}

/* ── Level Containers ──────────────────────────────── */
.level-container {
  position: fixed;
  inset: 0;
  top: 48px; /* below HUD */
  z-index: 100;
  overflow: auto;
}

/* ── Mobile (≤640px) ───────────────────────────────── */
@media (max-width: 640px) {
  #hud { padding: 0.6rem 0.75rem; font-size: 0.75rem; gap: 0.5rem; }
  .hud-item { gap: 0.3rem; }
  .hud-label { font-size: 0.55rem; letter-spacing: 0.05em; }

  #title-screen { padding: 1.5rem; }
  .title-tagline { font-size: 1rem; margin-bottom: 2rem; }
  #start-btn { padding: 0.9rem 2rem; width: 100%; max-width: 320px; }
  .title-footer { bottom: 1rem; }

  #end-screen { padding: 1.5rem; }
  .end-subtitle { margin-bottom: 2rem; }
  .end-stats { gap: 1.25rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.5rem; }
  .end-stat-value { font-size: 1.8rem; }
  .end-best { margin-bottom: 1.5rem; }
  .end-actions { flex-direction: column; width: 100%; max-width: 340px; gap: 0.75rem; }
  #share-btn, #play-again-btn, .end-woe2-link { width: 100%; padding: 0.9rem 1rem; }
  .end-cta { margin-top: 2rem; padding: 0 0.5rem; }
}

@media (max-width: 380px) {
  .hud-label { display: none; }
  .end-stat-value { font-size: 1.5rem; }
}

/* ── Meeting embed (end screen) ─────────────────────── */
#meeting-section {
  margin-top: 3rem;
  width: 100%;
  max-width: 720px;
}

.meeting-heading {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.meeting-subtext {
  font-size: 0.9rem;
  color: var(--game-text-dim);
  margin-bottom: 1.25rem;
}

.meetings-iframe-container {
  min-height: 620px;
  width: 100%;
}

@media (max-width: 640px) {
  #meeting-section { margin-top: 2rem; }
  .meeting-heading { font-size: 1.25rem; }
  /* The widget's booking-form step is ~1330px tall on narrow screens but
     HubSpot's embed script doesn't grow the iframe past the first view,
     leaving Confirm inside an inner scroll region iOS can't touch-scroll.
     Oversize the iframe so the whole flow renders without inner scrolling;
     the widget background is transparent, unused space is invisible. */
  .meetings-iframe-container,
  .meetings-iframe-container iframe { min-height: 1450px !important; }
}

.meeting-fallback {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--game-text-dim);
}

.meeting-fallback a {
  color: var(--game-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Leaderboard (end screen) ───────────────────────── */
#leaderboard-section {
  margin-top: 3rem;
  width: 100%;
  max-width: 560px;
}

.lb-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.lb-entry { margin-bottom: 1.25rem; }

#lb-initials {
  width: 92px;
  padding: 0.7rem 0.6rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  text-transform: uppercase;
  background: var(--game-surface);
  color: var(--game-text);
  border: 1px solid var(--game-border);
  border-radius: 8px;
  outline: none;
}

#lb-initials:focus { border-color: var(--game-accent); }

#lb-join {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.4rem;
  margin-left: 0.5rem;
  background: var(--game-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#lb-join:disabled { opacity: 0.5; cursor: default; }

.lb-hint { font-size: 0.75rem; color: var(--game-text-dim); margin-top: 0.5rem; }
.lb-done { font-size: 0.95rem; color: var(--game-success); }

.lb-tabs { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 0.75rem; }

.lb-tab {
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
  background: transparent;
  color: var(--game-text-dim);
  border: 1px solid var(--game-border);
  border-radius: 100px;
  cursor: pointer;
}

.lb-tab-active { color: var(--game-text); border-color: var(--game-accent); }

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.lb-table th {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--game-text-dim);
  font-weight: 500;
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.lb-table td {
  padding: 0.45rem 0.5rem;
  border-top: 1px solid var(--game-border);
  text-align: left;
}

.lb-name { font-weight: 700; letter-spacing: 0.1em; }

.lb-variant {
  font-weight: 400;
  letter-spacing: 0;
  font-size: 0.65rem;
  color: var(--game-text-dim);
  border: 1px solid var(--game-border);
  border-radius: 100px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.lb-you td { background: rgba(77, 255, 145, 0.07); }
.lb-empty { color: var(--game-text-dim); font-size: 0.9rem; }

@media (max-width: 640px) {
  #leaderboard-section { margin-top: 2rem; }
  .lb-table { font-size: 0.8rem; }
}

/* ── End-screen CTA bridge (WOE 2) ───────────────────── */
.end-cta-block { margin-top: 3rem; width: 100%; max-width: 560px; }
.end-cta-heading { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; margin-bottom: 0.5rem; color: var(--game-text); }
.end-cta-body { font-size: 0.95rem; color: var(--game-text-dim); line-height: 1.6; margin-bottom: 1.25rem; }
.end-cta-link { display: inline-block; font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; padding: 0.85rem 2rem; background: var(--game-accent); color: #fff; border-radius: 8px; text-decoration: none; box-shadow: 0 0 30px var(--game-accent-glow); transition: transform 0.2s; }
.end-cta-link:hover { transform: translateY(-1px); }

/* ── Payoff Screen (WOE 2) ───────────────────────────── */
#payoff-screen {
  position: fixed; inset: 0; z-index: 9997;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(77, 255, 145, 0.07) 0%, transparent 55%), var(--game-bg);
}
.payoff-skip { position: absolute; top: 1.5rem; right: 1.5rem; color: var(--game-text-dim); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.payoff-skip:hover { color: var(--game-text); }
.payoff-stage { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; max-width: 460px; width: 100%; }
.payoff-tooltip { position: relative; background: var(--game-success); color: var(--game-bg); font-weight: 500; font-size: 0.95rem; padding: 0.7rem 1.1rem; border-radius: 10px; animation: payoffFade 0.5s ease; }
.payoff-tooltip::after { content: ''; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid var(--game-success); }
.payoff-field { display: flex; gap: 0.6rem; width: 100%; }
.payoff-input { flex: 1; padding: 0.85rem 1rem; font-size: 1rem; font-family: var(--font-body); background: var(--game-surface); color: var(--game-text); border: 1px solid var(--game-border); border-radius: 8px; outline: none; }
.payoff-create { padding: 0.85rem 1.5rem; font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; background: var(--game-success); color: var(--game-bg); border: none; border-radius: 8px; cursor: pointer; }
.payoff-pulse { animation: payoffPulse 0.6s ease infinite; }
@keyframes payoffPulse { 50% { transform: scale(1.06); box-shadow: 0 0 24px rgba(77, 255, 145, 0.5); } }
.payoff-success { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; animation: payoffFade 0.5s ease; }
.payoff-check { width: 56px; height: 56px; border-radius: 50%; background: var(--game-success); color: var(--game-bg); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; animation: payoffPop 0.4s ease; }
@keyframes payoffPop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.payoff-checklist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.payoff-checklist li { color: var(--game-success); font-size: 0.9rem; min-height: 1.2em; }
.payoff-checklabel { color: var(--game-text-dim); font-size: 0.85rem; }
.payoff-headline { animation: payoffFade 0.6s ease; }
.payoff-headline h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--game-text); margin-bottom: 1.5rem; line-height: 1.25; }
.payoff-continue { padding: 0.9rem 2rem; font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; background: var(--game-accent); color: #fff; border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 0 30px var(--game-accent-glow); }
@keyframes payoffFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) { .payoff-field { flex-direction: column; } .payoff-create { width: 100%; } }

/* ═══ End screen — two-column layout (v3 redesign, 2026-07-06) ═══
   LEFT: the run (title, stats, label, actions) · RIGHT: .end-card (variant CTA).
   Approved mockup: marvin content/woe1-endscreen-2col/reference/woe2-endscreen-2col.html */

.end-grid {
  width: 100%;
  max-width: 1170px;
  margin: auto; /* vertical centering inside #end-screen's flex column */
  display: grid;
  grid-template-columns: 1fr 470px;
  gap: 72px;
  align-items: center;
  text-align: left;
  padding: 1.5rem 0;
}

.end-grid .end-title { font-size: clamp(2.5rem, 5vw, 4.1rem); line-height: 1.04; margin-bottom: 0.6rem; }
.end-grid .end-subtitle { margin-bottom: 2.6rem; }
.end-grid .end-stats { gap: 3.2rem; margin-bottom: 1.9rem; }
.end-grid .end-stat { text-align: left; }
.end-grid .end-stat-value { font-size: 2.6rem; margin-bottom: 0.3rem; }
.end-grid .end-best { margin-bottom: 0; }

.end-divider { width: 56px; height: 1px; background: var(--game-border); margin: 2.4rem 0; }

#end-screen .end-grid .end-actions { margin-top: 0; gap: 1.4rem; align-items: center; justify-content: flex-start; }

/* Cross-game link: identical neutral ghost to Play Again (Mert, 2026-07-06) */
.end-grid .end-woe2-link { flex-basis: auto; margin-top: 0; }
.end-grid .end-woe2-link:hover { border-color: var(--game-text-dim); }

/* RIGHT column card */
.end-card {
  background: var(--game-surface);
  border: 1px solid var(--game-border);
  border-radius: 16px;
  padding: 30px 30px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(232, 230, 227, 0.04);
  text-align: left;
  min-width: 0;
}
.end-card #meeting-section,
.end-card #capture-section { margin: 0; max-width: none; width: 100%; }
.end-card .meeting-heading { font-size: 1.62rem; margin-bottom: 0.45rem; }
.end-card .meeting-subtext { font-size: 0.9rem; line-height: 1.55; margin-bottom: 1.3rem; }
.end-card .meeting-fallback { text-align: center; }

/* Leaderboard (EN root) rides below the grid */
#end-screen #leaderboard-section { max-width: 720px; }

@media (max-width: 1024px) {
  .end-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    padding: 1rem 0;
  }
  .end-grid .end-stat { text-align: center; }
  .end-grid .end-stats { justify-content: center; }
  #end-screen .end-grid .end-actions { justify-content: center; }
  .end-divider { margin: 2.4rem auto; }
  .end-card { text-align: left; }
}

@media (max-width: 640px) {
  .end-grid { gap: 32px; }
  .end-grid .end-stats { gap: 1.5rem; flex-wrap: wrap; }
  .end-card { padding: 22px 20px 18px; }
}
