/* ════════ Titelbildschirm & Startland-Wahl (05.10.2026) ════════
   Hintergrund = echte Weltkarte (client/intro-ui.js), abgedunkelt und langsam treibend.
   Alles hier ist auf #auth, #pick und #intro-bg begrenzt. */

/* ── Hintergrund ───────────────────────────────────── */
.intro-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #070c13; pointer-events: none; }
#intro-map { position: absolute; inset: -4%; width: 108%; height: 108%; opacity: .7; filter: saturate(.6) brightness(.85);
  animation: intro-drift 90s ease-in-out infinite alternate; will-change: transform; }
#intro-map .ib-land path { stroke: none; }
#intro-map .ib-border { fill: none; stroke: rgba(5, 8, 13, .9); stroke-width: .8; }
#intro-map .ib-grat { fill: none; stroke: rgba(150, 190, 230, .07); stroke-width: .6; }
.intro-veil { position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, rgba(7, 12, 19, .35) 0%, rgba(7, 12, 19, .78) 70%, rgba(7, 12, 19, .94) 100%),
    linear-gradient(180deg, rgba(7, 12, 19, .2) 0%, rgba(7, 12, 19, .65) 100%); }
@keyframes intro-drift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.07) translate(-1.6%, 1.2%); }
}
@media (prefers-reduced-motion: reduce) { #intro-map { animation: none; } }
#auth, #pick { position: relative; z-index: 1; }

/* ── Gemeinsame Bausteine ──────────────────────────── */
.brand-mark { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; color: var(--accent);
  background: linear-gradient(180deg, rgba(224, 180, 76, .16), rgba(224, 180, 76, .05)); border: 1px solid rgba(224, 180, 76, .32);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06); }
.brand-mark.sm { width: 42px; height: 42px; border-radius: 13px; flex: none; }
.field { position: relative; display: flex; align-items: center; min-width: 0; }
.field-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: grid; color: var(--faint); pointer-events: none; transition: color .15s; }
.field:focus-within .field-ic { color: var(--accent); }
#auth .field input, #pick .field input, #pick .field select { width: 100%; min-height: 46px; padding: 11px 12px 11px 40px; font-size: 15px; }
#pick .field select { -webkit-appearance: none; appearance: none; border: 1px solid var(--line); background: rgba(0, 0, 0, .22) var(--ic-chev) no-repeat right 10px center / 16px;
  color: var(--text); border-radius: 10px; padding-right: 34px; font: inherit; cursor: pointer; }
#pick .field select:focus { outline: none; border-color: rgba(224, 180, 76, .6); box-shadow: 0 0 0 3px rgba(224, 180, 76, .14); }
#pick input[type=search]::-webkit-search-cancel-button { filter: invert(.6); }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(27, 20, 4, .25); border-top-color: var(--accent-ink); animation: intro-spin .7s linear infinite; }
.busy .spinner { display: inline-block; }
.primary.busy, .primary.busy:disabled { opacity: .85; cursor: progress; }
@keyframes intro-spin { to { transform: rotate(360deg); } }

/* ── Anmeldung ─────────────────────────────────────── */
#auth { padding: 32px 16px; }
.auth-wrap { width: 100%; max-width: 440px; display: grid; gap: 22px; animation: intro-in .5s ease-out both; }
@keyframes intro-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .auth-wrap { animation: none; } }
.brand { text-align: center; }
.brand-name { margin: 16px 0 6px; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; }
.brand-name span { color: var(--accent); }
.brand-sub { margin: 0 auto; max-width: 340px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.auth-card { padding: 22px; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); border-color: rgba(255, 255, 255, .08); }
.auth-tabs { margin-bottom: 16px; }
.auth-tabs button { padding: 9px; font-weight: 600; transition: background .15s, color .15s; }
#auth-form { gap: 10px; }
#auth-form.register .field.only-register { display: flex; }
#auth-form:not(.register) .only-register { display: none; }
.auth-note { margin: -2px 2px 0; color: var(--faint); font-size: 12.5px; }
.auth-error { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad-ink); font-size: 13.5px; line-height: 1.45; }
.auth-error::before { content: ''; flex: none; width: 16px; height: 16px; margin-top: 1px; background: currentColor; -webkit-mask: var(--ic-warning) center / contain no-repeat; mask: var(--ic-warning) center / contain no-repeat; }
.auth-error:empty { display: none; }
.auth-submit { width: 100%; min-height: 48px; margin-top: 4px; font-size: 15.5px; gap: 10px; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.features li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: start; padding: 12px; border-radius: 14px;
  background: rgba(15, 21, 30, .62); border: 1px solid rgba(255, 255, 255, .06); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.feat-ic { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-bg); color: var(--accent); }
.features b { font-size: 14px; }
.features small { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ── Startland ─────────────────────────────────────── */
#pick { display: block; place-items: initial; padding: 28px 24px 32px; }
.pick-wrap { max-width: 1260px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; animation: intro-in .45s ease-out both; }
.pick-head { display: flex; align-items: center; gap: 14px; }
.pick-title { flex: 1; min-width: 0; }
.pick-head h1 { font-size: 26px; margin: 0 0 2px; }
.pick-head .sub { margin: 0; font-size: 14px; }
.pick-mode { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--info-ink); background: var(--info-bg); border: 1px solid rgba(116, 164, 220, .22); }
.pick-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; border-radius: 16px;
  background: rgba(15, 21, 30, .72); border: 1px solid rgba(255, 255, 255, .06); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.search-field { flex: 1 1 320px; }
.sort-field { flex: 0 0 210px; }
.pick-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pick-chips + .pick-chips { padding-left: 10px; border-left: 1px solid var(--line-soft); }
.pick-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--muted); transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.pick-chip:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.pick-chip .pc-n { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .07); font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: center; }
.pick-chip.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.pick-chip.on .pc-n { background: rgba(27, 20, 4, .15); }

.pick-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pick-list { min-width: 0; }
.pick-count { margin: 0 2px 8px; color: var(--faint); font-size: 12.5px; }
.nation-grid { display: grid; align-content: start; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; max-height: calc(100vh - 290px); min-height: 280px;
  overflow-y: auto; padding: 3px 6px 6px 3px; scrollbar-width: thin; scrollbar-color: #2a3546 transparent; }
.nc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "flag main gov" "stats stats stats"; gap: 10px 12px; align-items: center;
  text-align: left; padding: 12px 12px 11px 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .07); color: var(--text);
  background: rgba(15, 21, 30, .74); box-shadow: inset 3px 0 0 var(--c); transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; }
.nc:hover { background: rgba(28, 36, 49, .9); border-color: rgba(255, 255, 255, .12); }
.nc:active { transform: scale(.99); }
.nc.on { background: rgba(32, 40, 54, .95); border-color: rgba(224, 180, 76, .65); box-shadow: inset 3px 0 0 var(--c), 0 0 0 3px rgba(224, 180, 76, .14); }
.nc:focus-visible { outline: 2px solid rgba(224, 180, 76, .7); outline-offset: 2px; }
.nc .nc-flag { grid-area: flag; width: 46px; height: 32px; margin: 0; border-radius: 6px; object-fit: cover; vertical-align: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 2px 6px rgba(0, 0, 0, .3); }
.nc-main { grid-area: main; display: grid; min-width: 0; }
.nc-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-gov { grid-area: gov; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.nc-gov.ai { color: var(--muted); background: rgba(255, 255, 255, .06); }
.nc-gov.pl { color: var(--good-ink); background: var(--good-bg); }
.nc-stats { grid-area: stats; display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nc-stats > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.nc-stats .i { color: var(--faint); }
.nc-stats .nc-free { margin-left: auto; color: var(--accent); font-weight: 600; }
.nc-stats .nc-pl { margin-left: auto; color: var(--good-ink); font-weight: 600; }

.pick-detail { position: sticky; top: 20px; padding: 18px; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border-color: rgba(255, 255, 255, .08); max-height: calc(100vh - 40px); overflow-y: auto; }
.pd-head { display: flex; align-items: center; gap: 14px; }
.pd-head .pd-flag { width: 64px; height: 44px; margin: 0; border-radius: 8px; object-fit: cover; flex: none; vertical-align: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 4px 12px rgba(0, 0, 0, .35); }
.pd-title { min-width: 0; }
.pd-name { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; text-transform: none; color: var(--text); line-height: 1.2; overflow-wrap: anywhere; }
.pd-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.pd-map { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 14px 0 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .07); background: #0b1826; }
.pd-map path { vector-effect: non-scaling-stroke; stroke-linejoin: round; fill-rule: evenodd; }
.pd-sea { fill: #0d1c2c; }
.pd-other { fill: #253041; stroke: #0b1320; stroke-width: .6; }
.pd-own { stroke: rgba(255, 255, 255, .85); stroke-width: 1.4; }
.pd-cap { fill: var(--accent); stroke: #000; stroke-width: .5; vector-effect: non-scaling-stroke; }
.pd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pd-kpis > div { padding: 8px 9px; border-radius: 11px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line-soft); min-width: 0; }
.pd-kpis small, .pd-gov small, .pd-people small { display: block; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.pd-kpis b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-kpis b i { font-style: normal; font-weight: 500; font-size: 13px; color: var(--muted); }
.pd-gov { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 9px 11px; border-radius: 11px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line-soft); }
.pd-gov b { font-size: 14px; }
.pd-gov-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none; }
.pd-gov-ic.ai { background: rgba(255, 255, 255, .06); color: var(--muted); }
.pd-gov-ic.pl { background: var(--good-bg); color: var(--good); }
.pd-hint { margin: 10px 0 0; }
.pd-people { margin-top: 10px; }
.pd-people > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pd-person { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-person.more { color: var(--muted); }
.pd-start { width: 100%; min-height: 50px; margin-top: 14px; font-size: 16px; gap: 9px; }
.pd-empty { display: grid; justify-items: center; gap: 6px; padding: 30px 10px; color: var(--muted); text-align: center; }
.pd-empty p { margin: 0; }
#pick-error:empty { display: none; }
#pick-error { margin: 10px 0 0; }

/* ── Tablet: Vorschau schmaler ─────────────────────── */
@media (max-width: 1100px) { .pick-body { grid-template-columns: minmax(0, 1fr) 330px; } .pd-kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) and (min-width: 480px) { .pd-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ── Handy & schmale Fenster: Vorschau UNTER der Liste ── */
@media (max-width: 820px) {
  #pick { padding: 18px 16px 28px; }
  .pick-body { grid-template-columns: minmax(0, 1fr); }
  .nation-grid { max-height: 52vh; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .pick-detail { position: static; max-height: none; }
  .pick-chips + .pick-chips { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  #auth { padding: 24px 16px; place-items: start center; }
  .brand-name { font-size: 30px; }
  .brand-mark { width: 52px; height: 52px; border-radius: 15px; }
  .auth-card { padding: 16px; }
  .features { gap: 8px; }
  .features li { padding: 10px; grid-template-columns: 1fr; grid-template-rows: none; align-content: start; row-gap: 4px; }
  .feat-ic { grid-row: auto; width: 30px; height: 30px; }
  .pick-head { align-items: flex-start; flex-wrap: wrap; }
  .pick-head .brand-mark.sm { display: none; }
  .pick-title { flex: 1 1 100%; }
  .pick-head h1 { font-size: 22px; }
  .pick-tools { padding: 10px; gap: 8px; }
  .search-field, .sort-field { flex: 1 1 100%; }
  /* Chips: eine Zeile, seitlich wischbar (nur die Leiste, nicht die Seite) */
  .pick-chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pick-chips::-webkit-scrollbar { display: none; }
  .nation-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-right: 3px; }
  .pick-detail { padding: 14px; }
  .pd-name { font-size: 20px; }
}
