/* ==========================================================================
   Crack The Egg – Client-Styles
   ========================================================================== */

:root {
  --bg:        #131110;
  --bg-2:      #1d1917;
  --panel:     rgba(255, 255, 255, .045);
  --panel-brd: rgba(255, 255, 255, .09);
  --ink:       #f4efe6;
  --ink-dim:   #a79f92;
  --gold:      #f5c451;
  --gold-deep: #d99a1f;
  --go:        #45d483;
  --go-deep:   #1fa365;
  --danger:    #ff6b6b;

  --c0: #56cfe1;
  --c1: #f78da7;
  --c2: #b5e48c;
  --c3: #ffb703;
  --c4: #c77dff;
  --c5: #ff8fab;
  --c6: #90dbf4;
  --c7: #fdc5f5;

  --radius: 20px;

  /* Bewegung: einmal federnd, einmal ruhig. Zwei Kurven reichen fürs ganze Spiel. */
  --spring: cubic-bezier(.2, 1.5, .4, 1);
  --ease:   cubic-bezier(.2, .8, .3, 1);

  /* Jeder Tisch hat seine eigene Farbe – die Testküche kühl, das echte Ei heiss. */
  --tbl-test:    var(--c0);
  --tbl-quick:   var(--c2);
  --tbl-normal:  var(--c3);
  --tbl-classic: var(--c1);
}

* { box-sizing: border-box; }

/* Für SVG-Elemente, bei denen das HTML-Attribut [hidden] nicht greift. */
.is-hidden { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 50% -10%, #2b2320 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.app { max-width: 940px; margin: 0 auto; padding: 18px 18px 48px; }

/* ------------------------------------------------------------------ Topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* Das Ei im Kopf schaukelt langsam vor sich hin – gerade genug, dass die
   Seite lebt, aber nicht so viel, dass es beim Lesen stört. */
.brand-egg {
  font-size: 28px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.5));
  transform-origin: 50% 90%;
  animation: eggIdle 4.5s ease-in-out infinite;
}

.brand:hover .brand-egg { animation: eggNudge .5s var(--spring); }

@keyframes eggIdle {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}

@keyframes eggNudge {
  0%   { transform: rotate(0) scale(1); }
  35%  { transform: rotate(-14deg) scale(1.12); }
  100% { transform: rotate(0) scale(1); }
}

.brand h1 {
  margin: 0;
  font-size: clamp(19px, 4.2vw, 32px);
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 800;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff8e6, var(--gold) 70%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.conn-badge {
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-brd);
  white-space: nowrap;
}

.conn-badge.is-online     { color: var(--go);     border-color: rgba(69,212,131,.4);  background: rgba(69,212,131,.1); }
.conn-badge.is-offline    { color: var(--danger); border-color: rgba(255,107,107,.4); background: rgba(255,107,107,.1); }
.conn-badge.is-connecting { color: var(--gold);   border-color: rgba(245,196,81,.4);  background: rgba(245,196,81,.1); }

.banner {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 107, 107, .13);
  border: 1px solid rgba(255, 107, 107, .35);
  color: #ffc9c9;
  font-size: 14px;
}

/* ------------------------------------------------------------------- Basics */

.lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 62ch;
  margin: 0 0 18px;
}

.lead strong, .rulecard strong { color: var(--ink); }
.muted { color: var(--ink-dim); font-weight: 400; }

.hint { font-size: 13px; color: var(--ink-dim); margin: 12px 0 0; }
.center { text-align: center; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.rulecard {
  position: relative;
  border: 1px solid rgba(245, 196, 81, .35);
  background: linear-gradient(180deg, rgba(245,196,81,.13), rgba(245,196,81,.04));
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  margin-bottom: 20px;
}

.rulecard-badge {
  position: absolute;
  top: -10px; left: 16px;
  background: var(--gold);
  color: #2a1f06;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.rulecard p { margin: 0; line-height: 1.6; color: #e9dcc0; }

/* ------------------------------------------------------------------ Buttons */

.btn {
  font: inherit;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 12px 20px;
  cursor: pointer;
  transition: transform .16s var(--spring), filter .15s ease, background .15s ease,
              box-shadow .18s var(--ease), opacity .15s;
}

.btn:active:not(:disabled) { transform: translateY(2px) scale(.985); transition-duration: .05s; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #ffd977, var(--gold) 45%, var(--gold-deep));
  color: #2a1f06;
  box-shadow: 0 10px 26px rgba(217, 154, 31, .28);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(217, 154, 31, .38); }

.btn-ghost {
  background: transparent;
  border-color: var(--panel-brd);
  color: var(--ink);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.06); }

/* Admin-Eingriff: sichtbar anders als alles, was Mitspieler dürfen. */
.btn-danger {
  background: rgba(255, 107, 107, .12);
  border-color: rgba(255, 107, 107, .45);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: rgba(255, 107, 107, .2); }
.btn-danger[hidden] { display: none; }

.btn-big { width: 100%; padding: 16px; font-size: 17px; letter-spacing: .04em; }
.btn-center { display: block; margin: 10px auto 0; }
.btn-row { display: flex; flex-direction: column; gap: 10px; }
.btn-row-center { flex-direction: row; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.icon-btn {
  font: inherit;
  font-size: 17px;
  line-height: 1;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover:not(:disabled) { background: rgba(255,255,255,.09); }

/* ------------------------------------------------------------------- Inputs */

.input {
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--panel-brd);
  background: rgba(255,255,255,.05);
  color: var(--ink);
  min-width: 0;
}

.input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.input-block { width: 100%; }

/* ------------------------------------------------------------- Raumliste */

.room-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.room {
  --table: var(--gold);
  position: relative;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 14px 14px 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--panel-brd);
  background: rgba(0,0,0,.22);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, background .18s,
              transform .18s var(--spring), box-shadow .18s var(--ease);
}

/* Jeder Tisch trägt seine Farbe als Kante – man erkennt ihn, bevor man liest. */
.room::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--table);
  opacity: .85;
}

.room-test    { --table: var(--tbl-test); }
.room-quick   { --table: var(--tbl-quick); }
.room-normal  { --table: var(--tbl-normal); }
.room-classic { --table: var(--tbl-classic); }

/* Anfassen soll sich lohnen: die Karte hebt sich und kippt ein Grad. */
.room:hover:not(:disabled) {
  background: rgba(255,255,255,.06);
  border-color: var(--table);
  transform: translateY(-4px) rotate(-.5deg);
  box-shadow: 0 14px 30px rgba(0,0,0,.4);
}

.room:active:not(:disabled) {
  transform: translateY(-1px) scale(.99) rotate(0deg);
  transition-duration: .07s;
}

.room.is-highlight {
  border-color: var(--table);
  background: rgba(255,255,255,.07);
  animation: roomWink 1.6s var(--ease) infinite;
}

/* Der eingeladene Tisch klopft leise – ein Ring, der nach aussen verläuft. */
@keyframes roomWink {
  0%   { box-shadow: 0 0 0 0 rgba(245,196,81,.45); }
  100% { box-shadow: 0 0 0 10px rgba(245,196,81,0); }
}

.room:disabled { opacity: .45; cursor: not-allowed; }

.room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.room-label { font-weight: 800; letter-spacing: .03em; }

.room-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--ink-dim);
}

.room-range { font-size: 12.5px; color: var(--table); font-variant-numeric: tabular-nums; font-weight: 700; }

.room-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-dim);
}

.room-state { text-transform: uppercase; letter-spacing: .1em; }

/* ------------------------------------------- Man klebt noch an einem Ei */

.egg-hold {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(245,196,81,.4);
  background: linear-gradient(180deg, rgba(245,196,81,.14), rgba(245,196,81,.04));
}

.egg-hold[hidden] { display: none; }

.egg-hold-text { flex: 1 1 240px; min-width: 0; }

.egg-hold-kicker {
  display: block;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}

.egg-hold-where { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.egg-hold .hint { margin-top: 6px; }
.egg-hold .btn { flex: 0 0 auto; }

/* Ein anderer Tisch ist tabu, solange man klebt – sichtbar, aber nicht wählbar. */
.room.is-locked-out { opacity: .4; }
.room.is-locked-out::after {
  content: '🥚 belegt';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ------------------------------------------------- Gespielte Runden (Archiv) */

.archive-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* Wie ein Tisch gebaut, aber ruhiger – hier wird nicht mehr gespielt. */
.archive-round {
  --table: var(--gold);
  position: relative;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 12px 12px 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-brd);
  background: rgba(0,0,0,.28);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, background .18s,
              transform .18s var(--spring), box-shadow .18s var(--ease);
}

.archive-round::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--table);
  opacity: .45;
}

.archive-round:hover {
  background: rgba(255,255,255,.06);
  border-color: var(--table);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0,0,0,.38);
}

.archive-round:active { transform: translateY(-1px) scale(.99); transition-duration: .07s; }

.archive-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.archive-label { font-weight: 800; font-size: 13.5px; }
.archive-when { font-size: 11px; color: var(--ink-dim); white-space: nowrap; }

.archive-winner {
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------- Eier aus Second Life */

.sl-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.sl-egg {
  --table: var(--gold);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: inherit;
  text-decoration: none;
  transition: background .12s, border-color .12s, transform .12s;
}

a.sl-egg:hover {
  background: rgba(255,255,255,.06);
  border-color: var(--table);
  transform: translateY(-2px);
}
a.sl-egg:active { transform: translateY(-1px) scale(.99); transition-duration: .07s; }

.sl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sl-parcel { font-weight: 800; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-region { font-size: 11px; color: var(--ink-dim); white-space: nowrap; }
.sl-owner { font-size: 12px; color: var(--ink-dim); }
.sl-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------- Tisch-Kopf im Spiel */

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(245,196,81,.28);
  background: linear-gradient(180deg, rgba(245,196,81,.09), rgba(245,196,81,.02));
}

.table-head-what { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex-wrap: wrap; }

.table-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--gold);
}

.table-shell { font-size: 12.5px; color: var(--ink-dim); }

.btn-copy { padding: 8px 12px; font-size: 12.5px; }
.copy-note { display: block; margin: -6px 0 10px; font-size: 12.5px; color: var(--ink-dim); word-break: break-all; }

/* Spielerfarbe pro Person – auch im Ergebnis benutzt. */
.tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--panel-brd);
  color: var(--ink-dim);
}

.tag-me   { color: var(--go);     border-color: rgba(69,212,131,.45); }
.tag-off  { color: var(--danger); border-color: rgba(255,107,107,.45); }

/* --------------------------------------------------------------- Spielkopf */

.demand {
  text-align: center;
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--ink-dim);
}

.demand strong {
  display: inline-block;
  font-size: clamp(24px, 7vw, 38px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  vertical-align: -2px;
  margin: 0 4px;
}

.scoreboard {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 10px;
}

.stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.stat-value { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }

.stat-hero {
  grid-column: 1 / -1;
  border-color: rgba(245,196,81,.3);
  background: linear-gradient(180deg, rgba(245,196,81,.1), rgba(245,196,81,.02));
}

.stat-hero .stat-value {
  font-size: clamp(36px, 10vw, 58px);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 26px rgba(245,196,81,.35);
}
.stat-prize .stat-value { color: var(--c2); }

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
}

.progress-bar {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), #fff2c9);
  transition: width .12s linear;
  overflow: hidden;
}

/* Ein Schimmer wandert über das schon Geschaffte – das Ei arbeitet. */
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(255,255,255,0) 20%,
    rgba(255,255,255,.55) 50%,
    rgba(255,255,255,0) 80%);
  animation: progressShine 1.9s linear infinite;
}

@keyframes progressShine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ------------------------------------------------- Verlauf der letzten Klicks */

.trail {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 2px;
  min-height: 20px;
}

.trail-label {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

.trail-dots { display: flex; gap: 5px; align-items: center; }

/* Älteste Klicks links und blasser, der jüngste rechts in voller Farbe. */
.trail-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent, var(--ink-dim));
  opacity: var(--fade, 1);
  transition: opacity .2s linear;
}

.trail-dot.is-me { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); }

.trail-dot.is-latest { animation: trailPop .22s cubic-bezier(.2,1.5,.4,1); }

.trail-empty {
  font-size: 12px;
  color: var(--ink-dim);
  opacity: .7;
}

@keyframes trailPop {
  0%   { transform: scale(.3); }
  100% { transform: scale(1); }
}

/* -------------------------------------------------------------------- Das Ei */

.egg-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 290px;
  margin: 4px 0 10px;
}

/* Warmes Licht hinter dem Ei – es steht auf einer Bühne, nicht im Leeren. */
.egg-stage::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(245,196,81,.16), transparent 72%);
  animation: stageGlow 5s ease-in-out infinite;
  pointer-events: none;
}

/* Und ein Schatten darunter, damit es nicht schwebt. */
.egg-stage::after {
  content: '';
  position: absolute;
  bottom: 16px;
  width: 128px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent 78%);
  pointer-events: none;
}

@keyframes stageGlow {
  0%, 100% { opacity: .75; transform: scale(.97); }
  50%      { opacity: 1;   transform: scale(1.03); }
}

/* Glanz, Risse, Bruch und Splitter zeichnet js/egg-canvas.js. */
.egg-canvas {
  position: relative;   /* über Schein und Schatten der Bühne */
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 320px;
  height: 290px;
  touch-action: manipulation;
}

/* ------------------------------------------------- Eigener Klick + Quittung */

.me { margin-bottom: 16px; }

.click-btn {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 116px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  color: #08170e;
  background: linear-gradient(180deg, #6ee7a8, var(--go) 45%, var(--go-deep));
  box-shadow: 0 12px 30px rgba(31, 163, 101, .3);
  transition: transform .06s ease, filter .12s ease, box-shadow .15s ease;
  touch-action: manipulation;
  user-select: none;
}

.click-btn:hover:not(:disabled):not(.is-locked) { filter: brightness(1.06); transform: translateY(-2px); }

/* Drücken muss sich anfühlen wie Drücken: kurz einsacken, Schatten flacher. */
.click-btn:active:not(:disabled) {
  transform: scale(.96) translateY(2px);
  box-shadow: 0 4px 12px rgba(31, 163, 101, .3);
  transition-duration: .05s;
}

/* Wenn man dran ist, atmet der Knopf – er holt einen zurück ans Ei. */
.click-btn:not(:disabled):not(.is-locked):not(.is-waiting) {
  animation: clickReady 2.6s var(--ease) infinite;
}

@keyframes clickReady {
  0%, 100% { box-shadow: 0 12px 30px rgba(31,163,101,.3), 0 0 0 0 rgba(110,231,168,.35); }
  50%      { box-shadow: 0 12px 30px rgba(31,163,101,.3), 0 0 0 12px rgba(110,231,168,0); }
}

.click-btn-label { font-size: clamp(28px, 8vw, 42px); font-weight: 800; letter-spacing: .12em; line-height: 1; }
.click-btn-sub   { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }

.click-btn:disabled { cursor: not-allowed; box-shadow: none; }

/* Sieht gesperrt aus, ist es aber nicht: ein Druck hier zählt als Block. */
.click-btn.is-locked {
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.04));
  color: var(--ink-dim);
  cursor: not-allowed;
  box-shadow: none;
}

.click-btn.is-waiting {
  background: linear-gradient(180deg, rgba(245,196,81,.28), rgba(245,196,81,.12));
  color: var(--gold);
}

.feedback { margin-top: 12px; }

.ack-line {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-brd);
  color: var(--ink-dim);
}

.ack-line.is-ok  { color: var(--go);     border-color: rgba(69,212,131,.4);  background: rgba(69,212,131,.1); }
.ack-line.is-bad { color: var(--danger); border-color: rgba(255,107,107,.4); background: rgba(255,107,107,.1); }

.feedback-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 12.5px;
  color: var(--ink-dim);
}

.feedback-meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.ack-chips { display: flex; gap: 4px; margin-top: 10px; min-height: 18px; }

.chip {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.chip-ok  { background: rgba(69,212,131,.2);  color: var(--go); }
.chip-bad { background: rgba(255,107,107,.2); color: var(--danger); }

/* ------------------------------------------------------- Mitspieler-Karten */

.players-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.pcard {
  padding: 12px;
  border-radius: 16px;
  background: rgba(0,0,0,.28);
  border: 1px solid var(--panel-brd);
  border-top: 3px solid var(--accent);
  transition: opacity .12s ease, filter .12s ease, transform .2s var(--spring);
}

/* Wer gerade geklickt hat, hüpft kurz nach vorn. */
.pcard.is-flash { transform: translateY(-3px); }

.pcard.is-blocked { opacity: .45; filter: saturate(.35); }
.pcard.is-off { opacity: .3; }

.pcard-head { margin-bottom: 4px; }

.pcard-name {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcard-clicks {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.1;
}

.pcard-status {
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  min-height: 14px;
}

.pcard.is-flash { animation: cardFlash .3s ease-out; }

@keyframes cardFlash {
  0%   { box-shadow: 0 0 0 0 var(--accent); }
  100% { box-shadow: 0 0 0 9px rgba(0,0,0,0); }
}

/* ------------------------------------------------------------------ Ergebnis */

.win-hero { position: relative; text-align: center; padding: 8px 0 24px; overflow: hidden; }

/* Ein Lichtstrahlenkranz hinter dem Sieger – der Moment darf gross sein. */
.win-hero::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%;
  width: 420px; height: 420px;
  margin-left: -210px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(245,196,81,.20), transparent 70%);
  animation: winGlow 3.2s ease-in-out infinite;
  pointer-events: none;
}

.win-hero > * { position: relative; }

.win-egg { font-size: 44px; animation: pop .55s cubic-bezier(.2,1.7,.4,1) both; }

@keyframes pop { 0% { transform: scale(.3) rotate(-18deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

@keyframes winGlow {
  0%, 100% { opacity: .7;  transform: scale(.95); }
  50%      { opacity: 1;   transform: scale(1.05); }
}

.win-kicker {
  margin: 6px 0 2px;
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.win-name {
  margin: 0;
  font-size: clamp(26px, 7.5vw, 44px);
  font-weight: 800;
  animation: winName .5s .1s var(--spring) both;
}

@keyframes winName {
  0%   { transform: translateY(14px) scale(.9); opacity: 0; }
  100% { transform: translateY(0) scale(1);     opacity: 1; }
}

.win-prize {
  margin: 6px 0 4px;
  font-size: clamp(30px, 9vw, 52px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  /* Breiterer Verlauf, damit ein Glanz darüberwandern kann. */
  background: linear-gradient(100deg,
    var(--gold-deep) 0%, var(--gold) 30%, #fffdf3 48%, var(--gold) 66%, var(--gold-deep) 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: prizeShine 3.4s var(--ease) infinite;
}

@keyframes prizeShine {
  0%,  12% { background-position: 130% 0; }
  62%,100% { background-position: -30% 0; }
}

.table-wrap { overflow-x: auto; }

.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }

.stats-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 700;
  padding: 0 12px 8px 0;
}

.stats-table td {
  padding: 9px 12px 9px 0;
  border-top: 1px solid var(--panel-brd);
  font-variant-numeric: tabular-nums;
}

.stats-table tr.is-winner td { color: var(--gold); font-weight: 700; }

.tdot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
}

.crown { font-size: 13px; }

/* --------------------------------------------------------------------- Footer */

.footer { margin-top: 26px; text-align: center; }

.mode-badge {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border: 1px solid var(--panel-brd);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ------------------------------------------------------ Sperre: zweiter Tab */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 10, 9, .92);
  backdrop-filter: blur(4px);
}

.overlay[hidden] { display: none; }

.overlay-card {
  max-width: 420px;
  text-align: center;
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-brd);
  background: var(--bg-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

.overlay-icon { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.overlay-card h2 { margin: 0 0 10px; font-size: 22px; }
.overlay-card p { margin: 0 0 12px; color: var(--ink-dim); font-size: 14.5px; line-height: 1.55; }
.overlay-card .btn { margin-top: 4px; }

/* ----------------------------------------------------------------- Responsive */

@media (min-width: 620px) {
  .scoreboard { grid-template-columns: repeat(3, 1fr); }
  .stat-hero { grid-column: 1 / 2; }
  .btn-row { flex-direction: row; align-items: center; }
  .btn-row .btn-big { flex: 1 1 auto; }
  .btn-row .btn-ghost { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  /* `*` trifft keine Pseudo-Elemente – Schimmer und Schein sitzen aber genau
     dort, also müssen sie eigens abgeschaltet werden. */
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .trail-dot { transition: none; }

  /* Ohne Bewegung kein Wackeln beim Anfassen – Farbe reicht als Rückmeldung. */
  .room:hover:not(:disabled),
  .room:active:not(:disabled),
  .click-btn:hover:not(:disabled):not(.is-locked),
  .pcard.is-flash { transform: none; }

  .progress-bar::after { display: none; }
}
