/* Retro pixel UI enhancements for TheGame.vc */

.share-row {
  display: flex;
  flex-direction: row;
  gap: 1.2em;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: 0.5em;
}

.share-row .retro-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 10px;
  background: #23232b;
  border: 2px solid #00ffea;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 0 10px #00ffea44;
}

.share-row .retro-btn:hover {
  background: #00ffea33;
  border-color: #00ffea;
  box-shadow: 0 0 18px #00ffea99;
}

.share-row .retro-btn svg {
  display: block;
  margin: 0 auto;
  width: 28px;
  height: 28px;
}


body {
  background: #18181b;
  overflow-x: hidden;
  color: #fff;
  font-family: 'VT323', monospace;
  image-rendering: pixelated;
}

.retro-title,
.retro-desc,
.retro-info,
.retro-btn,
.retro-tag,
.retro-border,
.retro-popup {
  color: #fff !important;
  font-family: 'Press Start 2P', 'VT323', monospace;
  text-shadow: 1px 1px 0 #00ffea, 0 0 8px #00ffea99;
}

.retro-tag {
  background: #23232b;
  border: 2px solid #00ffea;
  border-radius: 6px;
  padding: 0.2em 0.7em;
  margin: 0.1em;
  font-size: 1.1em;
  display: inline-block;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
}

.retro-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  min-width: 260px;
  background: #18181b;
  border: 5px double #00ffea;
  box-shadow: 0 0 32px #00ffea, 0 0 0 12px #004c4c;
  border-radius: 18px;
  z-index: 10001;
  padding: 2.2em 2.5em 1.7em 2.5em;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  text-align: left;
  font-size: 1.1em;
  animation: retroPopIn 0.36s cubic-bezier(.7, -0.41, .5, 1.63);
  filter: none !important;
  opacity: 1 !important;
}

.retro-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  z-index: 10000;
  filter: none !important;
  opacity: 1 !important;
}

/* ===== FUND DETAILED RETURNS — fullscreen spreadsheet ===== */
#returns-popup {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: #0c0c0f !important;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  min-width: unset;
  max-width: unset;
  max-height: unset;
  transform: none;
  left: 0;
  top: 0;
  opacity: 1 !important;
  filter: none !important;
  display: flex;
  animation: none;
  font-family: 'VT323', monospace;
  text-shadow: none;
}

.returns-fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.returns-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  background: linear-gradient(180deg, #14141a 0%, #0c0c0f 100%);
  border-bottom: 1px solid rgba(0, 255, 234, 0.2);
  flex-shrink: 0;
}

.returns-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.85rem;
  color: #00ffea;
  text-shadow: 0 0 10px rgba(0, 255, 234, 0.4);
  white-space: nowrap;
  margin: 0;
  letter-spacing: 1px;
}

.returns-header-stats {
  display: flex;
  gap: 24px;
  margin-left: auto;
  margin-right: 40px;
}

.returns-header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.returns-header-stat-value {
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  color: #fff;
  font-weight: bold;
}

.returns-header-stat-label {
  font-family: 'VT323', monospace;
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.returns-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.returns-close-btn:hover {
  color: #fff;
  border-color: #00ffea;
  background: rgba(0, 255, 234, 0.1);
}

.returns-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #00ffea33 transparent;
}

.returns-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  table-layout: fixed;
}

.returns-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.returns-table th {
  background: #16161c;
  color: #00ffea;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid rgba(0, 255, 234, 0.3);
  white-space: nowrap;
  font-weight: normal;
}

.returns-table th:not(.returns-th-company) {
  text-align: right;
}

.returns-th-company {
  width: 22%;
}

.returns-table td {
  padding: 10px 14px;
  color: #ccc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.returns-td-company {
  text-align: left !important;
  color: #fff !important;
  font-weight: bold;
  font-size: 1.25rem;
}

.returns-td-moic {
  font-weight: bold;
  font-size: 1.35rem;
}

.returns-row-even { background: rgba(255, 255, 255, 0.02); }
.returns-row-odd { background: transparent; }

.returns-table tbody tr:hover {
  background: rgba(0, 255, 234, 0.06);
}

/* Outcome badges */
.returns-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.returns-badge-ipo {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.returns-badge-bankrupt {
  background: rgba(255, 68, 68, 0.12);
  color: #ff4444;
  border: 1px solid rgba(255, 68, 68, 0.25);
}

.returns-badge-acquihire {
  background: rgba(255, 136, 68, 0.12);
  color: #ff8844;
  border: 1px solid rgba(255, 136, 68, 0.25);
}

.returns-badge-win {
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.25);
}

.returns-badge-ok {
  background: rgba(0, 255, 234, 0.08);
  color: #00ffea;
  border: 1px solid rgba(0, 255, 234, 0.2);
}

.returns-badge-loss {
  background: rgba(255, 68, 68, 0.08);
  color: #ff6666;
  border: 1px solid rgba(255, 68, 68, 0.2);
}

.returns-type-badge {
  color: #888;
  font-size: 1.05rem;
}

.returns-moic-star {
  color: #ffd700;
  font-size: 0.9rem;
  margin-left: 2px;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.returns-best-deal {
  padding: 10px 24px;
  text-align: center;
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  color: #888;
  border-top: 1px solid rgba(0, 255, 234, 0.15);
  background: #0f0f14;
  flex-shrink: 0;
}

.returns-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  color: #555;
}

#returns-overlay {
  background: rgba(0, 0, 0, 0.92);
  /* Slightly darker for better contrast */
}

@keyframes retroPopIn {
  0% {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.retro-popup-close {
  position: absolute;
  top: 0.7em;
  right: 1.3em;
  color: #00ffea;
  font-size: 1.3em;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  z-index: 1001;
}

.retro-title,
.retro-btn {
  letter-spacing: 2px;
}

@media (max-width: 640px) {

  /* Adjust main container */
  main {
    width: 95% !important;
    margin: 0.5rem auto !important;
    padding: 1rem !important;
  }

  /* Adjust font sizes */
  .retro-title {
    font-size: 1.5rem !important;
  }

  /* Adjust card sizing */
  #card {
    width: 100% !important;
    min-height: auto !important;
  }

  /* Improve touch targets */
  button,
  .swipeable {
    min-height: 44px;
    min-width: 44px;
  }

  /* Adjust timer size */
  #countdown-timer {
    width: 45px !important;
    height: 45px !important;
  }

  .timer-display {
    font-size: 1rem !important;
  }

  /* Portfolio popup: full-width on mobile */
  .detailed-portfolio-popup {
    width: 98vw;
    padding: 0.8rem;
  }

  .portfolio-table {
    font-size: 1rem;
  }

  .portfolio-table th,
  .portfolio-table td {
    padding: 0.4rem 0.5rem;
  }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  main {
    width: 85% !important;
  }
}

/* --- Custom summary/leaderboard/popup retro styles --- */

/* === SUMMARY SCREEN REDESIGN === */

/* Screen container */
#summary-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
  --summary-accent: #00ffea;
  --summary-accent-glow: rgba(0, 255, 234, 0.4);
  --summary-bg: rgba(10, 10, 15, 0.7);
  --summary-bg-glow: radial-gradient(ellipse at 50% 0%, rgba(0, 255, 234, 0.08) 0%, transparent 60%);
  background: var(--summary-bg-glow), var(--summary-bg);
}

/* Tier theming */
#summary-screen[data-moic-tier="loss"] {
  --summary-accent: #ff4444;
  --summary-accent-glow: rgba(255, 68, 68, 0.35);
  --summary-bg-glow: radial-gradient(ellipse at 50% 0%, rgba(255, 68, 68, 0.1) 0%, transparent 60%);
}
#summary-screen[data-moic-tier="okay"] {
  --summary-accent: #00ffea;
  --summary-accent-glow: rgba(0, 255, 234, 0.4);
  --summary-bg-glow: radial-gradient(ellipse at 50% 0%, rgba(0, 255, 234, 0.08) 0%, transparent 60%);
}
#summary-screen[data-moic-tier="good"] {
  --summary-accent: #44ff88;
  --summary-accent-glow: rgba(68, 255, 136, 0.35);
  --summary-bg-glow: radial-gradient(ellipse at 50% 0%, rgba(68, 255, 136, 0.1) 0%, transparent 60%);
}
#summary-screen[data-moic-tier="legendary"] {
  --summary-accent: #ffd700;
  --summary-accent-glow: rgba(255, 215, 0, 0.4);
  --summary-bg-glow: radial-gradient(ellipse at 50% 0%, rgba(255, 215, 0, 0.12) 0%, transparent 60%);
}

/* Particle canvas */
#summary-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Summary box */
#summary-screen #summary-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Animated sections */
.summary-section {
  opacity: 0;
  transform: translateY(24px);
  transition: none;
}
.summary-section.is-visible {
  animation: summaryFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Title section */
.summary-hero-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--summary-accent);
  text-shadow: 0 0 20px var(--summary-accent-glow), 0 0 40px var(--summary-accent-glow);
  text-align: center;
  letter-spacing: 3px;
  margin: 0;
  line-height: 1.4;
}
.summary-subtitle {
  font-family: 'VT323', monospace;
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin: 8px 0 0;
  letter-spacing: 1px;
}

/* Divider */
.summary-divider {
  height: 2px;
  margin: 16px auto 0;
  background: var(--summary-accent);
  box-shadow: 0 0 12px var(--summary-accent-glow);
  border-radius: 1px;
  width: 0%;
}
.summary-section.is-visible .summary-divider {
  animation: dividerExpand 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* MOIC Hero */
#moic-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 0 8px;
}
.moic-value {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(2.5rem, 10vw, 4.5rem);
  color: var(--summary-accent);
  text-shadow: 0 0 30px var(--summary-accent-glow), 0 0 60px var(--summary-accent-glow);
  letter-spacing: 2px;
  line-height: 1;
}
.moic-value.moic-revealed {
  animation: moicPulse 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.moic-label {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Stats row */
.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.summary-stat-value {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.55rem, 2vw, 0.75rem);
  color: #fff;
  text-shadow: none;
}
.summary-stat-label {
  font-family: 'VT323', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Section titles */
.summary-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--summary-accent);
  text-shadow: 0 0 8px var(--summary-accent-glow);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-align: center;
}

/* Share grid */
.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'VT323', monospace;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.share-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}
.share-btn[data-platform="x"]:hover {
  border-color: #fff;
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}
.share-btn[data-platform="whatsapp"]:hover {
  border-color: #25d366;
  color: #25d366;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.2);
}
.share-btn[data-platform="linkedin"]:hover {
  border-color: #0077b5;
  color: #0077b5;
  box-shadow: 0 4px 20px rgba(0, 119, 181, 0.2);
}
.share-btn[data-platform="copy"]:hover {
  border-color: var(--summary-accent);
  color: var(--summary-accent);
  box-shadow: 0 4px 20px var(--summary-accent-glow);
}
.share-btn.copied {
  border-color: #44ff88 !important;
  color: #44ff88 !important;
  box-shadow: 0 4px 20px rgba(68, 255, 136, 0.2) !important;
}
.share-label {
  font-size: 1.05rem;
  white-space: nowrap;
}

/* Leaderboard */
.leaderboard-container {
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}
.summary-leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-family: 'VT323', monospace;
}
.summary-leaderboard thead tr {
  background: rgba(255, 255, 255, 0.04);
}
.summary-leaderboard th {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: normal;
}
.summary-leaderboard th:last-child {
  text-align: right;
}
.summary-leaderboard td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
}
.summary-leaderboard tr:last-child td {
  border-bottom: none;
}
.summary-leaderboard .lb-rank {
  width: 48px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}
.summary-leaderboard .lb-player {
  text-align: left;
}
.summary-leaderboard .lb-score {
  text-align: right;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
}

/* Rank styling — colored left border accent for top 3 */
.summary-leaderboard tr[data-rank="1"] td {
  border-bottom-color: rgba(255, 215, 0, 0.15);
}
.summary-leaderboard tr[data-rank="1"] .lb-rank {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.summary-leaderboard tr[data-rank="1"] td:first-child {
  box-shadow: inset 3px 0 0 #ffd700;
}
.summary-leaderboard tr[data-rank="2"] .lb-rank {
  color: #c0c0c0;
  text-shadow: 0 0 6px rgba(192, 192, 192, 0.4);
}
.summary-leaderboard tr[data-rank="2"] td:first-child {
  box-shadow: inset 3px 0 0 #c0c0c0;
}
.summary-leaderboard tr[data-rank="3"] .lb-rank {
  color: #cd7f32;
  text-shadow: 0 0 6px rgba(205, 127, 50, 0.4);
}
.summary-leaderboard tr[data-rank="3"] td:first-child {
  box-shadow: inset 3px 0 0 #cd7f32;
}

/* Leaderboard row entrance stagger */
.summary-leaderboard tbody tr {
  opacity: 0;
  transform: translateX(-12px);
}
.summary-leaderboard tbody tr.is-visible {
  animation: lbRowSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Action buttons */
.summary-btn-primary {
  display: block;
  width: 100%;
  padding: 16px 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: #0a0a0f;
  background: var(--summary-accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 20px var(--summary-accent-glow), 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: summaryGlowPulse 2.5s ease-in-out infinite;
  margin-bottom: 10px;
}
.summary-btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px var(--summary-accent-glow), 0 6px 20px rgba(0, 0, 0, 0.4);
}
.summary-btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.summary-btn-secondary {
  display: block;
  width: 100%;
  padding: 12px 0;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.summary-btn-secondary:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

/* Keyframes */
@keyframes summaryFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dividerExpand {
  from { width: 0%; }
  to { width: 100%; }
}
@keyframes moicPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes summaryGlowPulse {
  0%, 100% { box-shadow: 0 0 20px var(--summary-accent-glow), 0 4px 15px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 30px var(--summary-accent-glow), 0 4px 20px rgba(0,0,0,0.4); }
}
@keyframes lbRowSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .summary-section, .summary-section.is-visible,
  .summary-leaderboard tbody tr, .summary-leaderboard tbody tr.is-visible,
  .moic-value.moic-revealed,
  .summary-btn-primary {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .summary-divider { width: 100% !important; }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  #summary-screen { padding: 16px 12px 40px; }
  #summary-screen #summary-box { gap: 22px; }
  .moic-value { font-size: clamp(2rem, 9vw, 3.5rem); }
  .summary-stats { gap: 6px; }
  .summary-stat { padding: 10px 2px; }
  .summary-stat-value { font-size: 0.5rem; }
  .share-grid { gap: 8px; }
  .share-btn { padding: 10px 6px; gap: 6px; }
  .share-label { font-size: 0.9rem; }
  .summary-leaderboard th, .summary-leaderboard td { padding: 8px; }
}

.retro-popup {
  max-width: 95vw;
  max-height: 80vh;
  overflow-y: auto;
}

.detailed-portfolio-popup {
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  padding: 1.5rem;
}

.retro-title {
  font-size: 1.4rem;
}

.retro-desc {
  font-size: 1rem;
}

main {
  padding: 1.5rem 0.5rem;
}

/* Year Progress Bar */
.year-progress-container {
  width: 100%;
  height: 10px;
  background-color: rgba(0, 255, 234, 0.12);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.year-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00ffea, #00ff88);
  border-radius: 5px;
  transition: width 0.3s ease-out;
  box-shadow: 0 0 8px rgba(0, 255, 234, 0.5);
  position: relative;
  z-index: 1;
}

.quarter-ticks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-evenly;
  pointer-events: none;
  z-index: 2;
}

.quarter-ticks span {
  width: 1px;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.quarter-labels {
  display: flex;
  justify-content: space-around;
  padding: 0.2rem 0;
  margin-bottom: 0.5rem;
}

.quarter-labels span {
  font-family: 'VT323', monospace;
  font-size: 0.7rem;
  color: rgba(0, 255, 234, 0.5);
  letter-spacing: 1px;
}

/* Year Transition */
#year-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#year-transition.show {
  opacity: 1;
}

#year-transition.hide {
  opacity: 0;
}

.year-number {
  font-family: 'Press Start 2P', monospace;
  font-size: 3rem;
  color: #00ff00;
  text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
  transform: scale(0.5);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#year-transition.show .year-number {
  transform: scale(1);
}

/* Endgame wrapped transition */
#endgame-transition-screen {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: radial-gradient(circle at 50% 20%, rgba(0, 255, 234, 0.12), rgba(0, 0, 0, 0.92) 55%);
  animation: endgameFadeIn 280ms ease-out forwards;
}

#endgame-transition-screen.is-closing {
  opacity: 0;
  transition: opacity 240ms ease;
}

.endgame-wrapped-shell {
  width: min(100%, 560px);
  border: 2px solid rgba(0, 255, 234, 0.45);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 13, 21, 0.97) 0%, rgba(10, 10, 16, 0.98) 100%);
  box-shadow: 0 0 24px rgba(0, 255, 234, 0.22), inset 0 0 0 1px rgba(0, 255, 234, 0.12);
  padding: 1.1rem 1rem 1rem;
}

.endgame-wrapped-header {
  font-family: 'Press Start 2P', monospace;
  color: #00ffea;
  line-height: 1.4;
  font-size: 0.78rem;
  text-align: center;
  text-shadow: 0 0 8px rgba(0, 255, 234, 0.6);
}

.endgame-wrapped-subtitle {
  font-family: 'VT323', monospace;
  color: #b9c0cc;
  letter-spacing: 1px;
  font-size: 1.15rem;
  text-align: center;
  margin-top: 0.45rem;
}

.endgame-wrapped-viewport {
  overflow: hidden;
  margin-top: 0.95rem;
  border: 1px solid rgba(0, 255, 234, 0.18);
  border-radius: 12px;
  background: rgba(3, 7, 12, 0.7);
}

.endgame-wrapped-track {
  display: flex;
  width: 100%;
}

.endgame-wrapped-slide {
  min-width: 100%;
  padding: 1rem 0.9rem;
  box-sizing: border-box;
  color: #d8dee9;
  animation: wrappedSlideIn 360ms ease-out;
}

.endgame-wrapped-kicker {
  color: #8feee5;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.endgame-wrapped-title {
  margin-top: 0.5rem;
  font-family: 'VT323', monospace;
  font-size: 2rem;
  line-height: 1.05;
  color: #fff;
}

.endgame-wrapped-subcopy {
  margin-top: 0.5rem;
  font-family: 'VT323', monospace;
  font-size: 1.12rem;
  line-height: 1.28;
  color: #b8c1ce;
}

.endgame-wrapped-value,
.endgame-carry-value {
  margin-top: 0.35rem;
  font-family: 'Press Start 2P', monospace;
  color: #00ffea;
  text-shadow: 0 0 12px rgba(0, 255, 234, 0.7);
}

.endgame-wrapped-value {
  font-size: 1.4rem;
}

.endgame-carry-value {
  font-size: 1.15rem;
  line-height: 1.5;
  animation: endgameGlowPulse 1.8s ease-in-out infinite;
}

.endgame-wrapped-stats {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.endgame-wrapped-stat {
  border: 1px solid rgba(0, 255, 234, 0.15);
  border-radius: 8px;
  background: rgba(0, 255, 234, 0.04);
  padding: 0.42rem 0.35rem;
  text-align: center;
}

.endgame-wrapped-stat span {
  display: block;
  color: #8a93a4;
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
}

.endgame-wrapped-stat b {
  display: block;
  margin-top: 0.16rem;
  color: #fff;
  font-family: 'VT323', monospace;
  font-size: 1.12rem;
  text-shadow: none;
}

.endgame-wrapped-metrics {
  margin-top: 0.64rem;
  display: grid;
  gap: 0.25rem;
  color: #9fa9ba;
  font-family: 'VT323', monospace;
  font-size: 1rem;
}

.endgame-wrapped-fun {
  margin-top: 0.62rem;
  color: #d7dde7;
  font-family: 'VT323', monospace;
  font-size: 1.06rem;
}

.endgame-wrapped-slide-cta .endgame-wrapped-title {
  font-size: 1.7rem;
}

.endgame-wrapped-nav,
.endgame-wrapped-controls {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 0.7rem;
}

.endgame-wrapped-nav-btn {
  min-height: 44px;
  min-width: 44px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 234, 0.35);
  background: #0b1220;
  color: #c7f9f2;
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
}

.endgame-wrapped-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.endgame-wrapped-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}

.endgame-wrapped-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 234, 0.45);
  background: rgba(0, 255, 234, 0.15);
  cursor: pointer;
}

.endgame-wrapped-dot.is-active {
  background: #00ffea;
  box-shadow: 0 0 10px rgba(0, 255, 234, 0.75);
}

.endgame-wrapped-cta {
  margin-top: 0.95rem;
  width: 100%;
  min-height: 44px;
  opacity: 0.55;
  pointer-events: none;
}

.endgame-wrapped-cta.is-ready {
  opacity: 1;
  pointer-events: auto;
}

/* Fund letter screen */
#fund-letter-screen.fund-letter-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0f;
  z-index: 10010;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 24px 16px;
  opacity: 1;
  transition: opacity 0.4s ease;
}

#fund-letter-screen.fund-letter-screen.is-closing {
  opacity: 0;
}

.fund-letter-container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  animation: endgameFadeIn 420ms ease-out forwards;
}

.fund-letter-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #222;
}

.fund-letter-body {
  color: #ccc;
  margin-bottom: 24px;
}

.fund-letter-content {
  margin-top: 8px;
}

.fund-letter-content.is-typing {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.07);
}

.fund-letter-cursor {
  width: 20px;
  height: 2px;
  background: #00ffea;
  box-shadow: 0 0 10px rgba(0, 255, 234, 0.9);
  margin-bottom: 10px;
  animation: endgameGlowPulse 1.6s ease-in-out infinite;
}

.fund-letter-cursor.is-done {
  opacity: 0.16;
}

.fund-letter-button-row {
  text-align: center;
  padding: 20px 0 40px;
}

.retro-btn.is-disabled,
.retro-btn:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

@keyframes endgameFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes wrappedSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes endgameGlowPulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(0, 255, 234, 0.24);
  }

  50% {
    box-shadow: 0 0 16px rgba(0, 255, 234, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {

  #endgame-transition-screen,
  .fund-letter-container,
  .endgame-wrapped-slide {
    animation: none !important;
  }

  #endgame-transition-screen.is-closing,
  #fund-letter-screen.fund-letter-screen {
    transition: none !important;
  }

  .endgame-wrapped-track {
    transition: none !important;
  }

  .endgame-carry-value,
  .fund-letter-cursor {
    animation: none !important;
  }
}

.year-display {
  font-family: 'Press Start 2P', monospace;
  color: #00ffea;
  text-shadow: 1px 1px #000;
  margin-bottom: 8px;
  text-align: center;
}

/* --- Styles moved from game.js --- */

/* Timeout Message Popup */
.timeout-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 40, 0, 0.95);
  padding: 1em 2em;
  border-radius: 8px;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 1rem;
  text-align: center;
  z-index: 11000;
  /* Ensure it's above other elements */
  box-shadow: 0 0 30px rgba(255, 40, 0, 0.8);
  animation: fadeInOut 1.5s forwards;
  pointer-events: none;
  /* Prevent interaction */
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }

  20% {
    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(0.9);
  }
}

/* Investment Error Popup (Danger Triangle) */
.invest-error-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20000;
}

.invest-error-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px #ff2222, 0 0 0 8px #2a0000;
  border-radius: 18px;
  padding: 2.3em 2.7em 2.2em 2.7em;
  background: rgba(40, 0, 0, 0.97);
  animation: retroPopIn 0.36s cubic-bezier(.7, -0.41, .5, 1.63);
  /* filter: none; Should be inherited or default */
  /* opacity: 1; Should be default */
}

.invest-error-triangle svg {
  display: block;
  /* Prevent extra space */
  width: 88px;
  height: 76px;
}

.invest-error-triangle polygon {
  fill: #ff2222;
  stroke: #fff;
  stroke-width: 4;
  filter: drop-shadow(0 0 12px #ff2222cc);
}

.invest-error-triangle rect {
  fill: #fff;
}

.invest-error-text {
  color: #fff;
  font-family: 'Press Start 2P', 'VT323', monospace;
  font-size: 1.3rem;
  margin-top: 1.1em;
  text-shadow: 0 0 8px #ff2222, 1px 1px 0 #fff;
  text-align: center;
  background: rgba(30, 0, 0, 0.85);
  padding: 0.8em 1.7em;
  border-radius: 13px;
  box-shadow: 0 0 22px #ff2222cc;
  letter-spacing: 1px;
}

.invest-error-close {
  position: absolute;
  top: 0.7em;
  right: 1.3em;
  color: #fff;
  font-size: 1.3em;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  z-index: 1001;
  /* Above other popup content */
  text-shadow: 0 0 8px #fff, 1px 1px 0 #ff2222;
  padding: 0;
  /* Reset default padding */
}

/* Portfolio Popup Table Styles */
/* Portfolio Popup Table Styles */
.portfolio-popup-container {
  width: 100%;
  padding-bottom: 8px;
}

.portfolio-empty-message {
  color: #fff;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  text-align: center;
  padding: 1rem;
}

/* Retro Spreadsheet Table Styles */
.portfolio-table-container {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  border: 2px solid #00ffea;
  border-radius: 4px;
  background: #0a0a12;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 255, 234, 0.15);
  margin-top: 10px;
}

.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.08rem;
  min-width: 750px;
}

/* Reset display for table elements to avoid Tailwind grid conflicts */
.portfolio-table tr {
  display: table-row !important;
}

.portfolio-table td,
.portfolio-table th {
  display: table-cell !important;
}

.portfolio-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.portfolio-table th {
  background: #0d0d18;
  color: #00ffea;
  text-shadow: 0 0 6px rgba(0, 255, 234, 0.7);
  padding: 0.7rem 0.8rem;
  text-align: left;
  border: 1px solid #004c4c;
  border-bottom: 2px solid #00ffea;
  font-family: 'VT323', monospace;
  font-weight: bold;
  white-space: nowrap;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 1rem;
  vertical-align: middle;
}

.portfolio-table td {
  padding: 0.55rem 0.8rem;
  border: 1px solid #1e2a2a;
  color: #d0d0d0;
  white-space: nowrap;
  vertical-align: middle;
  background: rgba(10, 10, 18, 0.6);
  font-size: 1.15rem;
}

/* Zebra Striping */
.portfolio-table tbody tr:nth-child(even) td {
  background: rgba(0, 255, 234, 0.025);
}

/* Hover row highlight */
.portfolio-table tbody tr:hover td {
  background: rgba(0, 255, 234, 0.1);
  color: #fff;
  cursor: default;
}

/* Column Specific Styles */
.portfolio-table .col-company {
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portfolio-table .col-year {
  text-align: center;
  color: #888;
}

.portfolio-table .col-invested,
.portfolio-table .col-value {
  text-align: right;
}

.portfolio-table .col-invested {
  color: #aaa;
}

.portfolio-table .col-value {
  color: #fff;
}

.portfolio-table .col-stage {
  text-align: center;
  color: #ffff00;
}

.portfolio-table .col-ownership {
  text-align: right;
  color: #00ffea;
}

.portfolio-table .col-multiple {
  text-align: center;
  font-weight: bold;
}

.portfolio-table .col-path {
  color: #777;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Multiple Color Coding */
.portfolio-table .multiple-good {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.portfolio-table .multiple-neutral {
  color: #ffaa00;
}

.portfolio-table .multiple-poor {
  color: #ff4444;
}

/* Status Indicator */
.portfolio-row.exited .col-company {
  color: #00ff88;
}

.portfolio-row.failed .col-company {
  color: #ff4444;
  text-decoration: line-through;
  opacity: 0.7;
}

/* Scrollbar styling for portfolio table */
.portfolio-table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.portfolio-table-container::-webkit-scrollbar-track {
  background: #0a0a12;
}

.portfolio-table-container::-webkit-scrollbar-thumb {
  background: #004c4c;
  border: 1px solid #00ffea;
  border-radius: 2px;
}

.portfolio-table-container::-webkit-scrollbar-thumb:hover {
  background: #00ffea;
}

/* Corner radius fixes for table */
.portfolio-table-container {
  border-radius: 6px;
}

/* General Utility/State Classes */
.hidden {
  display: none !important;
  /* Ensure it overrides other display properties */
}

.initially-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Add margin for game screens */
#game-screen,
#summary-screen {
  margin-bottom: 3rem;
}

/* Footer styles */
.retro-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(24, 24, 27, 0.95);
  /* More opaque background */
  padding: 0.7rem 0;
  text-align: center;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  z-index: 1000;
  /* Higher z-index to ensure it's above other elements */
  opacity: 0;
  visibility: hidden;
  /* Start hidden */
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
  /* Don't block interaction when invisible */
}

.retro-footer.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* Re-enable interaction when visible */
}

.retro-footer a {
  color: #fff;
  text-decoration: underline;
  margin: 0 0.8rem;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.retro-footer a:hover {
  color: #00ffea;
  text-shadow: 0 0 8px #00ffea;
}

/* Ensure proper spacing for content */
#summary-screen {
  padding-bottom: 4rem;
  /* Add extra padding to prevent footer overlap */
  margin-bottom: 1rem;
}

/* ===== MOBILE RESPONSIVENESS ADDITIONS ===== */

/* iOS scroll fix for all popups */
.retro-popup,
.detailed-portfolio-popup,
.enhanced-metrics-popup,
.metrics-db-popup,
.enhanced-popup,
.invest-result-popup,
.invest-amount-popup {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {

  /* Body alignment on short screens */
  body {
    align-items: flex-start !important;
    padding: 0.5rem !important;
  }

  #game-screen {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  /* Card content text sizes */
  #card-name {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  #pitch-text {
    font-size: 0.95rem;
    line-height: 1.3;
    max-height: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #ask-amount {
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
  }

  #tags-container {
    margin-bottom: 0.5rem !important;
  }

  .retro-tag {
    font-size: 0.75rem;
    padding: 0.1em 0.4em;
  }

  /* Card sizing - auto height to fit content */
  #card {
    min-height: auto !important;
    max-height: none;
    overflow-y: visible;
  }

  /* Leaderboard font sizes */
  .retro-leaderboard th,
  .retro-leaderboard td {
    font-size: 0.7em;
    padding: 0.4em 0.2em;
  }

  /* Year number */
  .year-number {
    font-size: 2rem;
  }

  .endgame-wrapped-shell {
    padding: 0.95rem 0.75rem 0.85rem;
  }

  .endgame-wrapped-header {
    font-size: 0.66rem;
  }

  .endgame-wrapped-subtitle {
    font-size: 1rem;
  }

  .endgame-wrapped-title {
    font-size: 1.8rem;
  }

  .endgame-wrapped-stats {
    gap: 0.32rem;
  }

  .endgame-wrapped-controls {
    grid-template-columns: 44px 1fr 44px;
    gap: 0.5rem;
  }

  .endgame-wrapped-nav-btn,
  .endgame-wrapped-cta {
    min-height: 44px;
  }

  .fund-letter-container {
    max-width: 100%;
  }

  /* Enhanced popup max height */
  .enhanced-metrics-popup,
  .metrics-db-popup,
  .enhanced-popup {
    -webkit-overflow-scrolling: touch;
    max-height: 85vh;
  }
}

@media (max-width: 480px) {
  #countdown-timer {
    width: 40px !important;
    height: 40px !important;
    margin-bottom: 0.3rem !important;
  }

  .timer-display {
    font-size: 1rem !important;
  }

  #card {
    min-height: auto !important;
    max-height: none;
  }

  .endgame-wrapped-shell {
    padding: 0.85rem 0.6rem 0.76rem;
  }

  .endgame-wrapped-header {
    font-size: 0.58rem;
    line-height: 1.5;
  }

  .endgame-wrapped-subtitle {
    font-size: 0.9rem;
  }

  .endgame-wrapped-title {
    font-size: 1.55rem;
  }

  .endgame-wrapped-nav-btn,
  .endgame-wrapped-cta {
    min-height: 44px;
  }

  .retro-popup {
    width: 95vw !important;
    padding: 1rem !important;
    font-size: 0.9em;
    word-break: break-word;
  }

  .retro-popup-close {
    font-size: 1.1em;
    top: 0.5em;
    right: 0.7em;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .invest-error-popup {
    padding: 1.5em 1.5em;
    width: 90vw;
    box-sizing: border-box;
  }

  .invest-error-text {
    padding: 0.6em 1em;
    font-size: 1.1rem;
  }

  .invest-error-triangle svg {
    width: 66px;
    height: 57px;
  }

  .retro-leaderboard th,
  .retro-leaderboard td {
    font-size: 0.6em;
    padding: 0.3em 0.15em;
  }

  .retro-footer {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
  }

  .retro-footer a {
    margin: 0 0.3rem;
  }

  /* Returns fullscreen table — mobile */
  .returns-header {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
  }

  .returns-title {
    font-size: 0.65rem;
    width: 100%;
  }

  .returns-header-stats {
    gap: 12px;
    margin-left: 0;
    margin-right: 28px;
    flex-wrap: wrap;
  }

  .returns-header-stat-value {
    font-size: 1.15rem;
  }

  .returns-header-stat-label {
    font-size: 0.7rem;
  }

  .returns-table {
    font-size: 1rem;
  }

  .returns-table th {
    font-size: 0.45rem;
    padding: 8px 6px;
    letter-spacing: 0.5px;
  }

  .returns-table td {
    padding: 8px 6px;
    font-size: 1rem;
  }

  .returns-td-company {
    font-size: 1.05rem;
  }

  .returns-td-moic {
    font-size: 1.15rem;
  }

  .returns-badge {
    font-size: 0.9rem;
    padding: 1px 5px;
  }
}

@media (max-width: 375px) {
  #card {
    min-height: auto !important;
    max-height: none;
  }
}

@media (max-width: 360px) {
  .retro-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* ===== PORTFOLIO TABLE MOBILE RESPONSIVENESS ===== */

/* Mobile portfolio table: remove min-width constraint */
@media (max-width: 768px) {
  .portfolio-table {
    min-width: auto;
    width: 100%;
    font-size: 0.9rem;
  }

  .portfolio-table-container {
    max-height: 60vh;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .portfolio-table th,
  .portfolio-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }

  /* Make Company column sticky on left for easier horizontal navigation */
  .portfolio-table .col-company {
    position: sticky;
    left: 0;
    background: #0d0d18;
    z-index: 5;
    max-width: 120px;
  }

  .portfolio-table tbody tr:nth-child(even) .col-company {
    background: rgba(0, 255, 234, 0.025);
  }

  .portfolio-table tbody tr:hover .col-company {
    background: rgba(0, 255, 234, 0.1);
  }
}

/* Small screens at 375-390px: reduce padding and hide Ownership */
@media (min-width: 375px) and (max-width: 390px) {

  .portfolio-table th,
  .portfolio-table td {
    padding: 0.15rem 0.2rem !important;
    font-size: 0.75rem !important;
  }

  .portfolio-table {
    font-size: 0.65rem;
  }

  /* Also hide Ownership column at this narrow width */
  .portfolio-table .col-ownership {
    display: none !important;
  }

  .portfolio-table th:nth-child(5),
  .portfolio-table tbody tr td:nth-child(5) {
    display: none !important;
  }
}

/* Extra small screens: hide less critical columns */
@media (max-width: 480px) {
  .portfolio-table {
    font-size: 0.75rem;
  }

  .portfolio-table th,
  .portfolio-table td {
    padding: 0.3rem 0.4rem;
  }

  /* Hide Year and Stage columns on very small screens to reduce width */
  .portfolio-table .col-year {
    display: none !important;
  }

  .portfolio-table .col-stage {
    display: none !important;
  }

  /* Also hide the corresponding header cells */
  .portfolio-table th:nth-child(2),
  .portfolio-table th:nth-child(4) {
    display: none !important;
  }

  /* And the corresponding data cells */
  .portfolio-table tbody tr td:nth-child(2),
  .portfolio-table tbody tr td:nth-child(4) {
    display: none !important;
  }

  /* Make Company column narrower */
  .portfolio-table .col-company {
    max-width: 80px;
    font-size: 0.75rem;
  }

  /* Reduce other columns' max-widths */
  .portfolio-table .col-invested,
  .portfolio-table .col-value,
  .portfolio-table .col-multiple,
  .portfolio-table .col-ownership {
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* Hide Ownership column at 390px and below for better spacing */
@media (max-width: 390px) {
  .portfolio-table .col-ownership {
    display: none !important;
  }

  .portfolio-table th:nth-child(5),
  .portfolio-table tbody tr td:nth-child(5) {
    display: none !important;
  }
}

/* Ultra-small screens: also hide Ownership column for more space */
@media (max-width: 360px) {
  .portfolio-table .col-ownership {
    display: none !important;
  }

  .portfolio-table th:nth-child(5),
  .portfolio-table tbody tr td:nth-child(5) {
    display: none !important;
  }

  .portfolio-table .col-company {
    max-width: 70px;
  }

  .portfolio-table th,
  .portfolio-table td {
    padding: 0.25rem 0.3rem;
    font-size: 0.7rem;
  }
}

/* Ensure table fits better on landscape mode and larger screens */
@media (min-width: 768px) {
  .portfolio-table {
    min-width: 750px;
  }

  .portfolio-table th,
  .portfolio-table td {
    padding: 0.55rem 0.8rem;
    font-size: 1.15rem;
  }

  .portfolio-table .col-company {
    max-width: 180px;
  }

  .portfolio-table .col-year {
    display: table-cell !important;
  }

  .portfolio-table .col-stage {
    display: table-cell !important;
  }
}

/* Tablet safe zone */
@media (min-width: 641px) and (max-width: 768px) {
  .game-buttons-grid {
    max-width: 380px;
  }
}

/* ===== FOUNDER CHARACTER PORTRAITS ===== */

.founder-portraits-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0 0.3rem 0;
}

.founder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
}

.founder-duo {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  width: 100%;
}

.founder-svg-container {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #00ffea;
  box-shadow: 0 0 10px rgba(0, 255, 234, 0.35), inset 0 0 6px rgba(0, 255, 234, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d1a;
}

.founder-svg-container svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

.founder-name {
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
  margin-top: 0.2rem;
}

.founder-trait {
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  color: #00ffea;
  font-style: italic;
  opacity: 0.85;
  margin-bottom: 0.1rem;
}

.founder-section-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0.4rem 0 0.3rem 0;
  gap: 0.4rem;
}

.founder-section-divider::before,
.founder-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00ffea44, transparent);
}

.founder-section-divider span {
  font-family: 'VT323', monospace;
  font-size: 0.8rem;
  color: #00ffea;
  opacity: 0.6;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.founder-attributes-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}

.founder-attribute-item {
  border-left: 2px solid #00ffea;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.5rem;
  border-radius: 0 4px 4px 0;
}

.founder-attribute-item .attribute-text {
  font-family: 'VT323', monospace;
  font-weight: bold;
  color: #fff;
  font-size: 0.95rem;
}

.founder-attribute-item .attribute-description {
  font-family: 'VT323', monospace;
  font-size: 0.82rem;
  color: #aaa;
  margin-top: 0.1rem;
  line-height: 1.2;
}

/* Founder mobile adjustments */
@media (max-width: 480px) {
  .founder-svg-container {
    width: 48px;
    height: 48px;
  }

  .founder-name {
    font-size: 1rem;
  }

  .founder-trait {
    font-size: 0.8rem;
  }

  .founder-duo {
    gap: 0.8rem;
  }

  .founder-attribute-item {
    padding: 0.2rem 0.4rem;
  }

  .founder-attribute-item .attribute-text {
    font-size: 0.85rem;
  }

  .founder-attribute-item .attribute-description {
    font-size: 0.75rem;
  }

  .founder-section-divider {
    margin: 0.3rem 0 0.2rem 0;
  }
}

/* ===== LP NOTIFICATION TOAST ===== */

.lp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 10px 20px;
  color: #fff;
  font-family: 'VT323', monospace;
  z-index: 10000;
  cursor: pointer;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
  animation: lpToastIn 0.4s ease-out;
}

.lp-toast-label {
  font-size: 0.7rem;
  color: #3b82f6;
  letter-spacing: 2px;
  margin-bottom: 4px;
  font-family: 'Press Start 2P', monospace;
}

.lp-toast-text {
  font-size: 1.1rem;
  color: #e2e8f0;
  font-style: italic;
  line-height: 1.3;
}

@keyframes lpToastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes lpToastOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

@media (max-width: 640px) {
  .lp-toast {
    bottom: 16px;
    padding: 8px 14px;
    max-width: 95vw;
  }

  .lp-toast-label {
    font-size: 0.6rem;
  }

  .lp-toast-text {
    font-size: 1rem;
  }
}

/* ===== EXIT TOAST (Investment Phase) ===== */

.exit-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: rgba(24, 24, 27, 0.95);
  border-radius: 8px;
  padding: 10px 16px;
  color: #fff;
  font-family: 'VT323', monospace;
  z-index: 10000;
  cursor: pointer;
  max-width: 320px;
  text-align: left;
  animation: exitToastIn 0.4s ease-out;
}

.exit-toast--bankruptcy {
  border: 1px solid #ff4444;
  box-shadow: 0 0 12px rgba(255, 68, 68, 0.3);
}

.exit-toast--acquihire {
  border: 1px solid #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.exit-toast--acquisition {
  border: 1px solid #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.exit-toast-label {
  font-size: 0.6rem;
  letter-spacing: 2px;
  margin-bottom: 4px;
  font-family: 'Press Start 2P', monospace;
}

.exit-toast--bankruptcy .exit-toast-label { color: #ff4444; }
.exit-toast--acquihire .exit-toast-label { color: #f59e0b; }
.exit-toast--acquisition .exit-toast-label { color: #10b981; }

.exit-toast-company {
  font-size: 1.05rem;
  color: #e2e8f0;
  font-weight: bold;
  line-height: 1.3;
}

.exit-toast-narrative {
  font-size: 0.95rem;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.2;
  margin-top: 2px;
}

.exit-toast-financials {
  font-size: 0.9rem;
  color: #10b981;
  margin-top: 4px;
}

@keyframes exitToastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes exitToastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

@media (max-width: 640px) {
  .exit-toast {
    top: 16px;
    right: 8px;
    max-width: 90vw;
    padding: 8px 12px;
  }

  .exit-toast-label {
    font-size: 0.5rem;
  }

  .exit-toast-company {
    font-size: 0.95rem;
  }

  .exit-toast-narrative {
    font-size: 0.85rem;
  }
}

/* ===== FOLLOW-ON DEAL MEMO ===== */

/* Compact popup override for follow-on popups */
.follow-on-popup {
  padding: 1.2em 1.5em 1em 1.5em !important;
  max-width: 380px !important;
  width: 90vw !important;
}

.deal-memo-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 255, 234, 0.15);
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.deal-memo-flavor {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: #b8c1ce;
  font-style: italic;
  line-height: 1.3;
  margin-bottom: 0.6rem;
  border-left: 3px solid rgba(0, 255, 234, 0.4);
  padding-left: 0.8rem;
  transition: opacity 0.15s ease;
}

/* Follow-on tab toggle (Deal / About) */
.follow-on-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 0.4rem;
}
.follow-on-tab {
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  padding: 0.25rem 0.9rem;
  cursor: pointer;
  border: 1px solid rgba(0, 255, 234, 0.25);
  background: transparent;
  color: #888;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 32px;
  display: flex;
  align-items: center;
}
.follow-on-tab:first-child {
  border-radius: 4px 0 0 4px;
  border-right: none;
}
.follow-on-tab:last-child {
  border-radius: 0 4px 4px 0;
}
.follow-on-tab--active {
  background: rgba(0, 255, 234, 0.12);
  color: #00ffea;
  border-color: rgba(0, 255, 234, 0.5);
  text-shadow: 0 0 6px rgba(0, 255, 234, 0.3);
}
.follow-on-tab:not(.follow-on-tab--active):hover {
  background: rgba(0, 255, 234, 0.05);
  color: #aaa;
}

@media (max-width: 400px) {
  .follow-on-tab {
    font-size: 0.85rem;
    padding: 0.2rem 0.7rem;
    min-height: 28px;
  }
}

.deal-memo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-family: 'VT323', monospace;
  font-size: 1rem;
}

.deal-memo-row:last-child {
  margin-bottom: 0;
}

.deal-memo-label {
  color: #8a93a4;
}

.deal-memo-value {
  color: #fff;
  font-weight: bold;
}

.deal-memo-value.highlight-green {
  color: #00ffea;
  text-shadow: 0 0 8px rgba(0, 255, 234, 0.4);
}

.deal-memo-value.highlight-red {
  color: #ff4444;
  text-shadow: 0 0 8px rgba(255, 68, 68, 0.4);
}

.deal-memo-amount-display {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.1rem;
  color: #00ffea;
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 12px rgba(0, 255, 234, 0.6);
}

.deal-memo-slider-container {
  margin-bottom: 0.8rem;
}

/* Follow-on button design */
.follow-on-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem 0.3rem !important;
  min-height: 48px;
  gap: 0.15rem;
}

.follow-on-btn__label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.follow-on-btn__sub {
  font-family: 'VT323', monospace;
  font-size: 0.85rem;
  opacity: 0.8;
  text-shadow: none;
}

.follow-on-btn--pass {
  background: rgba(255, 68, 68, 0.08) !important;
  border-color: #ff4444 !important;
  color: #ff6666 !important;
}

.follow-on-btn--pass:hover {
  background: rgba(255, 68, 68, 0.15) !important;
  box-shadow: 0 0 12px rgba(255, 68, 68, 0.3);
}

.follow-on-btn--pass .follow-on-btn__sub {
  color: #ff8888;
}

.follow-on-btn--invest {
  background: rgba(0, 255, 234, 0.08) !important;
  border-color: #00ffea !important;
  color: #00ffea !important;
}

.follow-on-btn--invest:hover {
  background: rgba(0, 255, 234, 0.15) !important;
  box-shadow: 0 0 12px rgba(0, 255, 234, 0.3);
}

.follow-on-btn--invest .follow-on-btn__sub {
  color: #66fff5;
}

/* ===== LEVEL 100 FOLLOW-ON ANIMATIONS ===== */

/* The Initial Drop */
@keyframes terminal-drop {
  0% {
    transform: perspective(500px) rotateX(-15deg) scale(1.1) translateY(-40px);
    opacity: 0;
  }

  40% {
    transform: perspective(500px) rotateX(5deg) scale(0.98) translateY(5px);
    opacity: 1;
    filter: drop-shadow(0 0 20px rgba(0, 255, 234, 0.5));
  }

  70% {
    transform: perspective(500px) rotateX(-2deg) scale(1.02) translateY(-2px);
    filter: drop-shadow(0 0 10px rgba(0, 255, 234, 0.3));
  }

  100% {
    transform: perspective(500px) rotateX(0deg) scale(1) translateY(0);
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  }
}

.terminal-drop-anim {
  animation: terminal-drop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Micro-shake used when dropping, or when slider hits $0 */
@keyframes micro-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-2px) rotate(-0.5deg);
  }

  75% {
    transform: translateX(2px) rotate(0.5deg);
  }
}

.danger-state {
  animation: micro-shake 0.3s ease-in-out infinite;
  border-color: #ff4444 !important;
  box-shadow: inset 0 0 20px rgba(255, 68, 68, 0.3), 0 0 15px rgba(255, 68, 68, 0.4) !important;
}

/* Deal Memo Row Cascade */
@keyframes row-lock-in {
  0% {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
    text-shadow: 0 0 20px #fff;
    filter: blur(2px) brightness(1.5);
    color: #fff;
  }

  50% {
    opacity: 1;
    transform: translateX(5px) scale(1.02);
    filter: blur(0px) brightness(1.2);
    text-shadow: 0 0 15px rgba(0, 255, 234, 1);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: brightness(1);
    /* Retains base text colors defined natively */
  }
}

.row-lock-in-anim {
  animation: row-lock-in 0.3s ease-out forwards;
}

/* Odometer / Slider Active Glow */
.slider-active-glow {
  text-shadow: 0 0 20px rgba(0, 255, 234, 0.9), 0 0 30px rgba(0, 255, 234, 0.5) !important;
  color: #fff !important;
  transform: scale(1.05);
  transition: all 0.1s ease-out;
}

/* Button Glitch / Scanlines Hover */
@keyframes neon-scanline {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 0% 100%;
  }
}

.follow-on-btn--invest:hover {
  background: linear-gradient(to bottom, rgba(0, 255, 234, 0.1) 0%, rgba(0, 255, 234, 0.3) 50%, rgba(0, 255, 234, 0.1) 100%) !important;
  background-size: 100% 200% !important;
  animation: neon-scanline 1s linear infinite !important;
}

.follow-on-btn--pass:hover .follow-on-btn__label {
  animation: glitch-text-anim 0.2s infinite alternate-reverse;
}

@keyframes glitch-text-anim {
  0% {
    transform: translate(0);
    text-shadow: 2px 0 #ff0000, -2px 0 #00ffff;
  }

  20% {
    transform: translate(-1px, 1px);
    text-shadow: -2px 0 #ff0000, 2px 0 #00ffff;
  }

  40% {
    transform: translate(-1px, -1px);
    text-shadow: 2px 0 #ff0000, -2px 0 #00ffff;
  }

  60% {
    transform: translate(1px, 1px);
    text-shadow: -2px 0 #ff0000, 2px 0 #00ffff;
  }

  80% {
    transform: translate(1px, -1px);
    text-shadow: 2px 0 #ff0000, -2px 0 #00ffff;
  }

  100% {
    transform: translate(0);
    text-shadow: 2px 0 #ff0000, -2px 0 #00ffff;
  }
}

/* Final Stamp Overlay */
.stamp-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  border-radius: 8px;
  animation: crt-flash 0.35s ease-out forwards;
  pointer-events: none;
}

.stamp-overlay.invest {
  background: rgba(0, 0, 0, 0.6);
  animation: fade-in-stamp 0.2s ease-out forwards;
}

@keyframes fade-in-stamp {
  0% {
    background: rgba(0, 255, 234, 0.4);
  }

  20% {
    background: rgba(0, 255, 234, 0.1);
  }

  100% {
    background: rgba(0, 0, 0, 0.6);
  }
}

.stamp-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 2rem;
  letter-spacing: 2px;
  transform: rotate(-10deg) scale(1.5);
  opacity: 0;
  animation: stamp-slam 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

.stamp-text.pass {
  color: #ff4444;
  border: 4px solid #ff4444;
  padding: 10px;
  text-shadow: 0 0 15px rgba(255, 68, 68, 0.8);
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.4) inset, 0 0 20px rgba(255, 68, 68, 0.4);
}

.stamp-text.missed {
  color: #ff8800;
  border: 4px solid #ff8800;
  padding: 10px;
  text-shadow: 0 0 15px rgba(255, 136, 0, 0.8);
  box-shadow: 0 0 20px rgba(255, 136, 0, 0.4) inset, 0 0 20px rgba(255, 136, 0, 0.4);
}

.stamp-text.invest {
  color: #00ffea;
  border: 4px solid #00ffea;
  padding: 10px;
  font-size: 3rem;
  transform: scale(0.5);
  text-shadow: 0 0 15px rgba(0, 255, 234, 0.8);
  box-shadow: 0 0 20px rgba(0, 255, 234, 0.4) inset, 0 0 20px rgba(0, 255, 234, 0.4);
  animation: stamp-slam-subtle 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes stamp-slam {
  0% {
    transform: rotate(-10deg) scale(3);
    opacity: 0;
  }

  50% {
    transform: rotate(-10deg) scale(0.9);
    opacity: 1;
  }

  100% {
    transform: rotate(-10deg) scale(1);
    opacity: 1;
  }
}

@keyframes stamp-slam-subtle {
  0% {
    transform: scale(3) rotate(5deg);
    opacity: 0;
    filter: blur(5px);
  }

  40% {
    transform: scale(0.8) rotate(-2deg);
    opacity: 1;
    filter: brightness(2) blur(0px);
  }

  70% {
    transform: scale(1.1) rotate(1deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
}

@keyframes crt-flash {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
    background: #fff;
  }

  100% {
    opacity: 1;
    background: rgba(0, 0, 0, 0.85);
  }
}