/* Stili specifici per l'interfaccia di gioco */

/* Base */
.game-body {
    background: linear-gradient(135deg, #0f1e2e, #162538, #1c2f48);
    color: #e6e6e6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  /* Header di gioco */
  .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(10, 20, 35, 0.8);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(76, 201, 240, 0.2);
    z-index: 10;
    position: relative;
  }
  
  .logo.small {
    transform: scale(0.8);
    margin-right: 15px;
  }
  
  .game-controls {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .game-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #b0bec5;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 5px;
  }

  #home-nation-label {
    color: #ffd54f;
    font-weight: 700;
  }

  #global-stability {
    color: #4db6ac;
    font-weight: 700;
  }

  #live-indicator {
    color: #b39ddb;
    font-weight: 600;
    font-size: 0.78rem;
  }

  #scenario-indicator {
    color: #ffab91;
    font-weight: 700;
    font-size: 0.85rem;
  }

  #calendar-indicator {
    color: #ce93d8;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
  }

  #chapter-indicator {
    color: #ffd54f;
    font-weight: 700;
    font-size: 0.82rem;
  }
  #chapter-indicator:empty { display: none; }

  #objectives-bar {
    display: flex;
    gap: 8px;
    margin-top: 4px;
  }

  .objective-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    color: #b0bec5;
  }

  .objective-chip.streak-active {
    color: #81c784;
    border-color: rgba(129, 199, 132, 0.5);
  }

  .objective-chip.danger {
    color: #ef9a9a;
    border-color: rgba(239, 154, 154, 0.5);
  }

  .streak-dots {
    letter-spacing: 2px;
    font-size: 0.85rem;
  }
  
  .turn-info {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4db6ac;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    border-radius: 5px;
    min-width: 120px;
    text-align: center;
  }
  
  .control-buttons {
    display: flex;
    gap: 10px;
  }
  
  .control-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
    background: #1e4976;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .control-btn:hover {
    background: #2a5a8a;
    transform: translateY(-2px);
  }
  
  .back-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
  }
  
  .back-btn:hover {
    background: rgba(0, 0, 0, 0.5);
  }
  
  /* Layout principale: mappa full-width sopra, dashboard sotto */
  .game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    flex-grow: 1;
  }

  section {
    background: rgba(10, 20, 35, 0.6);
    border-radius: 8px;
    padding: 15px;
    position: relative;
    backdrop-filter: blur(5px);
  }

  #map-section {
    min-height: 760px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #dashboards-section {
    height: auto;
  }
  
  section h2 {
    color: #4db6ac;
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(77, 182, 172, 0.3);
  }
  
  /* Mappa mondiale */
  .map-container {
    flex: 1 1 auto;
    min-height: 600px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background:
      radial-gradient(circle at center, rgba(77, 182, 172, 0.14), transparent 58%),
      rgba(0, 0, 0, 0.2);
  }

  /* Mappa SVG mondiale */
  .world-map-svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 6px;
    filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.4));
  }

  .map-fallback {
    color: #b0bec5;
    text-align: center;
    padding: 60px 20px;
    font-size: 0.9rem;
  }

  .map-fallback code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 3px;
    color: #4db6ac;
  }

  /* Regioni: paesi non-playable */
  .region.region-none path {
    fill: #1c2333;
    stroke: rgba(77, 182, 172, 0.10);
    stroke-width: 0.3;
    pointer-events: none;
    transition: fill 0.4s ease;
  }

  /* Regioni: paesi giocabili (gruppo per entita) */
  .region[data-region] {
    --region-color: #4db6ac;
    cursor: pointer;
  }

  .region[data-region] path {
    fill: var(--region-color);
    fill-opacity: 0.55;
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 0.4;
    transition: fill-opacity 0.25s ease, stroke 0.25s ease, stroke-width 0.25s ease;
  }

  .region[data-region]:hover path {
    fill-opacity: 0.85;
    stroke: #ffffff;
    stroke-width: 0.8;
  }

  .region.is-home path {
    stroke: #ffd54f;
    stroke-width: 1.4;
    fill-opacity: 0.85;
    filter: drop-shadow(0 0 6px rgba(255, 213, 79, 0.65));
  }

  .region.in-crisis path {
    stroke: #f44336;
    stroke-width: 1.5;
    animation: region-pulse 2s ease-in-out infinite;
  }

  .region.default-risk path {
    stroke: #b71c1c;
    stroke-width: 1.6;
    stroke-dasharray: 3 2;
  }

  @keyframes region-pulse {
    0%, 100% { fill-opacity: 0.55; }
    50% { fill-opacity: 0.95; }
  }

/* Pannello casa con obiettivi e suggerimenti */
.home-summary {
  background: rgba(255, 213, 79, 0.06);
  border: 1px solid rgba(255, 213, 79, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.home-summary h3 {
  color: #ffd54f;
  font-size: 1rem;
  margin-bottom: 8px;
}

#objectives-detail {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 0.82rem;
}

#objectives-detail li.check-ok {
  color: #81c784;
}

#objectives-detail li.check-pending {
  color: #b0bec5;
}

#hint-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.hint-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(77, 182, 172, 0.08);
  border-left: 3px solid #4db6ac;
  border-radius: 4px;
  font-size: 0.83rem;
}

.hint-text {
  color: #cfd8dc;
  flex: 1;
}

.hint-action {
  background: #4db6ac;
  color: #0f1e2e;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.hint-action:hover {
  background: #26a69a;
}

.hint-empty {
  font-size: 0.82rem;
  color: #81c784;
  font-style: italic;
}

#history-sparkline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

/* Quest panel (tutorial scenario) */
#quest-panel {
  background: rgba(206, 147, 216, 0.08);
  border: 1px solid rgba(206, 147, 216, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.quest-header {
  font-weight: 700;
  color: #ce93d8;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.quest-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}

.quest-list li.quest-done {
  color: #81c784;
  text-decoration: line-through;
  opacity: 0.7;
}

.quest-list li.quest-todo {
  color: #cfd8dc;
}

.quest-mark {
  display: inline-block;
  width: 16px;
  font-weight: 700;
}

/* Turn log panel */
.turn-log-section {
  background: rgba(15, 30, 50, 0.6);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(77, 182, 172, 0.18);
}

.turn-log-section > summary {
  color: #4db6ac;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.turn-log-section > summary::-webkit-details-marker {
  display: none;
}

.turn-log-section > summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: #4db6ac;
  transition: transform 0.2s ease;
  display: inline-block;
}

.turn-log-section[open] > summary::before {
  transform: rotate(90deg);
}

.turn-log-section[open] > summary {
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.25);
}

.turn-log-section h3 {
  color: #4db6ac;
  font-size: 0.95rem;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.25);
}

#turn-log-panel {
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 6px 8px;
}

.log-turn-label {
  color: #b0bec5;
  font-weight: 700;
  font-size: 0.74rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.log-entry {
  padding: 3px 6px;
  border-radius: 3px;
  margin: 2px 0;
  border-left: 2px solid transparent;
}

.log-entry.log-action {
  color: #90caf9;
  border-left-color: #1976d2;
  background: rgba(25, 118, 210, 0.08);
}

.log-entry.log-settlement {
  color: #ffd54f;
  border-left-color: #f9a825;
  background: rgba(249, 168, 37, 0.08);
}

.log-entry.log-quest {
  color: #ce93d8;
  border-left-color: #8e24aa;
  background: rgba(142, 36, 170, 0.10);
  font-weight: 600;
}

.log-entry.log-delta-pos {
  color: #81c784;
  border-left-color: #43a047;
}

.log-entry.log-delta-neg {
  color: #ef9a9a;
  border-left-color: #e53935;
}

.log-entry.flash {
  animation: log-flash 1.2s ease-out;
}

@keyframes log-flash {
  0% { background-color: rgba(255, 255, 255, 0.18); }
  100% { background-color: transparent; }
}

.log-empty {
  color: #607d8b;
  font-style: italic;
  font-size: 0.82rem;
}

/* Scenario picker */
#scenario-picker-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.scenario-card {
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenario-card:hover {
  border-color: rgba(77, 182, 172, 0.4);
  transform: translateY(-1px);
}

.scenario-card.selected {
  border-color: #4db6ac;
  background: rgba(77, 182, 172, 0.12);
}

.scenario-card h4 {
  color: #4db6ac;
  margin: 0 0 6px 0;
  font-size: 0.95rem;
}

.scenario-card p {
  font-size: 0.82rem;
  color: #cfd8dc;
  margin: 0 0 8px 0;
  line-height: 1.35;
}

.scenario-card small {
  color: #b0bec5;
  font-size: 0.72rem;
}

.sparkline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.18);
  padding: 6px 10px;
  border-radius: 4px;
}

.sparkline-label {
  color: #b0bec5;
  min-width: 60px;
}

.sparkline-value {
  margin-left: auto;
  color: #e6e6e6;
  font-weight: 700;
}

.sparkline-empty {
  color: #607d8b;
  font-style: italic;
}

/* Dashboard nazioni: griglia che riempie tutta la larghezza */
.dashboards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  padding-right: 5px;
}

.nation-dashboard {
  background: rgba(15, 30, 50, 0.8);
  border-radius: 8px;
  padding: 15px;
  border-left: 5px solid;
  transition: transform 0.2s ease;
  margin-bottom: 10px;
}

.nation-dashboard:hover {
  transform: translateY(-3px);
}

.nation-dashboard.is-home {
  box-shadow: 0 0 0 2px #ffd54f, 0 0 12px rgba(255, 213, 79, 0.3);
}

.nation-dashboard h3 {
  color: #4db6ac;
  margin-bottom: 10px;
  font-size: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 5px;
}

.finance-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.85rem;
  background: rgba(77, 182, 172, 0.1);
  padding: 10px;
  border: 1px solid rgba(77, 182, 172, 0.18);
  border-radius: 5px;
}

.gte-token {
  color: #81c784;
  font-weight: 700;
}

.gov-token {
  color: #ffd54f;
  font-weight: 700;
}

.tax-rate {
  color: #4db6ac;
  font-weight: 700;
}

.debt-amount {
  color: #ce93d8;
  font-weight: 700;
}

.debt-amount.default-risk {
  color: #f44336;
  text-decoration: underline;
}

.interest-rate {
  color: #ce93d8;
  font-weight: 700;
}

.market-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.market-chip {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(77, 182, 172, 0.12);
  border: 1px solid rgba(77, 182, 172, 0.25);
  color: #dff9f6;
  font-size: 0.78rem;
  font-weight: 700;
}

.token-market-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(129, 199, 132, 0.10);
  border: 1px solid rgba(129, 199, 132, 0.30);
  font-size: 0.78rem;
}

.token-chip-label {
  color: #b0bec5;
  font-weight: 600;
}

.token-chip-value {
  color: #81c784;
  font-weight: 700;
}

.token-chip-value.gte-price {
  color: #4db6ac;
}

.token-chip-value.gov-supply {
  color: #ffd54f;
}

.bond-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.commodities-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.commodity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 171, 145, 0.08);
  border: 1px solid rgba(255, 171, 145, 0.28);
  font-size: 0.78rem;
}

.commodity-chip-label {
  color: #ffab91;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.commodity-chip-value {
  color: #e6e6e6;
  font-weight: 700;
}

.commodity-chip-delta {
  font-weight: 700;
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: 4px;
}

.commodity-chip-delta.pos {
  color: #81c784;
  background: rgba(129, 199, 132, 0.12);
}

.commodity-chip-delta.neg {
  color: #ef9a9a;
  background: rgba(239, 154, 154, 0.12);
}

.indices-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.index-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(126, 87, 194, 0.10);
  border: 1px solid rgba(126, 87, 194, 0.30);
  font-size: 0.78rem;
}

.index-chip-label {
  color: #b39ddb;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.index-chip-value {
  color: #e6e6e6;
  font-weight: 700;
}

.index-chip-delta {
  font-weight: 700;
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: 4px;
}

.index-chip-delta.pos {
  color: #81c784;
  background: rgba(129, 199, 132, 0.12);
}

.index-chip-delta.neg {
  color: #ef9a9a;
  background: rgba(239, 154, 154, 0.12);
}

.news-panel {
  background: rgba(15, 30, 50, 0.6);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(77, 182, 172, 0.18);
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #4db6ac;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.25);
}

.news-sentiment {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.news-sentiment.pos { color: #81c784; background: rgba(129, 199, 132, 0.15); }
.news-sentiment.neg { color: #ef9a9a; background: rgba(239, 154, 154, 0.15); }
.news-sentiment.neutral { color: #b0bec5; background: rgba(176, 190, 197, 0.12); }

.news-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.news-item {
  display: block;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 2px solid rgba(77, 182, 172, 0.4);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.news-item:hover {
  background: rgba(77, 182, 172, 0.08);
  border-left-color: #4db6ac;
}

.news-title {
  color: #e6e6e6;
  font-size: 0.82rem;
  line-height: 1.3;
  margin-bottom: 3px;
}

.news-meta {
  color: #b0bec5;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-empty {
  color: #607d8b;
  font-style: italic;
  font-size: 0.82rem;
  padding: 8px;
}

/* Advisor panel persistente con guida concreta */
.advisor-panel {
  background: linear-gradient(135deg, rgba(15, 30, 50, 0.85), rgba(46, 22, 78, 0.6));
  border: 1px solid rgba(77, 182, 172, 0.45);
  border-left: 4px solid #4db6ac;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.advisor-panel:empty { display: none; }

.advisor-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4db6ac;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.25);
}

.advisor-panel-icon {
  font-size: 1.1rem;
}

.advisor-panel-title {
  flex: 1;
}

.advisor-panel-role {
  color: #b0bec5;
  font-weight: 500;
  font-size: 0.75rem;
}

.advisor-panel-body {
  color: #e6e6e6;
  font-size: 0.88rem;
  line-height: 1.45;
}

.advisor-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(77, 182, 172, 0.2);
}

.advisor-quick-actions:empty {
  display: none;
}

.advisor-quick-btn {
  padding: 8px 14px;
  background: rgba(77, 182, 172, 0.12);
  color: #4db6ac;
  border: 1px solid rgba(77, 182, 172, 0.45);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.advisor-quick-btn:hover {
  background: rgba(77, 182, 172, 0.25);
  transform: translateY(-1px);
}

.advisor-quick-btn.primary {
  background: #4db6ac;
  color: #0f1e2e;
  border-color: #4db6ac;
}

.advisor-quick-btn.primary:hover {
  background: #26a69a;
  border-color: #26a69a;
}

/* Sticky action bar in basso */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(15, 30, 50, 0.92), rgba(10, 20, 35, 0.98));
  border-top: 2px solid rgba(77, 182, 172, 0.45);
  backdrop-filter: blur(8px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.action-bar:empty {
  display: none;
}

.action-bar-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-bar-scenario {
  color: #ffd54f;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-bar-goal {
  color: #cfd8dc;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-bar-turn {
  color: #b0bec5;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.action-bar-turn strong {
  color: #4db6ac;
  font-size: 1rem;
}

.action-bar-next {
  flex-shrink: 0;
  padding: 12px 24px;
  background: #4db6ac;
  color: #0f1e2e;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(77, 182, 172, 0.3);
}

.action-bar-next:hover {
  background: #26a69a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(77, 182, 172, 0.5);
}

/* Spazio in fondo perche action-bar non copra contenuto */
.game-container {
  padding-bottom: 80px;
}

/* Collapsible secondary panels (headlines, news, yields/VIX) */
.collapsible-panel {
  background: rgba(15, 30, 50, 0.55);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(77, 182, 172, 0.16);
}

.collapsible-panel > summary {
  color: #4db6ac;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.collapsible-panel > summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel > summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: #4db6ac;
  transition: transform 0.2s ease;
  display: inline-block;
}

.collapsible-panel[open] > summary::before {
  transform: rotate(90deg);
}

.collapsible-panel[open] > summary {
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.22);
}

/* Reset internal panel padding/border when wrapped (avoid double frame) */
.collapsible-panel > .headlines-panel,
.collapsible-panel > .news-panel,
.collapsible-panel > .yields-vix-panel {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

/* Nation action popover (anchored to map clicks) */
.nation-popover {
  position: fixed;
  width: 240px;
  z-index: 950;
  background: linear-gradient(135deg, rgba(15, 30, 50, 0.96), rgba(10, 30, 60, 0.96));
  border: 1px solid rgba(77, 182, 172, 0.55);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: #e6e6e6;
  font-family: system-ui, -apple-system, sans-serif;
  padding: 0;
  overflow: hidden;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.nation-popover.hidden {
  display: none;
}

.nation-popover .popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(77, 182, 172, 0.12);
  border-bottom: 1px solid rgba(77, 182, 172, 0.3);
}

.nation-popover .popover-title {
  color: #4db6ac;
  font-weight: 700;
  font-size: 0.95rem;
}

.nation-popover .popover-close {
  background: transparent;
  border: none;
  color: #b0bec5;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.nation-popover .popover-close:hover {
  color: #4db6ac;
}

.nation-popover .popover-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: #cfd8dc;
  border-bottom: 1px solid rgba(77, 182, 172, 0.18);
}

.nation-popover .popover-flag {
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.7rem;
}

.nation-popover .popover-flag.crisis {
  background: rgba(255, 152, 0, 0.18);
  color: #ffcc80;
}

.nation-popover .popover-flag.default {
  background: rgba(244, 67, 54, 0.18);
  color: #ef9a9a;
}

.nation-popover .popover-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 14px;
}

.nation-popover .popover-action {
  padding: 8px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(77, 182, 172, 0.12);
  border: 1px solid rgba(77, 182, 172, 0.4);
  color: #4db6ac;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, transform 0.12s ease;
}

.nation-popover .popover-action:hover:not(:disabled) {
  background: rgba(77, 182, 172, 0.28);
  transform: translateY(-1px);
}

.nation-popover .popover-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Map overlay: trade + bond connection lines */
.world-map-svg .map-overlay {
  pointer-events: none;
}

.world-map-svg .connection-bond {
  stroke: rgba(206, 147, 216, 0.55);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  fill: none;
  opacity: 0.7;
}

.world-map-svg .connection-trade {
  stroke: #4db6ac;
  stroke-width: 1.6;
  stroke-dasharray: 8 6;
  fill: none;
  opacity: 0.85;
  animation: trade-flow-dash 2s linear infinite;
}

@keyframes trade-flow-dash {
  to { stroke-dashoffset: -28; }
}

/* Header pill groups */
.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(77, 182, 172, 0.25);
  border-radius: 999px;
  font-size: 0.85rem;
  color: #cfd8dc;
  white-space: nowrap;
}

.header-pill.pill-time {
  border-color: rgba(77, 182, 172, 0.4);
}

.header-pill.pill-state {
  border-color: rgba(255, 213, 79, 0.3);
}

.header-pill .pill-item strong {
  color: #4db6ac;
  font-weight: 700;
  margin-left: 4px;
}

.header-pill .pill-sep {
  width: 1px;
  height: 14px;
  background: rgba(77, 182, 172, 0.25);
}

.header-pill .pill-item {
  color: inherit;
}

#calendar-indicator { color: #4db6ac; font-weight: 600; }
#home-nation-label { color: #ffd54f; }
#global-stability { color: #b0bec5; }
#live-indicator { color: #81c784; }

/* Primary CTA in header */
.control-btn.primary-cta {
  background: #4db6ac;
  color: #0f1e2e;
  font-weight: 700;
  padding: 9px 18px;
  font-size: 0.92rem;
}

.control-btn.primary-cta:hover {
  background: #26a69a;
  transform: translateY(-2px);
}

/* Header drop-down menu */
.header-menu-wrap {
  position: relative;
  display: inline-block;
}

.header-menu-btn {
  font-size: 0.92rem;
  letter-spacing: 0.05em;
}

.header-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 92vw;
  z-index: 900;
  background: linear-gradient(135deg, rgba(15, 30, 50, 0.97), rgba(10, 30, 60, 0.97));
  border: 1px solid rgba(77, 182, 172, 0.4);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(8px);
}

.header-menu-panel.hidden {
  display: none;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-section-title {
  color: #4db6ac;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.2);
}

.menu-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.85rem;
}

.menu-row .menu-label {
  color: #b0bec5;
  font-size: 0.78rem;
  min-width: 70px;
}

.menu-row > span:not(.menu-label) {
  color: #e6e6e6;
  font-weight: 600;
}

#header-menu-panel #scenario-indicator { color: #4db6ac; }
#header-menu-panel #chapter-indicator { color: #ffd54f; }

#header-menu-panel #objectives-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.menu-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.menu-buttons .control-btn {
  width: 100%;
  text-align: center;
  padding: 8px 10px;
  font-size: 0.82rem;
}

/* News header improvements (timestamp + refresh button) */
.news-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.news-fetched-at {
  font-size: 0.7rem;
  color: #b0bec5;
  font-weight: 500;
  text-transform: none;
}

.news-refresh-btn {
  background: rgba(77, 182, 172, 0.15);
  border: 1px solid rgba(77, 182, 172, 0.4);
  color: #4db6ac;
  font-size: 0.85rem;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.news-refresh-btn:hover:not(:disabled) {
  background: rgba(77, 182, 172, 0.3);
}

.news-refresh-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.news-error {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(255, 152, 0, 0.12);
  border-left: 3px solid #ff9800;
  border-radius: 3px;
  color: #ffcc80;
  font-size: 0.78rem;
}

/* Ticker host divs (formerly inserted into map-section, now standalone in collapsed details) */
.collapsible-panel > .market-ticker,
.collapsible-panel > .token-market-ticker,
.collapsible-panel > .bond-ticker,
.collapsible-panel > .commodities-ticker,
.collapsible-panel > .indices-ticker {
  margin: 0;
}

.collapsible-panel > .market-ticker:empty::before,
.collapsible-panel > .token-market-ticker:empty::before,
.collapsible-panel > .bond-ticker:empty::before,
.collapsible-panel > .commodities-ticker:empty::before,
.collapsible-panel > .indices-ticker:empty::before {
  content: 'In attesa dei dati live…';
  color: #607d8b;
  font-style: italic;
  font-size: 0.82rem;
}

/* Two-column desktop layout (>=1200px) */
@media (min-width: 1200px) {
  .game-container {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(560px, 1.1fr);
    align-items: start;
    gap: 20px;
  }

  .left-pane {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
  }

  #map-section {
    height: 78vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #map-section .map-container {
    flex: 1 1 auto;
    min-height: 0;
  }

  #dashboards-section {
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .header-pill {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .header-menu-panel {
    width: calc(100vw - 24px);
    right: -8px;
  }
  .menu-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .action-bar {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .action-bar-scenario {
    font-size: 0.68rem;
  }
  .action-bar-goal {
    font-size: 0.78rem;
  }
  .action-bar-next {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

/* Headlines panel narrativo */
.headlines-panel {
  background: linear-gradient(135deg, rgba(15, 30, 50, 0.7), rgba(46, 22, 78, 0.5));
  border-left: 4px solid #ffd54f;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.headlines-panel:empty { display: none; }

.headlines-header {
  color: #ffd54f;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 700;
}

.headlines-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.headlines-list li {
  color: #e6e6e6;
  font-size: 0.85rem;
  line-height: 1.35;
  font-style: italic;
}

/* Avatar leader (foto del personaggio) */
.leader-avatar {
  display: inline-block;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(77, 182, 172, 0.5);
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.leader-avatar-modal {
  width: 64px;
  height: 64px;
}

.leader-avatar-panel {
  width: 32px;
  height: 32px;
  border-width: 1.5px;
}

/* Advisor card per intro/branching */
.advisor-card {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(77, 182, 172, 0.10);
  border-left: 3px solid #4db6ac;
  border-radius: 4px;
}

.advisor-card.with-avatar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.advisor-card .advisor-text {
  flex: 1;
  min-width: 0;
}

.advisor-card:empty { display: none; }

.advisor-name {
  color: #4db6ac;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.advisor-role {
  color: #b0bec5;
  font-weight: 500;
  font-size: 0.78rem;
}

.advisor-line {
  color: #e6e6e6;
  font-style: italic;
  line-height: 1.4;
}

/* Branching event modal */
#branching-event-modal .modal-content,
#chapter-intro-modal .modal-content {
  background: linear-gradient(135deg, #1c2a4a, #2a1a4a);
  border-color: rgba(255, 213, 79, 0.4);
}

#branching-event-modal .modal-header h3,
#chapter-intro-modal .modal-header h3 {
  color: #ffd54f;
}

.branching-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.branching-choice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  color: white;
  transition: all 0.2s ease;
}

.branching-choice:hover {
  background: rgba(77, 182, 172, 0.15);
  border-color: #4db6ac;
  transform: translateY(-1px);
}

.branching-choice-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #4db6ac;
}

.branching-choice-consequence {
  font-size: 0.8rem;
  color: #cfd8dc;
  line-height: 1.35;
}

.news-per-nation {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.news-nation-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.news-nation-chip.pos { color: #81c784; background: rgba(129, 199, 132, 0.14); border: 1px solid rgba(129, 199, 132, 0.4); }
.news-nation-chip.neg { color: #ef9a9a; background: rgba(239, 154, 154, 0.14); border: 1px solid rgba(239, 154, 154, 0.4); }
.news-nation-chip.neutral { color: #b0bec5; background: rgba(176, 190, 197, 0.10); border: 1px solid rgba(176, 190, 197, 0.3); }

.yields-vix-panel {
  background: rgba(15, 30, 50, 0.6);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(126, 87, 194, 0.20);
}

.yv-header {
  color: #b39ddb;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.yv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(126, 87, 194, 0.10);
  border: 1px solid rgba(126, 87, 194, 0.30);
  font-size: 0.78rem;
}

.yv-chip.high {
  background: rgba(244, 67, 54, 0.12);
  border-color: rgba(244, 67, 54, 0.45);
}

.yv-chip.low {
  background: rgba(129, 199, 132, 0.10);
  border-color: rgba(129, 199, 132, 0.40);
}

.yv-label {
  color: #b0bec5;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.yv-value {
  color: #e6e6e6;
  font-weight: 700;
}

.yv-chip.high .yv-value { color: #ef9a9a; }
.yv-chip.low .yv-value { color: #81c784; }

.token-chip-value.bond-outstanding {
  color: #b39ddb;
}

.token-chip-value.bond-defaults {
  color: #f44336;
}

.bond-outstanding {
  color: #b39ddb;
  font-weight: 700;
}

.bond-holdings {
  color: #80cbc4;
  font-weight: 700;
}

.bond-direction {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 10px;
  border-radius: 5px;
}

.bond-direction-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.bond-direction-item input {
  width: auto;
}

.bond-warn {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #ffab91;
}

.modal.currency-shock .modal-content {
  border-color: rgba(244, 67, 54, 0.6);
  background: linear-gradient(135deg, #2a1a30, #460f3a);
}

.modal.currency-shock .modal-header h3 {
  color: #ffab91;
}

#victory-modal.victory .modal-content {
  border-color: rgba(76, 175, 80, 0.7);
  background: linear-gradient(135deg, #1a3320, #0f3f24);
}

#victory-modal.victory .modal-header h3 {
  color: #81c784;
}

#victory-modal.defeat .modal-content {
  border-color: rgba(244, 67, 54, 0.7);
  background: linear-gradient(135deg, #2a1a1a, #460f0f);
}

#victory-modal.defeat .modal-header h3 {
  color: #ef9a9a;
}

/* Indicatori di resilienza */
.resilience-indicators {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 15px 0;
}

.indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.indicator span {
  width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar {
  flex-grow: 1;
  height: 12px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  overflow: hidden;
  margin-left: 10px;
}

.progress {
  height: 100%;
  background-color: #4CAF50;
  transition: width 0.5s, background-color 0.5s;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 5px;
  margin-top: 12px;
}

.trade-btn, .policy-btn, .invest-btn, .transfer-btn, .bond-btn {
  padding: 6px 4px;
  font-size: 0.74rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-btn {
  background: #1976d2;
}

.trade-btn:hover {
  background: #1565c0;
}

.policy-btn {
  background: #7b1fa2;
}

.policy-btn:hover {
  background: #6a1b9a;
}

.invest-btn { background: #2e7d32; }
.invest-btn:hover { background: #1b5e20; }
.transfer-btn { background: #00838f; }
.transfer-btn:hover { background: #006064; }
.bond-btn { background: #5e35b1; }

.bond-btn:hover {
  background: #4527a0;
}

/* Pannelli di interazione */
.panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-width: 90vw;
  background: linear-gradient(135deg, #1a2a40, #0f3460);
  padding: 20px;
  border-radius: 10px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(77, 182, 172, 0.3);
}

.panel h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #4db6ac;
  font-size: 1.3rem;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.3);
}

.trade-options, .policy-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.resource-selector, .amount-selector, .target-selector, .policy-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.amount-selector input {
  flex-grow: 1;
}

select, input {
  padding: 10px;
  border-radius: 5px;
  border: 1px solid rgba(77, 182, 172, 0.3);
  background-color: rgba(15, 30, 50, 0.8);
  color: #fff;
  width: 100%;
}

.policy-item {
  padding: 12px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 5px;
}

.policy-item label {
  flex-grow: 1;
  cursor: pointer;
}

.trade-actions, .policy-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.policy-cost {
  margin-top: 8px;
  color: #ffd54f;
  font-weight: 700;
}

.gte-cost {
  margin-top: 8px;
  color: #81c784;
  font-weight: 700;
}

.cooldown-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  font-size: 0.7rem;
  background: rgba(244, 67, 54, 0.18);
  border: 1px solid rgba(244, 67, 54, 0.45);
  color: #ffab91;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

/* Notifiche */
.notifications-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}

.notification {
  background: rgba(15, 30, 50, 0.9);
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 4px solid #4db6ac;
  animation: slideIn 0.3s ease;
  transition: opacity 0.5s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.notification.alert {
  border-left-color: #f44336;
}

.notification.success {
  border-left-color: #4CAF50;
}

.achievement-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(15, 30, 50, 0.95), rgba(46, 22, 78, 0.95));
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 213, 79, 0.5);
  box-shadow: 0 6px 18px rgba(255, 213, 79, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.4s ease;
  transition: opacity 0.4s ease;
}

.achievement-toast.fade-out {
  opacity: 0;
}

.achievement-toast-badge {
  font-size: 1.6rem;
  color: #ffd54f;
  text-shadow: 0 0 10px rgba(255, 213, 79, 0.8);
  flex-shrink: 0;
  line-height: 1;
}

.achievement-toast-title {
  font-size: 0.7rem;
  color: #ffd54f;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.achievement-toast-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.achievement-toast-desc {
  color: #cfd8dc;
  font-size: 0.78rem;
  line-height: 1.3;
}

.fade-out {
  opacity: 0;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modal per eventi */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: linear-gradient(135deg, #1a2a40, #0f3460);
  width: 500px;
  max-width: 90vw;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(77, 182, 172, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-content.wide {
  width: 700px;
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.3);
}

.modal-header h3 {
  color: #4db6ac;
  font-size: 1.3rem;
  margin: 0;
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(77, 182, 172, 0.3);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.primary-btn, .secondary-btn {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.primary-btn {
  background: #4db6ac;
  color: #0f1e2e;
}

.primary-btn:hover {
  background: #26a69a;
  transform: translateY(-2px);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Turn recap modal */
#turn-recap-modal .modal-content {
  width: 640px;
}

#turn-recap-modal .modal-footer {
  justify-content: space-between;
  align-items: center;
}

.recap-skip-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #b0bec5;
  cursor: pointer;
  user-select: none;
}

.recap-skip-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: #4db6ac;
}

.recap-chapter {
  font-size: 0.85rem;
  color: #4db6ac;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(77, 182, 172, 0.3);
}

.recap-section {
  margin-bottom: 16px;
}

.recap-section:last-child {
  margin-bottom: 0;
}

.recap-section-title {
  color: #ffd54f;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.recap-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recap-list li {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  font-size: 0.85rem;
  color: #cfd8dc;
  border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.recap-events li {
  border-left-color: #f9a825;
  color: #ffe082;
}

.recap-quests li {
  border-left-color: #8e24aa;
  color: #ce93d8;
  font-weight: 600;
}

.recap-deltas li.recap-delta-pos {
  border-left-color: #43a047;
  color: #a5d6a7;
}

.recap-deltas li.recap-delta-neg {
  border-left-color: #e53935;
  color: #ef9a9a;
}

.recap-goal {
  background: rgba(77, 182, 172, 0.08);
  border-radius: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(77, 182, 172, 0.25);
}

.recap-goal .recap-section-title {
  color: #4db6ac;
}

.recap-goal-text {
  color: #e0f2f1;
  font-size: 0.88rem;
  line-height: 1.5;
}

.recap-empty {
  color: #78909c;
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.close-btn {
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Tutorial */
.tutorial-slide {
  margin-bottom: 20px;
}

.tutorial-slide h4 {
  color: #4db6ac;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.tutorial-indicators {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 20px 0;
}

.tutorial-indicator {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.indicator-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.indicator-icon.energy {
  background: linear-gradient(135deg, #ff9800, #f57c00);
}

.indicator-icon.financial {
  background: linear-gradient(135deg, #26a69a, #00796b);
}

.indicator-icon.social {
  background: linear-gradient(135deg, #7e57c2, #5e35b1);
}

.indicator-icon.supply {
  background: linear-gradient(135deg, #42a5f5, #1976d2);
}

.indicator-info h5 {
  color: white;
  margin-bottom: 5px;
}

.tutorial-list {
  list-style-type: none;
  padding: 0;
  margin: 15px 0;
}

.tutorial-list li {
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
}

.tutorial-list li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: #4db6ac;
  font-weight: bold;
}

/* Animazioni per flussi commerciali */
.trade-flow {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}

/* Effetti di crisi */
.crisis-indicator {
  display: inline-block;
  background: #f44336;
  color: white;
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 4px;
  margin-left: 8px;
  animation: blink 2s infinite;
}

.default-badge {
  display: inline-block;
  background: #b71c1c;
  color: white;
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 0.05em;
  animation: blink 2s infinite;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Modal trofei */
#achievements-modal .modal-content {
  width: 760px;
}

#achievements-counter {
  margin-left: 10px;
  font-size: 0.95rem;
  color: #ffd54f;
  font-weight: 700;
}

.achievement-category {
  margin-bottom: 18px;
}

.achievement-category h4 {
  color: #4db6ac;
  font-size: 0.95rem;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(77, 182, 172, 0.25);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.achievement-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.achievement-card.unlocked {
  border-color: rgba(255, 213, 79, 0.55);
  background: rgba(255, 213, 79, 0.06);
}

.achievement-card.locked {
  opacity: 0.4;
}

.achievement-mark {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}

.achievement-card.unlocked .achievement-mark {
  color: #ffd54f;
  text-shadow: 0 0 6px rgba(255, 213, 79, 0.55);
}

.achievement-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.achievement-desc {
  color: #cfd8dc;
  font-size: 0.74rem;
  line-height: 1.3;
}

.achievement-card.locked .achievement-name,
.achievement-card.locked .achievement-desc {
  color: #b0bec5;
}

/* Utilità */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
  #map-section {
    min-height: 520px;
    max-height: 60vh;
  }

  .map-container {
    min-height: 400px;
  }

  .tutorial-indicators {
    grid-template-columns: 1fr;
  }

  #scenario-picker-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .game-header {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .game-controls {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .control-buttons {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .modal-content {
    max-height: 90vh;
  }

  #map-section {
    min-height: 380px;
    max-height: 55vh;
  }

  .map-container {
    min-height: 300px;
  }
}

@media (max-width: 600px) {
  .game-container {
    padding: 10px;
    gap: 12px;
  }

  #map-section {
    min-height: 320px;
    max-height: 50vh;
    padding: 10px;
  }

  .map-container {
    min-height: 240px;
  }

  section h2 {
    font-size: 1.05rem;
  }

  .dashboards-container {
    grid-template-columns: 1fr;
  }

  .nation-dashboard {
    padding: 12px;
  }

  .actions {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .trade-btn, .policy-btn, .invest-btn, .transfer-btn, .bond-btn {
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  .game-status {
    font-size: 0.78rem;
  }

  #objectives-detail {
    grid-template-columns: 1fr;
  }

  #history-sparkline {
    grid-template-columns: 1fr;
  }
}
