/* Handy-Ansicht */
html, body { min-height: 100%; }
body.player { min-height: 100dvh; overflow-x: hidden; -webkit-tap-highlight-color: transparent; font-size: 17px; }
#snow { z-index: 0; opacity: .7; }
main { position: relative; z-index: 2; max-width: 560px; margin: 0 auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); min-height: calc(100dvh - 56px); display: flex; flex-direction: column; }
.hidden { display: none !important; }

header#top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(8, 17, 39, .85); backdrop-filter: blur(8px); border-bottom: 2px solid rgba(242, 193, 78, .5); }
header .me { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; min-width: 0; }
header .me #meName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teamchip { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 2px solid var(--tc, #fff); white-space: nowrap; }
header .score { font-weight: 900; font-size: 18px; color: var(--gold-hi); display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green-hi); box-shadow: 0 0 8px var(--green-hi); }
.dot.off { background: var(--red-hi); box-shadow: 0 0 8px var(--red-hi); animation: pulse 1s infinite; }
#timebar { position: sticky; top: 52px; z-index: 4; height: 8px; background: rgba(255, 255, 255, .12); }
#timebar div { height: 100%; width: 100%; background: linear-gradient(90deg, #43d68f, #f2c14e 60%, #e8303f); transform-origin: 0 50%; }
#timebar.urgent div { animation: pulse .5s infinite; background: #e8303f; }

h1.title { font: italic 700 36px/1.1 var(--serif); text-align: center; margin: 18px 0 4px; }
.sub { text-align: center; color: var(--gold-hi); font: italic 500 18px var(--serif); margin-bottom: 20px; }
.card { background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .15); border-radius: 22px; padding: 20px; backdrop-filter: blur(4px); }
label.lbl { display: block; font-weight: 700; margin: 4px 0 8px; color: var(--muted); }
input.big {
  width: 100%; font: 800 26px var(--sans); padding: 16px 18px; border-radius: 16px; border: 3px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .95); color: var(--ink); outline: none; text-align: center;
}
input.big:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242, 193, 78, .35); }
.btn {
  display: block; width: 100%; margin-top: 16px; padding: 18px; border: 0; border-radius: 18px; cursor: pointer;
  font: 900 22px var(--sans); color: #4a2a00; background: linear-gradient(180deg, #fff1b8, #f2b632 55%, #c98a12);
  box-shadow: 0 6px 0 #8a5a00, 0 10px 20px rgba(0, 0, 0, .35); transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #8a5a00, 0 4px 10px rgba(0, 0, 0, .35); }
.btn:disabled { filter: grayscale(.8); opacity: .6; }
.btn.secondary { background: rgba(255, 255, 255, .15); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); font-size: 18px; padding: 12px; }
.err { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(232, 48, 63, .25); border: 2px solid var(--red-hi); font-weight: 700; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.teambtn { padding: 14px 10px; border-radius: 14px; border: 3px solid var(--tc); background: rgba(255, 255, 255, .06); color: #fff; font: 800 17px var(--sans); cursor: pointer; }
.teambtn.sel { background: var(--tc); box-shadow: 0 0 0 3px #fff inset; }

/* Warten */
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.huge { font: 96px/1 var(--emoji); animation: float 3s ease-in-out infinite; }
.msg { font: italic 700 30px/1.2 var(--serif); }
.msg2 { color: var(--muted); font-weight: 600; font-size: 18px; max-width: 360px; }
.loadline { color: var(--gold-hi); font-style: italic; min-height: 1.4em; transition: opacity .4s; }

/* Frage */
.qmeta { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 14px; font-weight: 800; }
.qmeta .badge { padding: 6px 14px; border-radius: 99px; background: linear-gradient(180deg, #ffe48a, #e3a419); color: #4a2a00; font-size: 16px; }
.qmeta .secs { font-size: 26px; font-variant-numeric: tabular-nums; }
.look { text-align: center; color: var(--gold-hi); font: italic 600 19px var(--serif); margin-bottom: 14px; }
.choices { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 340px; }
.choices.n5, .choices.n6 { grid-template-rows: repeat(3, 1fr); }
.choice {
  position: relative; border: 0; border-radius: 24px; cursor: pointer; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 85%, #fff), var(--c) 45%, var(--cd));
  box-shadow: 0 7px 0 var(--cd), 0 12px 22px rgba(0, 0, 0, .35); transition: transform .12s, box-shadow .12s, filter .2s, opacity .2s;
  min-height: 140px;
}
.choice .l { font: 900 56px/1 var(--sans); text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.choice .e { font: 40px/1 var(--emoji); }
.choice:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--cd); }
.choices.has-sel .choice:not(.sel) { filter: grayscale(.6) brightness(.7); opacity: .65; }
.choice.sel { outline: 5px solid #fff; outline-offset: 3px; animation: pulse 1.2s infinite; }
.choice.sel::after { content: '✔'; position: absolute; top: 8px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--cd); font: 900 22px/34px var(--sans); }
.saved { margin-top: 14px; text-align: center; font-weight: 700; color: var(--green-hi); min-height: 1.4em; }
.saved.pending { color: var(--muted); }
.unit { text-align: center; font: 700 20px var(--sans); color: var(--muted); margin-top: 8px; }
.preview { text-align: center; font: 800 20px var(--sans); color: var(--gold-hi); min-height: 1.4em; margin-top: 6px; }
.maptext { font: 800 20px/1.25 var(--sans); margin-bottom: 12px; text-align: center; }
.maphost { position: relative; line-height: 0; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(0, 0, 0, .4); touch-action: manipulation; }
.maphost img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.pin { position: absolute; width: 0; height: 0; pointer-events: none; }
.pin::before { content: '📍'; position: absolute; left: -18px; top: -38px; font: 38px/1 var(--emoji); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); animation: pop-in .4s cubic-bezier(.2, .9, .3, 1.6); }
.pin::after { content: ''; position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #e8303f; animation: ring 1.2s ease-out infinite; }
@keyframes ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.zoomhint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 8px; }

/* Ergebnis */
.result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.result .icon { font: 110px/1 var(--emoji); animation: pop-in .7s cubic-bezier(.2, .9, .3, 1.6) both; }
.result .head { font: italic 800 46px/1.05 var(--serif); animation: pop-in .7s .1s cubic-bezier(.2, .9, .3, 1.6) both; }
.result.ok .head { color: var(--green-hi); text-shadow: 0 0 24px rgba(67, 214, 143, .6); }
.result.no .head { color: var(--red-hi); }
.result .pts { font: 900 40px var(--sans); color: var(--gold-hi); animation: slide-up .6s .4s both; }
.result .detail { font-weight: 600; color: var(--snow); opacity: .9; animation: slide-up .6s .5s both; }
.result .tot { margin-top: 10px; padding: 12px 20px; border-radius: 16px; background: rgba(255, 255, 255, .1); font-weight: 800; animation: slide-up .6s .7s both; }
.bigrank { font: 900 90px/1 var(--sans); }
.bigrank small { font-size: 30px; color: var(--muted); }
body.flash-ok { animation: bg-ok 1s; }
body.flash-no { animation: bg-no 1s; }
@keyframes bg-ok { 0% { background-color: #1f9a62; } }
@keyframes bg-no { 0% { background-color: #8e0f20; } }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; max-width: 90vw; padding: 12px 20px; border-radius: 14px; background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: slide-up .3s; }
#toast.bad { background: #ffd0d4; }
.footnote { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }

/* Spielregeln & Testrunde */
.rules h2 { margin: 4px 0 14px; font: italic 700 28px var(--serif); color: var(--gold-hi); }
.rules .rstep { font-size: 14px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.rules ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.rules li { font-size: 18px; font-weight: 600; line-height: 1.35; }
.testnote { text-align: center; margin: -6px 0 12px; padding: 6px 12px; border-radius: 10px; background: rgba(214, 40, 57, .3); border: 2px solid var(--red-hi); font-weight: 800; }
.result .pts small { font-size: 22px; color: var(--muted); }
