/* LetzGuess – E-Sports-Dark-UI (SPEC §10) */

:root {
  --bg0: #07090f;
  --bg1: #0d1120;
  --surface: #121829;
  --surface-2: #172036;
  --line: #1f2a44;
  --line-2: #2a3858;
  --text: #e8edf7;
  --muted: #8a96b3;
  --red: #ff3b4f;
  --red-strong: #e0263f;
  --cyan: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;

  --font-display: 'Space Grotesk Variable', 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter Variable', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 120ms;
  --t-med: 220ms;

  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);

  --glass: rgba(13, 17, 32, 0.8); /* über hellen Fotos noch lesbar (WCAG AA) */
  --glass-line: rgba(232, 237, 247, 0.09);
  --gutter: 16px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--bg0);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body[data-screen='playing'], body[data-screen='result'], body[data-screen='loading'] { overflow: hidden; }

img, svg { display: block; }
::selection { background: rgba(34, 211, 238, 0.32); color: #fff; }
input, textarea { caret-color: var(--cyan); }
a { color: var(--cyan); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ico { width: 20px; height: 20px; flex: none; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
main:focus, h1:focus { outline: none; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--cyan); color: var(--bg0); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { top: calc(var(--sat) + 12px); }

/* Controls ------------------------------------------------------------------ */
button, a, [role='button'], label.tile, label.chip, label.seg-item, .tab {
  touch-action: manipulation;
}
button, [role='button'], .tab, .chip, .seg-item, .tile, .fab, .icon-btn {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-med), opacity var(--t-fast);
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { cursor: not-allowed; opacity: 0.45; }
.btn-lg { min-height: 52px; font-size: 17px; padding: 0 22px; }
.btn-sm { min-height: 44px; font-size: 15px; padding: 0 14px; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--red-strong); color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 59, 79, 0.4), 0 8px 26px -10px rgba(255, 59, 79, 0.75);
}
.btn-primary:disabled { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); opacity: 1; }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading .ico { opacity: 0; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 700ms linear infinite;
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background-color var(--t-fast), transform var(--t-fast) var(--ease-out), border-color var(--t-fast);
}
.icon-btn:active { transform: scale(0.94); }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) { background: #d81f39; box-shadow: 0 0 0 1px rgba(255, 59, 79, 0.6), 0 10px 32px -8px rgba(255, 59, 79, 0.85); }
  .btn-secondary:hover:not(:disabled) { background: #1d2842; border-color: #3a4a70; }
  .btn-ghost:hover:not(:disabled) { background: rgba(232, 237, 247, 0.05); border-color: #3a4a70; }
  .icon-btn:hover { background: var(--surface-2); border-color: #3a4a70; }
  .tab:hover { color: var(--text); }
  .tile:hover { border-color: #3a4a70; }
  .chip:hover, .seg-item:hover { border-color: #3a4a70; }
  a:hover { text-decoration-thickness: 2px; }
}

.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  background: var(--bg1); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font: inherit; font-size: 16px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: #7a86a6; }
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18); }
.input[aria-invalid='true'] { border-color: var(--red); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.input-addon { height: 48px; width: 48px; }
.input-code {
  font-family: var(--font-display); font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase;
  font-size: 20px; max-width: 160px;
}

.field { display: grid; gap: 8px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--text); }
.field-label .optional { color: var(--muted); font-weight: 400; margin-left: 4px; }
.field-hint { font-size: 14px; color: var(--muted); }
.field-error { font-size: 14px; color: #ff8a97; }
.field-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.section-title {
  font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 10px;
}
.section-title .count { color: var(--muted); font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.14); color: var(--cyan); font-size: 12px; font-weight: 600; vertical-align: 2px;
}

/* Global chrome --------------------------------------------------------------- */
.mute-btn {
  position: fixed; z-index: 70;
  top: calc(var(--sat) + 12px); right: calc(var(--sar) + 12px);
  background: var(--glass); border-color: var(--glass-line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.mute-btn[aria-pressed='true'] { color: var(--muted); }

.net-banner {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  top: calc(var(--sat) + 12px);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 140px);
  padding: 10px 16px; border-radius: 999px;
  background: rgba(60, 40, 8, 0.9); color: #fde7a7; border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}
.net-banner.is-ok { background: rgba(6, 50, 36, 0.92); color: #b7f5dc; border-color: rgba(52, 211, 153, 0.45); }
.net-banner.is-ok .net-spinner { border-color: var(--ok); animation: none; }
.net-spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid rgba(251, 191, 36, 0.3); border-top-color: var(--warn);
  animation: spin 800ms linear infinite;
}

.toasts {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--sab) + 18px);
  display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(18, 24, 41, 0.96); border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.8);
  font-size: 15px; pointer-events: auto; cursor: pointer;
  animation: toast-in var(--t-med) var(--ease-out);
}
.toast .ico { margin-top: 1px; }
.toast-error { border-color: rgba(255, 59, 79, 0.5); }
.toast-error .ico { color: var(--red); }
.toast-success .ico { color: var(--ok); }
.toast-info .ico { color: var(--cyan); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 200ms, transform 200ms; }

body[data-screen='playing'] .toasts { bottom: calc(var(--sab) + 88px); }

/* Seiten-Layout ------------------------------------------------------------------- */
.screen { position: relative; }
.page {
  position: relative; z-index: 1;
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: calc(var(--sat) + 12px) calc(var(--sar) + var(--gutter)) calc(var(--sab) + 32px) calc(var(--sal) + var(--gutter));
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding-right: 56px; margin-bottom: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-height: 44px; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.03em; }
.wordmark span, .hero-title span { color: var(--cyan); }
.hero-title .hero-sticker { color: #1a1204; }

/* 1. Start ---------------------------------------------------------------------------- */
.start-bg {
  position: absolute; inset: 0 0 auto 0; height: 760px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px 380px at 82% 8%, rgba(255, 59, 79, 0.16), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 92%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 92%);
  opacity: 0.55;
}
.start-grid {
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  align-items: start;
}
.hero { padding-top: 24px; display: grid; gap: 22px; align-content: start; }
.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(56px, 9.2vw, 120px); line-height: 0.9; letter-spacing: -0.055em;
  margin-left: -0.04em;
}
.hero-claim { font-size: clamp(17px, 1.6vw, 20px); color: #c3cbe0; max-width: 36ch; line-height: 1.55; text-wrap: pretty; }
.hero-claim-sub { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); }
.hero-title { position: relative; width: max-content; max-width: 100%; }
/* Aufkleber am Logo: das eine verspielte Element der Startseite */
.hero-sticker {
  position: absolute; right: -0.2em; top: -0.42em;
  padding: 0.28em 0.6em 0.32em; border-radius: 0.5em;
  background: var(--warn); color: #1a1204;
  font-family: var(--font-display); font-weight: 700; font-size: max(15px, 0.17em); letter-spacing: -0.01em; line-height: 1;
  transform: rotate(9deg); transform-origin: 50% 100%;
  box-shadow: 0 8px 22px -8px rgba(251, 191, 36, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  animation: sticker-in 520ms cubic-bezier(0.34, 1.56, 0.64, 1) 220ms both;
}
@media (hover: hover) and (pointer: fine) {
  .hero-title:hover .hero-sticker { transform: rotate(-4deg) scale(1.06); transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1); }
}

.community {
  display: grid; gap: 6px; max-width: 460px; margin-top: 6px;
  padding: 18px 20px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(18, 24, 41, 0.92), rgba(13, 17, 32, 0.92));
  border: 1px solid var(--line); color: var(--text); text-decoration: none;
  transition: border-color var(--t-med), transform var(--t-fast) var(--ease-out);
}
.community:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { .community:hover { border-color: rgba(52, 211, 153, 0.45); } }
.community-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: live 2s infinite; }
.community-value {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(38px, 5vw, 52px);
  letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--ok);
}
.community-campaign { display: grid; gap: 6px; margin-top: 4px; }
.campaign-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: #c3cbe0; }
.campaign-row span:last-child { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; white-space: nowrap; flex: none; }
.bar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--ok); border-radius: inherit; transition: width 900ms var(--ease-out); }
.community-link { font-size: 14px; color: var(--cyan); margin-top: 4px; }

.how { display: grid; gap: 14px; max-width: 460px; margin-top: 8px; }
.how li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; color: var(--muted); font-size: 15px; }
.how strong { color: var(--text); font-weight: 600; }
.how-n {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line-2); font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--cyan);
}

.play-card {
  display: grid; gap: 20px;
  padding: 22px; border-radius: var(--r-lg);
  background: rgba(18, 24, 41, 0.9); border: 1px solid var(--line);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}
.field-row-profile { align-items: end; }
.play-card > .field-hint { margin-top: -12px; }
.settings { display: grid; gap: 20px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.join { display: grid; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.join .input-group { max-width: 340px; }

/* Map-Kacheln */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: start; gap: 12px;
  padding: 12px; border-radius: var(--r-md); cursor: pointer;
  background: var(--bg1); border: 1px solid var(--line-2);
  transition: border-color var(--t-fast), box-shadow var(--t-med), transform var(--t-fast) var(--ease-out);
}
.tile:active { transform: scale(0.98); }
.tile:has(input:checked) { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 28px -10px rgba(34, 211, 238, 0.7); }
.tile:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tile-art-wrap { position: relative; display: grid; place-items: center; height: 76px; border-radius: var(--r-sm); background: var(--surface); }
.tile-art { width: 64px; height: 64px; color: var(--muted); }
.tile-tag {
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  background: var(--bg0); border: 1px solid var(--line-2); color: #c3cbe0;
  font-family: var(--font-display); font-size: 11px; font-weight: 600; line-height: 1.3;
}
.tile-tag.is-new { background: var(--red-strong); border-color: var(--red-strong); color: #fff; transform: translateX(-50%) rotate(-4deg); }
.tile:has(input:checked) .tile-tag:not(.is-new) { border-color: var(--cyan); color: var(--cyan); }
.tile-art .art-eu { stroke-width: 0.9; stroke-linejoin: round; }
.tile-art .art-ring { fill: none; stroke: rgba(255, 59, 79, 0.55); stroke-width: 1; }
.tile-art .art-fill { fill: rgba(34, 211, 238, 0.16); stroke: var(--cyan); stroke-width: 1.4; }
.tile-art .art-dim { fill: rgba(138, 150, 179, 0.1); stroke: #4a5778; stroke-width: 1.2; }
.tile-art .art-line { stroke: rgba(34, 211, 238, 0.55); }
.tile-art .art-cut { stroke: rgba(34, 211, 238, 0.4); stroke-width: 0.8; stroke-dasharray: 2 2; }
.tile-art .art-pin { fill: var(--red); stroke: var(--bg0); stroke-width: 1.5; }
.tile-body { display: grid; gap: 3px; align-content: start; }
.tile-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.25; }
.tile-desc { font-size: 13px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { font-size: 12px; color: var(--cyan); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Chips + Segmente */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .seg-item { position: relative; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg1);
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.chip:active span { transform: scale(0.96); }
.chip input:checked + span { background: var(--text); color: var(--bg0); border-color: var(--text); }
.chip input:focus-visible + span, .seg-item input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px; border-radius: 11px; background: var(--bg1); border: 1px solid var(--line-2); }
.seg-item span {
  display: grid; place-items: center; min-height: 40px; border-radius: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.seg-item input:checked + span { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px #3a4a70; }
.field-row:has(.seg-6) { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); }

.settings.is-readonly .tile, .settings.is-readonly .chip, .settings.is-readonly .seg-item { cursor: default; }
.settings.is-readonly .tile:not(:has(input:checked)) { opacity: 0.5; }
.settings.is-readonly .chip input:disabled:not(:checked) + span { opacity: 0.5; }

/* Bestenliste */
.board { margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.board-head .section-title { font-size: 24px; }
.tabs { display: flex; gap: 4px; min-width: 0; max-width: 100%; padding: 3px; border-radius: 11px; background: var(--bg1); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: 40px; padding: 0 14px; border-radius: 8px; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-family: var(--font-display); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.tab[aria-selected='true'] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px #3a4a70; }
.board-body { border-radius: var(--r-lg); border: 1px solid var(--line); background: rgba(18, 24, 41, 0.6); overflow: hidden; transition: opacity var(--t-med); }
.board-body.is-loading { opacity: 0.55; }
.board-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.board-table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.board-table td { padding: 12px 16px; border-bottom: 1px solid rgba(31, 42, 68, 0.6); vertical-align: middle; }
.board-table tr:last-child td { border-bottom: 0; }
.board-table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-display); font-weight: 600; }
.board-table .dim { color: var(--muted); font-weight: 500; }
.board-table .rank { width: 48px; font-family: var(--font-display); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-table .top-1 .rank { color: var(--warn); }
.board-table .top-2 .rank { color: #cbd5e1; }
.board-table .top-3 .rank { color: #f59e6b; }
.who { display: grid; }
.who-name { font-weight: 600; overflow-wrap: anywhere; }
.who-team { font-size: 13px; color: var(--muted); }
.board-table .mode { color: var(--muted); font-size: 14px; }
.board-note { font-size: 13px; color: var(--muted); }
.empty { padding: 28px 20px; color: var(--muted); text-align: center; max-width: 52ch; margin: 0 auto; }

.footer { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.footer p { max-width: 80ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; }
.footer-links a { color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }

/* 3. Lobby ------------------------------------------------------------------------- */
.lobby-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); align-items: start; }
.lobby-main { display: grid; gap: 20px; }
.panel { padding: 20px; border-radius: var(--r-lg); background: rgba(18, 24, 41, 0.9); border: 1px solid var(--line); display: grid; gap: 16px; }
.code-card {
  position: relative; overflow: hidden;
  padding: 24px; border-radius: var(--r-lg);
  background: radial-gradient(500px 260px at 90% 0%, rgba(255, 59, 79, 0.14), transparent 70%), var(--bg1);
  border: 1px solid var(--line); display: grid; gap: 16px;
}
.code-label { font-size: 15px; font-weight: 500; color: var(--muted); font-family: var(--font-body); }
.room-code { display: flex; gap: 10px; }
.code-char {
  display: grid; place-items: center;
  width: clamp(60px, 9vw, 92px); aspect-ratio: 0.82;
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2);
  font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 7vw, 72px); letter-spacing: -0.02em;
  box-shadow: inset 0 -3px 0 rgba(34, 211, 238, 0.5);
  animation: char-in 260ms var(--ease-out) both;
}
.code-char:nth-child(2) { animation-delay: 40ms; }
.code-char:nth-child(3) { animation-delay: 80ms; }
.code-char:nth-child(4) { animation-delay: 120ms; }
.code-help { color: #c3cbe0; font-size: 15px; }
.invite { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-input { flex: 1 1 240px; min-width: 0; font-size: 16px; color: #c3cbe0; }

.player-list { display: grid; gap: 6px; }
.player {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 12px; border-radius: var(--r-md);
  background: var(--bg1); border: 1px solid var(--line);
  animation: row-in 220ms var(--ease-out);
}
.player.is-me { border-color: rgba(34, 211, 238, 0.4); }
.player.is-offline { opacity: 0.55; }
.player-avatar, .podium-avatar {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c);
  border: 1.5px solid var(--c);
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.player-body { display: grid; min-width: 0; flex: 1; }
.player-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-team { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-host { color: var(--warn); display: inline-flex; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }
.status-dot.off { background: #4a5778; }

.readonly-note { display: flex; align-items: center; gap: 8px; }
.readonly-note .ico { width: 16px; height: 16px; }
.settings-compact .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-compact .tile { grid-template-columns: 60px minmax(0, 1fr); }
.settings-compact .tile-art-wrap { height: 60px; }
.settings-compact .tile-art { width: 48px; height: 48px; }
.settings-compact .tile-desc { -webkit-line-clamp: 2; }
.lobby-start { display: grid; gap: 10px; padding-top: 4px; }
.lobby-wait { display: flex; align-items: center; gap: 12px; color: #c3cbe0; min-height: 52px; justify-content: center; }

.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

/* 4. Laden ------------------------------------------------------------------------- */
.screen-loading {
  min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center;
  padding: calc(var(--sat) + 24px) calc(var(--sar) + 24px) calc(var(--sab) + 24px) calc(var(--sal) + 24px);
  background: radial-gradient(520px 520px at 50% 45%, rgba(34, 211, 238, 0.08), transparent 70%), var(--bg0);
}
.radar { position: relative; width: 220px; height: 220px; margin-bottom: 8px; }
.radar-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(34, 211, 238, 0.25); }
.radar-ring.r2 { inset: 22%; }
.radar-ring.r3 { inset: 44%; border-color: rgba(34, 211, 238, 0.4); }
.radar::before, .radar::after { content: ''; position: absolute; background: rgba(34, 211, 238, 0.16); }
.radar::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.radar::after { top: 50%; left: 0; right: 0; height: 1px; }
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(34, 211, 238, 0.32), rgba(34, 211, 238, 0) 70deg, transparent 360deg);
  animation: spin 2.2s linear infinite;
}
.radar-blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); opacity: 0; animation: blip 2.2s infinite; }
.radar-blip.b1 { left: 68%; top: 26%; animation-delay: 0.25s; }
.radar-blip.b2 { left: 72%; top: 64%; animation-delay: 0.85s; background: var(--warn); }
.radar-blip.b3 { left: 24%; top: 58%; animation-delay: 1.5s; }
.radar-pin { position: absolute; left: 50%; top: 50%; margin: -22px 0 0 -22px; border-radius: 12px; box-shadow: 0 0 32px rgba(255, 59, 79, 0.45); animation: bob 1.6s ease-in-out infinite; }
.loading-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.03em; }
.loading-sub { color: var(--muted); max-width: 40ch; font-size: 14px; }
.loading-quip {
  min-height: 1.5em; max-width: 34ch; color: var(--cyan);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(17px, 2.2vw, 20px); letter-spacing: -0.01em;
  transition: opacity 180ms ease-out, transform 180ms var(--ease-out), filter 180ms ease-out;
}
.loading-quip.is-swap { opacity: 0; transform: translateY(4px); filter: blur(2px); }

/* 5. Spiel ---------------------------------------------------------------------------- */
.screen-play { position: fixed; inset: 0; height: 100dvh; overflow: hidden; background: #000; }
.viewer { position: absolute; inset: 0; background: #000; touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.view-layer { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 180ms ease-out, visibility 0s linear 180ms; }
.view-layer.is-active { opacity: 1; visibility: visible; transition: opacity 180ms ease-out, visibility 0s; }
.view-layer.no-fade, .view-layer.no-fade.is-active { transition: none; }
.viewer.is-locked .view-layer { pointer-events: none; }

.photo-stage { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; }
.photo-stage.is-grabbing { cursor: grabbing; }
.photo-stage.is-locked { cursor: default; }
.photo-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; -webkit-user-drag: none; user-select: none; }

/* Pannellum: eigene Lade-/Fehleranzeigen statt der Standard-UI */
.view-layer .pnlm-container { background: #000; font-family: var(--font-body); }
.view-layer .pnlm-load-box, .view-layer .pnlm-error-msg, .view-layer .pnlm-load-button,
.view-layer .pnlm-about-msg, .view-layer .pnlm-info-box, .view-layer .pnlm-controls-container { display: none !important; }

.veil { position: absolute; inset: 0; display: grid; place-items: center; padding: 120px 24px 140px; background: radial-gradient(closest-side, rgba(7, 9, 15, 0.4), rgba(7, 9, 15, 0.9)); z-index: 2; }
.veil.is-blink, .veil.is-error { background: var(--bg0); }
.veil-box { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 380px; }
.veil-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(34, 211, 238, 0.2); border-top-color: var(--cyan); animation: spin 800ms linear infinite; }
.veil-ico { width: 40px; height: 40px; color: var(--muted); }
.veil.is-error .veil-ico { color: var(--red); }
.veil-title { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.veil-text { color: var(--muted); font-size: 15px; }

.glass {
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
}

.hud {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; pointer-events: none;
  padding: calc(var(--sat) + 12px) calc(var(--sar) + 68px) 0 calc(var(--sal) + 12px);
  display: grid; justify-items: center; gap: 8px;
}
.hud > * { pointer-events: auto; }
.hud-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  width: min(560px, 100%); min-height: 56px; padding: 6px 16px; border-radius: 16px;
}
.hud-cell { display: grid; line-height: 1.1; }
.hud-round { justify-items: start; }
.hud-score { justify-items: end; }
.hud-k { font-size: 12px; color: #a9b4cf; }
.hud-v { font-family: var(--font-display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.hud-timer {
  min-width: 108px; justify-items: center; padding: 4px 14px; border-radius: 12px;
  background: rgba(7, 9, 15, 0.55); border: 1px solid var(--glass-line);
}
.hud-timer .hud-v { font-size: 28px; }
.hud-timer.is-low .hud-v { color: var(--warn); }
.hud-timer.is-urgent { border-color: rgba(255, 59, 79, 0.7); animation: urgent 1s ease-in-out infinite; }
.hud-timer.is-urgent .hud-v { color: var(--red); }
.hud-timer.is-infinite .hud-v { color: var(--muted); }
.hud-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: min(760px, 100%); }
.hud-player {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line); font-size: 13px; font-weight: 500;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color var(--t-med), background-color var(--t-med);
}
.hud-player.is-done { border-color: rgba(52, 211, 153, 0.55); }
.hud-player.is-offline { opacity: 0.5; }
.hud-player-dot {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 25%, transparent); color: var(--c); border: 1.5px solid var(--c);
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
}
.hud-player.is-done .hud-player-dot { background: var(--ok); border-color: var(--ok); color: var(--bg0); }
.hud-player-dot .ico { width: 13px; height: 13px; }
.hud-player-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(58, 16, 26, 0.86); border: 1px solid rgba(255, 59, 79, 0.55); color: #ffc2c9;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
}
.mod-pill .ico { width: 14px; height: 14px; }
.hud-mod:empty { display: none; }
.hud-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.hud-tags:not(:has(> :not([hidden]):not(:empty))) { display: none; }
.hud-streak, .streak-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(90deg, #ff3b4f, #fb923c 60%, #fbbf24); color: #1a0d04;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: 0 6px 20px -8px rgba(251, 146, 60, 0.9);
}
.hud-streak::before, .streak-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff7e0; box-shadow: 0 0 8px #fff7e0; }
.streak-badge { margin-left: auto; align-self: center; animation: pop-in 360ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.score-big .streak-badge { font-size: 13px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; white-space: nowrap; }

.views-nav {
  position: absolute; z-index: 5; left: calc(var(--sal) + 16px); bottom: calc(var(--sab) + 16px);
  display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px;
}
.views-nav .icon-btn { background: transparent; border-color: transparent; }
.views-label { font-family: var(--font-display); font-weight: 600; font-size: 14px; padding: 0 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.waiting {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-radius: 22px;
  font-weight: 500; font-size: 15px; line-height: 1.35; max-width: min(520px, 100%);
  animation: toast-in var(--t-med) var(--ease-out);
}
.waiting .dots { flex: none; }

/* Rate-Karte: Desktop-Panel */
.guess {
  position: absolute; z-index: 8;
  right: calc(var(--sar) + 16px); bottom: calc(var(--sab) + 16px);
  width: 340px; display: grid; grid-template-rows: auto 1fr auto;
  border-radius: 16px; overflow: hidden;
  background: rgba(13, 17, 32, 0.9); border: 1px solid var(--glass-line);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  opacity: 0.88;
  transition: width 200ms var(--ease-out) 260ms, opacity 160ms ease 260ms;
}
.guess-head { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; min-height: 44px; }
.guess-title { flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: #c3cbe0; }
.guess-head .icon-btn { width: 36px; height: 36px; background: transparent; border-color: transparent; }
.guess-pin-toggle[aria-pressed='true'] { color: var(--cyan); }
.guess-close, .sheet-handle { display: none !important; }
.guess-map { position: relative; height: 220px; transition: height 200ms var(--ease-out) 260ms; cursor: crosshair; }
.guess-map .maplibregl-canvas { cursor: crosshair; }
.guess-foot { padding: 8px; }
.guess.is-done { opacity: 0.75; }

@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
  .guess:hover, .guess:has(:focus-visible) { width: min(46vw, 760px); opacity: 1; transition-delay: 0ms; }
  .guess:hover .guess-map, .guess:has(:focus-visible) .guess-map { height: min(54dvh, 540px); transition-delay: 0ms; }
}
@media (min-width: 761px) {
  .guess.is-pinned { width: min(46vw, 760px); opacity: 1; transition-delay: 0ms; }
  .guess.is-pinned .guess-map { height: min(54dvh, 540px); transition-delay: 0ms; }
}
.fab { display: none; }

/* Rate-Karte: Mobil-Bottom-Sheet */
@media (max-width: 760px) {
  .hud { padding-right: calc(var(--sar) + 64px); padding-left: calc(var(--sal) + 8px); }
  .hud-bar { padding: 6px 12px; min-height: 52px; }
  .hud-timer { min-width: 92px; padding: 3px 10px; }
  .hud-timer .hud-v { font-size: 24px; }
  .hud-v { font-size: 18px; }
  .hud-player-name { max-width: 80px; }
  .hud-players { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding-bottom: 2px; }
  .hud-players::-webkit-scrollbar { display: none; }
  .hud-player { flex: none; }
  .waiting { font-size: 14px; padding: 9px 14px; }

  .fab {
    position: absolute; z-index: 7; right: calc(var(--sar) + 16px); bottom: calc(var(--sab) + 16px);
    display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px;
    border-radius: 999px; color: var(--text); cursor: pointer;
    font-family: var(--font-display); font-weight: 600; font-size: 17px;
    transition: transform var(--t-fast) var(--ease-out), border-color var(--t-med);
  }
  .fab:active { transform: scale(0.96); }
  .fab.has-pin { border-color: rgba(34, 211, 238, 0.65); box-shadow: 0 0 26px -8px rgba(34, 211, 238, 0.8); }
  .views-nav { bottom: calc(var(--sab) + 84px); left: calc(var(--sal) + 12px); }

  .guess {
    left: 0; right: 0; bottom: 0; width: auto; height: min(74dvh, 640px);
    border-radius: 20px 20px 0 0; border-bottom: 0; opacity: 1;
    transform: translateY(105%); visibility: hidden;
    transition: transform 260ms var(--ease-out), visibility 0s linear 260ms;
    overscroll-behavior: contain;
  }
  .guess.is-open { transform: translateY(0); visibility: visible; transition: transform 260ms var(--ease-out), visibility 0s; }
  .guess-head { position: relative; padding: 14px 8px 6px 18px; }
  .guess-title { font-size: 17px; color: var(--text); }
  .sheet-handle { display: block !important; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #3a4a70; }
  .guess-close { display: inline-grid !important; }
  .guess-head .icon-btn { width: 44px; height: 44px; }
  .guess-pin-toggle { display: none !important; }
  .guess-map, .guess.is-pinned .guess-map { height: auto; transition: none; }
  .guess-foot { padding: 10px 16px calc(var(--sab) + 12px); }
  .guess-foot .btn { min-height: 52px; font-size: 17px; }
}

/* Marker */
.mk-pin { width: 26px; height: 34px; pointer-events: none; }
.mk-pin .mk-dot {
  position: absolute; left: 50%; bottom: 0; width: 22px; height: 22px; margin-left: -11px;
  border-radius: 50% 50% 50% 0; transform: translateY(-6px) rotate(-45deg);
  background: var(--c); border: 2.5px solid #07090f; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.mk-pin .mk-dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #07090f; }
.mk-pin.is-me .mk-dot { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25), 0 4px 14px rgba(0, 0, 0, 0.55); }
.mk-pin.is-drop .mk-dot { animation: drop 260ms var(--ease-out); }
.mk-label {
  position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%);
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
  background: rgba(7, 9, 15, 0.85); border: 1px solid var(--c); color: var(--text);
  font-size: 12px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}
.mk-target { width: 28px; height: 34px; pointer-events: none; filter: drop-shadow(0 0 10px rgba(255, 59, 79, 0.65)); }
.mk-target svg { width: 28px; height: 34px; }
.mk-num {
  position: absolute; left: 19px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--text); color: var(--bg0); font-family: var(--font-display); font-weight: 700; font-size: 11px;
  display: grid; place-items: center;
}

/* MapLibre im Dark-Look */
.maplibregl-ctrl-group { background: rgba(13, 17, 32, 0.9) !important; border: 1px solid var(--glass-line); box-shadow: none !important; }
.maplibregl-ctrl-group button { width: 36px !important; height: 36px !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--glass-line) !important; }
.maplibregl-ctrl-icon { filter: invert(1) brightness(1.2); }
.maplibregl-ctrl-attrib { background: rgba(7, 9, 15, 0.7) !important; color: var(--muted); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: #c3cbe0; }
.maplibregl-ctrl-attrib-button { filter: invert(1); background-color: transparent !important; }
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(7, 9, 15, 0.75) !important; }
.maplibregl-map { font-family: var(--font-body); background: #222b3f; }
/* Show-Momente */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 95; pointer-events: none; }
.fx-glow { position: fixed; inset: 0; z-index: 95; pointer-events: none; box-shadow: inset 0 0 140px 10px rgba(52, 211, 153, 0.45); animation: glow-fade 1.3s ease-out both; }

/* 6. Rundenergebnis ------------------------------------------------------------------- */
.screen-result { position: fixed; inset: 0; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) 420px; background: var(--bg0); }
.result-map { position: relative; min-height: 0; }
.result-panel {
  position: relative; min-height: 0; display: grid; grid-template-rows: 1fr auto;
  background: var(--bg1); border-left: 1px solid var(--line);
}
.result-scroll {
  overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 18px; align-content: start;
  padding: calc(var(--sat) + 72px) calc(var(--sar) + 24px) 24px 24px;
}
.result-kicker { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.result-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.03em; line-height: 1.1; margin-top: -10px; overflow-wrap: anywhere; }
.result-place { color: #c3cbe0; margin-top: -10px; }
.result-me { display: grid; gap: 10px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.result-me.is-perfect { border-color: rgba(52, 211, 153, 0.6); box-shadow: 0 0 40px -16px rgba(52, 211, 153, 0.8); }
.result-verdict {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(19px, 2vw, 22px); line-height: 1.2; letter-spacing: -0.02em;
  color: var(--text); min-height: 1.2em; text-wrap: balance;
  opacity: 0; transform: translateY(6px);
}
.result-verdict.is-in { opacity: 1; transform: none; transition: opacity 240ms ease-out, transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.result-verdict[data-tone='perfect'] { color: var(--ok); }
.result-verdict[data-tone='great'] { color: var(--cyan); }
.result-verdict[data-tone='ok'] { color: var(--warn); }
.result-verdict[data-tone='meh'] { color: #fdba74; }
.result-verdict[data-tone='miss'] { color: #ff8a97; }
.result-verdict[data-tone='none'] { color: var(--muted); }
.score-big { display: flex; align-items: baseline; gap: 10px; }
.score-big span { font-family: var(--font-display); font-weight: 700; font-size: 56px; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.score-big small { color: var(--muted); font-size: 16px; }
.score-meter { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.score-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--warn) 55%, var(--ok)); background-size: 420px 100%; }
.result-dist { color: #c3cbe0; display: grid; gap: 2px; }
.result-total { color: var(--muted); font-size: 14px; }

.rank-list { display: grid; gap: 4px; }
.rank-item {
  display: grid; grid-template-columns: 28px 12px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid transparent;
}
.rank-item.is-me { border-color: rgba(34, 211, 238, 0.4); }
.rank-item.is-offline { opacity: 0.55; }
.rank-pos { font-family: var(--font-display); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.rank-name { display: grid; font-weight: 600; min-width: 0; }
.rank-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rank-nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-line .tag { margin: 0; flex: none; vertical-align: 0; }
.rank-sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.rank-score { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-compact .rank-item { min-height: 40px; }

.credits { font-size: 13px; color: var(--muted); display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.credits:empty { display: none; }
.credits-title { font-size: 13px; font-weight: 600; color: #c3cbe0; }
.credits-list { display: grid; gap: 4px; overflow-wrap: anywhere; }
.credits a { color: var(--cyan); }

.result-foot { padding: 14px calc(var(--sar) + 24px) calc(var(--sab) + 16px) 24px; border-top: 1px solid var(--line); background: var(--bg1); display: grid; gap: 8px; }
.next-info { text-align: center; color: var(--muted); font-size: 14px; min-height: 21px; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .screen-result { grid-template-columns: 1fr; grid-template-rows: 42dvh minmax(0, 1fr); }
  .result-panel { border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; margin-top: -16px; z-index: 2; }
  .result-scroll { padding: 20px calc(var(--sar) + 16px) 16px calc(var(--sal) + 16px); gap: 16px; }
  .result-title { margin-top: -8px; }
  .score-big span { font-size: 46px; }
  .result-foot { padding: 12px calc(var(--sar) + 16px) calc(var(--sab) + 12px) calc(var(--sal) + 16px); }
}

/* 7. Endstand ------------------------------------------------------------------------- */
.final-head { display: grid; gap: 6px; margin-bottom: 24px; }
.final-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 6vw, 64px); letter-spacing: -0.045em; line-height: 1; }
.final-meta { color: var(--muted); }
.final-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.final-left, .final-right { display: grid; gap: 18px; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; min-height: 260px; }
.podium.podium-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; }
.podium-step { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; animation: rise 420ms var(--ease-out) both; }
.podium-step.step-1 { animation-delay: 160ms; }
.podium-step.step-3 { animation-delay: 80ms; }
.podium-avatar { width: 52px; height: 52px; font-size: 22px; }
.step-1 .podium-avatar { width: 64px; height: 64px; font-size: 26px; box-shadow: 0 0 30px -6px var(--c); }
.podium-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-name .tag { margin-left: 6px; }
.podium-team { font-size: 13px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-family: var(--font-display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.podium-block {
  width: 100%; display: grid; place-items: start center; padding-top: 12px;
  border-radius: 12px 12px 4px 4px; background: var(--surface); border: 1px solid var(--line);
}
.step-1 .podium-block { height: 120px; background: linear-gradient(180deg, rgba(251, 191, 36, 0.22), var(--surface)); border-color: rgba(251, 191, 36, 0.5); }
.step-2 .podium-block { height: 88px; }
.step-3 .podium-block { height: 64px; }
.podium-rank { font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--muted); }
.step-1 .podium-rank { color: var(--warn); font-size: 36px; }
.podium-step.is-me .podium-block { box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.6); }

.podium-solo { display: grid; gap: 4px; min-height: 0; padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); grid-template-columns: 1fr; align-items: start; }
.podium-solo-label { color: var(--muted); }
.podium-solo-score { font-family: var(--font-display); font-weight: 700; font-size: clamp(52px, 8vw, 80px); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.podium-solo-score small { font-size: 22px; color: var(--muted); letter-spacing: 0; font-weight: 600; }
.podium-solo-sub { color: #c3cbe0; }
/* Rang-Titel */
.rank-card {
  display: grid; gap: 6px; padding: 20px 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line-2);
  animation: rise 420ms var(--ease-out) 120ms both;
}
.rank-card[data-level='4'], .rank-card[data-level='5'] { border-color: rgba(251, 191, 36, 0.55); box-shadow: 0 0 46px -20px rgba(251, 191, 36, 0.9); }
.rank-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rank-card-k { color: var(--muted); font-size: 14px; }
.rank-ladder { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.rank-ladder i { width: 6px; border-radius: 2px; background: var(--line-2); }
.rank-ladder i:nth-child(1) { height: 30%; } .rank-ladder i:nth-child(2) { height: 44%; } .rank-ladder i:nth-child(3) { height: 58%; }
.rank-ladder i:nth-child(4) { height: 72%; } .rank-ladder i:nth-child(5) { height: 86%; } .rank-ladder i:nth-child(6) { height: 100%; }
.rank-ladder i.on { background: var(--cyan); }
.rank-card[data-level='4'] .rank-ladder i.on, .rank-card[data-level='5'] .rank-ladder i.on { background: var(--warn); }
.rank-card-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4vw, 42px); line-height: 1.02; letter-spacing: -0.04em;
  text-wrap: balance;
}
.rank-card[data-level='4'] .rank-card-title, .rank-card[data-level='5'] .rank-card-title { color: var(--warn); }
.rank-card-line { color: #c3cbe0; max-width: 52ch; }
/* Teilen */
.share-card { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--bg1); border: 1px dashed var(--line-2); }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-head .section-title { font-size: 16px; }
.share-preview {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: var(--font-body); font-size: 14px; line-height: 1.6; color: #c3cbe0;
}

.contrib {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg);
  background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.35); color: var(--text); text-decoration: none;
}
.contrib-ico { width: 28px; height: 28px; color: var(--ok); }
.contrib-text { display: grid; gap: 2px; }
.contrib-text strong { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.contrib-text span { color: #a9e9cf; font-size: 14px; }
@media (hover: hover) and (pointer: fine) { .contrib:hover { border-color: rgba(52, 211, 153, 0.65); } }
.final-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.final-map { height: 360px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.rounds-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.rounds-table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rounds-table td { padding: 10px; border-bottom: 1px solid rgba(31, 42, 68, 0.6); vertical-align: top; }
.rounds-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rounds-table .strong { font-family: var(--font-display); font-weight: 700; }
.rounds-table td:first-child { font-family: var(--font-display); font-weight: 700; color: var(--muted); width: 56px; }
.place { display: grid; }
.place-sub { font-size: 13px; color: var(--muted); }

/* Dialog */
.dialog {
  width: min(420px, calc(100vw - 32px)); padding: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
}
.dialog::backdrop { background: rgba(7, 9, 15, 0.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-form { display: grid; gap: 12px; padding: 22px; }
.dialog-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.dialog-title span { color: var(--cyan); letter-spacing: 0.08em; }
.dialog-actions { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 10px; margin-top: 6px; }

/* Responsive ------------------------------------------------------------------------------ */
@media (max-width: 1020px) {
  .start-grid, .lobby-grid, .final-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 0; }
  .community { max-width: none; }
}
@media (max-width: 760px) {
  .start-grid { gap: 20px; }
  .hero { display: contents; }
  .hero-title { order: 1; }
  .hero-claim { order: 2; margin-top: -6px; }
  .play-card { order: 3; }
  .community { order: 4; margin-top: 8px; }
  .how { order: 5; }
  .hero-title { font-size: clamp(52px, 17vw, 76px); }
  .play-card { padding: 16px; gap: 18px; border-radius: 16px; }
  .field-row, .field-row:has(.seg-6) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .tiles, .settings-compact .tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tile, .settings-compact .tile { grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto; align-items: center; padding: 10px 10px 12px; }
  .tile-art-wrap, .settings-compact .tile-art-wrap { height: 64px; }
  .hero-sticker { right: -0.5em; }
  .rank-card { padding: 18px; }
  .tile-art { width: 50px; height: 50px; }
  .tile-desc { -webkit-line-clamp: 2; }
  .actions { grid-template-columns: minmax(0, 1fr); }
  .join .input-group { max-width: none; }
  .input-code { max-width: none; }
  .board { margin-top: 40px; }
  .board-head .section-title { font-size: 21px; }
  .tabs { width: 100%; }
  .tab { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.15; padding: 4px 8px; font-size: 13px; }
  .chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .chip span { justify-content: center; padding: 0 6px; width: 100%; font-size: 14px; }
  .board-table th, .board-table td { padding: 10px 10px; }
  .board-table .mode { display: none; }
  .code-card { padding: 18px; }
  .room-code { gap: 8px; }
  .code-char { width: calc((100% - 24px) / 4); max-width: 84px; }
  .panel { padding: 16px; }
  .final-map { height: 280px; }
  .rounds-table td:first-child { width: 40px; }
  .rounds-table th, .rounds-table td { padding-left: 8px; padding-right: 8px; }
  .final-actions .btn { flex: 1 1 100%; }
  .podium { min-height: 230px; gap: 6px; }
  .step-1 .podium-block { height: 100px; }
  .step-2 .podium-block { height: 72px; }
  .step-3 .podium-block { height: 54px; }
}

/* Animationen ----------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes char-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
@keyframes blip { 0%, 100% { opacity: 0; transform: scale(0.6); } 12% { opacity: 1; transform: scale(1.2); } 40% { opacity: 0; transform: scale(1); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes urgent { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 79, 0.0); background: rgba(7, 9, 15, 0.55); } 50% { box-shadow: 0 0 24px 2px rgba(255, 59, 79, 0.55); background: rgba(90, 12, 24, 0.6); } }
@keyframes drop { from { transform: translateY(-20px) rotate(-45deg); opacity: 0.4; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes sticker-in { from { opacity: 0; transform: rotate(24deg) scale(0.6); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.8); } }
@keyframes glow-fade { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .radar-sweep { display: none; }
  /* Ruhiges Aufleuchten statt Konfetti: reine Opazität, bleibt bei reduzierter Bewegung erhalten */
  .fx-glow { animation-duration: 1.3s !important; }
  .result-verdict { transform: none; }
  .radar-blip { opacity: 1; }
}
