@font-face { font-family: Kanit; src: url(../fonts/kanit-latin-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Kanit; src: url(../fonts/kanit-latin-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Kanit; src: url(../fonts/kanit-latin-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Kanit; src: url(../fonts/kanit-latin-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --mint: #39B398;
  --beere: #A62055;
  --petrol: #003E53;
  --sand: #E9D0B2;
  --ink: #0c2731;
  --muted: #45616b;
  --glass: rgba(255, 255, 255, 0.8);
  --line: rgba(0, 62, 83, 0.14);
  --shadow: 0 12px 34px rgba(0, 32, 46, 0.18), 0 2px 6px rgba(0, 32, 46, 0.08);
  --font: Kanit, "Trebuchet MS", system-ui, sans-serif;
  --bar-h: 88px;
  --stage-h: 640px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #dfe4ee;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------ Bühne */
.stage { position: relative; overflow: hidden; background: #c5c9dc; }
.mode-game, .mode-game body { height: 100%; overflow: hidden; }
.mode-game .stage { position: fixed; inset: 0; }
.mode-game .m01n-bar, .mode-game .page-intro, .mode-game .hint-line { display: none; }

#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: crosshair; }
#game.grab { cursor: grab; }
#game.grabbing { cursor: grabbing; }
#shot-mirror { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.stage::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 95% at 50% 46%, rgba(0, 0, 0, 0) 55%, rgba(18, 28, 58, 0.22) 100%); }

.hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hud .brand, .hud .help, .hud .corner > *, .hud .dock-row { pointer-events: auto; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

kbd {
  display: inline-block; min-width: 1.6em; text-align: center;
  font: 600 11.5px/1.5 var(--font);
  padding: 0 6px; border-radius: 6px;
  color: var(--petrol); background: rgba(0, 62, 83, 0.07); border: 1px solid rgba(0, 62, 83, 0.18);
}

/* ------------------------------------------------------------ oben links */
.brand {
  position: absolute; top: 18px; left: 18px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px 10px 14px; border-radius: 18px;
}
.brand img { height: 30px; width: auto; display: block; }
.brand strong { display: block; font-weight: 600; font-size: 19px; line-height: 1.05; color: var(--petrol); }
.brand span { display: block; font-size: 12.5px; color: var(--muted); }

.help { position: absolute; top: 84px; left: 18px; width: 318px; border-radius: 16px; padding: 4px 6px 6px; }
.help-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; padding: 6px 6px; border-radius: 10px;
  font-weight: 600; font-size: 14.5px; color: var(--petrol); text-align: left;
}
.help-toggle span { flex: 1; }
.help-toggle:hover { background: rgba(0, 62, 83, 0.06); }
.help ul { list-style: none; margin: 2px 0 0; padding: 0 6px 4px; }
.help li { font-size: 12.5px; line-height: 1.45; padding: 5px 0; border-top: 1px solid rgba(0, 62, 83, 0.08); color: #24414b; }
.help li b { display: block; margin-bottom: 1px; font-weight: 600; font-size: 13.5px; color: var(--petrol); }
.help li.more { color: var(--muted); }
.help kbd { font-size: 11px; padding: 0 5px; }
.help.collapsed ul { display: none; }
.help.collapsed { width: auto; }

.hint-line {
  position: absolute; top: 14px; left: 14px; margin: 0;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--petrol);
  pointer-events: none;
}

/* ------------------------------------------------------------ Status oben Mitte */
.status {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
  max-width: min(560px, calc(100% - 40px));
}
.chip { padding: 7px 16px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--petrol); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chip b { color: var(--beere); font-weight: 600; }
.toast {
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: var(--petrol); color: #fff; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: none; }
.toast:empty { display: none; }

/* ------------------------------------------------------------ oben rechts */
.corner { position: absolute; top: 18px; right: 18px; display: flex; gap: 10px; align-items: center; }
.modeswitch { display: flex; padding: 4px; border-radius: 999px; gap: 2px; }
.modeswitch button {
  border: 0; background: transparent; color: var(--petrol);
  font-weight: 500; font-size: 13.5px; padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.modeswitch button[aria-pressed="true"] { background: var(--petrol); color: #fff; }
.modeswitch .s { display: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--petrol); }
.icon-btn[aria-pressed="true"] { color: var(--beere); }

/* ------------------------------------------------------------ Dock: 2er-Umschalter Schneeschieber | Kugelrollen */
/* volle Breite + Flex-Zentrierung: ein per left:50% verschobenes Dock würde auf halbe Breite schrumpfen */
.dock {
  position: absolute; bottom: 16px; left: 10px; right: 10px;
  display: flex; justify-content: center; pointer-events: none;
}
.tool-row { display: flex; padding: 5px; border-radius: 999px; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; border-radius: 999px; background: rgba(0, 62, 83, 0.06); }
/* gleitende Markierung hinter dem aktiven Werkzeug */
.seg::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 50%; border-radius: 999px;
  background: var(--petrol); box-shadow: 0 6px 16px rgba(0, 62, 83, 0.3);
  transition: transform .34s cubic-bezier(.3, 1.35, .5, 1);
}
.dock[data-active="balls"] .seg::before { transform: translateX(100%); }
.tool-row .tool {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent;
  color: var(--petrol); font-weight: 600; font-size: 15px; white-space: nowrap; transition: color .2s;
}
.tool-row .tool:not([aria-pressed="true"]):hover { background: rgba(0, 62, 83, 0.07); }
.tool-row .tool[aria-pressed="true"] { color: #fff; }
.tool-row .tool svg { width: 22px; height: 22px; }
.tool-row .tool kbd { font-size: 10.5px; padding: 0 4px; min-width: 1.5em; opacity: .85; }
.tool-row .tool[aria-pressed="true"] kbd { color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.32); }
.tool-row .tool:focus-visible, .modeswitch button:focus-visible, .icon-btn:focus-visible, .help-toggle:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
@media (pointer: coarse) { .tool-row .tool kbd { display: none; } }
/* Neuschnee: eigener Button rechts vom Umschalter, durch eine feine Linie getrennt */
.tool-row .sep { align-self: stretch; width: 1px; margin: 9px 5px; background: var(--line); }
.tool-row .snow-btn { padding: 0 16px 0 14px; }
.tool-row .snow-btn svg { color: var(--petrol); transition: color .3s; }
/* Schauer läuft: zartes Mint, die Flocke dreht sich langsam */
.tool-row .snow-btn.is-snowing { background: rgba(57, 179, 152, 0.16); }
.tool-row .snow-btn.is-snowing svg { color: var(--mint); animation: flake-spin 2.6s linear infinite; }
@keyframes flake-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tool-row .snow-btn.is-snowing svg { animation: none; } }

.loader {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px;
  background: #c5c9dc; color: var(--petrol); font-weight: 500; font-size: 16px; z-index: 3; pointer-events: none;
  transition: opacity .5s;
}
.loader span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(0, 62, 83, 0.2); border-top-color: var(--mint); animation: spin 0.9s linear infinite; }
.loader.done { opacity: 0; }
/* kein WebGL / Startfehler: freundlicher Hinweis statt Endlos-Ladebalken */
.loader.fail { opacity: 1; padding: 28px; text-align: center; gap: 10px; }
.loader .fail-title { margin: 0; font-weight: 600; font-size: 22px; color: var(--petrol); }
.loader .fail-text { margin: 0; max-width: 34em; font-size: 15.5px; line-height: 1.55; font-weight: 400; color: #29434d; }
.no-game .hud > :not(.loader) { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Header-Modus (m01n.com) */
.mode-header body { background: #fff; }
.mode-header .stage { height: var(--stage-h); }
.mode-header #game { touch-action: pan-y; }
.mode-header .stage.is-active #game { touch-action: none; }
.mode-header .brand, .mode-header .help { display: none; }
.mode-header .status { top: 14px; }
.mode-header .stage:not(.is-active) .chip { display: none; }
/* Touch im noch inaktiven Header: kurzer Hinweis „Tippe ins Bild …“ */
@media (pointer: coarse) { .mode-header .stage:not(.is-active) .chip { display: inline-block; } }
.mode-header .stage.is-active .hint-line { display: none; }
.mode-header .corner { top: 12px; right: 14px; }
.mode-header .modeswitch button { font-size: 12.5px; padding: 6px 12px; }
.mode-header .icon-btn { width: 38px; height: 38px; }
.mode-header .dock { bottom: 12px; }
.mode-header .tool-row { padding: 4px; }
.mode-header .tool-row .tool { height: 42px; padding: 0 16px; font-size: 14px; }
.mode-header .tool-row .snow-btn { padding: 0 14px 0 12px; }

.m01n-bar {
  position: sticky; top: 0; z-index: 10;
  height: var(--bar-h); display: flex; align-items: center; gap: 30px;
  padding: 0 clamp(18px, 4vw, 64px);
  background: #fff; border-bottom: 1px solid rgba(0, 62, 83, 0.08);
}
.m01n-logo img { height: 46px; width: auto; display: block; }
.m01n-nav { margin-left: auto; display: flex; gap: 28px; }
.m01n-nav a { color: var(--petrol); text-decoration: none; font-weight: 500; font-size: 17px; }
.m01n-nav a:hover { color: var(--beere); }
.m01n-cta {
  display: inline-block; background: var(--mint); color: #000; text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 10px 20px; border-radius: 999px; white-space: nowrap;
}
.m01n-burger { display: grid; gap: 5px; width: 28px; }
.m01n-burger i { display: block; height: 3px; border-radius: 3px; background: var(--petrol); }

.page-intro { padding: 72px clamp(18px, 6vw, 110px) 96px; background: #fff; }
.intro-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; max-width: 1280px; margin: 0 auto; }
.eyebrow { margin: 0 0 12px; font-weight: 600; font-size: 15px; letter-spacing: .03em; color: var(--beere); }
.page-intro h1 { margin: 0 0 22px; font-weight: 600; font-size: clamp(44px, 6vw, 84px); line-height: 0.98; color: var(--petrol); letter-spacing: -0.01em; }
.lead { margin: 0; max-width: 34em; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: #29434d; }
.intro-card { background: var(--sand); border-radius: 30px; padding: 34px 34px 30px; }
.intro-card p { margin: 0 0 18px; font-size: 16.5px; line-height: 1.6; color: #2b2b2b; }
.intro-card .eyebrow { color: var(--petrol); }

/* ------------------------------------------------------------ Shot-Modus (Headless) */
.is-shot *, .is-shot *::before, .is-shot *::after { animation: none !important; transition: none !important; }
.is-shot .loader { display: none; }
.is-shot .toast { display: none; }

/* ------------------------------------------------------------ schmal */
@media (max-width: 900px) {
  .help { width: min(330px, calc(100% - 36px)); }
  .m01n-nav { display: none; }
  .m01n-bar { justify-content: space-between; }
  .m01n-bar .m01n-cta { margin-left: auto; }
  .intro-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --bar-h: 70px; --stage-h: 560px; }
  .brand div { display: none; }
  .brand { padding: 9px 12px; }
  .brand { top: 12px; left: 12px; padding: 8px 12px 8px 10px; }
  .brand span { display: none; }
  .brand img { height: 33px; }
  .brand strong { font-size: 16px; }
  .help { top: 74px; left: 12px; }
  .corner { top: 12px; right: 12px; gap: 6px; }
  .modeswitch .l { display: none; }
  .modeswitch .s { display: inline; }
  .status, .mode-header .status { top: auto; bottom: calc(var(--dock-h, 70px) + 22px); }
  .dock { bottom: 14px; }
  /* mit Neuschnee-Button: Werkzeuge etwas kompakter, damit beide Spalten gleich breit bleiben (Markierung = 50 %) */
  .tool-row .tool, .mode-header .tool-row .tool { height: 46px; padding: 0 11px; font-size: 14px; gap: 6px; }
  .tool-row .tool svg { width: 20px; height: 20px; }
  /* schmal: Neuschnee nur als Flocke (Name über aria-label/title), damit das Dock einzeilig bleibt */
  .tool-row .snow-btn, .mode-header .tool-row .snow-btn { width: 46px; padding: 0; }
  .tool-row .snow-btn span, .tool-row .snow-btn kbd { display: none; }
  .tool-row .sep { margin: 9px 3px; }
  .m01n-logo img { height: 36px; }
  .m01n-bar .m01n-cta { display: none; }
  .hint-line { display: none; }
}
@media (max-width: 360px) {
  .dock { left: 6px; right: 6px; }
  .tool-row { padding: 4px; }
  .tool-row .tool, .mode-header .tool-row .tool { padding: 0 9px; font-size: 12px; gap: 4px; }
  .tool-row .tool svg { width: 16px; height: 16px; }
  .tool-row .snow-btn, .mode-header .tool-row .snow-btn { width: 38px; padding: 0; }
  .tool-row .snow-btn svg { width: 20px; height: 20px; }
  .tool-row .sep { margin: 9px 2px; }
}
