/* EXPANSA — Retro Green HUD (play header clone base, no header.js, hero enlarged) */

/* ===== Vars ===== */
:root {
  --bg: #000;
  --panel: rgba(0, 0, 0, 0.65);
  --panel-b: #0f8;
  --text: #aefccf;
  --muted: #6fd99f;
  --ui: #00ff80;
  --danger: #ff6b6b;
  --topbar-h: 38px; /* slightly taller header for breathing room */
  --cosmolab-size: 200px;   /* keep canvas + label perfectly in sync */
  --cosmolab-gap: 200px;     /* pull it up; 500px was pushing it way down */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.4 "Lucida Console", Monaco, Consolas, "Courier New", ui-monospace, Menlo, monospace;
  background: var(--bg);
  color: var(--text);
  text-shadow: 0 0 4px rgba(0, 255, 128, 0.20);
}

/* ===== Top Nav — floating buttons only (no bar, no brand) ===== */
.topbar {
  position: fixed;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  padding: 0;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  z-index: 9999;
}

.nav {
  display: flex;
  gap: 10px;
}

.brand {
  display: none !important;
}

.topbar .btn {
  padding: 3px 8px;
  font-size: 12px;
  opacity: 0.9;
}
.topbar .btn:hover {
  opacity: 1;
}


/* ===== Buttons ===== */
.btn {
  text-decoration: none;
  appearance: none;
  border: 1px solid var(--panel-b);
  background: transparent;
  color: var(--ui);
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 0;
  cursor: pointer;
  transition: filter .12s ease, transform .06s ease, background .12s ease, opacity .12s;
  text-shadow: none;
}
.btn:hover {
  background: rgba(0, 255, 128, 0.06);
  filter: drop-shadow(0 0 8px rgba(0, 255, 128, 0.45));
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; }
.btn.primary {
  background: linear-gradient(180deg, rgba(0,255,128,0.10), rgba(0,0,0,0.45));
  color: #cfffec;
  border-color: var(--panel-b);
}
.btn.primary:hover {
  background: linear-gradient(180deg, rgba(0,255,128,0.16), rgba(0,0,0,0.55));
  filter: drop-shadow(0 0 8px rgba(0,255,128,0.55));
}
.btn.danger {
  border-color: var(--danger);
  color: #ffdfe3;
  background: rgba(255,0,0,0.08);
}
.btn.danger:hover {
  background: rgba(255,0,0,0.12);
  filter: drop-shadow(0 0 6px rgba(255,0,0,0.35));
}
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

/* Small button variant for SHIPS */
.small-btn {
  padding: 6px 14px !important;
  font-size: 12px !important;
  border-width: 1px !important;
}

#play-btn {
  padding: 14px 34px !important;   /* bigger click area */
  font-size: 20px !important;      /* larger text */
  border-width: 1px !important;    /* thicker border */
}


/* ===== Layout ===== */
main {
  min-height: calc(100vh - var(--topbar-h));
  padding-top: var(--topbar-h);
}
.screen { display: none; padding: 16px; }
.screen.active { display: block; }

/* ===== Panels ===== */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-b);
  border-radius: 0;
  padding: 14px;
  color: var(--text);
}
.panel.narrow { max-width: 640px; margin: 0 auto; }

/* ===== Hero ===== */
.hero {
  max-width: 980px;
  margin: 40px auto 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 90px 40px 120px; /* more height to reveal more image */
  border: 1px solid var(--panel-b);
}
#screen-home .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("img/hero-synthwave.png") center/cover no-repeat;
  z-index: 0;
  filter: brightness(0.6);
  transition: filter .25s ease;
}
#screen-home .hero:hover::before { filter: brightness(1); }
#screen-home .hero::after { content: none; }
#screen-home .hero > * { position: relative; z-index: 2; }

.hero h1 {
  margin: 0 0 6px;
  font-size: 44px;
  letter-spacing: .5px;
  color: var(--ui);
  text-shadow: 0 0 8px rgba(0,255,128,0.35);
}
.tagline { color: var(--muted); margin: 0 0 16px; }
.actions {
  display: flex;
  gap: 14px;                 /* more distance between hero buttons */
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0;
}
.actions .btn {
  padding: 10px 24px;        /* larger buttons */
  font-size: 16px;
  border-width: 2px;
}
.note { color: #7bf0b0; }

/* ===== Ship Encyclopedia Hero (with background image) ===== */
.hero.ships-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-b);
  width: 100%;
  text-align: center;
  margin: 40px auto 0;
  padding: 110px 40px 140px; /* 🔺 more height top/bottom = taller banner */
  background: rgba(0, 0, 0, 0.4);
}

.hero.ships-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("img/hero-ships.png") center/cover no-repeat;
  z-index: 0;
  filter: brightness(0.6);
  transition: filter 0.25s ease;
}

.hero.ships-hero:hover::before {
  filter: brightness(1);
}

.hero.ships-hero > * {
  position: relative;
  z-index: 2;
}


/* ===== Footer ===== */
.footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 12px 8px;
  border-top: 1px solid var(--panel-b);
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.4);
}
.footer a { color: var(--ui); text-decoration: none; }
.footer a:hover {
  text-decoration: none;
  filter: drop-shadow(0 0 6px rgba(0,255,128,0.35));
}
.footer .sep { opacity: .7; }

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .brand { font-size: 12px; }
  .nav { gap: 6px; flex-wrap: wrap; }
  .btn { padding: 4px 8px; font-size: 12px; }
  .hero { margin: 24px 8px 10px; padding: 60px 16px 38px; }
  .hero h1 { font-size: 32px; }
  #cosmolab-preview { width: 160px; height: 160px; }
}

/* ===== Square corners ===== */
:where(button, .btn, .panel, .topbar, .footer, canvas, input, select) {
  border-radius: 0 !important;
}

/* ===== Links ===== */
a { color: var(--ui); text-decoration: none; }
a:hover {
  text-decoration: none;
  filter: drop-shadow(0 0 6px rgba(0,255,128,0.35));
}

/* ===== Noscript ===== */
.noscript {
  margin: 10px auto;
  max-width: 600px;
  background: #000;
  border: 1px solid var(--panel-b);
  color: var(--text);
  padding: 10px 12px;
}

/* ===== Info Box (under hero) ===== */
.info-box {
  max-width: 920px;
  margin: 60px auto 0;
  padding: 12px 18px;
  border: 1px solid var(--panel-b);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 0 8px rgba(0, 255, 128, 0.15) inset;
}

.info-box p {
  margin: 4px 0;
  color: var(--muted);
}

.info-box strong {
  color: var(--ui);
  text-shadow: 0 0 6px rgba(0,255,128,0.35);
}

/* ===== Info Box Separators ===== */
.info-box p {
  margin: 10px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 255, 128, 0.25);
}

.info-box p:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}



body, main, header, footer, .hero, .info-box, .panel, .screen {
  position: relative;
  z-index: 2;
}

/* ===== Collapsible Info Box — fade + real collapse ===== */
.info-box.collapsible {
  overflow: hidden;
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

/* Collapsed = invisible */
.info-box.collapsible.collapsed {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

/* Expanded = visible with glow */
.info-box.collapsible:not(.collapsed) {
  border-color: var(--panel-b);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 14px 3px rgba(0,255,128,0.25);
}

/* Header */
.info-box .info-header {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 255, 128, 0.25);
}
.info-box.collapsed .info-header {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Toggle arrow */
.info-box .toggle-btn {
  background: none;
  border: none;
  color: var(--ui);
  margin-left: 10px;
  font-size: 16px;
  cursor: pointer;
  transform-origin: center;
  transition: transform 0.3s ease, filter 0.25s ease;
}
.info-box .toggle-btn:hover {
  filter: drop-shadow(0 0 8px rgba(0,255,128,0.45));
}
.info-box.collapsed .toggle-btn {
  transform: rotate(-90deg);
}

/* Content: fade + height collapse */
.info-box .info-content {
  opacity: 1;
  max-height: 9999px;
  transition:
    opacity 0.4s ease,
    max-height 0.5s ease;
}

.info-box.collapsed .info-content {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
}

/* ===== Ship Encyclopedia — 2 per row, image float right, text wraps naturally ===== */
.ship-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 24px auto;
}

.ship-entry {
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--panel-b);
  padding: 12px;
  width: 100%;
  text-align: left;
  overflow: hidden;
}

/* Float the ship image right so text wraps around it naturally */
.ship-entry .ship-img img {
  float: right;
  width: 120px;
  height: auto;
  border: 1px solid rgba(0,255,128,0.25);
  background: #000;
  margin: 4px 0 10px 14px; /* space on left side now */
  cursor: pointer;
}

/* Info text */
.ship-entry .ship-info h3 {
  margin: 0 0 6px;
  color: var(--ui);
  font-size: 14px;
}
.ship-entry .ship-info p {
  margin: 3px 0;
  font-size: 12px;
  line-height: 1.35;
}

/* Responsive fallback */
@media (max-width: 900px) {
  .ship-grid {
    grid-template-columns: 1fr;
  }
  .ship-entry .ship-img img {
    float: none;
    display: block;
    margin: 0 auto 10px auto;
  }
}

/* ===== Mobile fix: prevent logo overlapping buttons ===== */
@media (max-width: 900px) {
  #expansa-logo {
    position: relative !important;   /* take it out of absolute layout */
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 auto 16px auto !important; /* place it nicely above title */
    display: block !important;
    text-align: center;
    z-index: 5;
  }

  #expansa-logo img {
    height: 90px !important;  /* smaller so it fits neatly */
    width: auto;
  }

  /* give hero a bit more breathing room below */
  .hero {
    padding-top: 40px !important;
    padding-bottom: 60px !important;
  }
}

#cycle-timer {
  position: relative;
  margin: 20px auto;        /* centers it */
  width: fit-content;       /* shrink to text size */
  padding: 6px 12px;
  background: rgba(0,0,0,0.5);
  border: 1px solid #0f0;
  color: #0f0;
  font-family: monospace;
  font-size: 18px;
  z-index: 2000;
}

/* ===== Mobile fix for dynamic typing text ===== */
#home-dynamic-text {
  white-space: normal !important;     /* allow line wrapping */
  word-break: break-word;             /* force wrap if long words */
  overflow-wrap: break-word;          /* safe wrap */
  max-width: 90%;                     /* prevent stretching too wide */
  margin: 0 auto;                     /* center it */
  display: block;
  text-align: center;                 /* keep centered vibe */
}

/* smaller, tighter variant on mobile */
@media (max-width: 700px) {
  #home-dynamic-text {
    font-size: 12px !important;
    line-height: 1.3;
    margin-top: 6px;
  }
}

/* ===== Mobile footer fix ===== */
@media (max-width: 700px) {
  .footer {
    flex-wrap: nowrap;        /* keep everything on one line */
    font-size: 11px;          /* smaller to fit */
    gap: 4px;                 /* tighter spacing */
    padding: 8px 4px;
    white-space: nowrap;      /* prevent breaking mid-word */
    overflow-x: auto;         /* allow subtle horizontal scroll if REALLY needed */
    scrollbar-width: none;    /* hide scrollbar (Firefox) */
  }

  .footer::-webkit-scrollbar { 
    display: none;            /* hide scrollbar (Chrome/Safari) */
  }

  .footer a {
    font-size: 11px;
  }

  .footer .sep {
    font-size: 11px;
    opacity: 0.6;
  }
}

/* DESKTOP — wider cycles panel ONLY */
@media (min-width: 900px) {
  .cycles-frame {
    width: 100% !important;
    max-width: 600px !important; /* set exactly what you want */
    height: 420px !important;
  }
}

.report-holder {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* ============================
   INFO GRID
   ============================ */

#info-grid {
  display: grid;
  grid-template-columns: repeat(4, 200px);
  gap: 20px;
  justify-content: center; /* centers the whole row */
  margin-top: 40px;
}

.grid-box {
  width: 200px;               /* ← CHANGE THIS to make all boxes smaller */
  border: 1px solid #0f8;
  background: rgba(0,0,0,0.2);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.grid-box img {
  width: 100%;            /* scales automatically */
  height: auto;
  object-fit: contain;
  image-rendering: crisp-edges;
}

.grid-box h3 {
  margin-top: 6px;
  font-size: 10px;
  font-family: inherit;
  color: var(--ui);
  text-shadow: none;
  letter-spacing: normal;
  font-weight: normal;   /* ← THIS removes the bold */
}

/* GLOW ONLY (NO ZOOM) */
.grid-box:hover {
  box-shadow: 0 0 12px #0f8;
}




/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
  #info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 550px) {
  #info-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================
   MODAL WINDOW
   ============================ */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.modal-window {
  background: #000;
  border: 1px solid #0f8;
  padding: 26px;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 0 20px #0f8;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 6px;
  right: 10px;
  cursor: pointer;
  font-size: 24px;
  color: #0f8;
  text-shadow: 0 0 4px #0f8;
}

#modal-content {
  margin-top: 20px;
  font-size: 16px;
  color: #0f8;
}

#modal-content img {
  display: block;
  margin: 0 auto 14px auto; /* center + spacing */
  max-width: 70%;
  height: auto;
}
