/* =========================================================================
   LAN-PARTY HQ — Stylesheet
   Dark neon arcade. Alles selbst gehostet, keine externen Fonts/CDNs.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg:            #06070d;
  --bg-2:          #0b0d18;
  --surface:       rgba(255, 255, 255, 0.045);
  --surface-2:     rgba(255, 255, 255, 0.075);
  --surface-solid: #11142260;
  --line:          rgba(255, 255, 255, 0.10);
  --line-strong:   rgba(255, 255, 255, 0.20);

  --text:          #eaf0ff;
  --text-dim:      #9aa6c8;
  --text-faint:    #64708f;

  --pink:          #ff2d78;
  --cyan:          #24e0ff;
  --violet:        #a855f7;
  --lime:          #39ff88;
  --amber:         #ffb020;
  --red:           #ff4d5e;

  --accent:        var(--cyan);

  --radius:        18px;
  --radius-sm:     12px;
  --radius-lg:     26px;

  --shadow:        0 18px 50px -12px rgba(0, 0, 0, 0.75);
  --glow-cyan:     0 0 0 1px rgba(36,224,255,.35), 0 0 28px -4px rgba(36,224,255,.45);
  --glow-pink:     0 0 0 1px rgba(255,45,120,.35), 0 0 28px -4px rgba(255,45,120,.45);

  --font: 'Segoe UI Variable Display', 'Segoe UI', Inter, system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
button { font: inherit; color: inherit; }

::selection { background: var(--pink); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.26); background-clip: content-box; }

/* =========================================================================
   Hintergrund
   ========================================================================= */
.bg-layer { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }

.bg-grid {
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.055) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: perspective(600px) rotateX(58deg) translateY(-6%);
  transform-origin: 50% 0%;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%);
  animation: gridDrift 22s linear infinite;
}
@keyframes gridDrift { to { background-position: 0 54px, 54px 0; } }

.bg-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.bg-glow--a { width: 620px; height: 620px; background: radial-gradient(circle, var(--pink), transparent 68%); top: -18%; left: -8%; animation: float1 26s var(--ease) infinite; }
.bg-glow--b { width: 560px; height: 560px; background: radial-gradient(circle, var(--cyan), transparent 68%); bottom: -20%; right: -6%; animation: float2 31s var(--ease) infinite; }
.bg-glow--c { width: 460px; height: 460px; background: radial-gradient(circle, var(--violet), transparent 68%); top: 40%; left: 55%; animation: float3 38s var(--ease) infinite; }
@keyframes float1 { 50% { transform: translate(180px, 120px) scale(1.18); } }
@keyframes float2 { 50% { transform: translate(-160px, -110px) scale(1.12); } }
@keyframes float3 { 50% { transform: translate(-220px, 90px) scale(.86); } }

.bg-scan {
  position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.028) 0 1px, transparent 1px 3px);
}

@media (prefers-reduced-motion: reduce) {
  .bg-grid, .bg-glow { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================================
   Basis-Komponenten
   ========================================================================= */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650; font-size: 14px;
  cursor: pointer;
  transition: transform .16s var(--ease-back), box-shadow .2s, background .2s, border-color .2s, opacity .2s;
  position: relative; overflow: hidden;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--line-strong); background: rgba(255,255,255,.11); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.btn--primary { --btn-bg: linear-gradient(135deg, var(--cyan), #3b82f6); --btn-fg: #041018; border-color: transparent; box-shadow: 0 8px 26px -8px rgba(36,224,255,.7); }
.btn--primary:hover:not(:disabled) { box-shadow: 0 14px 34px -8px rgba(36,224,255,.9); background: linear-gradient(135deg, #5aeaff, #4f90ff); }
.btn--accent { --btn-bg: linear-gradient(135deg, var(--pink), var(--violet)); --btn-fg: #fff; border-color: transparent; box-shadow: 0 8px 26px -8px rgba(255,45,120,.7); }
.btn--accent:hover:not(:disabled) { box-shadow: 0 14px 34px -8px rgba(255,45,120,.95); }
.btn--ghost { --btn-bg: transparent; }
.btn--danger { --btn-bg: rgba(255,77,94,.14); --btn-fg: #ffb3ba; border-color: rgba(255,77,94,.3); }
.btn--danger:hover:not(:disabled) { background: rgba(255,77,94,.24); }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn--xl { padding: 16px 34px; font-size: 17px; border-radius: 16px; }
.btn--icon { padding: 8px; width: 34px; height: 34px; border-radius: 10px; }

.input, .select, textarea.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0,0,0,.28);
  color: var(--text);
  font: inherit;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus, .select:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(36,224,255,.16);
  background: rgba(0,0,0,.42);
}
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5' stroke='%239aa6c8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 34px; }
.select option { background: #0e1220; color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; font-weight: 650; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none; }
.check input { accent-color: var(--cyan); width: 16px; height: 16px; cursor: pointer; }
.check-row { display: flex; gap: 18px; flex-wrap: wrap; }

.form-error { color: #ff8e9b; font-size: 13px; min-height: 18px; margin-top: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--text-dim);
}
.chip--on { background: rgba(36,224,255,.16); border-color: rgba(36,224,255,.4); color: #baf3ff; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
  position: relative;
}
.panel__title { font-size: 16px; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.panel__title .ico { font-size: 20px; }
.panel__hint { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); }
.center { text-align: center; }

.empty {
  padding: 40px 20px; text-align: center; color: var(--text-faint);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty__icon { font-size: 40px; display: block; margin-bottom: 10px; opacity: .6; }

/* =========================================================================
   Lobby
   ========================================================================= */
.lobby { min-height: 100dvh; display: grid; place-items: center; padding: 40px 20px; }
.lobby[hidden] { display: none; }
.lobby__inner { width: 100%; max-width: 1140px; }
.lobby__head { text-align: center; margin-bottom: 40px; }

.logo { display: inline-flex; align-items: center; gap: 16px; }
.logo__mark {
  font-size: 46px; line-height: 1;
  filter: drop-shadow(0 0 20px rgba(36,224,255,.6));
  animation: bob 3.4s ease-in-out infinite;
}
.logo__mark--sm { font-size: 26px; animation: none; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-7deg); } }

.logo__text {
  font-size: clamp(30px, 6vw, 52px); font-weight: 900; letter-spacing: -.04em; line-height: 1;
  background: linear-gradient(100deg, var(--cyan), #fff 38%, var(--pink) 72%, var(--violet));
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 7s linear infinite;
}
.logo__text span { opacity: .9; }
.logo__text em { font-style: normal; opacity: .55; font-size: .55em; vertical-align: super; margin-left: 4px; }
@keyframes shine { to { background-position: 220% center; } }

.lobby__tag { color: var(--text-dim); margin-top: 12px; font-size: 15px; letter-spacing: .02em; }

.lobby__grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

.code-form { display: flex; flex-direction: column; gap: 12px; }
.code-input {
  width: 100%; padding: 16px;
  font-family: var(--mono); font-size: 34px; font-weight: 800;
  letter-spacing: .34em; text-align: center; text-transform: uppercase;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: rgba(0,0,0,.36); color: var(--cyan);
  text-shadow: 0 0 18px rgba(36,224,255,.55);
  transition: border-color .2s, box-shadow .2s;
}
.code-input:focus { outline: none; border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.code-input::placeholder { color: rgba(255,255,255,.12); text-shadow: none; }

.party-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.party-card {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  cursor: pointer; transition: all .18s var(--ease);
}
.party-card:hover { background: rgba(255,255,255,.08); border-color: var(--line-strong); transform: translateX(4px); }
.party-card__code { font-family: var(--mono); font-weight: 800; color: var(--cyan); font-size: 15px; letter-spacing: .1em; }
.party-card__body { flex: 1; min-width: 0; }
.party-card__name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-card__meta { font-size: 12px; color: var(--text-faint); }
.party-card__del { opacity: 0; transition: opacity .2s; }
.party-card:hover .party-card__del { opacity: 1; }

/* =========================================================================
   Shell / Topbar / Nav
   ========================================================================= */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.shell[hidden] { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: rgba(8, 10, 20, 0.7);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.topbar__brand {
  display: flex; align-items: center; gap: 11px;
  background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 12px;
  transition: background .2s;
}
.topbar__brand:hover { background: var(--surface-2); }
.topbar__party { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.topbar__party strong { font-size: 15px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__party small { font-size: 11px; color: var(--text-faint); font-family: var(--mono); letter-spacing: .08em; }

.nav { position: relative; display: flex; gap: 4px; padding: 4px; margin: 0 auto;
  background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 15px; }
.nav__btn {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border: 0; background: none; border-radius: 11px;
  cursor: pointer; color: var(--text-dim); font-weight: 650; font-size: 14px;
  transition: color .22s;
  white-space: nowrap;
}
.nav__btn span { font-size: 17px; transition: transform .3s var(--ease-back); }
.nav__btn:hover { color: var(--text); }
.nav__btn:hover span { transform: scale(1.22) rotate(-8deg); }
.nav__btn.is-active { color: #05121a; }
.nav__pill {
  position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 4px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--cyan), #56a8ff);
  box-shadow: 0 6px 20px -6px rgba(36,224,255,.85);
  transition: transform .42s var(--ease-back), width .42s var(--ease-back);
}
.nav__btn .badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--pink); color: #fff; border-radius: 99px;
  font-size: 11px; font-weight: 800;
  animation: pop .34s var(--ease-back);
}
.nav__btn.is-active .badge { background: #05121a; color: var(--cyan); }
@keyframes pop { from { transform: scale(0); } }

.topbar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.presence { display: flex; align-items: center; }
.presence__dot {
  width: 30px; height: 30px; margin-left: -9px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; border: 2px solid var(--bg-2);
  background: var(--surface-2);
  transition: transform .2s var(--ease-back);
  animation: pop .3s var(--ease-back);
}
.presence__dot:first-child { margin-left: 0; }
.presence__dot:hover { transform: translateY(-4px) scale(1.15); z-index: 3; }
.presence__more { font-size: 12px; color: var(--text-faint); margin-left: 8px; }

.me {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 13px 5px 5px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; transition: all .2s;
}
.me:hover { border-color: var(--line-strong); background: rgba(255,255,255,.1); }
.me__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 16px;
  background: linear-gradient(135deg, var(--violet), var(--pink));
}
.me__name { font-size: 13px; font-weight: 650; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================================
   Views
   ========================================================================= */
.views { flex: 1; position: relative; }
.view { display: none; padding: 26px 22px 80px; max-width: 1400px; margin: 0 auto; }
.view.is-active { display: block; animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }

.view__head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.view__title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 850; letter-spacing: -.035em; }
.view__sub { color: var(--text-dim); font-size: 14px; }

.section { margin-bottom: 30px; }
.section__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section__title { font-size: 17px; display: flex; align-items: center; gap: 9px; }
.section__title .ico { font-size: 19px; }

.grid { display: grid; gap: 16px; }
/* Grid-Kinder duerfen unter ihre Inhaltsbreite schrumpfen. Ohne das gilt
   min-width:auto und ein langer Spielname wie "Farmer vs Hunter / Trolls and
   Elves / Tree Tag / Island Defense" sprengt auf dem Handy die ganze Spalte. */
.grid > *, .game-layout > * { min-width: 0; }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(163px, 1fr)); }

/* Chart-Raster: feste Spaltenzahl statt auto-fit. Die drei schmalen Karten
   (Podium, Verteilung, Profil) fuellen so genau eine Zeile, statt verstreut
   Luecken zu lassen - die breiten Charts spannen ueber alle Spalten. */
.grid--charts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1240px) { .grid--charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px)  { .grid--charts { grid-template-columns: 1fr; } }

/* Zu breite Charts scrollen; solange sie passen, stehen sie mittig.
   "safe" verhindert, dass beim Ueberlauf der linke Rand abgeschnitten wird. */
.chart-scroll { display: flex; justify-content: safe center; }

/* =========================================================================
   Umschalter der ausgewerteten Größe
   ========================================================================= */
.metric-switch {
  display: flex; gap: 3px; padding: 3px;
  background: rgba(0,0,0,.32); border: 1px solid var(--line);
  border-radius: 13px; flex-wrap: wrap;
}
.metric-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-dim);
  font-size: 13px; font-weight: 650; cursor: pointer;
  transition: color .2s, background .2s, transform .16s var(--ease-back);
  white-space: nowrap;
}
.metric-btn span { font-size: 15px; transition: transform .28s var(--ease-back); }
.metric-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.metric-btn:hover span { transform: scale(1.2) rotate(-8deg); }
.metric-btn:active { transform: scale(.95); }
.metric-btn.is-on {
  background: linear-gradient(135deg, var(--cyan), #56a8ff);
  color: #05121a;
  box-shadow: 0 5px 16px -6px rgba(36,224,255,.8);
}
@media (max-width: 620px) {
  .metric-switch { width: 100%; }
  .metric-btn { flex: 1; justify-content: center; padding: 8px 6px; }
  .metric-btn b { display: none; }
  .metric-btn span { font-size: 18px; }
}

/* =========================================================================
   KPI-Kacheln
   ========================================================================= */
.kpi {
  position: relative; overflow: hidden;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.kpi::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 100% 0%, var(--kpi-color, var(--cyan)), transparent 62%);
  opacity: .14; pointer-events: none;
}
.kpi__icon { font-size: 22px; margin-bottom: 8px; display: block; }
.kpi__value { font-size: 30px; font-weight: 850; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.kpi__unit { font-size: 14px; font-weight: 650; color: var(--text-dim); margin-left: 3px; }
.kpi__label { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; margin-top: 4px; }
.kpi__sub { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* =========================================================================
   Hydration
   ========================================================================= */
.drink-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  position: sticky; top: 70px; z-index: 40;
  backdrop-filter: blur(20px);
}
.drink-pick {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px 9px 11px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(0,0,0,.24);
  cursor: pointer; font-weight: 650; font-size: 14px;
  transition: all .2s var(--ease-back);
  position: relative;
}
.drink-pick__icon { font-size: 22px; line-height: 1; transition: transform .25s var(--ease-back); }
.drink-pick:hover { transform: translateY(-3px); border-color: var(--dc); box-shadow: 0 10px 26px -12px var(--dc); }
.drink-pick:hover .drink-pick__icon { transform: scale(1.22) rotate(-9deg); }
.drink-pick.is-active {
  border-color: var(--dc);
  background: color-mix(in srgb, var(--dc) 18%, transparent);
  box-shadow: 0 0 0 1px var(--dc), 0 10px 30px -12px var(--dc);
}
.drink-pick__meta { font-size: 11px; color: var(--text-faint); font-weight: 500; }
.drink-pick__del {
  position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--line); background: #1b1f30; color: #ff8e9b;
  font-size: 11px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .18s; display: grid; place-items: center;
}
.drink-pick:hover .drink-pick__del { opacity: 1; }

.tap-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

.tap {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(16px);
  transition: transform .2s var(--ease-back), box-shadow .25s, border-color .25s;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tap:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--uc) 55%, transparent); box-shadow: 0 22px 46px -20px var(--uc); }
.tap:active { transform: translateY(-1px) scale(.985); }
.tap.is-offline { opacity: .62; }

/* Fuellstand-Hintergrund = Hydrationsfortschritt */
.tap__fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--uc) 34%, transparent), color-mix(in srgb, var(--uc) 6%, transparent));
  transition: height .8s var(--ease);
  pointer-events: none;
}
/* Wasserlinie des Fuellstands. Bewusst zurueckhaltend: sie kann je nach
   Fuellstand genau auf Hoehe des Namens liegen und darf ihn nicht zerschneiden. */
.tap__fill::before {
  content: ''; position: absolute; top: -4px; left: -50%; width: 200%; height: 8px;
  background: color-mix(in srgb, var(--uc) 26%, transparent);
  border-radius: 50%;
  filter: blur(1px);
  animation: wave 4.5s ease-in-out infinite;
}
@keyframes wave { 50% { transform: translateX(25%) scaleY(1.7); } }

.tap__inner { position: relative; z-index: 2; padding: 18px; }
.tap__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tap__avatar {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 24px;
  background: color-mix(in srgb, var(--uc) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--uc) 45%, transparent);
  position: relative;
}
.tap__online {
  position: absolute; bottom: -3px; right: -3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--lime); border: 2.5px solid #0c0f1a;
  box-shadow: 0 0 10px var(--lime);
}
.tap__name { font-weight: 750; font-size: 16px; letter-spacing: -.02em; }
.tap__status { font-size: 11.5px; color: var(--text-dim); }
.tap__count {
  margin-left: auto; text-align: right;
  font-size: 30px; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--uc);
  text-shadow: 0 0 22px color-mix(in srgb, var(--uc) 60%, transparent);
}
.tap__count small { display: block; font-size: 10px; font-weight: 600; color: var(--text-faint); letter-spacing: .09em; text-shadow: none; }

.tap__drinks { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; min-height: 22px; }
.tap__drink {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 99px;
  background: rgba(0,0,0,.34); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700;
}

.tap__meter { height: 6px; border-radius: 99px; background: rgba(0,0,0,.4); overflow: hidden; margin-bottom: 4px; }
.tap__meter i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--uc), #fff); transition: width .7s var(--ease); box-shadow: 0 0 12px var(--uc); }
.tap__meterlabel { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-faint); margin-bottom: 14px; }

.tap__actions { display: flex; gap: 8px; }
.tap__open {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px; border-radius: 14px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--dc, var(--cyan)), color-mix(in srgb, var(--dc, var(--cyan)) 55%, #000));
  color: #06121a; font-weight: 800; font-size: 14.5px;
  transition: transform .15s var(--ease-back), filter .2s;
  box-shadow: 0 8px 24px -10px var(--dc, var(--cyan));
}
.tap__open:hover { filter: brightness(1.14); transform: translateY(-2px); }
.tap__open:active { transform: scale(.95); }
.tap__open span { font-size: 19px; }
.tap__undo { width: 44px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.3); cursor: pointer; font-size: 16px; transition: all .18s; }
.tap__undo:hover { background: rgba(255,77,94,.2); border-color: rgba(255,77,94,.4); }
.tap__undo:disabled { opacity: .3; cursor: not-allowed; }

/* Klick-Feedback: fliegendes Icon */
.fly {
  position: fixed; z-index: 999; pointer-events: none;
  font-size: 34px;
  animation: fly 1.05s var(--ease) forwards;
}
@keyframes fly {
  0%   { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  18%  { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -260%) scale(.7) rotate(22deg); opacity: 0; }
}

.tap.is-hit { animation: tapHit .5s var(--ease-back); }
@keyframes tapHit {
  0% { transform: scale(1); }
  35% { transform: scale(1.045); box-shadow: 0 0 0 4px color-mix(in srgb, var(--uc) 45%, transparent); }
  100% { transform: scale(1); }
}

/* Live-Feed */
/* Scrollbare Flex-Spalten: ohne flex-shrink:0 staucht der Browser die
   Eintraege auf die Containerhoehe zusammen, statt sie scrollen zu lassen -
   der Text laeuft dann aus der Zeile heraus. */
.feed, .game-list, .party-list { display: flex; flex-direction: column; }
.feed > *, .game-list > *, .party-list > * { flex-shrink: 0; }

.feed { gap: 7px; max-height: 420px; overflow-y: auto; padding-right: 6px; }
.feed__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
  font-size: 13px;
  animation: slideIn .42s var(--ease-back);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-18px); } }
.feed__icon { font-size: 18px; }
.feed__time { margin-left: auto; font-size: 11px; color: var(--text-faint); font-family: var(--mono); }

/* =========================================================================
   Charts
   ========================================================================= */
.chart-card {
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.chart-card__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.chart-card__title { font-size: 15px; font-weight: 750; }
.chart-card__sub { font-size: 12px; color: var(--text-faint); }
.chart-card__body { margin-top: 16px; position: relative; }
.chart-card--wide { grid-column: 1 / -1; }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-scroll { overflow-x: auto; overflow-y: hidden; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; }
.legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); cursor: default; }
.legend__swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 9px currentColor; }

.chart-tip {
  position: fixed; z-index: 500; pointer-events: none;
  padding: 9px 12px; border-radius: 10px;
  background: rgba(10,13,24,.96); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.5;
  transform: translate(-50%, calc(-100% - 12px));
  opacity: 0; transition: opacity .14s;
  max-width: 260px;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip b { color: #fff; }

/* Podium */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 20px 0 0; }
.podium__col { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; max-width: 150px; }
.podium__avatar {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 28px;
  border: 2px solid var(--pc); background: color-mix(in srgb, var(--pc) 20%, transparent);
  box-shadow: 0 0 26px -4px var(--pc);
  animation: podiumIn .7s var(--ease-back) backwards;
}
.podium__name { font-weight: 700; font-size: 13.5px; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__score { font-size: 12px; color: var(--text-dim); }
.podium__block {
  width: 100%; border-radius: 14px 14px 0 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--pc) 58%, transparent), color-mix(in srgb, var(--pc) 16%, transparent));
  border: 1px solid color-mix(in srgb, var(--pc) 75%, transparent); border-bottom: 0;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--pc) 70%, transparent), 0 -6px 26px -10px var(--pc);
  display: grid; place-items: center;
  font-size: 30px; font-weight: 900; color: var(--pc);
  animation: podiumGrow .85s var(--ease-back) backwards;
  transform-origin: bottom;
}
@keyframes podiumIn { from { opacity: 0; transform: translateY(-22px) scale(.5); } }
@keyframes podiumGrow { from { transform: scaleY(0); } }

/* =========================================================================
   Gaming-Room
   ========================================================================= */
.game-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
@media (max-width: 1080px) { .game-layout { grid-template-columns: 1fr; } }

.game-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter {
  padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--line); background: rgba(0,0,0,.24);
  font-size: 13px; font-weight: 650; color: var(--text-dim); cursor: pointer;
  transition: all .18s;
}
.filter:hover { color: var(--text); border-color: var(--line-strong); }
.filter.is-on { background: color-mix(in srgb, var(--fc, var(--cyan)) 20%, transparent); border-color: var(--fc, var(--cyan)); color: #fff; }

.game-list { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; padding-right: 6px; }

.game {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,.032);
  transition: all .2s var(--ease); position: relative; overflow: hidden;
}
.game::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gc); opacity: .85;
}
.game:hover { background: rgba(255,255,255,.075); transform: translateX(4px); border-color: var(--line-strong); }
.game.is-wished { background: color-mix(in srgb, var(--pink) 10%, transparent); border-color: rgba(255,45,120,.3); }
.game.is-winner { animation: winnerPulse 1.6s ease-in-out 3; }
@keyframes winnerPulse { 50% { box-shadow: 0 0 0 3px rgba(57,255,136,.55); background: rgba(57,255,136,.14); } }

.game__icon { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.game__body { flex: 1; min-width: 0; }
.game__name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game__meta { font-size: 11px; color: var(--text-faint); display: flex; gap: 8px; flex-wrap: wrap; }

.game__wishers { display: flex; margin-right: 4px; }
.game__wisher { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; margin-left: -7px; border: 2px solid #0d1020; background: var(--surface-2); }
.game__wisher:first-child { margin-left: 0; }

.game__wish {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(0,0,0,.3);
  font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums;
  transition: all .2s var(--ease-back);
}
.game__wish:hover { transform: scale(1.09); border-color: rgba(255,45,120,.55); }
.game__wish:active { transform: scale(.94); }
.game__wish.is-on { background: linear-gradient(135deg, var(--pink), var(--violet)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -7px var(--pink); }
.game__chance { font-size: 11px; color: var(--text-faint); font-family: var(--mono); min-width: 38px; text-align: right; }

/* Wheel */
.wheel-panel { position: sticky; top: 76px; }
.wheel-wrap { position: relative; display: grid; place-items: center; padding: 8px 0 4px; }
.wheel-canvas { width: 100%; max-width: 380px; aspect-ratio: 1; display: block; filter: drop-shadow(0 18px 44px rgba(0,0,0,.7)); }
.wheel-pointer {
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  font-size: 30px; z-index: 3; filter: drop-shadow(0 3px 8px rgba(0,0,0,.8));
  transform-origin: 50% 20%;
}
.wheel-pointer.is-tick { animation: tick .07s ease-out; }
@keyframes tick { 50% { transform: translateX(-50%) rotate(13deg); } }

.wheel-hub {
  position: absolute; width: 23%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 35% 30%, #232840, #0c0f1a);
  border: 2px solid var(--line-strong);
  box-shadow: inset 0 2px 10px rgba(255,255,255,.14), 0 8px 26px rgba(0,0,0,.65);
  font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--text-dim);
  pointer-events: none;
}

/* Sieger-Bühne */
.spin-stage {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(12,16,32,.92), rgba(4,5,10,.98));
  backdrop-filter: blur(16px);
  animation: fadeIn .3s ease;
}
.spin-stage[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.stage__inner { text-align: center; max-width: 92vw; }
.stage__wheel { position: relative; display: grid; place-items: center; }
.stage__wheel .wheel-canvas { max-width: min(58vh, 460px); }
.stage__label { font-size: 13px; letter-spacing: .34em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.stage__hint { margin-top: 18px; font-size: 13px; color: var(--text-faint); }

.winner { animation: winnerIn .8s var(--ease-back); }
@keyframes winnerIn { from { opacity: 0; transform: scale(.7) translateY(30px); } }
.winner__crown { font-size: 58px; animation: bob 2.4s ease-in-out infinite; }
.winner__label { font-size: 13px; letter-spacing: .4em; text-transform: uppercase; color: var(--lime); margin: 10px 0 6px; }
.winner__icon { font-size: clamp(70px, 14vw, 120px); line-height: 1; filter: drop-shadow(0 0 40px rgba(57,255,136,.6)); animation: bob 3s ease-in-out infinite; }
.winner__name {
  font-size: clamp(30px, 7vw, 66px); font-weight: 900; letter-spacing: -.045em; line-height: 1.08;
  margin: 10px 0;
  background: linear-gradient(100deg, var(--lime), #fff 45%, var(--cyan));
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 4s linear infinite;
}
.winner__stats { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin: 18px 0 26px; }
.winner__stat b { display: block; font-size: 23px; font-weight: 850; color: #fff; font-variant-numeric: tabular-nums; }
.winner__stat span { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; }

/* Countdown */
.countdown {
  font-size: clamp(90px, 22vw, 190px); font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: countPop .95s var(--ease-back);
}
@keyframes countPop { 0% { transform: scale(2.4); opacity: 0; } 60% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: 0; } }

/* =========================================================================
   Toasts
   ========================================================================= */
.toasts {
  position: fixed; top: 74px; right: 18px; z-index: 800;
  display: flex; flex-direction: column; gap: 9px; align-items: flex-end;
  pointer-events: none; max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 15px;
  background: rgba(14,18,32,.94); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); backdrop-filter: blur(20px);
  pointer-events: auto; cursor: pointer;
  animation: toastIn .44s var(--ease-back);
  position: relative; overflow: hidden;
  max-width: 100%;
}
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(120%) scale(.85); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(120%) scale(.85); } }
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tc, var(--cyan)); }
.toast__icon { font-size: 23px; flex-shrink: 0; }
.toast__body { min-width: 0; }
.toast__title { font-weight: 700; font-size: 13.5px; }
.toast__text { font-size: 12.5px; color: var(--text-dim); }
.toast__bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--tc, var(--cyan)); opacity: .55; animation: toastBar linear forwards; }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }

/* =========================================================================
   Modal
   ========================================================================= */
.modal-root {
  position: fixed; inset: 0; z-index: 850;
  display: grid; place-items: center; padding: 20px;
  background: rgba(3,5,12,.76); backdrop-filter: blur(10px);
  animation: fadeIn .22s ease;
}
.modal-root[hidden] { display: none; }
.modal {
  width: min(560px, 100%); max-height: 88dvh; overflow-y: auto;
  padding: 26px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #141930, #0a0d18);
  border: 1px solid var(--line-strong);
  box-shadow: 0 34px 90px -20px rgba(0,0,0,.9);
  animation: modalIn .38s var(--ease-back);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.9) translateY(24px); } }
.modal__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal__title { font-size: 20px; }
.modal__close { margin-left: auto; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.picker { display: flex; flex-wrap: wrap; gap: 7px; }
.picker__opt {
  width: 40px; height: 40px; border-radius: 11px; cursor: pointer;
  display: grid; place-items: center; font-size: 20px;
  border: 1px solid var(--line); background: rgba(0,0,0,.26);
  transition: all .18s var(--ease-back);
}
.picker__opt:hover { transform: scale(1.14); border-color: var(--line-strong); }
.picker__opt.is-on { border-color: var(--cyan); background: rgba(36,224,255,.2); box-shadow: 0 0 0 2px rgba(36,224,255,.35); }
.picker--color .picker__opt { border-radius: 50%; }
.picker--color .picker__opt.is-on { box-shadow: 0 0 0 3px rgba(255,255,255,.85); }

/* FX-Canvas */
.fx { position: fixed; inset: 0; z-index: 890; pointer-events: none; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav__btn { flex: 1; justify-content: center; padding: 9px 8px; }
  .nav__btn b { display: none; }
  .nav__btn span { font-size: 20px; }
  .topbar__right { margin-left: auto; }
  .me__name { display: none; }
  .view { padding: 18px 14px 70px; }
  .drink-bar { top: 128px; }
  .wheel-panel { position: static; }
  .toasts { top: auto; bottom: 16px; right: 12px; left: 12px; max-width: none; align-items: stretch; }
}
@media (max-width: 480px) {
  .tap-grid { grid-template-columns: 1fr; }
  .grid--kpi { grid-template-columns: repeat(2, 1fr); }
  .kpi__value { font-size: 24px; }
}

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
