/* Pillerhupen – Stylesheet
   Schriften liegen in static/fonts/ (SIL Open Font License, siehe OFL-*.txt) und werden vom eigenen
   Server geladen: kein Google-Fonts-Abruf, DSGVO-freundlich. Auf Latein inkl. Umlaute reduziert. */

/* Bowlby One hat nur einen Schnitt. Der Gewichtsbereich verhindert, dass der Browser für fette
   Überschriften einen künstlich verbreiterten Fettdruck errechnet. */
@font-face { font-family: 'Bowlby One'; src: url('fonts/BowlbyOne-Regular.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('fonts/WorkSans-Variable.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }

:root {
  --ink: #1A1446;
  --ink-2: #2B2466;
  --ink-3: #120E33;
  --sun: #FFD23F;
  --sun-light: #FFE68A;
  --white: #FFFFFF;
  --muted: #C9C3F5;
  --warn: #B3122E;
  --accent: #E5383B;
  --display: 'Bowlby One', 'Arial Black', 'Helvetica Neue', Impact, system-ui, sans-serif;
  --body: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow: 8px 8px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--sun); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; overflow-x: hidden; }
a { color: var(--ink); }
a:hover { color: var(--warn); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 4px dashed var(--ink); outline-offset: 6px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--sun); padding: 10px 16px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: 1240px; margin: 0 auto; padding-left: clamp(16px, 4vw, 24px); padding-right: clamp(16px, 4vw, 24px); }
.fill-accent { fill: var(--accent); }

/* Header */
.header { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo span { font-family: var(--display); font-weight: 900; font-size: 26px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 700; }
.nav a { text-decoration: none; }

/* Hero */
.hero { padding-top: clamp(8px, 3vw, 32px); padding-bottom: clamp(56px, 8vw, 80px); display: flex; flex-wrap: wrap; align-items: center; gap: clamp(24px, 5vw, 48px); }
.hero-text { flex: 1 1 460px; display: flex; flex-direction: column; gap: 22px; }
.badge { align-self: flex-start; background: var(--ink); color: var(--sun); font-weight: 700; font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; padding: 8px 16px; border-radius: 999px; }
h1 { font-family: var(--display); font-weight: 900; font-size: clamp(46px, 7vw, 96px); line-height: 0.98; }
.lead { font-size: 21px; max-width: 560px; }
.world { font-weight: 600; }
.world strong { font-family: var(--display); font-weight: 900; font-size: 24px; }
.offline { font-weight: 400; font-size: 15px; }

.hero-horn { flex: 1 1 440px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.bubble-slot { min-height: clamp(72px, 10vw, 92px); display: flex; align-items: flex-end; justify-content: center; }
.bubble { background: var(--white); border: 3px solid var(--ink); border-radius: 24px; padding: 14px 26px; font-family: var(--display); font-weight: 900; font-size: clamp(24px, 6vw, 30px); box-shadow: 6px 6px 0 var(--ink); }
.bubble-idle { font-weight: 700; font-size: 18px; }
.horn { appearance: none; border: 0; background: var(--white); border-radius: 50%; width: min(440px, 86vw); max-width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 10px 10px 0 var(--ink); outline: 4px solid var(--ink); transition: transform .08s; -webkit-tap-highlight-color: transparent; }
.horn:active { transform: scale(.96); }
.horn:focus-visible { outline: 4px dashed var(--ink); outline-offset: 10px; }
.horn svg { width: 84%; }
.waves { opacity: 0; }
.waves.show { opacity: 1; }
.mycount { font-size: 18px; font-weight: 600; }
.mycount strong { font-family: var(--display); font-weight: 900; font-size: 26px; }

/* Blöcke */
.actions { padding-bottom: clamp(64px, 9vw, 96px); display: flex; flex-direction: column; gap: clamp(48px, 7vw, 72px); }
.block { display: flex; flex-direction: column; gap: 28px; }
.block-head { display: flex; flex-direction: column; gap: 10px; }
.block-head h2, .block > h2, .panel > h2 { font-family: var(--display); font-weight: 900; font-size: clamp(30px, 4.5vw, 52px); line-height: 1.05; }
.block-head p { font-size: 18px; max-width: 640px; }

.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.grid-6 { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 16px; }

.press { transition: transform .08s, box-shadow .08s; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.press:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink) !important; }

.card { appearance: none; text-align: left; background: var(--white); border: 3px solid var(--ink); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-height: 210px; }
.chip { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--ink); font-family: var(--display); font-weight: 900; font-size: 26px; color: var(--white); }
.chip-red { background: #E5383B; } .chip-blue { background: #2E7DBE; } .chip-green { background: #2F8F5B; } .chip-purple { background: #7A3FA0; }
.card-title { font-family: var(--display); font-weight: 900; font-size: 23px; }
.card-text { font-size: 16px; }
.card-cta { margin-top: auto; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }

.panel { background: var(--white); border: 3px solid var(--ink); border-radius: 28px; padding: clamp(24px, 4vw, 40px); box-shadow: 10px 10px 0 var(--ink); display: flex; flex-direction: column; gap: 28px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; }
.panel-accent { background: var(--accent); color: var(--white); }

.pill { appearance: none; font-weight: 700; font-size: 17px; line-height: 1.2; min-height: 52px; padding: 8px 26px; border-radius: 999px; background: var(--ink); color: var(--sun); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--accent); }
.pill:disabled { opacity: .7; cursor: progress; }
.pill-dark { box-shadow: 4px 4px 0 var(--sun); }

.note { appearance: none; border: 3px solid var(--ink); border-radius: 18px; padding: 20px 10px 16px; background: var(--white); box-shadow: 5px 5px 0 var(--ink); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.note svg { width: min(72px, 100%); transition: transform .1s; }
.note span { font-family: var(--display); font-weight: 900; font-size: 26px; }
.note.on { background: var(--sun); }
.note.on svg { transform: scale(1.15) rotate(-6deg); }

/* Challenge */
.challenge-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px; }
.challenge-main { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.ch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.ch-col { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.strong { font-size: 18px; font-weight: 600; }
.big-pill { appearance: none; font-family: var(--display); font-weight: 900; font-size: clamp(19px, 4.6vw, 22px); line-height: 1.15; min-height: 62px; padding: 10px clamp(22px, 4vw, 34px); border-radius: 999px; background: var(--sun); color: var(--ink); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.ch-honk { appearance: none; font-family: var(--display); font-weight: 900; font-size: clamp(32px, 5vw, 52px); width: min(240px, 66vw); aspect-ratio: 1 / 1; border-radius: 50%; background: var(--sun); color: var(--ink); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); touch-action: manipulation; user-select: none; }
.ch-stats { display: flex; flex-direction: column; gap: 8px; }
.num-xl { font-family: var(--display); font-weight: 900; font-size: 48px; }
.num-l { font-family: var(--display); font-weight: 900; font-size: 36px; }
.result { background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; padding: 16px 26px; font-family: var(--display); font-weight: 900; font-size: clamp(22px, 3.2vw, 34px); box-shadow: 6px 6px 0 var(--ink); }
.ch-form { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 480px; }
.ch-form label { font-weight: 600; }
.ch-form-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ch-form input { flex: 1 1 200px; min-height: 52px; padding: 0 18px; border-radius: 14px; border: 3px solid var(--ink); font: inherit; color: var(--ink); background: var(--white); }
.ch-msg { min-height: 1.5em; font-weight: 600; }

.board { flex: 0 1 340px; min-width: 0; background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; padding: 24px; box-shadow: 6px 6px 0 var(--ink); align-self: flex-start; width: 100%; }
.board h3 { font-family: var(--display); font-weight: 900; font-size: 22px; margin-bottom: 12px; }
.board-list { margin: 0; padding: 0; list-style: none; counter-reset: rank; display: flex; flex-direction: column; gap: 6px; }
.board-list li { counter-increment: rank; display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 2px dashed #E6E2F5; }
.board-list li::before { content: counter(rank) "."; font-family: var(--display); font-weight: 900; min-width: 2ch; }
.board-list .b-name { flex: 1; min-width: 0; overflow-wrap: break-word; font-weight: 600; }
.board-list .b-score { font-family: var(--display); font-weight: 900; white-space: nowrap; }
.board-empty { font-size: 16px; }
.board-game { font-weight: 700; font-size: 15px; margin: -6px 0 12px; color: var(--warn); }

/* Spielhalle */
.arcade { padding-bottom: clamp(64px, 9vw, 96px); display: flex; flex-direction: column; gap: 28px; }
.tabs { display: flex; flex-wrap: wrap; gap: 12px; }
.tab { appearance: none; font-weight: 700; font-size: 16px; min-height: 48px; padding: 0 20px; border-radius: 999px; background: var(--white); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--sun); box-shadow: 4px 4px 0 var(--accent); }
.game { display: flex; flex-direction: column; gap: 24px; }
.game .block-head h3 { font-family: var(--display); font-weight: 900; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.05; }
.result:focus { outline: none; }

/* Ampel-Start */
.ampel { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--ink); border-radius: 26px; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink-3); }
.lamp { width: clamp(52px, 12vw, 72px); aspect-ratio: 1 / 1; border-radius: 50%; border: 3px solid var(--ink-3); opacity: .22; }
.lamp-red { background: #FF3B30; }
.lamp-yellow { background: #FFCC00; }
.lamp-green { background: #34C759; }
.ampel.red .lamp-red { opacity: 1; box-shadow: 0 0 26px #FF3B30; }
.ampel.yellow .lamp-yellow { opacity: 1; box-shadow: 0 0 26px #FFCC00; }
.ampel.green .lamp-green { opacity: 1; box-shadow: 0 0 30px #34C759; }

/* Nachhupen */
.simon { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; max-width: 420px; }
.simon .note { color: var(--ink); }
.simon.wait .note { cursor: default; }
.simon.wait .note:not(.on) { opacity: .75; }

/* Gänsejagd */
.pond { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2.4vw, 18px); width: 100%; max-width: 440px; }
.hole { appearance: none; position: relative; aspect-ratio: 1 / 1; padding: 0; border: 3px solid var(--ink); border-radius: 50%; overflow: hidden; cursor: pointer; background: radial-gradient(circle at 50% 78%, #4FA3D1 0 38%, #8FD0EC 39% 100%); box-shadow: 4px 4px 0 var(--ink); touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.hole .goose { position: absolute; left: 10%; width: 80%; bottom: 2%; transform: translateY(105%); transition: transform .12s ease-out; pointer-events: none; }
.hole.up .goose { transform: translateY(0); }
.hole.hit .goose { transform: translateY(-70%) rotate(-24deg); opacity: 0; transition: transform .28s ease-in, opacity .28s ease-in; }
.hole.still .goose { transition: none !important; }
.hole.miss { animation: ph-shake .25s; }

/* Exakt-Hupe */
.ex-honk { font-size: clamp(28px, 4.4vw, 44px); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ex-honk.holding { background: var(--white); transform: translate(4px, 4px); box-shadow: 4px 4px 0 var(--ink); }

/* Hupometer */
.dark { background: var(--ink); color: var(--white); }
.dark-inner { padding-top: clamp(56px, 7vw, 80px); padding-bottom: clamp(56px, 7vw, 80px); display: flex; flex-direction: column; gap: 28px; }
.dark h2 { font-family: var(--display); font-weight: 900; font-size: clamp(30px, 4.5vw, 52px); color: var(--sun); }
.meter { background: var(--ink-2); border-radius: 24px; padding: clamp(20px, 4vw, 32px); display: flex; flex-direction: column; gap: 18px; }
.meter-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.meter-label { color: var(--muted); font-size: 16px; }
.meter-head .meter-label:first-child { text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.rank { font-family: var(--display); font-weight: 900; font-size: clamp(28px, 4vw, 44px); }
.bar { height: 22px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--sun); border-radius: 999px; transition: width .2s; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; font-size: 15px; color: var(--muted); }

/* Charta & Fakten */
.section { padding-top: clamp(56px, 8vw, 88px); padding-bottom: clamp(56px, 8vw, 88px); gap: clamp(28px, 4vw, 40px); }
.section > h2 { font-family: var(--display); font-weight: 900; font-size: clamp(30px, 4.5vw, 52px); }
.rule { background: var(--white); border: 3px solid var(--ink); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.rule-no { font-family: var(--display); font-weight: 900; font-size: 40px; color: var(--accent); }
.rule h3 { font-size: 22px; }
.section-tight { padding-bottom: clamp(56px, 8vw, 88px); }
.kicker { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--warn); }
.facts { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; font-size: 19px; }

/* Footer */
.footer { border-top: 3px solid var(--ink); }
.footer-inner { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-logo { font-family: var(--display); font-weight: 900; font-size: 22px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; font-weight: 600; }
.swatches { display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.swatch-label { font-weight: 600; }
.swatch { appearance: none; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--ink); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--sun), 0 0 0 6px var(--ink); }
.sw-red { background: #E5383B; } .sw-blue { background: #2E7DBE; } .sw-green { background: #2F8F5B; } .sw-pink { background: #C2378F; }

/* Tablet: Hall of Fame unter das Spiel, volle Breite */
@media (max-width: 960px) {
  .board { flex-basis: 100%; }
}

/* Handy */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .lead { font-size: 18px; }
  .block-head p { font-size: 16px; }
  .logo span { font-size: 22px; }
  .nav { gap: 6px 18px; font-size: 15px; }

  /* Hup-o-Mat: kompakte Karten mit Kreis links statt hoher Kacheln */
  .grid-4 { gap: 16px; }
  .card { min-height: 0; padding: 16px 18px; display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; row-gap: 2px; align-items: center; }
  .card .chip { grid-row: 1 / span 3; width: 52px; height: 52px; font-size: 22px; }
  .card-title { font-size: 19px; }
  .card-text { font-size: 15px; }
  .card-cta { margin-top: 4px; font-size: 13px; }

  /* Orchester: drei Hupen pro Reihe */
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .note { padding: 14px 6px 10px; gap: 6px; border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); }
  .note svg { width: min(54px, 100%); }
  .note span { font-size: 21px; }

  .panel { padding: 20px; border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); }

  /* Spielhalle: Reiter als ordentliches Raster */
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .tab:first-child { grid-column: 1 / -1; }
  .tab { font-size: 15px; padding: 0 10px; min-height: 46px; }
  .challenge-grid { gap: 28px; }
  .num-xl { font-size: 40px; }
  .num-l { font-size: 30px; }
  .result { padding: 12px 18px; }
  .board { padding: 20px; }
  .ampel { flex-direction: row; }
  .lamp { width: 48px; }
}

/* Unterseiten */
.legal { padding-top: 24px; padding-bottom: 88px; max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.legal h1 { font-size: clamp(36px, 6vw, 60px); }
.legal h2 { font-family: var(--display); font-weight: 900; font-size: 24px; margin-top: 16px; }

/* Animationen */
@keyframes ph-pop { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.12) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(-3deg); opacity: 1; } }
@keyframes ph-wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes ph-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pop { animation: ph-pop .35s ease-out both; }
.wobble { animation: ph-wobble 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .pop, .wobble, .hole.miss { animation: none; }
  .hole .goose { transition: none; }
  html { scroll-behavior: auto; }
}
