:root {
  --fundal: #0b1220;
  --panou: #121b2d;
  --linie: #24324a;
  --text: #e8eef7;
  --slab: #9aa7b8;
  --accent: #3b82f6;
  --bun: #22c55e;
  --gresit: #ef4444;
  --antet: 52px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fundal); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}
a { color: #7fb0ff; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.02rem; }
hr { border: 0; border-top: 1px solid var(--linie); margin: 14px 0; width: 100%; }

/* Antetul */
header {
  height: var(--antet); flex: none; display: flex; align-items: center; gap: 18px;
  padding: 0 16px; background: #0e1626; border-bottom: 1px solid var(--linie); position: relative; z-index: 10;
}
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; white-space: nowrap; }
nav { display: flex; gap: 4px; }
nav a { color: var(--slab); text-decoration: none; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
nav a:hover { background: #1a2740; color: var(--text); }
nav a.activ { background: #1d3360; color: #fff; }
.versiune { margin-left: auto; color: var(--slab); font-size: .8rem; white-space: nowrap; }
#buton-meniu { display: none; background: none; border: 0; font-size: 1.4rem; padding: 4px 6px; }

main { flex: 1; min-height: 0; overflow: auto; }
main[data-sectiune="glob"], main[data-sectiune="romania"] { overflow: hidden; }

/* Glob și hărți: harta în stânga, panoul în dreapta */
.glob { display: flex; height: 100%; }
.stanga { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.harta { flex: 1; min-height: 0; background: #020814; }
.bara { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: #0e1626; border-bottom: 1px solid var(--linie); }
.panou { width: 360px; flex: none; overflow-y: auto; padding: 16px; background: var(--panou); border-left: 1px solid var(--linie); }
.mesaj {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 5;
  background: rgba(10, 16, 28, .92); padding: 9px 16px; border-radius: 10px; border: 1px solid var(--linie); max-width: 90%;
  transition: opacity .3s;
}
.mesaj.ascuns { opacity: 0; pointer-events: none; }

.segmente { display: inline-flex; background: #0a1120; border: 1px solid var(--linie); border-radius: 9px; padding: 2px; flex-wrap: wrap; }
.segmente button { background: none; border: 0; padding: 5px 12px; border-radius: 7px; color: var(--slab); }
.segmente button.activ { background: var(--accent); color: #fff; }

.nota { color: var(--slab); font-size: .9rem; }
.mic { font-size: .8rem; }
.pre { white-space: pre-line; }
.cauta, select {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--linie);
  background: #0a1120; color: var(--text); font: inherit; margin-bottom: 10px;
}
.filtre { display: flex; gap: 8px; } .filtre select { flex: 1; }
.lista { display: flex; flex-direction: column; gap: 2px; }
.linie {
  display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0;
  padding: 7px 8px; border-radius: 8px; width: 100%;
}
.linie:hover { background: #1a2740; }
.linie b { display: block; font-weight: 600; }
.linie small { display: block; color: var(--slab); }
.steag { font-size: 1.6rem; width: 34px; text-align: center; flex: none; }
.steag-mare { font-size: 3.6rem; line-height: 1; }
.cap { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.inapoi { background: none; border: 0; color: #7fb0ff; padding: 0; }
.rand { display: flex; gap: 10px; margin: 9px 0; }
.rand .ic { width: 24px; text-align: center; flex: none; }
.rand .et { color: var(--slab); font-size: .8rem; }
.rand .val { font-weight: 500; white-space: pre-line; }
.principal {
  background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 9px 18px; font-weight: 600;
}
.principal:hover { filter: brightness(1.1); }
.principal.mare { font-size: 1.15rem; padding: 12px 40px; }
.simplu { background: none; border: 1px solid var(--linie); border-radius: 9px; padding: 8px 16px; }
.mag {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  color: #111; font-weight: 700; font-size: .9rem;
}
.mag.mare { width: 64px; height: 64px; font-size: 1.4rem; }
.legenda { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; margin: 6px 0 10px; align-items: center; }
.legenda i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.fapt { margin-bottom: 16px; } .fapt p { margin: 0; }

/* Profilul de adâncime (România) */
.profil-box { height: 210px; flex: none; display: flex; flex-direction: column; background: #0e1626; border-top: 1px solid var(--linie); }
.profil-titlu { padding: 4px 10px 0; font-size: .78rem; font-weight: 600; }
.profil { width: 100%; flex: 1; min-height: 0; display: block; }

/* Joc-test */
.test { max-width: 760px; margin: 0 auto; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.emoji-mare { font-size: 4.5rem; line-height: 1.1; }
.sus { display: flex; justify-content: space-between; width: 100%; }
.progres { width: 100%; height: 6px; background: #1a2740; border-radius: 3px; overflow: hidden; }
.progres i { display: block; height: 100%; background: var(--accent); }
.variante { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.variante button {
  padding: 14px; border-radius: 10px; border: 1px solid var(--linie); background: var(--panou); font-size: 1rem;
}
.variante button:hover:not(:disabled) { border-color: var(--accent); }
.variante button.bun { background: rgba(34, 197, 94, .25); border-color: var(--bun); }
.variante button.gresit { background: rgba(239, 68, 68, .25); border-color: var(--gresit); }
.variante button.stins { opacity: .5; }
.variante button:disabled { cursor: default; }
.explicatie { padding: 12px 16px; border-radius: 10px; width: 100%; text-align: left; }
.explicatie.bun { background: rgba(34, 197, 94, .12); } .explicatie.gresit { background: rgba(239, 68, 68, .12); }
.record { color: #f59e0b; font-weight: 700; font-size: 1.1rem; margin: 0; }

/* Fapte */
.fapte { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.statistici { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.stat { background: var(--panou); border: 1px solid var(--linie); border-radius: 12px; padding: 14px; text-align: center; }
.stat b { display: block; font-size: 1.35rem; } .stat small { color: var(--slab); }
.carduri { columns: 2 340px; column-gap: 16px; }
.card { break-inside: avoid; background: var(--panou); border: 1px solid var(--linie); border-left: 4px solid var(--c); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; }
.card h2 { color: var(--c); }
.card ul { margin: 0; padding-left: 18px; } .card li { margin: 6px 0; }

/* Telefon și tabletă îngustă */
@media (max-width: 860px) {
  /* Secțiunile, mereu vizibile: două rânduri de butoane. */
  header { height: auto; flex-wrap: wrap; gap: 0; padding: 0; }
  .logo { padding: 10px 14px 4px; }
  .versiune { display: none; }
  nav { width: 100%; display: grid; grid-template-columns: 1fr 1fr; padding: 4px 8px 8px; gap: 6px; }
  nav a { background: #16213a; padding: 8px 10px; font-size: .9rem; text-align: center; white-space: normal; }
  .profil-titlu { font-size: .7rem; }
  .maplibregl-ctrl-attrib.maplibregl-compact { font-size: 10px; }
  .glob { flex-direction: column; }
  .stanga { flex: none; height: 58%; }
  .panou { width: auto; flex: 1; border-left: 0; border-top: 1px solid var(--linie); }
  .profil-box { height: 170px; }
  .variante { grid-template-columns: 1fr; }
}

/* Steaguri (imagini) */
.steag-img { width: 30px; height: 20px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); vertical-align: middle; }
.steag-mare .steag-img { width: 84px; height: 56px; border-radius: 5px; }
.steag-test { height: 110px; max-width: 220px; object-fit: contain; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.steag-mic { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; vertical-align: -3px; }
