/* lisa-roman.com/shot-polizei · Handy zuerst. prefers-reduced-motion wird bewusst nicht
   ausgewertet (Romans Vorgabe): Animationen laufen für alle. */
:root {
  --cream: #fbf3ec;
  --cream-deep: #f4e5d8;
  --paper: #fffaf5;
  --terracotta: #d1634b;
  --terracotta-soft: #dd8a78;
  --ink: #8f4432;
  --navy: #1f2a44;
  --font-script: "Caveat", "Comic Sans MS", cursive;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; background: var(--cream); color: var(--ink);
  font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
body.playing { overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.script { font-family: var(--font-script); color: var(--terracotta); font-weight: 400; }
:focus-visible { outline: 2.5px solid var(--terracotta); outline-offset: 3px; }
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Start */
.start { position: relative; max-width: 540px; margin: 0 auto; padding: max(1.4rem, env(safe-area-inset-top)) 1rem calc(7rem + env(safe-area-inset-bottom)); }
.brand { text-align: center; padding: .8rem 0 .4rem; animation: rise .7s var(--ease-out) both; }
.names { font-size: 1.6rem; margin: 0; line-height: 1; }
.badge { display: block; width: 86px; height: 86px; margin: .7rem auto .1rem; animation: wobble 3.2s ease-in-out infinite; }
.title { font-size: clamp(3.2rem, 15vw, 4.4rem); font-weight: 700; line-height: .95; margin: .1rem 0 .5rem; }
.tagline { margin: 0 auto; max-width: 21em; font-size: 1.25rem; }
.choose { font-family: var(--font-script); font-weight: 700; color: var(--terracotta); text-align: center; font-size: 2.1rem; margin: 1.5rem 0 .7rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .9rem .4rem; }
.fig { display: flex; flex-direction: column; align-items: center; gap: .35rem; border: 0; background: none; padding: .25rem 0; cursor: pointer; border-radius: 14px; }
.fig img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; background: var(--cream-deep); box-shadow: 0 0 0 2px var(--paper), 0 3px 10px rgba(143, 68, 50, .18); transition: transform .25s var(--ease-out), box-shadow .25s; }
.fig-name { font-size: 1.05rem; line-height: 1.1; }
.fig[aria-checked="true"] img { transform: scale(1.08); box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--terracotta), 0 6px 16px rgba(209, 99, 75, .3); }
.fig[aria-checked="true"] .fig-name { color: var(--terracotta); font-weight: 600; }
.start-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 1.4rem 1rem calc(.9rem + env(safe-area-inset-bottom)); background: linear-gradient(rgba(251, 243, 236, 0), var(--cream) 40%); }
.btn { min-height: 52px; padding: .55rem 1.6rem; border-radius: 999px; border: 1.5px solid var(--terracotta); background: var(--paper); color: var(--terracotta); font-size: 1.25rem; font-weight: 600; cursor: pointer; transition: transform .15s var(--ease-out), box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--terracotta); color: var(--paper); box-shadow: 0 8px 20px rgba(209, 99, 75, .32); }
.btn:disabled { opacity: .5; box-shadow: none; cursor: default; }
.start-bar .btn { width: min(100%, 420px); }

/* Spiel */
.game { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--cream); overflow: hidden; }
.stage { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; --u: 3.75px; }
.stage canvas { display: block; }
.hud { position: absolute; inset: 0 0 auto; display: flex; flex-direction: column; gap: calc(var(--u) * 1.6); padding: calc(var(--u) * 2.4) calc(var(--u) * 3); pointer-events: none; }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--u) * 2); }
.chip { display: inline-flex; align-items: center; gap: calc(var(--u) * 1.4); background: rgba(255, 250, 245, .9); color: var(--ink); border-radius: 999px; padding: calc(var(--u) * 1) calc(var(--u) * 2.8); box-shadow: 0 2px 10px rgba(31, 42, 68, .16); font-size: calc(var(--u) * 4.4); line-height: 1.1; white-space: nowrap; }
.clock { font-family: var(--font-script); font-weight: 700; font-size: calc(var(--u) * 6.6); color: var(--terracotta); padding-block: calc(var(--u) * .2); min-width: calc(var(--u) * 20); justify-content: center; font-variant-numeric: tabular-nums; }
.score b { font-size: calc(var(--u) * 5.8); color: var(--terracotta); font-variant-numeric: tabular-nums; }
.strikes { gap: calc(var(--u) * 1); }
.strikes i { display: block; width: calc(var(--u) * 4.2); height: calc(var(--u) * 5.2); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M4.2 9h11.6l-1.3 11H5.5z' fill='%23cfe6f5'/%3E%3Cpath d='M3 3h14l-2 18H5z' fill='none' stroke='%23d1634b' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .35s var(--ease-out), opacity .35s; }
.strikes i.hit { transform: rotate(-105deg) scale(.9); opacity: .38; }
.pegel { flex: 1; max-width: calc(var(--u) * 64); }
.pegel-track { flex: 1; height: calc(var(--u) * 2.2); border-radius: 999px; background: rgba(143, 68, 50, .14); overflow: hidden; }
.pegel-bar { display: block; width: 100%; height: 100%; transform-origin: left center; transform: scaleX(0); background: #e3b04b; transition: transform .25s var(--ease-out), background-color .3s; }
.pegel-bar[data-level="1"] { background: #e07b3c; }
.pegel-bar[data-level="2"] { background: #c63f37; }
.pegel-val { font-variant-numeric: tabular-nums; min-width: 4.4em; text-align: right; }
.mute { pointer-events: auto; border: 0; cursor: pointer; padding: calc(var(--u) * 1.8); font-size: calc(var(--u) * 5); }
.mute[aria-pressed="true"] .on, .mute:not([aria-pressed="true"]) .off { display: none; }
.start-mute { position: absolute; z-index: 2; top: max(.9rem, env(safe-area-inset-top)); right: .7rem; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1.5px solid var(--terracotta-soft); background: var(--paper); color: var(--terracotta); font-size: 22px; cursor: pointer; box-shadow: 0 2px 8px rgba(143, 68, 50, .12); }
.start-mute[aria-pressed="true"] .on, .start-mute:not([aria-pressed="true"]) .off { display: none; }
.banner { position: absolute; left: 50%; top: 36%; width: 92%; transform: translate(-50%, -50%); opacity: 0; font-family: var(--font-script); font-weight: 700; font-size: calc(var(--u) * 12); line-height: 1.05; text-align: center; text-wrap: balance; color: var(--paper); text-shadow: 0 2px 16px rgba(31, 42, 68, .6), 0 0 2px rgba(31, 42, 68, .5); pointer-events: none; }
.banner.show { animation: banner 2.2s var(--ease-out) both; }

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--u) * 6); background: rgba(31, 42, 68, .38); }
.card { width: 100%; max-width: 420px; background: var(--paper); border-radius: 22px; padding: 1.3rem 1.2rem 1.2rem; text-align: center; box-shadow: 0 18px 50px rgba(31, 42, 68, .32); animation: pop .4s var(--ease-out) both; }
.card-title { font-size: 2.6rem; font-weight: 700; line-height: 1; margin: .1rem 0 .6rem; }
.hints { list-style: none; margin: 0 0 1.1rem; padding: 0; text-align: left; display: grid; gap: .7rem; }
.hints li { display: grid; grid-template-columns: 2.4rem 1fr; gap: .65rem; align-items: center; font-size: 1.08rem; line-height: 1.28; }
.hints svg, .hints img { width: 2.4rem; height: 2.4rem; object-fit: contain; }
.rules-list { gap: 1rem; margin-top: .4rem; }
.rules-list li { background: var(--paper); border-radius: 14px; padding: .7rem .9rem; font-size: 1.15rem; box-shadow: 0 2px 8px rgba(143, 68, 50, .08); }
.over-result { font-size: 1.3rem; margin: 0 0 .3rem; }
.over-rank { margin: 0 0 1.1rem; color: var(--terracotta); font-weight: 600; font-size: 1.2rem; }
.actions { display: flex; flex-direction: column; gap: .6rem; }
/* Rundenende: Strafzettel als Bild, darunter vier Knöpfe */
.overlay.over { padding: calc(var(--u) * 3); background: rgba(31, 42, 68, .58); }
.over-in { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 2.6); }
.over-wait { margin: 0; font-size: calc(var(--u) * 8); font-weight: 700; color: var(--paper); text-align: center; text-shadow: 0 2px 14px rgba(31, 42, 68, .6); animation: pulse 1.1s ease-in-out infinite; }
.ticket { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100% - 128px); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .38); animation: pop .5s var(--ease-out) both; }
.actions.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; max-width: 440px; }
.actions.grid2 .btn { min-height: 50px; padding: .35rem .6rem; font-size: 1.12rem; }
.actions.grid2 .btn:disabled { opacity: .55; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.start-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .2rem 1.4rem; margin: .7rem 0 0; }
.link-btn { display: block; margin: 0; padding: .3rem 0; border: 0; background: none; color: var(--terracotta); font-size: 1.15rem; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* Bestenliste */
.board { position: fixed; inset: 0; z-index: 20; background: var(--cream); overflow-y: auto; overscroll-behavior: contain; animation: rise .35s var(--ease-out) both; }
.board-in { max-width: 540px; margin: 0 auto; padding: max(1rem, env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom)); }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.board-head h2 { font-size: 2.6rem; font-weight: 700; margin: .3rem 0 .7rem; }
.board-close { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--terracotta-soft); background: var(--paper); color: var(--terracotta); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.board-row { display: grid; grid-template-columns: 2.2rem 46px 1fr auto; align-items: center; gap: .7rem; background: var(--paper); border-radius: 14px; padding: .45rem .8rem; box-shadow: 0 2px 8px rgba(143, 68, 50, .08); }
.board-row.me { box-shadow: 0 0 0 2px var(--terracotta), 0 4px 12px rgba(209, 99, 75, .2); }
.board-place { font-family: var(--font-script); font-weight: 700; font-size: 1.7rem; color: var(--terracotta); text-align: center; }
.board-row img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--cream-deep); }
.board-who { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.board-who b { font-size: 1.15rem; font-weight: 600; }
.board-who small { font-size: .92rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-score { text-align: right; font-variant-numeric: tabular-nums; font-size: 1.02rem; line-height: 1.2; }
.board-score b { display: block; font-size: 1.2rem; color: var(--terracotta); white-space: nowrap; }
.board-msg { text-align: center; opacity: .8; padding: 1.5rem 0; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.85); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1); }
}
