/* ── Overlays: results, tutorial, glossary, popups, intro ── */
/* Land purchase popup */
.land-popup-card {
  background: linear-gradient(180deg, #1e1a14, #14120e);
  border: 2px solid #6b5030;
  border-radius: 12px;
  padding: 24px 28px;
  text-align: center;
  max-width: min(320px, 90vw);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

.land-popup-title {
  font-family: 'Georgia', serif;
  font-size: 18px;
  color: #d4b070;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.land-popup-info {
  font-size: 13px;
  color: #8a7a60;
  margin-bottom: 12px;
}

.land-popup-price {
  font-size: 22px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 18px;
}

.land-popup-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Theme banner */
#theme-missions-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(59,130,246,0.08);
}

#theme-missions-row .theme-banner {
  border-bottom: none;
  flex-shrink: 0;
}

#theme-missions-row .missions-panel {
  flex: 1;
  min-width: 0;
}

.theme-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
}

.theme-banner .theme-icon {
  font-size: 14px;
}

.theme-banner .theme-name {
  font-weight: 700;
  color: var(--text-heading);
}

.theme-banner .theme-desc {
  color: #64748b;
  font-size: 10px;
}

/* Theme popup overlay */
.theme-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 240px;
  max-width: 90vw;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  font-size: 13px;
}

.theme-popup.hidden { display: none; }

.theme-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-heading);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.theme-popup-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.theme-popup-close:hover { color: #e0e0e0; }

.theme-popup-desc {
  color: #94a3b8;
  line-height: 1.5;
}

/* Live event notification */
.live-event-popup {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15,23,42,0.95);
  border: 2px solid #eab308;
  border-radius: 12px;
  padding: 10px 18px;
  z-index: 260;
  max-width: min(380px, 90vw);
  box-shadow: 0 4px 20px rgba(234,179,8,0.2);
  animation: eventSlideIn 0.4s ease;
}

@keyframes eventSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.live-event-popup .live-event-name {
  font-weight: 700;
  color: #fbbf24;
  font-size: 13px;
}

.live-event-popup .live-event-text {
  color: #94a3b8;
  font-size: 11px;
}

.live-event-popup #live-event-icon {
  font-size: 22px;
}

/* Glossary */
.glossary-screen {
  width: min(500px, calc(100vw - 16px));
  max-height: 90vh;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.glossary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.glossary-header h2 {
  color: var(--text-heading);
  font-size: 18px;
  margin: 0;
}

.glossary-search-row {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.glossary-search {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.glossary-search:focus { border-color: var(--accent); }
.glossary-search::placeholder { color: var(--text-muted); }

.glossary-select {
  width: 140px;
  padding: 8px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
}

.glossary-card {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.glossary-card h3 {
  color: var(--text-heading);
  font-size: 16px;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.glossary-card p { margin: 8px 0; }

.glossary-card ul {
  padding-left: 18px;
  margin: 6px 0;
}
.glossary-card li { margin-bottom: 4px; }

.glossary-card .gl-tip {
  background: rgba(59,130,246,0.06);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin: 10px 0;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  color: var(--text-dim);
}

@media (max-width: 500px) {
  .glossary-search-row { flex-direction: column; }
  .glossary-select { width: 100%; }
}

/* Main menu logo */
.menu-logo {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.galton-logo {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(200,160,80,0.2));
}

.menu-title-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-game-name {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 28px;
  color: #d4b070;
  letter-spacing: 2px;
  margin: 0;
  line-height: 1.1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.menu-game-tagline {
  font-size: 11px;
  color: #6b5838;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
  font-family: 'Georgia', serif;
}

/* Tutorial prompt — positioned near target element */
.tutorial-prompt {
  position: fixed;
  z-index: 260;
  background: rgba(15,23,42,0.95);
  border: 2px solid var(--accent, #3b82f6);
  border-radius: 10px;
  padding: 10px 16px;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  max-width: min(300px, 85vw);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  animation: tutorialPulse 2s ease-in-out infinite;
  transition: top 0.3s, left 0.3s;
}

.tut-arrow {
  position: absolute;
  width: 0; height: 0;
  border: 8px solid transparent;
}
.tut-arrow.arrow-up    { top: -16px; border-bottom-color: var(--accent, #3b82f6); }
.tut-arrow.arrow-down  { bottom: -16px; border-top-color: var(--accent, #3b82f6); }

@keyframes tutorialPulse {
  0%, 100% { border-color: var(--accent, #3b82f6); }
  50% { border-color: #60a5fa; box-shadow: 0 0 16px rgba(59,130,246,0.3); }
}
.help-tip { padding-right: 30px; }
.help-tip-close {
  position: absolute; top: 2px; right: 4px;
  width: 22px; height: 22px;
  background: none; border: none; color: #94a3b8;
  font-size: 18px; line-height: 1; cursor: pointer;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.help-tip-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Overlay for results / start screen */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.overlay-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  max-width: min(420px, calc(100vw - 32px));
}

.overlay-card h2 {
  font-size: 26px;
  margin-bottom: 16px;
  color: var(--text-heading);
}

.overlay-card p {
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.overlay-card .btn {
  margin-top: 20px;
}

/* Main menu buttons — flex gap handles spacing, no extra margin */
#main-menu .overlay-card .btn {
  margin-top: 0;
}

/* Results card — scrollable content, sticky buttons at bottom */
.results-card {
  max-width: min(460px, calc(100vw - 24px));
  text-align: left;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
}
.results-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.results-btn-sticky {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 0 0 14px 14px;
  flex-shrink: 0;
}
.results-btn-sticky .btn {
  margin-top: 0;
}

/* Results screen buttons — equal size, text wraps */
.results-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 6px;
  font-size: 13px;
  text-align: center;
  word-break: break-word;
}

/* Round review */
.review-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #1e3a5f;
}

.review-bar-wrap {
  margin-bottom: 10px;
}

.review-capture-bar {
  height: 8px;
  border-radius: 4px;
  background: #1a1a2e;
  overflow: hidden;
  margin-top: 4px;
}

.review-capture-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.review-capture-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.review-narrative {
  font-size: 13px;
  color: #e0e0e0;
  line-height: 1.5;
  margin: 8px 0;
}

.review-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}

.review-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.review-tag.positive {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.review-tag.negative {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

.review-tag.neutral {
  background: rgba(148,163,184,0.12);
  color: #94a3b8;
}

.review-better {
  font-size: 12px;
  color: #94a3b8;
  padding: 6px 10px;
  background: rgba(59,130,246,0.08);
  border-radius: 8px;
  margin: 8px 0;
}

.review-suggestions {
  font-size: 12px;
  color: var(--text-heading);
  margin: 6px 0 0;
}

.review-suggestions ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.review-suggestions li {
  margin-bottom: 2px;
}

/* Advisor track record (round review) */
.review-advisor-record {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.review-advisor-record.hidden { display: none; }
.advisor-record-header {
  font-size: 12px;
  font-weight: 600;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.advisor-record-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 40px 1fr 36px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}
.advisor-record-name { font-weight: 600; }
.advisor-record-stat { color: #c0c0c0; font-variant-numeric: tabular-nums; }
.advisor-record-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.advisor-record-fill { height: 100%; transition: width 0.3s ease; }
.advisor-record-pct {
  text-align: right;
  color: #a0a0a0;
  font-variant-numeric: tabular-nums;
}

/* ── Broker dividend popup ── */
.broker-popup {
  position: fixed;
  top: 80px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid #fbbf24;
  border-radius: 14px;
  padding: 12px 14px;
  max-width: min(340px, calc(100vw - 24px));
  z-index: 95;
  box-shadow: 0 6px 24px rgba(251,191,36,0.2), 0 4px 16px rgba(0,0,0,0.5);
  animation: brokerSlideIn 0.35s ease-out;
}

.broker-popup.hidden { display: none; }

@keyframes brokerSlideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.broker-face {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: none;
  background: rgba(251,191,36,0.15);
  border: 2px solid #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.broker-body {
  flex: 1;
  min-width: 0;
}

.broker-name {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.broker-msg {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
}

.broker-dismiss {
  background: none;
  border: none;
  color: #475569;
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex: none;
}
.broker-dismiss:hover { color: #fbbf24; }


/* ── Intro onboarding overlay ─────────────────────── */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(10,10,20,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: introFadeIn 0.4s ease;
}
@keyframes introFadeIn { from { opacity: 0; } to { opacity: 1; } }
.intro-overlay.intro-fade-out {
  animation: introFadeOut 0.35s ease forwards;
}
@keyframes introFadeOut { from { opacity: 1; } to { opacity: 0; } }

.intro-card {
  background: var(--bg-panel, #16213e);
  border: 1px solid var(--border, #0f3460);
  border-radius: 14px;
  padding: 20px 18px 16px;
  max-width: min(380px, calc(100vw - 24px));
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.intro-canvas {
  width: 100%;
  max-width: 280px;
  height: 220px;
  border-radius: 10px;
  background: #08060a;
  margin: 0 auto 14px;
  display: block;
}

.intro-title {
  color: var(--text-heading, #a0c4ff);
  font-size: 18px;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}

.intro-desc {
  color: var(--text-dim, #94a3b8);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 16px;
  min-height: 40px;
}

.intro-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.intro-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border, #0f3460);
  transition: background 0.25s, transform 0.25s;
}
.intro-dot.active {
  background: var(--accent, #3b82f6);
  transform: scale(1.3);
}

.intro-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.intro-btn-skip {
  background: transparent !important;
  color: var(--text-dim, #94a3b8) !important;
  font-size: 13px !important;
  padding: 8px 16px !important;
  border: 1px solid var(--border, #0f3460) !important;
}
.intro-btn-skip:hover {
  border-color: var(--text-dim, #94a3b8) !important;
}
.intro-btn-next {
  background: var(--accent, #3b82f6) !important;
  color: #fff !important;
  font-size: 14px !important;
  padding: 8px 24px !important;
  min-width: 100px;
}

