/* NOMU NEKO — Nintendo-bunt: dicke Konturen, harte Schatten, ein grosser
   Knopf pro Schritt. Farben aus cat_game_screen.dart. */

:root {
  --ink: #1B1B1B;
  --sky: #5BC0EB;
  --grass: #8BD450;
  --cream: #FFF4D6;
  --gold: #F2C14E;
  --red: #E4000F;
  --font: "Nunito", "Arial Rounded MT Bold", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { margin: 0; min-height: 100%; background: var(--grass); }
body { margin: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, #A8E0F5 60%, var(--grass) 100%);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.mg-open { overflow: hidden; }

h1, h2, h3, b, .btn, .lbl, .seg button { font-weight: 900; letter-spacing: .02em; }
h1, h2, h3 { margin: .2em 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; display: flex; align-items: center; gap: .35em; }
p { line-height: 1.4; }
a { color: inherit; }

.ico { width: 1.2em; height: 1.2em; flex: none; }
.center { text-align: center; justify-content: center; }
.hint { font-size: .85rem; opacity: .8; margin: .3rem 0; }
.white { color: #fff; text-shadow: 2px 2px 0 var(--ink); }

/* ── Layout ── */

#app { max-width: 1280px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.home, .lobby, .finish { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.home > .hero { display: flex; justify-content: center; margin-top: 16px; }
.hero .neko { width: min(200px, 50vw); height: auto; }

.logo {
  text-align: center; color: #fff; font-size: clamp(2.6rem, 11vw, 3.6rem); margin: 0; line-height: 1;
  text-shadow: 3px 3px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink);
}
.logo.sm { font-size: clamp(2rem, 9vw, 2.8rem); margin-top: 16px; }
.sub { text-align: center; letter-spacing: .4em; font-weight: 900; margin: -6px 0 0; }

.panel {
  background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.panel.row { flex-direction: row; align-items: center; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.two > * { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.lbl { font-size: .85rem; margin-top: 6px; }

/* ── Knopf: dicke Kontur, harter Schatten, drueckt sich runter ── */

.btn {
  --c: var(--red);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px 20px; margin-bottom: 5px;
  font: inherit; font-size: 1.1rem; font-weight: 900; color: #fff; letter-spacing: .05em;
  text-shadow: 2px 2px 0 var(--ink);
  background: var(--c); border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: 0 5px 0 var(--ink); cursor: pointer; touch-action: manipulation;
  transition: transform 60ms, box-shadow 60ms;
}
.btn.big { padding: 20px; font-size: 1.6rem; border-radius: 26px; box-shadow: 0 8px 0 var(--ink); margin-bottom: 8px; }
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.btn.big:active:not(:disabled) { transform: translateY(8px); }
.btn:disabled { background: #BDBDBD; cursor: default; }
.btn .bi { display: inline-flex; }
.btn .bi svg { width: 1.6em; height: 1.6em; }
.btn.big .bi svg { width: 1.5em; height: 1.5em; }
.btn .bi .neko { width: 2.2em; }
.btn .bi .bottle { width: auto; height: 1.6em; }
.btn .bi .dice { width: 1.4em; }

.link { background: none; border: 0; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 4px; color: var(--ink); }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; color: var(--ink);
}
.iconbtn.sm { width: 32px; height: 32px; border-width: 2px; border-radius: 10px; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font: inherit; font-weight: 900; padding: 6px 10px;
  background: #fff; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; color: var(--ink);
}

/* ── Formular ── */

.field { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: .9rem; }
input[type=text], input:not([type]) {
  font: inherit; font-size: 1.15rem; font-weight: 800; padding: 12px 14px; width: 100%;
  border: 3px solid var(--ink); border-radius: 14px; background: var(--cream); color: var(--ink); min-width: 0;
}
input:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #009AC7; outline-offset: 2px; }
.join input { text-transform: uppercase; letter-spacing: .3em; text-align: center; flex: 1; }
.join .btn { width: auto; margin: 0; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 4px 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: #43B047; flex: none; }
.check span { display: flex; flex-direction: column; }
.check small { font-size: .82rem; opacity: .8; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.seg { display: flex; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; }
.seg button {
  flex: 1; font: inherit; font-weight: 900; padding: 10px 4px; background: #fff; border: 0; cursor: pointer; color: var(--ink);
  border-left: 2px solid var(--ink); min-width: 0;
}
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--gold); }

details summary { font-weight: 900; cursor: pointer; padding: 6px 0; }
details[open] summary { margin-bottom: 4px; }

.invite { background: var(--gold); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; text-align: center; }
.resume { flex-direction: row; align-items: center; flex-wrap: wrap; }
.resume .btn { width: auto; margin: 0 0 0 auto; }

.rooms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rooms button {
  width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 0 12px; text-align: left; font: inherit; cursor: pointer;
  background: var(--cream); border: 2px solid var(--ink); border-radius: 14px; padding: 8px 12px; color: var(--ink);
}
.rooms b { grid-row: span 2; font-size: 1.4rem; letter-spacing: .15em; align-self: center; }
.rooms small { opacity: .8; }

footer { text-align: center; font-size: .82rem; padding: 8px 0 16px; }
footer p { margin: .3em 0; }

/* Katzen-Koepfe */
.mini { display: inline-flex; width: 40px; flex: none; }
.mini.lg { width: 60px; }
.mini.xl { width: 96px; margin: 0 auto; }
.mini svg, .tok svg { width: 100%; height: auto; display: block; }
.coins { display: inline-flex; align-items: center; gap: 3px; }
.coins .coin { width: 15px; height: 15px; }

.bounce { animation: hop .9s ease-out infinite alternate; }
.neko.sm { width: 110px; height: auto; margin: 0 auto; }
@keyframes hop { to { transform: translateY(-5%); } }

/* ── Leiste oben ── */

.bar { display: flex; align-items: center; gap: 10px; padding: 10px 0; max-width: 1280px; margin: 0 auto; }
.bar-title { font-weight: 900; font-size: 1.15rem; flex: 1; text-align: center; }
.bar-right { display: flex; gap: 6px; }
.lost {
  display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--red); color: #fff; font-weight: 900;
  border: 3px solid var(--ink); border-radius: 14px; padding: 8px; margin-bottom: 8px;
}

/* ── Lobby ── */

.code-panel { text-align: center; align-items: center; }
.bigcode { font-size: 3.4rem; font-weight: 900; letter-spacing: .25em; padding-left: .25em; line-height: 1; }
.code-panel .btn { width: auto; }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.players li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 12px; }
.players li:nth-child(odd) { background: var(--cream); }
.players li.off { opacity: .45; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: .75rem; font-weight: 900; border: 2px solid var(--ink); border-radius: 8px; padding: 1px 6px; background: #fff; }
.tag.me { background: var(--gold); }
.wait p { margin: .3em 0; }

/* ── Spiel ── */

.game { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) and (min-aspect-ratio: 11/10) {
  .game { grid-template-columns: minmax(0, 6fr) minmax(320px, 5fr); align-items: start; }
  .board-wrap { position: sticky; top: 8px; }
}

.board {
  position: relative; width: 100%; max-width: min(100%, 78vh); margin: 0 auto; aspect-ratio: 1;
  display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr);
}
.space {
  margin: 5%; background: var(--sc); border: 2.5px solid var(--ink); border-radius: 22%;
  box-shadow: 0 3px 0 var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.space .bottle { height: 78%; width: auto; }
.space .smoke { animation: smoke 2.4s ease-in-out infinite; }
@keyframes smoke { 50% { transform: translateY(-2px); opacity: .6; } }
.center { grid-row: 2 / 7; grid-column: 2 / 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%; }
.c-neko { width: 44%; }
.c-neko svg { width: 100%; height: auto; display: block; }
.c-dice { width: 22%; display: flex; justify-content: center; }
.c-dice svg { width: 100%; height: auto; }
.c-logo { font-weight: 900; font-size: clamp(1rem, 4.5vw, 2rem); white-space: nowrap; }

.tokens { position: absolute; inset: 0; pointer-events: none; }
.tok { position: absolute; transition: left .2s ease, top .2s ease, width .2s ease; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.tok.cur { z-index: 2; animation: hop .45s ease-out infinite alternate; }
.tok.off { opacity: .4; }
.more { position: absolute; z-index: 3; background: var(--ink); color: #fff; font-size: .7rem; font-weight: 900; padding: 0 5px; border-radius: 8px; }

.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.score { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.pl {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; background: #fff; flex: none;
  border: 2px solid var(--ink); border-radius: 16px; transition: background .25s;
}
.pl.cur { background: var(--gold); border-width: 3px; }
.pl.me b { text-decoration: underline; text-decoration-thickness: 2px; }
.pl.off .mini { opacity: .35; }
.pl-t { display: flex; flex-direction: column; font-size: .85rem; line-height: 1.15; }
.pl-t b { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.actions { display: flex; flex-direction: column; gap: 12px; }
.actions > h2 { text-align: center; margin: 0; }
.shout { color: #fff; font-size: 1.8rem !important; text-shadow: 2px 2px 0 var(--ink); }
.dl { text-align: center; font-weight: 800; font-size: .85rem; margin: 0; min-height: 1.2em; }

.event { align-items: center; text-align: center; }
.ev-title {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; font-weight: 900;
  background: var(--sc); border: 2px solid var(--ink); border-radius: 14px;
}
.ev-title .bottle { height: 34px; width: auto; }
.ev-cat { width: 100px; }
.ev-cat svg { width: 100%; height: auto; }
.ev-text { font-weight: 900; font-size: 1.25rem; margin: .2em 0; }
.flip { font-weight: 900; font-size: 1.3rem; margin: 0; }
.flip.good { color: #2E7D32; }
.flip.bad { color: var(--red); }

.mg-ico { display: flex; justify-content: center; }
.mg-ico svg { width: 56px; height: 56px; }
.mg-ico .bottle { width: auto; }
.winners { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.winners > div { display: flex; flex-direction: column; align-items: center; }
.winners .ico { width: 30px; height: 30px; }

/* ── Ende ── */

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 8px; }
.pod { display: flex; flex-direction: column; align-items: center; width: 31%; max-width: 120px; text-align: center; }
.pod .ico { width: 40px; height: 40px; }
.pod b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.step {
  width: 100%; margin-top: 4px; border: 3px solid var(--ink); border-radius: 10px 10px 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900;
}
.step > span { font-size: 1.4rem; }
.rest { background: #fff; border: 3px solid var(--ink); border-radius: 18px; margin: 0; padding: 8px 16px 8px 40px; }
.rest li { padding: 4px 0; }
.rest li > * { vertical-align: middle; }
.rest .coins { float: right; margin-top: 10px; }

/* ── Minispiel-Vollbild ── */

#overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none;
}
#overlay[hidden] { display: none; }
.mg { width: min(520px, 100%); padding: 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.mg h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
.mg-how { font-weight: 900; font-size: 1.2rem; }
.mg-count { font-size: 7rem; font-weight: 900; line-height: 1; }
.mg-neko { width: min(240px, 60vw); height: auto; }
.mg-big { transition: transform 50ms; }
.mg-big.pop { transform: scale(1.06); }
.mg-taps { font-size: 5rem; font-weight: 900; line-height: 1; }
.mg-time { font-size: 1.8rem; font-weight: 900; }
.mg-clock { font-size: 4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.mg .btn { max-width: 420px; }

#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 150%);
  background: var(--ink); color: #fff; font-weight: 800; padding: 12px 18px; border-radius: 14px; z-index: 60;
  max-width: calc(100% - 32px); transition: transform .25s, opacity .25s; pointer-events: none; opacity: 0;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ── Rechtstexte ── */

.legal { max-width: 760px; margin: 24px auto; background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); padding: 24px; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.15rem; margin-top: 1.4em; }

@media (prefers-reduced-motion: reduce) {
  .bounce, .tok.cur, .space .smoke { animation: none; }
  .tok { transition: none; }
}
