/* 🦖 Sync-A-Saurus V2 – baut auf arcade-ui.css auf */

.brand span, .hero-logo h1 span { color: var(--pink); }
.hero-logo h1 span { background: linear-gradient(135deg, var(--pink), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-dinos { display: flex; justify-content: center; gap: 0.3rem; font-size: 3rem; height: 4.2rem; align-items: flex-end; }
.hero-dinos span { display: inline-block; animation: syncHop 1.2s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(255, 77, 141, 0.55)); }
.hero-dinos span:nth-child(2) { animation-delay: 0.12s; font-size: 3.6rem; filter: drop-shadow(0 0 18px rgba(61, 224, 255, 0.6)); }
.hero-dinos span:nth-child(3) { animation-delay: 0.32s; }
@keyframes syncHop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-18px) rotate(-6deg); } }

/* ---------- Menü ---------- */
.menu-layout { width: 100%; max-width: 1000px; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.menu-layout .card { max-width: none; }
.howto-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.9rem; }
.howto-card { padding: 0.6rem; border-radius: var(--radius-sm); border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); display: flex; flex-direction: column; gap: 0.2rem; }
.howto-card b { font-size: 0.9rem; }
.howto-card small { color: #cbd5e1; font-size: 0.7rem; line-height: 1.35; }
.howto-list { margin: 0 0 0 1.1rem; display: grid; gap: 0.35rem; color: #cbd5e1; font-size: 0.82rem; }
.howto-list kbd { padding: 0.02rem 0.32rem; border-radius: 5px; background: rgba(255,255,255,0.1); border: 1px solid var(--stroke); font-size: 0.7rem; }
.howto { margin-top: 1rem; text-align: left; color: #cbd5e1; font-size: 0.85rem; }
.howto summary { cursor: pointer; color: var(--gold); font-weight: 700; }
.small { font-size: 0.75rem; margin-top: 0.4rem; }
.top-list { display: grid; gap: 0.2rem; margin-top: 0.6rem; }
.top-row { display: grid; grid-template-columns: 1.8rem 1fr auto; gap: 0.4rem; font-size: 0.85rem; padding: 0.25rem 0.5rem; border-radius: 8px; background: rgba(255,255,255,0.03); }
.top-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.top-row b { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- Lobby ---------- */
.lobby-layout { width: 100%; max-width: 1100px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: start; }
.lobby-layout .card { max-width: none; }
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.lobby-head .room-code { font-size: 2.4rem; margin: 0; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1.1rem; }
.diff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1.1rem; }
.mode-card, .diff-card { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.8rem 0.9rem; border-radius: var(--radius-sm); background: rgba(0,0,0,0.25); border: 1.5px solid var(--stroke); cursor: pointer; text-align: left; transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s; }
.diff-card { align-items: center; text-align: center; padding: 0.6rem 0.4rem; }
.mode-card b, .diff-card b { font-size: 0.95rem; }
.mode-card small, .diff-card small { color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.mode-card.selected, .diff-card.selected { border-color: var(--c); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.mode-card:hover:not(.readonly), .diff-card:hover:not(.readonly) { transform: translateY(-2px); }
.readonly { cursor: default; }
.settings-grid.three { grid-template-columns: repeat(2, 1fr); }
.role-preview { font-size: 0.82rem; color: #cbd5e1; background: rgba(0,0,0,0.25); border: 1px dashed var(--stroke); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin: 0; }
.member-list { display: grid; gap: 0.4rem; margin-bottom: 1rem; max-height: 340px; overflow-y: auto; }
.member-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); animation: popIn 0.3s cubic-bezier(.3,1.6,.5,1); }
.member-row.me { border-color: rgba(255, 210, 63, 0.5); }
.member-row.cpu { opacity: 0.6; border-style: dashed; }
.member-row .name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row .tag { font-size: 0.7rem; color: var(--muted); font-weight: 700; }
.dino-dot { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: color-mix(in srgb, var(--c) 25%, transparent); border: 1.5px solid var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 50%, transparent); font-size: 0.8rem; flex-shrink: 0; }
.color-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.35rem; margin-bottom: 1rem; }
.color-sw { aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: 0 0 8px color-mix(in srgb, var(--c) 50%, transparent); transition: transform 0.12s; }
.color-sw:hover:not(:disabled) { transform: scale(1.12); }
.color-sw.sel { border-color: #fff; transform: scale(1.12); }
.color-sw:disabled { opacity: 0.18; cursor: not-allowed; box-shadow: none; }
.start-problem { text-align: center; color: #fda4af; font-size: 0.85rem; min-height: 1.2em; margin-top: 0.5rem; }

/* ---------- Lauf ---------- */
#gameScreen.active { justify-content: flex-start; }
.game-wrap { width: 100%; max-width: 1400px; }
.game-hud { display: flex; align-items: stretch; gap: 0.6rem; margin-bottom: 0.6rem; }
.game-hud > div { background: rgba(11,11,26,0.7); border: 1px solid var(--stroke); border-radius: 12px; padding: 0.3rem 0.9rem; backdrop-filter: blur(6px); }
.game-hud small { display: block; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 800; }
.game-hud b { font-size: 1.45rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.game-hud i { font-style: normal; font-size: 0.75rem; color: var(--muted); margin-left: 0.2rem; font-weight: 700; }
.hud-dist b { color: var(--cyan); }
.hud-score b { color: var(--gold); }
.hud-hearts { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.3rem; font-size: 1.6rem; }
.hud-hearts span { transition: transform 0.3s, opacity 0.3s, filter 0.3s; filter: drop-shadow(0 0 8px rgba(255,77,109,0.7)); }
.hud-hearts span.lost { opacity: 0.18; filter: grayscale(1); transform: scale(0.8); }
.hud-hearts span.pop { animation: popIn 0.4s cubic-bezier(.3,1.8,.5,1); }
.hud-speed b { color: var(--pink); }

.arena { position: relative; width: 100%; height: calc(100vh - 215px); min-height: 340px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--stroke); box-shadow: var(--shadow); background: #070712; touch-action: none; user-select: none; -webkit-user-select: none; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.team-strip { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 0.35rem; pointer-events: none; }
.tm { display: flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.55rem 0.2rem 0.25rem; border-radius: 999px; background: rgba(11,11,26,0.72); border: 1.5px solid color-mix(in srgb, var(--c) 60%, transparent); font-size: 0.74rem; font-weight: 800; transition: transform 0.12s, background 0.12s, box-shadow 0.12s; }
.tm .av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #0b0b1a; font-size: 0.7rem; }
.tm .roles { opacity: 0.9; letter-spacing: 0.05em; }
.tm.me { outline: 2px solid var(--gold); }
.tm.flash-ok { background: color-mix(in srgb, var(--c) 55%, rgba(11,11,26,0.72)); transform: scale(1.08); box-shadow: 0 0 18px var(--c); }
.tm.flash-bad { background: rgba(255, 77, 109, 0.55); transform: scale(1.05); }
.tm.flash-sync { background: rgba(255, 210, 63, 0.6); transform: scale(1.12); box-shadow: 0 0 22px var(--gold); }
.tm .press { min-width: 1.1rem; text-align: center; }

.action-bar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 0.6rem; z-index: 4; }
.act-btn { position: relative; min-width: 120px; padding: 0.55rem 1rem 0.5rem; border-radius: 16px; border: 2px solid var(--c); background: rgba(11,11,26,0.7); color: #fff; font-weight: 900; font-size: 1rem; cursor: pointer; backdrop-filter: blur(6px); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 35%, transparent); display: flex; flex-direction: column; align-items: center; gap: 0.1rem; touch-action: none; overflow: hidden; transition: transform 0.08s, background 0.1s; }
.act-btn .ic { font-size: 1.5rem; line-height: 1.1; }
.act-btn kbd { font-size: 0.62rem; color: var(--muted); font-weight: 700; font-family: inherit; }
.act-btn.down { transform: scale(0.94); background: color-mix(in srgb, var(--c) 45%, rgba(11,11,26,0.7)); }
.act-btn.cool { opacity: 0.55; }
.act-btn .cd { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--c); width: 0; }
.act-btn .votes { position: absolute; top: 4px; right: 8px; font-size: 0.68rem; color: var(--gold); }
.act-btn.sync { animation: syncGlow 0.5s ease-in-out infinite alternate; border-color: var(--gold); }
@keyframes syncGlow { to { box-shadow: 0 0 34px var(--gold); transform: scale(1.06); } }

.center-msg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; padding: 1rem; }
.center-msg .big { font-size: clamp(3rem, 12vw, 7.5rem); font-weight: 900; font-style: italic; background: linear-gradient(135deg, var(--gold), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(255, 77, 141, 0.6)); animation: cdPop 0.6s cubic-bezier(.2,1.6,.4,1) both; line-height: 1.05; }
.center-msg .big.sync { background-image: linear-gradient(135deg, #fff6c2, var(--gold), var(--orange)); animation: cdPop 0.4s cubic-bezier(.2,1.6,.4,1) both, pulse 0.5s 0.4s infinite; }
.center-msg .sub { font-size: clamp(1rem, 3vw, 1.5rem); font-weight: 900; text-shadow: 0 2px 16px rgba(0,0,0,0.9); margin-top: 0.4rem; }
.center-msg .offsets { position: relative; width: min(420px, 80vw); height: 34px; margin: 0.8rem auto 0; border-radius: 999px; background: rgba(11,11,26,0.75); border: 1px solid var(--stroke); }
.center-msg .offsets .zone { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: rgba(61,255,162,0.18); }
.center-msg .offsets i { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); border: 2px solid #0b0b1a; }
@keyframes cdPop { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.banner { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); padding: 0.5rem 1.4rem; border-radius: 999px; font-weight: 900; font-size: clamp(0.95rem, 2.4vw, 1.4rem); background: rgba(11,11,26,0.85); border: 2px solid var(--cyan); white-space: nowrap; pointer-events: none; animation: popIn 0.35s cubic-bezier(.3,1.6,.5,1); }
.banner.good { border-color: var(--green); color: #d1ffe6; }
.banner.bad { border-color: var(--red); color: #ffd1d9; }
.banner.warn { border-color: var(--gold); background: linear-gradient(90deg, rgba(255,210,63,0.35), rgba(255,138,61,0.35)); }
.banner.role { border-color: var(--c, var(--gold)); font-size: clamp(1.1rem, 3vw, 1.8rem); }
.spectate-banner { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); padding: 0.4rem 1rem; border-radius: 999px; background: rgba(167, 139, 250, 0.22); border: 1px solid rgba(167, 139, 250, 0.55); font-weight: 800; font-size: 0.85rem; pointer-events: none; white-space: nowrap; }
.controls-hint { text-align: center; color: var(--muted); font-size: 0.78rem; margin-top: 0.6rem; }
.game-actions { display: flex; justify-content: center; margin-top: 0.5rem; }
.arena-exit { display: none; position: absolute; right: 10px; bottom: 130px; z-index: 6; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--stroke); background: rgba(11,11,26,0.6); color: #fff; font-weight: 900; }

/* ---------- Ergebnis ---------- */
.end-dist { font-weight: 900; line-height: 1; }
.end-dist b { font-size: clamp(3.5rem, 12vw, 6rem); background: linear-gradient(135deg, var(--cyan), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 24px rgba(61,224,255,0.4)); }
.end-dist span { font-size: 1.6rem; color: var(--muted); margin-left: 0.3rem; }
.end-score { color: #cbd5e1; margin: 0.4rem 0; }
.end-score b { color: var(--gold); }
.end-cause { font-weight: 800; margin: 0.6rem 0 0.2rem; }
.end-cause .guilty { color: var(--red); }
.end-best { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.8rem; }
.end-best b { color: var(--gold); }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; margin: 0.8rem 0; }
.award { padding: 0.7rem 0.6rem; border-radius: var(--radius-sm); background: rgba(0,0,0,0.3); border: 1.5px solid var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 30%, transparent); animation: popIn 0.5s cubic-bezier(.3,1.6,.5,1) both; }
.award:nth-child(2) { animation-delay: 0.15s; } .award:nth-child(3) { animation-delay: 0.3s; }
.award .ic { font-size: 1.8rem; }
.award b { display: block; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.award small { color: var(--muted); font-size: 0.72rem; }
.results-list { display: grid; gap: 0.3rem; margin: 0.8rem 0; text-align: left; }
.res-row { display: grid; grid-template-columns: 22px 1fr 4.5rem 3.2rem 3.2rem 3.2rem 3rem; gap: 0.5rem; align-items: center; padding: 0.35rem 0.6rem; border-radius: 9px; background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); font-size: 0.82rem; }
.res-row.head { background: none; border: none; color: var(--muted); font-size: 0.64rem; font-weight: 800; text-transform: uppercase; padding-top: 0; padding-bottom: 0; }
.res-row.me { border-color: rgba(255, 210, 63, 0.6); background: rgba(255,210,63,0.08); }
.res-row .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row .num { text-align: right; font-variant-numeric: tabular-nums; color: #cbd5e1; }
.res-row .num.good { color: var(--green); font-weight: 900; }
.res-row .num.bad { color: var(--red); font-weight: 900; }
.end-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 900px) {
    .menu-layout, .lobby-layout { grid-template-columns: 1fr; }
    .howto-cards { grid-template-columns: 1fr; }
    .res-row { grid-template-columns: 22px 1fr 3.6rem 2.8rem 2.8rem; }
    .res-row > :nth-child(6), .res-row > :nth-child(7) { display: none; }
    .banner { white-space: normal; text-align: center; width: max-content; max-width: 92%; border-radius: 18px; }
    .game-hud > div { padding: 0.2rem 0.55rem; }
    .game-hud b { font-size: 1.1rem; }
    .hud-hearts { font-size: 1.2rem; }
}

/* Touch: Lauf im Vollbild, Buttons groß */
body.touch .controls-hint { display: none; }
body.touch.in-game .topbar, body.touch.in-game .volume-box, body.touch.in-game .game-actions { display: none; }
body.touch.in-game .arena { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: none; z-index: 40; }
body.touch.in-game .game-hud { position: fixed; top: 6px; left: 6px; right: 50px; z-index: 41; gap: 0.3rem; pointer-events: none; }
body.touch.in-game .team-strip { top: 58px; }
body.touch.in-game .arena-exit { display: block; }
body.touch .action-bar { left: 8px; right: 8px; transform: none; bottom: 14px; }
body.touch .act-btn { flex: 1; min-width: 0; padding: 1rem 0.4rem; font-size: 0.95rem; }
body.touch .act-btn .ic { font-size: 2rem; }
body.touch .act-btn kbd { display: none; }
@media (max-width: 600px) { body.touch.in-game .hud-speed { display: none; } }
