:root {
  --space-deep: #0A0E17;
  --space-mid: #121826;
  --line: rgba(232, 230, 220, 0.12);
  --text-bright: #EDEAE0;
  --text-dim: #9AA0AE;

  --gold: #D9A441;
  --gold-soft: rgba(217, 164, 65, 0.16);

  --green: #5B8C5A;
  --green-bright: #6FBF73;
  --green-glass: rgba(111, 191, 115, 0.28);
  --green-glass-strong: rgba(111, 191, 115, 0.42);

  --res-credits: #D9A441;
  --res-metal: #A9B0BC;
  --res-bio: #6FBF73;
  --res-fuel: #5B9BD9;
  --res-crystal: #B98FE0;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--space-deep) url('/img/Background-landingpage.jpg') center/cover no-repeat fixed;
  color: var(--text-bright);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #ffffff55, transparent),
    radial-gradient(1px 1px at 90px 120px, #ffffff40, transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, #ffffff55, transparent),
    radial-gradient(1px 1px at 220px 200px, #ffffff35, transparent),
    radial-gradient(1.5px 1.5px at 300px 40px, #ffffff50, transparent),
    radial-gradient(1px 1px at 340px 160px, #ffffff30, transparent),
    radial-gradient(1.5px 1.5px at 380px 260px, #ffffff45, transparent);
  background-repeat: repeat;
  background-size: 420px 300px;
  opacity: 0.8;
}

.hangar {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Top bar: brand + resources + login ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 23, 0.35);
  backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px 2px var(--gold-soft);
}

.wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.resources {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.res {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
}

.res-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.res-credits .res-dot { background: var(--res-credits); box-shadow: 0 0 8px 1px rgba(217,164,65,0.4); }
.res-metal .res-dot   { background: var(--res-metal); }
.res-bio .res-dot      { background: var(--res-bio); }
.res-fuel .res-dot     { background: var(--res-fuel); }
.res-crystal .res-dot  { background: var(--res-crystal); box-shadow: 0 0 8px 1px rgba(185,143,224,0.4); }

.login-link {
  flex-shrink: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 16px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.login-link:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---- Stage: Farm rail | ship panel | Space rail ---- */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  min-height: 0;
}

.edge-btn {
  position: relative;
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--green-glass-strong) 0%, var(--green-glass) 100%);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 rgba(217, 164, 65, 0);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.edge-btn::before {
  content: '';
  position: absolute;
  top: 0;
  width: 18px;
  height: 100%;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.15s ease;
}

.edge-farm::before {
  left: -18px;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.edge-space::before {
  right: -18px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.edge-btn:hover::before {
  background: rgba(217, 164, 65, 0.55);
}

.edge-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #FFF;
  letter-spacing: 0.01em;
}

.edge-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  border-color: var(--gold);
  box-shadow: 0 8px 24px var(--gold-soft);
}

.edge-btn:active {
  transform: translateY(0);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.edge-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-color: var(--gold);
  box-shadow: 0 8px 24px var(--gold-soft);
}

/* Prepared for later: dynamic disabled state once zone-logic exists server-side */
.edge-btn.disabled {
  pointer-events: none;
  background: linear-gradient(180deg, rgba(90, 100, 92, 0.28) 0%, rgba(60, 70, 62, 0.28) 100%);
  filter: grayscale(0.6) brightness(0.7);
}

.edge-btn.disabled .edge-label {
  color: rgba(237, 234, 224, 0.45);
}

/* ---- Ship panel: transparent glass container, center of hangar ---- */
.ship-panel {
  flex: 0 1 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  max-height: 480px;
}

.ship-panel-inner {
  width: 100%;
  max-width: 460px;
  height: 100%;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: rgba(237, 234, 224, 0.04);
  border: 1px solid rgba(237, 234, 224, 0.10);
  backdrop-filter: blur(3px);
  overflow: hidden;
}

.ship-section,
.team-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
}

.ship-section {
  flex: 1 1 70%;
}

.team-section {
  flex: 0 0 30%;
  border-top: 1px solid rgba(237, 234, 224, 0.10);
  background: rgba(237, 234, 224, 0.02);
}

.ship-icon {
  width: 96px;
  height: 96px;
  color: var(--gold);
  opacity: 0.9;
}

.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
}

.team-section .section-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.crew-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.crew-slot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px dashed rgba(237, 234, 224, 0.3);
  background: rgba(237, 234, 224, 0.03);
}

/* Team-Slots 1-4: Farmer, Mechaniker, Gunman, Schiffs-Schuetze (klickbare Buttons, groesser als die leeren Slots) */
.crew-slot.farmer,
.crew-slot.mechanic,
.crew-slot.gunman ,
.crew-slot.shipgunner,
.crew-slot.copilot,
.crew-slot.chef,
.crew-slot.hacker {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: inherit;
  cursor: pointer;
  border-style: solid;
  border-color: rgba(237, 234, 224, 0.3);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.crew-slot.farmer img,
.crew-slot.mechanic img,
.crew-slot.gunman img ,
.crew-slot.shipgunner img,
.crew-slot.copilot img,
.crew-slot.chef img,
.crew-slot.hacker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(0.7) brightness(0.8);
  transition: opacity 0.15s ease, filter 0.2s ease;
}

.crew-slot.farmer:hover:not(:disabled),
.crew-slot.mechanic:hover:not(:disabled),
.crew-slot.gunman:hover:not(:disabled) ,
.crew-slot.shipgunner:hover:not(:disabled),
.crew-slot.copilot:hover:not(:disabled),
.crew-slot.chef:hover:not(:disabled),
.crew-slot.hacker:hover:not(:disabled) { border-color: var(--gold); }

.crew-slot.farmer:hover:not(:disabled) img,
.crew-slot.mechanic:hover:not(:disabled) img,
.crew-slot.gunman:hover:not(:disabled) img ,
.crew-slot.shipgunner:hover:not(:disabled) img,
.crew-slot.copilot:hover:not(:disabled) img,
.crew-slot.chef:hover:not(:disabled) img,
.crew-slot.hacker:hover:not(:disabled) img { opacity: 0.85; }

/* Aktiv = leuchtet */
.crew-slot.farmer.active,
.crew-slot.mechanic.active,
.crew-slot.gunman.active ,
.crew-slot.shipgunner.active,
.crew-slot.copilot.active,
.crew-slot.chef.active,
.crew-slot.hacker.active {
  border-color: var(--green-bright);
  background: var(--green-glass);
  box-shadow: 0 0 14px 2px var(--green-glass-strong);
}

.crew-slot.farmer.active img,
.crew-slot.mechanic.active img,
.crew-slot.gunman.active img ,
.crew-slot.shipgunner.active img,
.crew-slot.copilot.active img,
.crew-slot.chef.active img,
.crew-slot.hacker.active img {
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--green-bright));
  animation: farmerGlow 2.4s ease-in-out infinite;
}
@keyframes farmerGlow {
  0%, 100% { filter: drop-shadow(0 0 4px var(--green-bright)); }
  50%      { filter: drop-shadow(0 0 10px var(--green-bright)) brightness(1.15); }
}

.crew-slot.farmer:disabled,
.crew-slot.mechanic:disabled,
.crew-slot.gunman:disabled ,
.crew-slot.shipgunner:disabled,
.crew-slot.copilot:disabled,
.crew-slot.chef:disabled,
.crew-slot.hacker:disabled { cursor: not-allowed; }

.crew-slot.farmer:disabled:not(.active) img,
.crew-slot.mechanic:disabled:not(.active) img,
.crew-slot.gunman:disabled:not(.active) img ,
.crew-slot.shipgunner:disabled:not(.active) img,
.crew-slot.copilot:disabled:not(.active) img,
.crew-slot.chef:disabled:not(.active) img,
.crew-slot.hacker:disabled:not(.active) img { opacity: 0.3; }

.crew-slot.farmer:focus-visible,
.crew-slot.mechanic:focus-visible,
.crew-slot.gunman:focus-visible ,
.crew-slot.shipgunner:focus-visible,
.crew-slot.copilot:focus-visible,
.crew-slot.chef:focus-visible,
.crew-slot.hacker:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.team-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 100%;
  line-height: 1.3;
}

/* ---- Transfer-Panel: eigener Glas-Container unter der Buehne ---- */
.xfer-panel {
  flex: 0 0 auto;
  width: calc(100% - 40px);
  max-width: 520px;
  margin: 0 auto 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(237, 234, 224, 0.04);
  border: 1px solid rgba(237, 234, 224, 0.10);
  backdrop-filter: blur(3px);
}

/* ---- Footer ---- */
.footbar {
  border-top: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ---- Responsive scaling (buttons stay at the edges, never stack) ---- */
@media (max-width: 720px) {
  .resources { gap: 12px; }
  .res { font-size: 0.78rem; }
  .edge-btn { width: 80px; height: 80px; border-radius: 13px; }
  .edge-label { font-size: 0.88rem; }
  .ship-icon { width: 76px; height: 76px; }
}

@media (max-width: 460px) {
  .topbar { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .resources { order: 3; width: 100%; gap: 10px; }
  .edge-btn { width: 56px; height: 56px; border-radius: 10px; }
  .edge-label { font-size: 0.72rem; }
  .stage { padding: 12px; gap: 10px; }
  .ship-icon { width: 60px; height: 60px; }
  .crew-slot { width: 18px; height: 18px; }
  .crew-slot.farmer, .crew-slot.mechanic,
.crew-slot.gunman ,
.crew-slot.shipgunner,
.crew-slot.copilot,
.crew-slot.chef,
.crew-slot.hacker { width: 38px; height: 38px; }
}

/* ---- Mobile: Seite darf scrollen, Transfer-Container bekommt volle Breite ---- */
@media (max-width: 720px) {
  body { height: auto; min-height: 100vh; min-height: 100dvh; overflow-y: auto; }
  .hangar { height: auto; min-height: 100vh; min-height: 100dvh; }
  .stage { flex: 0 0 auto; }
  .ship-panel { height: auto; max-height: none; }
  .ship-panel-inner { height: auto; max-height: none; }
  .ship-section { flex: 0 0 auto; padding: 24px 16px; }
  .team-section { flex: 0 0 auto; }
  .xfer-panel { width: calc(100% - 24px); margin-bottom: 12px; padding: 12px; }
  .footbar { margin-top: auto; }
}

@media (max-width: 460px) {
  .xfer-panel .xfer-grid { column-gap: 8px; }
  .xfer-panel .xfer-cell { flex-direction: column; align-items: center; gap: 0; padding: 6px 4px; font-size: 13px; }
  .xfer-panel .xfer-btn { width: 38px; height: 40px; }
}
