/* =============================================================================
   neo.css — Neokontor-Optik: moderner, klarer Stil ohne KI-Bilder.
   Wird NACH main.css geladen und überschreibt nur Farben, Schriften, Formen
   und das Handy-Layout. Struktur und Verhalten bleiben in main.css.
   Schriften: Inter und Fraunces (SIL Open Font License, src/assets/fonts).
   ============================================================================= */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/Fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --neo-navy: #13283a;
  --neo-navy-2: #1d3b52;
  --neo-gold: #e2b552;
  --neo-gold-dark: #a8790f;
  --neo-sea: #3f8fae;
  --neo-bg: #e7edf0;
  --neo-card: #ffffff;
  --neo-line: #e3e9ec;
  --neo-muted: #5d7282;
  --neo-red: #c8102e;
  --neo-green: #2e9e6a;

  --color-parchment: #ffffff;
  --color-parchment-dark: #f3efe4;
  --color-ink: var(--neo-navy);
  --color-ink-soft: var(--neo-muted);
  --color-accent: var(--neo-navy);
  --color-accent-soft: var(--neo-navy-2);
  --color-gold: var(--neo-gold);
  --color-panel-bg: #ffffff;
  --color-border: var(--neo-line);
  --shadow-soft: 0 8px 24px rgba(8, 30, 45, 0.14);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html,
body {
  background: var(--neo-bg);
  color: var(--neo-navy);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
select,
input {
  font-family: var(--font-body);
}

/* ---------- Kopfleiste ---------- */
.topbar {
  background: var(--neo-navy);
  border-bottom: 0;
  color: #fff;
  padding: 0.65rem 1.2rem;
  box-shadow: 0 4px 18px rgba(8, 30, 45, 0.25);
}
.topbar h1 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #fff;
}
.topbar .subtitle {
  font-style: normal;
  opacity: 0.7;
  font-size: 0.78rem;
}
.turn-indicator {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  color: #fff;
}
.end-turn-button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  background: var(--neo-gold);
  color: var(--neo-navy);
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.end-turn-button:hover {
  background: #ecc56c;
}
.new-game-button,
.map-zoom-toggle {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 0.42rem 0.8rem;
  opacity: 1;
}
.new-game-button:hover,
.map-zoom-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}
.map-zoom-toggle {
  color: var(--neo-navy);
  background: #fff;
  border-color: var(--neo-line);
  box-shadow: 0 2px 8px rgba(8, 30, 45, 0.08);
}
.map-zoom-toggle:hover {
  background: #f4f7f8;
  border-color: #cfd8dd;
}
.language-toggle .language-option.is-active {
  color: var(--neo-gold);
}

/* ---------- Karte ---------- */
.map-scroll {
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}
.map-frame {
  border: 0;
  border-radius: 18px;
  background: #235a7a;
  box-shadow: none;
}
.map-scroll-hint {
  color: var(--neo-muted);
}

.city-marker {
  flex-direction: row;
  gap: clamp(3px, 0.45cqw, 7px);
  color: var(--neo-navy);
  font-family: var(--font-body);
  filter: none;
  /* Punkt sitzt genau auf der Stadt, das Namensschild daneben. */
  transform: translate(calc(-1 * var(--dot) / 2), -50%);
  --dot: clamp(12px, 1.45cqw, 22px);
}
.city-marker.label-left {
  flex-direction: row-reverse;
  transform: translate(calc(-100% + var(--dot) / 2), -50%);
}
.city-marker .marker-badge {
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--city-color, var(--neo-sea));
  border: clamp(2px, 0.3cqw, 4px) solid #fff;
  box-shadow: 0 1px 4px rgba(8, 30, 45, 0.45);
  display: grid;
  place-items: center;
}
.city-marker.is-home {
  --dot: clamp(20px, 2.5cqw, 36px);
}
.city-marker.is-home .marker-badge {
  width: var(--dot);
  height: var(--dot);
  background: var(--neo-navy);
  border: clamp(2px, 0.3cqw, 4px) solid var(--neo-gold);
  color: var(--neo-gold);
}
.city-marker.is-home .marker-badge svg {
  width: 72%;
  height: 72%;
}
.city-marker:hover .marker-badge,
.city-marker:focus-visible .marker-badge {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(226, 181, 82, 0.6);
}
.city-marker .marker-label {
  font-size: clamp(10px, 1.05cqw, 15px);
  font-weight: 600;
  padding: clamp(2px, 0.28cqw, 5px) clamp(6px, 0.8cqw, 12px);
  background: rgba(255, 255, 255, 0.94);
  color: var(--neo-navy);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(8, 30, 45, 0.2);
  letter-spacing: 0;
}
.city-marker.is-home .marker-label {
  color: var(--neo-navy);
  font-weight: 750;
}

.ship-map-marker {
  border: 0;
  background: none;
  box-shadow: none;
  width: clamp(26px, 3.4cqw, 52px);
  height: clamp(26px, 3.4cqw, 52px);
  border-radius: 0;
}
.ship-map-marker img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 2px rgba(8, 30, 45, 0.35));
}
/* Farbiger Wimpel unter dem Schiff: verbindet Karte und Flottenliste. */
.ship-map-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 36%;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--ship-color, var(--neo-gold));
  box-shadow: 0 0 0 1.5px #fff;
}
.ship-map-marker.is-at-sea img {
  filter: drop-shadow(0 2px 2px rgba(8, 30, 45, 0.35));
}

/* ---------- Statusleiste und Karten ---------- */
.status-panel {
  background: var(--neo-card);
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}
.status-panel h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.1rem;
  color: var(--neo-navy);
  border-bottom: 1px solid var(--neo-line);
  letter-spacing: 0;
}
.stat-row .label {
  color: var(--neo-muted);
}
.rank-badge {
  background: var(--neo-navy);
  color: var(--neo-gold);
  font-family: var(--font-body);
  font-weight: 700;
  border: 0;
}
.rank-progress-bar {
  background: #e9eef1;
  border: 0;
}
.rank-progress-bar > span {
  background: linear-gradient(90deg, var(--neo-gold), #ecc56c);
}
.ship-card {
  background: #f7f9fa;
  border: 1px solid var(--neo-line);
  border-radius: 14px;
}
.ship-card img {
  filter: none;
}
.condition-bar {
  background: #e3e9ec;
  border: 0;
}
.ship-destination-select {
  border: 1px solid #cfd8dd;
  border-radius: 9px;
  background: #fff;
  color: var(--neo-navy);
  padding: 0.35rem 0.5rem;
}
.ship-controls button,
.repair-button,
.shipyard-card button,
.trade-action-button,
.round-summary-ok,
.game-over-dialog button {
  background: var(--neo-navy);
  color: #fff;
  border: 0;
  border-radius: 9px;
  font-family: var(--font-body);
  font-weight: 700;
}
.ship-controls button:hover,
.repair-button:hover,
.shipyard-card button:hover,
.trade-action-button:hover,
.round-summary-ok:hover {
  background: var(--neo-navy-2);
}
.shipyard-card,
.warehouse-row {
  background: #f7f9fa;
  border: 1px solid var(--neo-line);
  border-radius: 12px;
}
.goods-legend .good-item {
  background: #f7f9fa;
  border: 1px solid var(--neo-line);
  border-radius: 12px;
}
.goods-legend .good-item img {
  background: #f3efe4;
  border: 0;
  border-radius: 10px;
  padding: 3px;
  box-shadow: none;
}

/* ---------- Protokoll ---------- */
.log-panel {
  background: #fff;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  color: var(--neo-navy);
}
.log-entry {
  border-color: var(--neo-line);
}
.log-entry-placeholder {
  color: var(--neo-muted);
}

/* ---------- Dialoge ---------- */
.trade-dialog {
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--neo-navy);
  box-shadow: 0 18px 50px rgba(8, 30, 45, 0.35);
}
.trade-dialog::backdrop,
.trade-backdrop {
  background: rgba(13, 32, 46, 0.55);
}
.trade-dialog-header {
  border-bottom: 1px solid var(--neo-line);
}
.trade-dialog-header h2 {
  font-weight: 650;
}
.trade-table thead {
  color: var(--neo-muted);
}
.trade-table td {
  border-color: var(--neo-line);
}
.trade-table tbody tr:hover {
  background: #f4f7f8;
}
.good-cell img,
.mo-good-header img,
.good-inventory-title-icon {
  background: #f3efe4;
  border-radius: 10px;
  padding: 3px;
  border: 0;
}
.ship-tab {
  border: 1px solid var(--neo-line);
  background: #f7f9fa;
  border-radius: 10px;
  color: var(--neo-navy);
}
.ship-tab.is-selected {
  background: var(--neo-navy);
  color: #fff;
  border-color: var(--neo-navy);
}
.trade-table button,
.qty-step-btn {
  border-radius: 8px;
}
.round-summary-scene {
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  margin: 0 auto 0.9rem;
  border: 0;
  border-radius: 24px;
  background: transparent;
  object-fit: contain;
  box-shadow: 0 8px 22px rgba(8, 30, 45, 0.18);
}
.round-summary-event-img,
.tutorial-img,
.rank-change-img {
  border-radius: 14px;
  border: 0;
  box-shadow: none;
  background: transparent;
}

/* ---------- Geführte Runde ---------- */
.tour-bubble {
  background: var(--neo-navy);
  color: #fff;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(8, 30, 45, 0.4);
}
.tour-counter {
  color: var(--neo-gold);
}
.tour-primary {
  background: var(--neo-gold);
  color: var(--neo-navy);
  border-radius: 10px;
}
.tour-skip {
  color: #b9c7d0;
}
.tour-target {
  outline-color: var(--neo-gold) !important;
}

/* ---------- Titelbild und Vorspann (ohne Film) ---------- */
.intro-overlay {
  background: radial-gradient(ellipse at 50% 35%, #2a5372 0%, var(--neo-navy) 70%);
}
.intro-title {
  color: #fff;
}
.intro-seal {
  width: min(38vw, 12rem);
  border-radius: 24%;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45));
}
.intro-title h1 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #fff;
}
.intro-tagline {
  font-style: normal;
  opacity: 0.75;
}
.intro-start {
  font-family: var(--font-body);
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  background: var(--neo-gold);
  color: var(--neo-navy);
}
.intro-start:hover,
.intro-start:focus-visible {
  background: #ecc56c;
}
.intro-skip-link {
  color: #b9c7d0;
}
.intro-lang button {
  border-color: rgba(255, 255, 255, 0.3);
  color: #dbe4ea;
  border-radius: 9px;
}
.intro-lang button[aria-pressed="true"] {
  background: var(--neo-gold);
  border-color: var(--neo-gold);
  color: var(--neo-navy);
}
.intro-skip {
  border-radius: 10px;
  background: rgba(19, 40, 58, 0.6);
  z-index: 3;
}
.intro-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(#9fd3e6, #e9f3ef 55%, #3f8fae 55%, #235a7a);
}
.intro-scene .intro-sea {
  position: absolute;
  left: 0;
  right: 0;
  top: 55%;
  bottom: 0;
}
.intro-scene .intro-waves {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 40px;
  background: repeating-radial-gradient(circle at 20px -6px, transparent 0 18px, rgba(255, 255, 255, 0.35) 19px 21px, transparent 22px 40px);
  background-size: 40px 40px;
  animation: intro-waves 3s linear infinite;
}
@keyframes intro-waves {
  to {
    transform: translateX(40px);
  }
}
.intro-scene .intro-sun {
  position: absolute;
  right: 14%;
  top: 12%;
  width: 11vmin;
  height: 11vmin;
  border-radius: 50%;
  background: #ffd36b;
  box-shadow: 0 0 60px rgba(255, 211, 107, 0.8);
}
.intro-scene .intro-city {
  position: absolute;
  left: 4%;
  bottom: 45%;
  width: 34vmin;
}
.intro-scene .intro-ship {
  position: absolute;
  bottom: 30%;
  width: 26vmin;
  left: 8%;
  animation: intro-sail 13s linear forwards, intro-bob 3s ease-in-out infinite;
}
@keyframes intro-sail {
  to {
    left: 78%;
  }
}
@keyframes intro-bob {
  50% {
    transform: translateY(-1.2vmin) rotate(2deg);
  }
}
.intro-caption {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  width: min(90vw, 40rem);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 4.2vw, 2.4rem);
  line-height: 1.25;
  color: var(--neo-navy);
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.8);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.intro-caption.is-visible {
  opacity: 1;
}

/* ---------- Handy ---------- */
@media (max-width: 600px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0.5rem 0.7rem 0.55rem;
    gap: 0.45rem;
  }
  .topbar .subtitle {
    display: none;
  }
  .topbar h1 {
    font-size: 1.3rem;
  }
  .turn-controls {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0.4rem;
    margin: 0 -0.7rem;
    padding: 0 0.7rem 2px;
    width: calc(100% + 1.4rem);
  }
  .turn-controls::-webkit-scrollbar {
    display: none;
  }
  .turn-indicator,
  .end-turn-button,
  .new-game-button {
    flex: none;
  }
  .main-layout {
    padding: 0.6rem;
    gap: 0.7rem;
  }
  .map-scroll,
  .map-frame {
    border-radius: 16px;
  }
  .status-panel {
    border-radius: 20px;
    max-height: none;
  }
  .log-section {
    padding: 0 0.6rem 0.8rem;
  }
}

/* Neokontor: Punkte statt großer Bild-Marker brauchen weniger Zoom — 2x
   zeigt mehr von Nord- und Ostsee (siehe main.js MAP_ZOOM_SCALE). */
.map-frame.is-zoomed {
  width: 200%;
  height: 200%;
}

/* ---------- Handelstabelle ---------- */
.trade-table {
  font-size: 0.86rem;
}
.trade-table tbody tr:nth-child(odd) {
  background: #f7f9fa;
}
.trade-table tbody tr.is-highlighted {
  background: rgba(226, 181, 82, 0.35);
}
.good-cell img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  border: 0;
  background: #f3efe4;
  padding: 3px;
}
.trade-table button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.76rem;
  border: 0;
  border-radius: 8px;
  padding: 0.32rem 0.6rem;
  background: var(--neo-navy);
  color: #fff;
}
.trade-table button:hover:not(:disabled) {
  background: var(--neo-navy-2);
}
.trade-table button.qty-step-btn {
  background: #e8eef1;
  color: var(--neo-navy);
  padding: 0.28rem 0.45rem;
}
.trade-table button.qty-step-btn:hover:not(:disabled) {
  background: #d9e2e7;
}
.trade-table button:disabled {
  background: #eef2f4;
  color: #9aa9b3;
  opacity: 1;
}
.profit-positive {
  color: var(--neo-green);
}
.profit-negative {
  color: #c0503d;
}
.trade-result.is-profit {
  background: rgba(46, 158, 106, 0.12);
  color: #1f7a50;
  border-color: transparent;
}
.trade-result.is-loss {
  background: rgba(192, 80, 61, 0.12);
  color: #a33a28;
  border-color: transparent;
}

/* ---------- Tutorial ---------- */
.tutorial-next,
.tutorial-back {
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: 10px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
}
.tutorial-next {
  background: var(--neo-navy);
  color: #fff;
  border: 0;
}
.tutorial-back {
  background: #e8eef1;
  color: var(--neo-navy);
  border: 0;
}
.tutorial-dot.is-active {
  background: var(--neo-gold);
}
.round-summary-event {
  background: #f4f7f8;
  border-radius: 12px;
}
.round-summary-verdict {
  border-radius: 12px;
  border: 0;
  font-family: var(--font-body);
}
