html, body { overscroll-behavior: none; }
body { min-height: 100dvh; display: flex; flex-direction: column; }
#app { flex: 1; display: flex; flex-direction: column; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; margin: 0 auto; }
.view { flex: 1; display: flex; flex-direction: column; gap: 14px; animation: viewIn 0.4s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
.center { justify-content: center; align-items: center; text-align: center; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(0, 0, 0, 0.3); font-weight: 900; }
.bar-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-team .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--team); font-size: 18px; flex: none; }
.bar-team .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-score { background: var(--accent); color: #2a1600; border-radius: 99px; padding: 2px 12px; white-space: nowrap; }
.timebar { height: 6px; background: rgba(255, 255, 255, 0.1); }
.timebar div { height: 100%; background: var(--green); transform-origin: left; transition: background 0.3s; }
.timebar.danger div { background: var(--red); }
.offline { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: var(--red); padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: 14px; z-index: 100; }

/* Beitreten */
.brand { font-family: var(--font-display); font-size: 40px; text-align: center; margin-top: 12px; text-shadow: 0 4px 0 #0008; }
.brand small { display: block; font-family: var(--font); font-size: 15px; color: var(--muted); font-weight: 800; text-shadow: none; }
.label { font-weight: 900; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.big-input { font-size: 22px !important; font-weight: 900; padding: 14px 16px !important; text-align: center; }
.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatars button { aspect-ratio: 1; border: 0; border-radius: 14px; background: var(--panel); font-size: 26px; cursor: pointer; transition: transform 0.15s; }
.avatars button.sel { background: var(--accent); transform: scale(1.1) rotate(-6deg); box-shadow: 0 0 0 3px #fff; }
.join-btn { font-size: 22px; padding: 16px; width: 100%; }

/* Warten */
.big-avatar { width: 140px; height: 140px; border-radius: 50%; background: var(--team); display: grid; place-items: center; font-size: 76px; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2), 0 0 40px var(--team); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(4deg); } }
.title { font-family: var(--font-display); font-size: 32px; line-height: 1.1; }
.sub { color: var(--muted); font-weight: 800; font-size: 17px; }
.dots span { animation: blink 1.4s infinite both; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }

/* Frage */
.q-head { display: flex; justify-content: space-between; font-weight: 900; font-size: 14px; color: var(--muted); }
.q-text { font-weight: 900; font-size: 21px; line-height: 1.25; }
.q-img { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 12px; align-self: center; }
.choice-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 260px; }
.choice-grid.n2 { grid-template-columns: 1fr; }
.choice-btn {
  border: 0; border-radius: 16px; color: #fff; font-weight: 900; font-size: 18px; padding: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35); cursor: pointer; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.1s, opacity 0.3s, filter 0.3s;
}
.choice-btn .shape { font-size: 38px; }
.choice-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.choice-grid.chosen .choice-btn:not(.sel) { opacity: 0.35; filter: grayscale(0.6); }
.choice-btn.sel { box-shadow: 0 0 0 4px #fff, 0 5px 0 rgba(0, 0, 0, 0.35); }
.bg-c0 { background: var(--c0); } .bg-c1 { background: var(--c1); } .bg-c2 { background: var(--c2); }
.bg-c3 { background: var(--c3); } .bg-c4 { background: var(--c4); } .bg-c5 { background: var(--c5); }

.submit { font-size: 20px; padding: 16px; width: 100%; }
.sent { background: rgba(46, 229, 157, 0.15); border: 2px solid var(--green); border-radius: 14px; padding: 12px 14px; font-weight: 800; animation: popIn 0.4s cubic-bezier(.3, 1.6, .5, 1); }
.sent b { color: var(--green); }
.sent .val { font-size: 19px; color: #fff; word-break: break-word; }
@keyframes popIn { from { transform: scale(0.6); opacity: 0; } }

/* Anagramm */
.tiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tile { width: 44px; height: 50px; border: 0; border-radius: 10px; font-family: var(--font-display); font-size: 28px; color: #3a2400; background: linear-gradient(#ffe08a, #ffc233); box-shadow: 0 4px 0 #b07800; cursor: pointer; transition: transform 0.15s, opacity 0.2s; }
.tile.used { opacity: 0.15; transform: scale(0.85); pointer-events: none; }
.word { min-height: 62px; background: rgba(0, 0, 0, 0.3); border-radius: 14px; border: 2px dashed var(--line); padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; }
.word .tile { width: 36px; height: 44px; font-size: 24px; animation: popIn 0.25s; }
.word:empty::before { content: 'Buchstaben antippen …'; color: var(--muted); font-weight: 800; }
.row-btns { display: flex; gap: 8px; }
.row-btns .btn { flex: 1; }

/* Wer bin ich */
.hint { background: var(--panel-strong); border-radius: 12px; padding: 10px 12px; font-weight: 800; display: flex; gap: 10px; }
.hint .no { background: var(--cyan); color: #00313b; border-radius: 8px; padding: 0 8px; font-family: var(--font-display); height: fit-content; }
.hint.old { opacity: 0.55; font-size: 14px; }
.potline { text-align: center; font-weight: 900; color: var(--accent); font-size: 18px; }

/* Ergebnis */
.result { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px; z-index: 10; }
.result.ok { background: radial-gradient(circle at 50% 40%, #34f0a8, #0c8a5a); }
.result.no { background: radial-gradient(circle at 50% 40%, #ff6b85, #a3122f); }
.result.none { background: radial-gradient(circle at 50% 40%, #6b5b95, #2a1f4a); }
.result .icon { font-size: 110px; animation: resIcon 0.7s cubic-bezier(.3, 1.8, .5, 1) both; }
.result.no .icon { animation: resIcon 0.7s cubic-bezier(.3, 1.8, .5, 1) both, shake 0.5s 0.7s; }
@keyframes resIcon { from { transform: scale(0) rotate(-90deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-14px); } 75% { transform: translateX(14px); } }
.result .t { font-family: var(--font-display); font-size: 44px; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.result .pts { font-family: var(--font-display); font-size: 64px; color: #fff; animation: resIcon 0.6s 0.3s both; }
.result .ans { background: rgba(0, 0, 0, 0.25); border-radius: 14px; padding: 10px 16px; font-weight: 800; max-width: 100%; }
.result .foot { font-weight: 900; opacity: 0.85; }

.rank-big { font-family: var(--font-display); font-size: 96px; line-height: 1; color: var(--accent); text-shadow: 0 6px 0 #0008; animation: resIcon 0.7s both; }
