/* ===========================================================================
   UNO & more — Casino-Filz Theme, mobile-first
   Keine Gradients als Deko, keine weissen Rounded-Boxen.
   Satte Vollfarben, harte "anfasser"-Schatten, Typo mit Charakter.
   =========================================================================== */

:root {
  --felt:       #15604a;
  --felt-dark:  #0d3f31;
  --wood:       #6b3f24;
  --wood-dark:  #4a2a17;
  --cream:      #f3e9d6;
  --cream-dim:  #c8bba2;
  --gold:       #e2a63d;
  --gold-dark:  #a9762a;
  --ink:        #17110b;

  --red:    #d8402f;
  --yellow: #f4b400;
  --green:  #2fa05d;
  --blue:   #2f6fd0;

  --hard-shadow: 0 5px 0 rgba(0, 0, 0, .30);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--felt-dark);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

/* ---------------------------------------------------------------------------
   Die "Phone"-Spalte. Auf dem Handy vollflaechig, auf dem Desktop als
   Geraet gerahmt — die Browser-Variante sieht aus wie auf dem Handy.
   --------------------------------------------------------------------------- */
#app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background-color: var(--felt);
  /* feine Filz-Koernung (SVG-Noise, selbst gebaut) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, .42);
}

@media (min-width: 520px) {
  body { padding: 26px 0; align-items: center; }
  #app {
    min-height: calc(100dvh - 52px);
    max-height: 900px;
    border-radius: 38px;
    border: 11px solid #1c130c;          /* Geraet-Rahmen */
    box-shadow:
      inset 0 0 120px rgba(0, 0, 0, .45),
      0 34px 90px rgba(0, 0, 0, .62);
  }
}

/* ---------------------------------------------------------------------------
   Screens
   --------------------------------------------------------------------------- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
}

/* --- Name-Eingabe --------------------------------------------------------- */
.screen-name { justify-content: center; }

.brand { text-align: center; margin-bottom: 42px; }

.logo {
  font-weight: 900;
  font-size: 82px;
  line-height: .82;
  letter-spacing: -4px;
  color: var(--cream);
  text-shadow: 0 6px 0 var(--gold-dark), 0 8px 16px rgba(0, 0, 0, .45);
}

.brand-sub {
  font-weight: 800;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 15px;
  margin-top: 10px;
  padding-left: 8px; /* optisch zentrieren wegen letter-spacing */
}

.tagline { color: var(--cream-dim); margin-top: 18px; font-size: 15px; }

.name-form { display: flex; flex-direction: column; gap: 12px; }

.field-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--cream-dim);
  letter-spacing: .4px;
  text-transform: uppercase;
}

.hint {
  text-align: center;
  color: var(--cream-dim);
  font-size: 13px;
  margin-top: 30px;
}

/* --- Home ----------------------------------------------------------------- */
.screen-home { gap: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(0, 0, 0, .22);
}

.logo-small { font-weight: 900; font-size: 24px; letter-spacing: -1px; }
.logo-small span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-left: 5px;
}

.me { text-align: right; }
.me-name { font-weight: 800; font-size: 15px; }

.code-chip {
  margin-top: 6px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, .28);
  border: none;
  color: var(--cream);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(243, 233, 214, .22);
}
.code-chip:active { box-shadow: inset 0 0 0 1px var(--gold); }
.code-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cream-dim);
}
.code-value { font-weight: 900; letter-spacing: 2px; color: var(--gold); }

.join-row { display: flex; gap: 10px; margin-top: 20px; }
.join-row .input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 800;
  text-align: center;
}

/* --- Spiele-Kacheln ------------------------------------------------------- */
.games { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }

.tile {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, .22);
  color: var(--cream);
  border: none;
  box-shadow: var(--hard-shadow);
}
.tile-active:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .30); }
.tile-locked { opacity: .5; cursor: default; }

.tile-art {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 17px;
}
.tile-art-uno {
  background: var(--red);
  color: #fff;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .18);
  transform: rotate(-5deg);
  letter-spacing: -1px;
}
.tile-art-soon { background: rgba(243, 233, 214, .12); color: var(--cream-dim); }

.tile-meta { flex: 1; min-width: 0; }
.tile-name { font-weight: 800; font-size: 17px; }
.tile-desc { color: var(--cream-dim); font-size: 13px; margin-top: 2px; }

.tile-play { font-weight: 800; color: var(--gold); font-size: 14px; }
.tile-lock {
  font-size: 11px;
  color: var(--cream-dim);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.foot { margin-top: auto; padding-top: 26px; text-align: center; }
.linkish {
  background: none;
  border: none;
  color: var(--cream-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Form-Elemente
   --------------------------------------------------------------------------- */
.input {
  font: inherit;
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: none;
  background: rgba(0, 0, 0, .30);
  color: var(--cream);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .42);
}
.input::placeholder { color: rgba(243, 233, 214, .38); }
.input:focus {
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .42), 0 0 0 2px var(--gold);
}

.btn {
  font: inherit;
  font-weight: 800;
  letter-spacing: .3px;
  border: none;
  cursor: pointer;
  padding: 15px 22px;
  border-radius: 14px;
  color: var(--ink);
  background: var(--gold);
  box-shadow: 0 5px 0 var(--gold-dark);
  transition: transform .06s ease, box-shadow .06s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-dark); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--cream);
  box-shadow: inset 0 0 0 2px rgba(243, 233, 214, .35);
}
.btn-ghost:active { transform: none; box-shadow: inset 0 0 0 2px var(--cream); }

/* ---------------------------------------------------------------------------
   Toast
   --------------------------------------------------------------------------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--cream);
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .55), 0 0 0 1px rgba(243, 233, 214, .14);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
  max-width: 88vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading { display: grid; place-items: center; flex: 1; color: var(--cream-dim); font-weight: 700; }

/* ===========================================================================
   Lobby
   =========================================================================== */
.screen-lobby { gap: 0; }

.lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(0, 0, 0, .22);
}
.lobby-code-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cream-dim);
}
.lobby-code {
  font: inherit;
  font-weight: 900;
  font-size: 34px;
  letter-spacing: 6px;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 2px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .3);
}
.lobby-code:active { color: var(--cream); }

.seats { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.seat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .22);
  box-shadow: var(--hard-shadow);
}
.seat-me { box-shadow: 0 0 0 2px var(--gold), 0 4px 0 rgba(0, 0, 0, .25); }
.seat-empty {
  justify-content: center;
  background: rgba(0, 0, 0, .12);
  box-shadow: inset 0 0 0 2px rgba(243, 233, 214, .12);
}
.seat-free { color: var(--cream-dim); font-size: 13px; font-weight: 700; letter-spacing: .5px; }

.seat-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: var(--av, #555);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.seat-info { flex: 1; min-width: 0; }
.seat-name { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seat-sub { color: var(--cream-dim); font-size: 12px; margin-top: 2px; }

.seat-x {
  font: inherit;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(0, 0, 0, .3);
  color: var(--cream-dim);
}
.seat-x:active { color: var(--red); }

.tag { font-size: 9px; font-weight: 900; letter-spacing: .5px; padding: 2px 6px; border-radius: 6px; }
.tag-host { background: var(--gold); color: var(--ink); }
.tag-me { background: rgba(243, 233, 214, .2); color: var(--cream); }

.add-bot { display: flex; align-items: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.add-bot-label { font-size: 13px; color: var(--cream-dim); font-weight: 700; }

.btn-block { width: 100%; margin-top: 16px; }
.btn-small { padding: 9px 13px; font-size: 13px; border-radius: 11px; }

.wait-note { text-align: center; color: var(--cream-dim); margin-top: 22px; font-weight: 700; }
.lobby-hint { text-align: center; color: var(--cream-dim); font-size: 12px; margin-top: auto; padding-top: 20px; }
.lobby-hint b { color: var(--gold); letter-spacing: 1px; }

/* ===========================================================================
   Spiel — Tisch
   =========================================================================== */
.screen-game { padding: 16px 14px; gap: 0; }

.game-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; }
.game-brand { font-weight: 900; font-size: 20px; letter-spacing: -1px; text-shadow: 0 2px 0 var(--gold-dark); }
.game-meta { display: flex; align-items: center; gap: 10px; }

.dir-wrap { color: var(--cream-dim); display: flex; }
.dir-svg { width: 22px; height: 22px; }
.dir-rev .dir-svg { transform: scaleX(-1); }

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5), 0 2px 4px rgba(0, 0, 0, .4);
}
.color-red    { background: var(--red); }
.color-yellow { background: var(--yellow); }
.color-green  { background: var(--green); }
.color-blue   { background: var(--blue); }

.stack-badge {
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  padding: 3px 11px;
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .3);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* --- Tisch-Bereich mit Gegner-Zonen (links / oben / rechts) --------------- */
.table-area {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 215px;
}
.opp-zone { position: absolute; display: flex; z-index: 2; }
.opp-left  { left: 2px; top: 50%; transform: translateY(-50%); }
.opp-right { right: 2px; top: 50%; transform: translateY(-50%); }
.opp-top   { top: 0; left: 50%; transform: translateX(-50%); }

/* --- Gegner --------------------------------------------------------------- */
.opp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .22);
  min-width: 66px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
}
.opp-active { box-shadow: 0 0 0 2px var(--gold), 0 3px 0 rgba(0, 0, 0, .25); }
.opp-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--av, #555);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  font-size: 15px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.opp-name { font-size: 11px; font-weight: 700; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--ink);
  color: var(--gold);
  font-weight: 900;
  font-size: 12px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--felt), 0 2px 4px rgba(0, 0, 0, .4);
}
.opp-uno {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 9px;
  letter-spacing: .5px;
  padding: 2px 7px;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}

/* --- Tisch (Zug- + Ablagestapel) ------------------------------------------ */
.table { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 26px; }
.pile { position: relative; }
.pile .card { --cw: 76px; }
.pile-count {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  font-weight: 800;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(243, 233, 214, .2);
}
.pile-draw.tap { cursor: pointer; }
.pile-draw.tap:active .card { transform: translateY(3px); }

.status { text-align: center; font-weight: 700; color: var(--cream-dim); padding: 4px 0; font-size: 14px; min-height: 24px; }
.status-me { color: var(--gold); }
.status-warn { color: #ffb4a8; }

/* ===========================================================================
   Karten
   =========================================================================== */
.card {
  --cw: 62px;
  width: var(--cw);
  height: calc(var(--cw) * 1.5);
  border-radius: 9px;
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  user-select: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .85);
}
.card-red    { background: var(--red); }
.card-yellow { background: var(--yellow); }
.card-green  { background: var(--green); }
.card-blue   { background: var(--blue); }
.card-wild   { background: #1a1410; }

.c-oval {
  width: 70%;
  height: 80%;
  background: #fff;
  border-radius: 50%;
  transform: rotate(-20deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--cw) * 0.42);
}
.card-red .c-oval    { color: var(--red); }
.card-yellow .c-oval { color: #c98f00; }
.card-green .c-oval  { color: var(--green); }
.card-blue .c-oval   { color: var(--blue); }

.sym { width: 58%; height: 58%; display: block; }
.plus { font-size: calc(var(--cw) * 0.4); letter-spacing: -1px; }

.c-corner {
  position: absolute;
  font-size: calc(var(--cw) * 0.2);
  font-weight: 900;
  color: #fff;
  line-height: 1;
}
.card-yellow .c-corner { color: #17110b; }
.c-tl { top: 5px; left: 6px; }
.c-br { bottom: 5px; right: 6px; transform: rotate(180deg); }
.c-corner .sym { width: calc(var(--cw) * 0.2); height: calc(var(--cw) * 0.2); display: block; }

/* Wild-Karten: vierfarbige Oval-Scheibe */
.card-wildcard .c-oval { background: transparent; box-shadow: none; transform: none; }
.wild-quad { width: 100%; height: 100%; border-radius: 50%; display: block; }
.w4 { position: relative; width: 100%; height: 100%; }
.w4 .wild-quad { width: 100%; height: 100%; }
.w4 b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: calc(var(--cw) * 0.32);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}

/* Kartenruecken */
.card-back { background: #1a1410; box-shadow: 0 3px 0 rgba(0, 0, 0, .35), inset 0 0 0 3px var(--gold); }
.back-oval {
  width: 70%;
  height: 80%;
  background: var(--red);
  border-radius: 50%;
  transform: rotate(-20deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: calc(var(--cw) * 0.24);
  letter-spacing: -1px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .5);
}

/* --- Eigene Hand ---------------------------------------------------------- */
.hand {
  display: flex;
  align-items: flex-end;
  justify-content: safe center;
  padding: 18px 6px 6px;
  min-height: 118px;
  overflow-x: auto;
  overflow-y: visible;
}
.hand .card { margin-left: -20px; transition: transform .12s ease, box-shadow .12s ease; }
.hand .card:first-child { margin-left: 0; }
.card.playable {
  cursor: pointer;
  transform: translateY(-13px);
  box-shadow: 0 0 0 3px var(--gold), 0 7px 0 rgba(0, 0, 0, .35);
  z-index: 3;
}
.card.playable:active { transform: translateY(-6px); }
.card.dim { opacity: .5; filter: saturate(.65); }

/* --- Steuerung ------------------------------------------------------------ */
.controls { display: flex; gap: 10px; justify-content: center; padding: 8px 0 12px; min-height: 56px; flex-wrap: wrap; }
.btn-warn { background: var(--red); color: #fff; box-shadow: 0 5px 0 #9c2c20; }
.btn-warn:active { box-shadow: 0 1px 0 #9c2c20; }
.btn-uno { background: var(--red); color: #fff; box-shadow: 0 5px 0 #9c2c20; font-style: italic; }
.btn-uno:active { box-shadow: 0 1px 0 #9c2c20; }

/* ===========================================================================
   Overlays (Sieg/Niederlage, Farbwahl)
   =========================================================================== */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; padding: 24px; }
.overlay-dim { background: rgba(8, 18, 14, .74); }

.overlay-box {
  text-align: center;
  background: var(--felt-dark);
  padding: 34px 28px;
  border-radius: 22px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 0 0 3px var(--gold), 0 24px 60px rgba(0, 0, 0, .6);
}
.overlay-title { font-weight: 900; font-size: 40px; letter-spacing: -1px; }
.overlay-title.win { color: var(--gold); text-shadow: 0 4px 0 var(--gold-dark); }
.overlay-title.lose { color: var(--cream-dim); }
.overlay-sub { color: var(--cream-dim); margin: 10px 0 22px; }
.overlay-btns { display: flex; flex-direction: column; gap: 10px; }

.color-pick {
  background: var(--felt-dark);
  padding: 24px;
  border-radius: 22px;
  box-shadow: 0 0 0 3px var(--gold), 0 24px 60px rgba(0, 0, 0, .6);
}
.color-pick-title { text-align: center; font-weight: 800; margin-bottom: 16px; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-btn {
  width: 74px;
  height: 74px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .4);
}
.color-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }

/* ===========================================================================
   Effekte & Leben
   =========================================================================== */

/* Gewuenschte Farbe faerbt den schwarzen Wild-Bereich ein */
.card-wild.wild-tint-red    { background: var(--red); }
.card-wild.wild-tint-yellow { background: var(--yellow); }
.card-wild.wild-tint-green  { background: var(--green); }
.card-wild.wild-tint-blue   { background: var(--blue); }
.card-wild.wild-tint-yellow .c-corner { color: #17110b; }

/* Karte "landet" einmalig auf dem Ablagestapel (sanftes Aufsetzen) */
.card-settle { animation: cardSettle .3s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes cardSettle { from { transform: scale(1.16); } to { transform: scale(1); } }

/* Fliegende Karte */
.fly-card {
  position: fixed;
  z-index: 60;
  width: 62px;
  height: 93px;
  pointer-events: none;
  transition: transform .48s cubic-bezier(.25, .7, .3, 1);
  will-change: transform;
}
.fly-card .card {
  width: 62px;
  height: 93px;
  margin: 0;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(255, 255, 255, .85);
}
.fly-small { width: 48px; height: 72px; }
.fly-small .card { --cw: 48px; width: 48px; height: 72px; }

/* Schwebende Aktions-Texte ("zieht", "+4 Karten", "UNO!") */
.float-label {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  transform: translate(-50%, 0);
  transition: transform .85s ease, opacity .85s ease;
  font-weight: 900;
  font-size: 15px;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .55);
  white-space: nowrap;
}
.float-draw { color: var(--cream-dim); font-size: 13px; }
.float-eat  { color: #ffb4a8; }
.float-uno  { color: var(--gold); font-size: 24px; font-style: italic; }
.float-bad  { color: #ff8d7e; font-size: 14px; }

/* Konfetti */
.confetti {
  position: fixed;
  z-index: 80;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  pointer-events: none;
  animation-name: confettiFall;
  animation-timing-function: cubic-bezier(.2, .6, .4, 1);
  animation-fill-mode: forwards;
}
@keyframes confettiFall {
  to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .85; }
}

/* Gegner-Chip: Puls wenn gehandelt, Denk-Punkte beim Bot */
.opp.act { animation: chipPulse .55s ease; }
@keyframes chipPulse { 0% { transform: scale(1); } 45% { transform: scale(1.16); } 100% { transform: scale(1); } }

.opp-think { display: flex; gap: 3px; margin-top: 2px; }
.opp-think i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cream-dim);
  animation: thinkDot 1s infinite ease-in-out;
}
.opp-think i:nth-child(2) { animation-delay: .15s; }
.opp-think i:nth-child(3) { animation-delay: .3s; }
@keyframes thinkDot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* Spiel-Screen braucht position fuer Ambient + Overlays */
.screen-game { position: relative; }

/* Warmes Tisch-Lampenlicht, das sanft "atmet" */
.ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(ellipse 95% 55% at 50% -8%, rgba(255, 214, 140, .09), transparent 62%);
  animation: lamp 7s ease-in-out infinite;
}
@keyframes lamp { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* Spielbare Karten: goldenes Atmen + Hover */
.card.playable { animation: playableGlow 1.5s ease-in-out infinite; }
@keyframes playableGlow {
  0%, 100% { box-shadow: 0 0 0 3px var(--gold), 0 7px 0 rgba(0, 0, 0, .35); }
  50%      { box-shadow: 0 0 0 3px var(--gold), 0 0 16px 3px rgba(226, 166, 61, .5), 0 7px 0 rgba(0, 0, 0, .35); }
}

/* Desktop-Hover (nur wo es Hover gibt) */
@media (hover: hover) {
  .btn:hover:not(:disabled) { filter: brightness(1.07); }
  .card.playable:hover { transform: translateY(-18px); }
  .tile-active:hover { transform: translateY(-2px); }
  .linkish:hover { color: var(--cream); }
  .lobby-code:hover { color: var(--cream); }
  .seat-x:hover { color: var(--red); }
  .pile-draw.tap:hover .card { transform: translateY(-3px); }
}

/* --- UNO: grosses Banner (UNO! / Platz X) + Raenge ------------------------ */
.uno-banner {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.uno-banner.show { opacity: 1; }
.uno-banner-word {
  font-weight: 900;
  font-size: 74px;
  letter-spacing: -2px;
  font-style: italic;
  color: var(--gold);
  text-shadow: 0 5px 0 var(--gold-dark), 0 0 30px rgba(226, 166, 61, .5), 0 8px 20px rgba(0, 0, 0, .5);
  transform: rotate(-6deg);
  animation: bannerPop .4s cubic-bezier(.3, 1.6, .5, 1);
}
.uno-banner-name {
  margin-top: 10px;
  font-weight: 800;
  font-size: 17px;
  color: var(--cream);
  background: rgba(0, 0, 0, .4);
  padding: 4px 18px;
  border-radius: 999px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}
@keyframes bannerPop { 0% { transform: rotate(-6deg) scale(.3); } 100% { transform: rotate(-6deg) scale(1); } }

.opp-finished { opacity: .55; }
.opp-rank {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}

.ranking { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 18px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  font-weight: 700;
  text-align: left;
}
.rank-row.rank-me { background: rgba(226, 166, 61, .22); box-shadow: inset 0 0 0 2px var(--gold); }
.rank-pos { font-weight: 900; color: var(--gold); font-size: 18px; min-width: 28px; }
.rank-name { font-size: 15px; }

/* ===========================================================================
   Mensch aergere Dich nicht
   =========================================================================== */

/* Farb-Palette der Spielfiguren (alle Elemente mit .cc-<farbe>) */
.cc-red    { --pc: #d8402f; }
.cc-blue   { --pc: #2f6fd0; }
.cc-green  { --pc: #2fa05d; }
.cc-yellow { --pc: #f4b400; }

.screen-madn { position: relative; padding: 14px; gap: 0; }
.game-brand-madn { text-shadow: 0 2px 0 #1f4f9c; }

.madn-turn { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--cream); }
.cc-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--pc); display: inline-block; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3); }

/* --- Spieler-Chips -------------------------------------------------------- */
.madn-players { display: flex; gap: 8px; justify-content: center; padding: 6px 0; flex-wrap: wrap; }
.mp {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
}
.mp-active { box-shadow: 0 0 0 2px var(--gold), 0 3px 0 rgba(0, 0, 0, .25); }
.mp-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--pc); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3); }
.mp-name { font-size: 12px; font-weight: 700; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-home { font-size: 11px; font-weight: 900; color: var(--gold); }

/* --- Brett ---------------------------------------------------------------- */
.board-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px 0; min-height: 0; }
.board {
  position: relative;
  width: min(88vw, 372px);
  max-width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  background-color: #b9894e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04 0.3' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23w)' opacity='0.08'/%3E%3C/svg%3E");
  border-radius: 14px;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .18), inset 0 0 26px rgba(0, 0, 0, .25), 0 12px 30px rgba(0, 0, 0, .45);
}

.cell { position: relative; }
.cell-track::after,
.cell-start::after,
.cell-home::after,
.cell-base::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.cell-track::after { inset: 21%; background: #f3e9d6; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.cell-start::after { inset: 16%; background: var(--pc); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55), inset 0 2px 3px rgba(0, 0, 0, .25); }
.cell-home::after  { inset: 24%; background: var(--pc); opacity: .9; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.cell-base::after  { inset: 12%; background: var(--pc); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .25); }
.cell-center::after {
  content: '\2605';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(0, 0, 0, .28);
  font-size: 20px;
}

/* Weg-Vorschau: Pfad-Felder leuchten golden auf */
.cell.path-preview::before {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: rgba(226, 166, 61, .45);
  box-shadow: 0 0 10px 2px rgba(226, 166, 61, .55);
  z-index: 3;
  animation: pathPulse .5s ease-in-out infinite;
}
@keyframes pathPulse { 0%, 100% { opacity: .45; } 50% { opacity: .9; } }

/* --- Figuren -------------------------------------------------------------- */
.piece {
  position: absolute;
  width: 7%;
  height: 7%;
  transform: translate(-50%, -50%);
  transition: left .45s cubic-bezier(.3, .8, .4, 1), top .45s cubic-bezier(.3, .8, .4, 1);
  z-index: 5;
  pointer-events: none;
}
.piece-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--pc);
  box-shadow: inset -2px -3px 5px rgba(0, 0, 0, .35), inset 2px 2px 4px rgba(255, 255, 255, .45), 0 3px 5px rgba(0, 0, 0, .4);
}
.piece.movable { pointer-events: auto; cursor: pointer; z-index: 6; }
.piece.movable .piece-body {
  box-shadow: 0 0 0 3px var(--gold), inset -2px -3px 5px rgba(0, 0, 0, .35), 0 0 12px 2px rgba(226, 166, 61, .6);
  animation: piecePulse 1.2s ease-in-out infinite;
}
@keyframes piecePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* --- Wuerfel & Steuerung -------------------------------------------------- */
.madn-controls { min-height: 70px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 8px 0 12px; }
.dice-side { display: flex; align-items: center; }
.dice {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 12px;
  background: #f3e9d6;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .3), inset 0 0 0 2px rgba(0, 0, 0, .08);
}
/* Leer (noch nicht gewuerfelt): kein "?", einfach ein leerer Wuerfel */
.dice-idle {
  background: rgba(0, 0, 0, .22);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .4), inset 0 0 0 2px rgba(243, 233, 214, .15);
}
.pip { position: absolute; width: 18%; height: 18%; border-radius: 50%; background: #17110b; transform: translate(-50%, -50%); }
.pip-0 { left: 27%; top: 27%; } .pip-1 { left: 50%; top: 27%; } .pip-2 { left: 73%; top: 27%; }
.pip-3 { left: 27%; top: 50%; } .pip-4 { left: 50%; top: 50%; } .pip-5 { left: 73%; top: 50%; }
.pip-6 { left: 27%; top: 73%; } .pip-7 { left: 50%; top: 73%; } .pip-8 { left: 73%; top: 73%; }
.dice-rolling { animation: diceRoll .5s ease; }
@keyframes diceRoll {
  0%   { transform: rotate(0) scale(1); }
  20%  { transform: rotate(-24deg) scale(1.12); }
  45%  { transform: rotate(20deg) scale(.92); }
  70%  { transform: rotate(-12deg) scale(1.08); }
  100% { transform: rotate(0) scale(1); }
}
.dice-hint { font-weight: 700; color: var(--cream-dim); font-size: 14px; }
.mp-finished { opacity: .55; }

/* --- Lobby: Spiel-Titel + Kachel ------------------------------------------ */
.lobby-game {
  text-align: center;
  font-weight: 900;
  font-size: 19px;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  padding: 2px 0 14px;
  letter-spacing: .5px;
}

/* Farbwahl in der Lobby (MADN) */
.seat-color {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: var(--pc);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 2px 4px rgba(0, 0, 0, .3);
}
.lobby-colors {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .18);
}
.lobby-colors-label { font-weight: 700; font-size: 13px; color: var(--cream-dim); }
.lobby-swatches { display: flex; gap: 10px; }
.color-pick-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--pc);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3), 0 3px 5px rgba(0, 0, 0, .3);
  transition: transform .1s ease;
}
.color-pick-btn:hover:not(:disabled) { transform: scale(1.12); }
.color-pick-btn.mine { box-shadow: 0 0 0 3px var(--gold), inset 0 0 0 2px rgba(255, 255, 255, .3); }
.color-pick-btn.taken { opacity: .3; cursor: not-allowed; }
.tile-art-madn {
  background: var(--blue);
  color: #fff;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .18);
  transform: rotate(4deg);
  font-size: 13px;
  letter-spacing: -.5px;
}

/* ===========================================================================
   Account / Login
   =========================================================================== */
.guest-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--cream-dim);
  background: rgba(0, 0, 0, .25);
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: .5px;
}
.account-line { display: flex; align-items: center; gap: 14px; justify-content: center; }
.account-mail { font-size: 13px; color: var(--cream-dim); font-weight: 700; }
.login-link { margin-top: 18px; font-size: 14px; }
.login-link + .login-link { margin-top: 10px; }

.screen-login { justify-content: center; }
.login-top { margin-bottom: 26px; }
.login-title { font-weight: 900; font-size: 26px; margin-top: 12px; letter-spacing: -.5px; }
.login-step { display: flex; flex-direction: column; gap: 12px; }
.login-hint { font-size: 13px; color: var(--cream-dim); line-height: 1.4; }
.label-opt { font-weight: 400; color: var(--cream-dim); font-size: 11px; }
.login-code { letter-spacing: 8px; font-weight: 900; font-size: 22px; text-align: center; }
.dev-code {
  font-size: 13px;
  color: var(--cream);
  background: rgba(226, 166, 61, .16);
  box-shadow: inset 0 0 0 1px rgba(226, 166, 61, .4);
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.5;
  text-align: center;
}
.dev-code b { color: var(--gold); font-size: 20px; letter-spacing: 4px; }
