/* ==========================================================
   4 Gewinnt – Cartoon-Stil (Standarddesign „Comic“)
   Andere Designs in themes.css überschreiben nur Variablen und Details.
   ========================================================== */

:root {
  --ink: #1d1d3b;
  --paper: #fffaf0;
  --sky-top: #4cc3ff;
  --sky-bottom: #bdeaff;
  --hill1: #7ed957;
  --hill2: #49a84f;
  --yellow: #ffd23f;
  --orange: #ff9f1c;
  --red: #ff5a5f;
  --green: #49a84f;
  --blue: #2591d6;
  --purple: #6d3f8f;
  --grey: #9aa0b5;

  --d-r: #ff5a5f;          /* roter Stein */
  --d-g: #ffd23f;          /* gelber Stein */
  --disc-border: var(--ink);
  --disc-shine: rgba(255, 255, 255, .45);
  --disc-shade: rgba(0, 0, 0, .18);
  --disc-filter: none;
  --frame: #2591d6;        /* Farbe des Spielbretts */
  --hole: #bdeaff;         /* Farbe der leeren Löcher */
  --col-hover: rgba(255, 255, 255, .18);
  --c4-gap: clamp(4px, 1.3vw, 9px);

  --line: 3px;
  --radius: 18px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);

  --font-head: 'Luckiest Guy', 'Comic Sans MS', Impact, sans-serif;
  --font-body: 'Nunito', 'Comic Sans MS', 'Chalkboard SE', system-ui, sans-serif;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(var(--sky-top), var(--sky-bottom) 75%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: .5px;
  margin: 0 0 .5em;
  line-height: 1.1;
}

a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

/* ---------------- Kulisse ---------------- */

.scenery { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.sun {
  position: absolute; top: 24px; right: 8%;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--yellow);
  border: var(--line) solid var(--ink);
  box-shadow: inset -10px -10px 0 #f5b700;
}
.sun-rays {
  position: absolute; inset: -34px; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 210, 63, .55) 0 12deg, transparent 12deg 30deg);
  border-radius: 50%;
  animation: spin 40s linear infinite;
}

.cloud {
  position: absolute; width: 120px; height: 44px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 40px;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; background: #fff;
  border: var(--line) solid var(--ink); border-bottom: none; border-radius: 50% 50% 0 0;
}
.cloud::before { width: 52px; height: 34px; top: -26px; left: 16px; }
.cloud::after  { width: 40px; height: 26px; top: -18px; left: 58px; }
.cloud.c1 { top: 90px;  animation-duration: 70s;  animation-delay: -10s; }
.cloud.c2 { top: 180px; animation-duration: 95s;  animation-delay: -50s; transform: scale(.7); }
.cloud.c3 { top: 40px;  animation-duration: 120s; animation-delay: -80s; transform: scale(.85); }

/* Schwebende Spielsteine */
.floater {
  position: absolute; width: 46px; height: 46px; border-radius: 50%; opacity: .5;
  border: var(--line) solid var(--ink); box-shadow: inset 0 -6px 0 var(--disc-shade), inset 0 0 0 7px rgba(0, 0, 0, .08);
  animation: float 14s ease-in-out infinite;
}
.floater.fr { background: var(--d-r); }
.floater.fg { background: var(--d-g); }
.floater.f1 { left: 6%;  top: 28%; animation-delay: -2s; }
.floater.f2 { left: 18%; top: 62%; animation-delay: -6s; transform: scale(.7); }
.floater.f3 { left: 84%; top: 40%; animation-delay: -9s; }
.floater.f4 { left: 72%; top: 70%; animation-delay: -4s; }
.floater.f5 { left: 44%; top: 82%; animation-delay: -11s; transform: scale(.6); }
.floater.f6 { left: 92%; top: 16%; animation-delay: -7s; transform: scale(.6); }

.hills { position: absolute; bottom: 0; left: 0; width: 100%; height: 18vh; min-height: 100px; }
.hill { stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; }
.hill.h1 { fill: var(--hill1); }
.hill.h2 { fill: var(--hill2); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { left: -180px; } to { left: 110vw; } }
@keyframes float {
  0%, 100% { translate: 0 0; rotate: -8deg; }
  50% { translate: 0 -26px; rotate: 10deg; }
}

/* ---------------- Kopfzeile ---------------- */

.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(12px, 3vw, 28px);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-grid { width: 52px; height: 52px; transition: transform .3s var(--bounce); }
.logo:hover .logo-grid { transform: rotate(-10deg) scale(1.08); }
.lg-bg { fill: var(--frame); stroke: var(--ink); stroke-width: 3.5; }
.logo-grid circle { stroke: var(--ink); stroke-width: 2; }
.lg-hole { fill: var(--hole); }
.lg-r { fill: var(--d-r); }
.lg-g { fill: var(--d-g); }
.logo-text {
  font-family: var(--font-head); font-size: clamp(24px, 4.5vw, 36px); line-height: .95;
  color: #fff; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
}
.logo-text span { color: var(--yellow); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; border: var(--line) solid var(--ink); box-shadow: var(--shadow-sm);
  font-size: 20px; cursor: pointer; transition: transform .15s;
}
.icon-btn:hover { transform: translateY(-2px) rotate(-8deg); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }

.userchip {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 999px;
  padding: 4px 4px 4px 14px; box-shadow: var(--shadow-sm);
}
.userchip .name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Grundbausteine ---------------- */

main { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 8px clamp(12px, 3vw, 28px) 140px; }

.panel {
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.5vw, 24px);
  margin-bottom: 20px;
  animation: pop-in .35s var(--bounce);
}
.panel h2 { font-size: 26px; }
@keyframes pop-in { from { transform: scale(.94); opacity: 0; } }

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.muted { opacity: .7; font-weight: 600; }
.hint { font-size: 14px; opacity: .75; margin: 14px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 14px;
  border: var(--line) solid var(--ink); box-shadow: var(--shadow-sm);
  background: #fff; color: var(--ink);
  font-family: var(--font-head); font-size: 18px; letter-spacing: .5px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.small { padding: 6px 12px; font-size: 15px; border-radius: 11px; }
.btn.big { padding: 14px 22px; font-size: 22px; }
.btn.green { background: var(--green); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.yellow { background: var(--yellow); }
.btn.white { background: #fff; }
.btn.green, .btn.red, .btn.blue { text-shadow: 1px 1px 0 var(--ink); }
.btn.wiggle:hover { animation: wiggle .4s ease-in-out; }
@keyframes wiggle { 25% { rotate: -2deg; } 75% { rotate: 2deg; } }

.input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: var(--line) solid var(--ink); background: #fff;
  font-weight: 700; outline: none;
}
.input:focus { box-shadow: 0 0 0 4px var(--yellow); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.error, .form-msg.err { color: #c62828; min-height: 1.2em; margin: 0 0 10px; }
.form-msg.ok { color: #2e7d32; }
.form-msg { margin: 4px 0 10px; min-height: 1em; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: #0001; padding: 5px; border-radius: 14px; }
.tabs button {
  flex: 1; padding: 9px; border: none; border-radius: 10px; background: transparent;
  font-family: var(--font-head); font-size: 17px; cursor: pointer;
}
.tabs button.active { background: #fff; border: var(--line) solid var(--ink); box-shadow: var(--shadow-sm); }

.avatar.cpu { background: #e8ecf5; font-size: 22px; text-shadow: none; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: var(--line) solid var(--ink); color: #fff;
  font-family: var(--font-head); font-size: 20px; text-shadow: 1px 1px 0 var(--ink);
}

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  border: 2px solid var(--ink); background: #fff; font-size: 13px; white-space: nowrap;
}
.badge.hot { background: var(--red); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.badge.wait { background: #e8ecf5; }
.badge.won { background: var(--yellow); }
.badge.lost { background: #d9d9e3; }
.badge.draw { background: #c8f0d0; }
.badge.chat { background: var(--blue); color: #fff; }
@keyframes pulse { 50% { transform: scale(1.07); } }

.tag {
  display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px;
  background: var(--red); color: #fff; font-family: var(--font-body); font-size: 14px;
  vertical-align: middle; border: 2px solid var(--ink);
}

/* Kleiner Spielstein (Lobby, Spielerkopf) */
.mini-disc {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  background: var(--frame); border: 2px solid var(--ink); border-radius: 8px;
}
.mini-disc .disc { width: 20px; height: 20px; border-width: 2px; }

/* ---------------- Anmeldung ---------------- */

.auth { max-width: 440px; margin: 10px auto; text-align: center; }
.auth h1 {
  font-size: clamp(30px, 6vw, 46px); color: #fff;
  -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink);
}
.auth .panel { text-align: left; }
.auth .c4-wrap.demo { width: 230px; margin: 0 auto 18px; pointer-events: none; --c4-gap: 4px; }
.auth .c4-wrap.demo .slot { border-width: 2px; }
.auth .c4-wrap.demo .disc { border-width: 2px; }
.auth-features { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; font-size: 15px; }
.auth-features li { display: flex; gap: 10px; align-items: center; }
.auth-features b { width: 26px; text-align: center; }

/* ---------------- Lobby ---------------- */

.lobby-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.games { display: grid; gap: 10px; }
.game-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm);
  text-decoration: none; cursor: pointer; transition: transform .15s;
}
.game-card:hover { transform: translateY(-2px) rotate(-.4deg); }
.game-card.your-turn { background: #fff4c2; }
.game-card.finished { opacity: .85; }
.game-card .info { flex: 1; min-width: 0; }
.game-card .opp { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card .sub { font-size: 13px; opacity: .7; }
.game-card .badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.finished-games { margin-top: 16px; }
.finished-games summary { cursor: pointer; margin-bottom: 10px; }

.empty { text-align: center; padding: 10px; }
.big-emoji { font-size: 54px; animation: float 6s ease-in-out infinite; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #fff; border: 2px solid var(--ink); border-radius: 12px;
}
.list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #e8ecf5; border: 2px solid var(--ink); font-size: 14px;
}
.rank.r1 { background: var(--yellow); }
.rank.r2 { background: #d9dde8; }
.rank.r3 { background: #f0b27a; }

.new-game form { display: flex; gap: 8px; }
.new-game form .input { flex: 1; min-width: 0; }
select.input { cursor: pointer; text-overflow: ellipsis; }
select.input:disabled { cursor: not-allowed; opacity: .6; }
.divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; opacity: .6; }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 2px dashed var(--ink); }

.level-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.level-opt {
  display: grid; justify-items: center; gap: 2px; padding: 10px 6px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 14px; cursor: pointer;
  transition: transform .15s;
}
.level-opt:hover { transform: translateY(-2px); }
.level-opt.active { background: var(--yellow); box-shadow: var(--shadow-sm); }
.level-icon { font-size: 26px; line-height: 1.1; }
.level-opt b { font-family: var(--font-head); font-weight: 400; font-size: 18px; }
.level-opt small { font-size: 12px; opacity: .75; text-align: center; }

/* ---------------- Spielansicht ---------------- */

.game-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.versus { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 17px; }
.versus .player { display: flex; align-items: center; gap: 8px; }
.vs {
  font-family: var(--font-head); font-size: 22px; color: var(--red);
  -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; transform: rotate(-8deg);
}

.status-banner {
  display: grid; gap: 2px; text-align: center; padding: 12px 16px; margin-bottom: 18px;
  border: var(--line) solid var(--ink); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm);
}
.status-banner .sb-title { font-family: var(--font-head); font-size: clamp(20px, 3.5vw, 28px); }
.status-banner .sb-sub { opacity: .75; }
.status-banner.turn { background: var(--yellow); }
.status-banner.wait { background: #e8ecf5; }
.status-banner.win { background: #ffe066; }
.status-banner.lose { background: #d9d9e3; }
.status-banner.draw { background: #c8f0d0; }
.status-banner.flash { animation: flash .6s ease-in-out 3; }
@keyframes flash { 50% { transform: scale(1.03); filter: brightness(1.1); } }

.board-area { display: grid; justify-items: center; gap: 10px; margin-bottom: 18px; }
.rule { margin: 0; text-align: center; font-size: 14px; }

/* Das Spielbrett */
.c4-wrap { position: relative; width: min(100%, 520px); }
.c4-wrap.wobble { animation: wobble .4s ease-in-out; }
@keyframes wobble { 20% { rotate: -2deg; } 40% { rotate: 2deg; } 60% { rotate: -1deg; } 80% { rotate: 1deg; } }

.c4 {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--c4-gap); padding: var(--c4-gap);
  background: var(--frame); border: var(--line) solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.c4 .col {
  display: grid; grid-auto-rows: auto; gap: var(--c4-gap); padding: 0; min-width: 0;
  background: none; border: none; border-radius: 999px; cursor: default;
  transition: background .15s;
}
.c4.playable .col:not(.full) { cursor: pointer; }
.c4.playable .col:not(.full):hover { background: var(--col-hover); }
.c4 .col:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }

.slot {
  position: relative; display: block; aspect-ratio: 1; border-radius: 50%;
  background: var(--hole); border: var(--line) solid var(--ink);
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, .15);
}
.slot .disc { position: absolute; inset: -3px; width: auto; height: auto; }
.slot.last .disc:not(.ghost) { outline: 3px solid #fff; outline-offset: -9px; }
.slot.win .disc { animation: win-bounce .6s var(--bounce) both; }
.slot.win .disc::after {
  content: ''; position: absolute; inset: 26%; border-radius: 50%; border: 3px solid var(--ink); background: rgba(255, 255, 255, .55);
}
@keyframes win-bounce { 40% { transform: scale(1.18) rotate(-6deg); } }

/* Spielsteine */
.disc {
  display: block; width: 24px; height: 24px; border-radius: 50%;
  border: var(--line) solid var(--disc-border);
  box-shadow: inset 0 -5px 0 var(--disc-shade), inset 0 4px 0 var(--disc-shine);
  filter: var(--disc-filter);
}
.disc.d-R { background: var(--d-r); color: var(--d-r); }
.disc.d-G { background: var(--d-g); color: var(--d-g); }
.disc.ghost { opacity: .35; }
/* Hineinfallen: von oberhalb des Bretts bis ins Ziel, dann kurz nachfedern */
.slot .disc.drop {
  z-index: 3;
  animation: drop var(--dur, .4s) cubic-bezier(.55, 0, 1, .45) both, land .25s ease-out var(--dur, .4s);
}
@keyframes drop { from { transform: translateY(calc(var(--fall, 1) * -1 * (100% + var(--c4-gap)) - 30%)); } }
@keyframes land { 40% { transform: translateY(-9%) scaleY(.93); } }

/* Gewinnlinie */
.win-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 4; }
.strike { stroke: var(--ink); stroke-width: 9; stroke-linecap: round; opacity: .8; }
.strike.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-stroke .5s ease-in-out .15s forwards; }
@keyframes draw-stroke { to { stroke-dashoffset: 0; } }

.pop-text {
  position: absolute; left: 50%; top: 40%; z-index: 5; pointer-events: none;
  font-family: var(--font-head); font-size: clamp(24px, 5vw, 38px); white-space: nowrap;
  color: var(--yellow); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
  animation: pop-text 1.2s ease-out forwards;
}
@keyframes pop-text {
  0% { transform: translate(-50%, 0) scale(.3) rotate(-10deg); opacity: 0; }
  25% { transform: translate(-50%, -10px) scale(1.15) rotate(-4deg); opacity: 1; }
  100% { transform: translate(-50%, -70px) scale(1) rotate(0); opacity: 0; }
}

/* ---------------- Chat ---------------- */

.chat h3 { font-size: 20px; }
.chat-box { position: relative; }
.chat-list {
  height: 220px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 14px;
}
.chat-empty { margin: auto; text-align: center; opacity: .6; font-size: 14px; }
.msg { max-width: 80%; display: grid; gap: 2px; }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.fresh { animation: pop-in .3s var(--bounce); }
.msg .bubble {
  padding: 7px 12px; border-radius: 14px; border: 2px solid var(--ink);
  background: #e8ecf5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.mine .bubble { background: var(--yellow); border-bottom-right-radius: 4px; }
.msg.theirs .bubble { border-bottom-left-radius: 4px; }
.msg .meta { font-size: 11px; opacity: .6; }
.chat-new {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  border: 2px solid var(--ink); border-radius: 999px; background: var(--blue); color: #fff; padding: 4px 12px; cursor: pointer;
}
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip {
  padding: 4px 10px; border-radius: 999px; border: 2px solid var(--ink); background: #fff;
  font-size: 13px; cursor: pointer;
}
.chip:hover { background: var(--yellow); }
.chat-form { display: flex; gap: 8px; align-items: center; }
.chat-form .input { flex: 1; min-width: 0; }
.chat-count { font-size: 12px; opacity: .6; min-width: 2ch; }

/* ---------------- Overlays, Toasts, Konfetti ---------------- */

.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(20, 20, 50, .55); animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.overlay > .panel { max-width: 440px; width: 100%; text-align: center; }
.overlay .big { font-size: 72px; animation: float 3s ease-in-out infinite; }
.overlay .row { justify-content: center; }
.overlay.win h1 { color: var(--orange); }
.overlay.lose h1 { color: var(--grey); }
.overlay.draw h1 { color: var(--green); }

.settings-overlay { place-items: start center; overflow-y: auto; }
.overlay > .panel.settings { max-width: 640px; text-align: left; }
.settings h3 { margin-top: 18px; font-size: 20px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-card {
  position: relative; display: grid; gap: 4px; padding: 8px; text-align: left;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 14px; cursor: pointer;
}
.theme-card.active { background: var(--yellow); box-shadow: var(--shadow-sm); }
.theme-card .check {
  position: absolute; top: 4px; right: 6px; z-index: 2; width: 24px; height: 24px; border-radius: 50%;
  display: none; place-items: center; background: var(--green); color: #fff; border: 2px solid var(--ink);
}
.theme-card.active .check { display: grid; }
.theme-card .tname { font-family: var(--font-head); font-size: 16px; }
.theme-card .tdesc { font-size: 12px; opacity: .75; }

.tp {
  height: 86px; border-radius: 10px; border: 2px solid var(--ink); display: grid; place-items: center;
  background: linear-gradient(var(--tp-bg1), var(--tp-bg2));
}
.tp-board {
  width: 82px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 4px;
  background: var(--tp-board); border: 2px solid var(--tp-line); border-radius: 8px;
}
.tp-board i { aspect-ratio: 1; border-radius: 50%; background: var(--tp-hole); border: 1.5px solid var(--tp-line); }
.tp-board i.tp-R { background: var(--tp-r); }
.tp-board i.tp-G { background: var(--tp-g); }
.tp-grid .tp-board { background-image: linear-gradient(#cfe0f1 1px, transparent 1px), linear-gradient(90deg, #cfe0f1 1px, transparent 1px); background-size: 6px 6px; }
.tp-glow .tp-board { box-shadow: 0 0 8px var(--tp-line); }
.tp-glow .tp-board i.tp-R { box-shadow: 0 0 5px var(--tp-r); }
.tp-glow .tp-board i.tp-G { box-shadow: 0 0 5px var(--tp-g); }

.account details { margin-bottom: 8px; }
.account summary { cursor: pointer; padding: 6px 0; }
.account-form { padding: 6px 0 4px; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.toggle-row small { display: block; font-size: 12px; opacity: .7; font-weight: 600; }
.switch {
  flex: none; position: relative; width: 54px; height: 30px; border-radius: 999px;
  border: var(--line) solid var(--ink); background: #d9d9e3; cursor: pointer; padding: 0;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ink); transition: left .2s var(--bounce);
}
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { left: 26px; }

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast {
  padding: 10px 16px; border-radius: 12px; border: var(--line) solid var(--ink); background: #fff;
  box-shadow: var(--shadow-sm); animation: pop-in .25s var(--bounce); text-align: center;
}
.toast.ok { background: #c8f0d0; }
.toast.err { background: #ffd0d0; }
.toast.out { opacity: 0; transform: translateY(10px); transition: .3s; }

.confetti {
  position: fixed; top: -20px; z-index: 70; width: 12px; height: 16px; pointer-events: none;
  background: var(--c); border: 2px solid var(--ink);
  animation: fall linear forwards;
}
.confetti.disc-r, .confetti.disc-g { width: 18px; height: 18px; border-radius: 50%; border-width: 2px; }
.confetti.disc-r { background: var(--d-r); }
.confetti.disc-g { background: var(--d-g); }
@keyframes fall {
  to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); }
}

.loading { display: grid; justify-items: center; padding: 60px 0; }
.spinner { display: flex; gap: 6px; }
.spinner .disc { width: 44px; height: 44px; animation: bounce-y .8s ease-in-out infinite alternate; }
.spinner .d-G { animation-delay: .4s; }
@keyframes bounce-y { to { transform: translateY(-14px) rotate(12deg); } }

/* ---------------- Mobil ---------------- */

@media (max-width: 560px) {
  .logo-grid { width: 42px; height: 42px; }
  .userchip .name { display: none; }
  .userchip { padding-left: 4px; }
  .sun { width: 64px; height: 64px; }
  .new-game form { flex-direction: column; }
  .game-card { flex-wrap: wrap; }
  .game-card .badges { width: 100%; justify-content: flex-start; }
}

/* ---------------- Animationen reduzieren ---------------- */

html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .cloud, .sun-rays, .floater, .big-emoji { animation: none; }
}
