/* 🔥 Dino Potato Panic V2 – baut auf arcade-ui.css auf */

.potato-bob { animation: potatoBob 1.6s ease-in-out infinite; }
@keyframes potatoBob { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-10px) rotate(10deg); filter: drop-shadow(0 0 28px rgba(255, 138, 61, 0.9)); } }
.hero-logo h1 span { background: linear-gradient(135deg, var(--orange), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.howto { margin-top: 1.25rem; text-align: left; color: #cbd5e1; font-size: 0.85rem; }
.howto summary { cursor: pointer; color: var(--gold); font-weight: 700; }
.howto ul { margin: 0.6rem 0 0 1.1rem; display: grid; gap: 0.35rem; }
.howto kbd { padding: 0.05rem 0.35rem; border-radius: 5px; background: rgba(255,255,255,0.1); border: 1px solid var(--stroke); font-size: 0.75rem; }

/* ---------- Lobby ---------- */
.lobby-layout { width: 100%; max-width: 1050px; display: grid; grid-template-columns: 1.3fr 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; }
.map-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin-bottom: 1.25rem; }
.map-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.7rem 0.3rem 0.6rem; border-radius: var(--radius-sm); background: rgba(0,0,0,0.25); border: 1.5px solid var(--stroke); cursor: pointer; text-align: center; transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s; }
.map-card:hover:not(.readonly) { transform: translateY(-2px); }
.map-card svg { width: 100%; height: 38px; }
.map-card b { font-size: 0.8rem; }
.map-card small { color: var(--muted); font-size: 0.65rem; }
.map-card.selected { border-color: var(--c); box-shadow: 0 0 20px color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.map-card.readonly { cursor: default; }
.settings-grid.three { grid-template-columns: repeat(3, 1fr); }
.toggle-row { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.85rem; cursor: pointer; }
.toggle-row input { accent-color: var(--gold); width: 18px; height: 18px; }
.member-list { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.member-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 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 .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; border-radius: 7px 7px 4px 4px; background: var(--c); box-shadow: 0 0 10px var(--c); position: relative; flex-shrink: 0; }
.dino-dot::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff; top: 5px; right: 4px; box-shadow: inset -1px 0 0 1px #111; }
.start-problem { text-align: center; color: #fda4af; font-size: 0.85rem; min-height: 1.2em; margin-top: 0.5rem; }

/* ---------- Spiel ---------- */
#gameScreen.active { justify-content: flex-start; }
.game-wrap { width: 100%; max-width: 1280px; }
.arena { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 140px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--stroke); box-shadow: var(--shadow); background: #070712; touch-action: none; user-select: none; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.nameplate { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: 0.72rem; font-weight: 800; padding: 0.12rem 0.5rem; border-radius: 999px; background: rgba(11, 11, 26, 0.78); border: 1.5px solid var(--c); color: #fff; transition: opacity 0.2s; }
.nameplate.me { box-shadow: 0 0 10px var(--c); }
.nameplate.holder { border-color: #ff4d6d; color: #ffd1d9; animation: plateHot 0.5s ease-in-out infinite alternate; }
.nameplate.dead { opacity: 0.35; text-decoration: line-through; }
@keyframes plateHot { to { box-shadow: 0 0 16px #ff4d6d; } }
.floater { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 1.1rem; white-space: nowrap; pointer-events: none; text-shadow: 0 2px 10px rgba(0,0,0,0.8); animation: floatUp 1s ease-out forwards; }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, -50%) scale(0.6); } 20% { transform: translate(-50%, -70%) scale(1.15); } to { opacity: 0; transform: translate(-50%, -160%) scale(1); } }

.hud-top { position: absolute; top: 10px; left: 10px; right: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: start; pointer-events: none; }
.hud-round { background: rgba(11,11,26,0.7); border: 1px solid var(--stroke); border-radius: 12px; padding: 0.35rem 0.7rem; text-align: center; backdrop-filter: blur(6px); }
.hud-round .section-label { margin: 0; font-size: 0.6rem; }
.hud-round b { font-size: 1.3rem; }
.hud-fuse { justify-self: center; width: min(420px, 100%); background: rgba(11,11,26,0.72); border: 1px solid var(--stroke); border-radius: 14px; padding: 0.4rem 0.7rem; backdrop-filter: blur(6px); }
.fuse-label { text-align: center; font-weight: 800; font-size: 0.85rem; margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fuse-bar { position: relative; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.08); overflow: visible; }
#fuseFill { height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #ff4d6d, #ff8a3d, #ffd23f); box-shadow: 0 0 12px rgba(255, 138, 61, 0.7); transition: width 0.1s linear; }
.fuse-bar .spark { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: radial-gradient(circle, #fff, #ffd23f 40%, transparent 70%); animation: sparkle 0.15s infinite alternate; left: 0; display: none; }
@keyframes sparkle { to { transform: scale(1.5); } }
.hud-fuse.hot { border-color: rgba(255, 138, 61, 0.7); }
.hud-fuse.critical { border-color: #ff4d6d; animation: fuseShake 0.12s infinite; }
@keyframes fuseShake { 50% { transform: translateX(2px); } }
.hud-wins { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-end; max-height: 60%; }
.win-chip { display: flex; align-items: center; gap: 0.35rem; background: rgba(11,11,26,0.72); border: 1px solid var(--stroke); border-radius: 999px; padding: 0.15rem 0.55rem 0.15rem 0.2rem; font-size: 0.72rem; font-weight: 800; backdrop-filter: blur(6px); }
.win-chip.out { opacity: 0.45; }
.win-chip .dino-dot { width: 16px; height: 16px; }
.win-chip .pips { color: var(--gold); letter-spacing: 0.05em; }

.center-msg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; }
.center-msg .big { font-size: clamp(3rem, 12vw, 8rem); font-weight: 900; 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.8s cubic-bezier(.2,1.6,.4,1) both; }
.center-msg .sub { font-size: clamp(1rem, 3vw, 1.6rem); font-weight: 900; text-shadow: 0 2px 16px rgba(0,0,0,0.9); margin-top: 0.4rem; }
@keyframes cdPop { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.spectate-banner { position: absolute; bottom: 14px; 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; }
.webgl-fail { position: absolute; inset: 0; display: grid; place-items: center; color: #fda4af; font-weight: 800; padding: 2rem; text-align: center; }

.touch-controls { position: absolute; inset: auto 0 10px 0; display: none; justify-content: space-between; padding: 0 12px; pointer-events: none; }
.touch-controls .tc-left, .touch-controls .tc-right { display: flex; gap: 10px; pointer-events: auto; }
.touch-controls button { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); background: rgba(11, 11, 26, 0.55); color: #fff; font-size: 1.6rem; font-weight: 900; backdrop-filter: blur(4px); touch-action: none; }
.touch-controls button.active { background: rgba(255, 210, 63, 0.35); border-color: var(--gold); }
.touch-controls .tc-jump { width: 76px; height: 76px; }
body.touch .touch-controls { display: flex; }
body.touch .controls-hint { display: none; }

/* ---------- Ende ---------- */
.crown-big { font-size: 3.5rem; animation: bob 2.4s ease-in-out infinite; display: inline-block; }
#endTitle { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0.3rem 0; }
#endTitle span { color: var(--gold); }
.end-stats { display: grid; gap: 0.4rem; margin: 1.25rem 0; text-align: left; }
.end-row { display: grid; grid-template-columns: 1.6rem 22px 1fr repeat(3, auto); gap: 0.6rem; align-items: center; padding: 0.5rem 0.7rem; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); font-size: 0.85rem; }
.end-row.me { border-color: rgba(255, 210, 63, 0.5); }
.end-row .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-row .st { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.end-row .w { color: var(--gold); font-weight: 900; }
.end-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 900px) {
    .lobby-layout { grid-template-columns: 1fr; }
    .map-grid { grid-template-columns: repeat(3, 1fr); }
    .settings-grid.three { grid-template-columns: 1fr 1fr; }
    .arena { aspect-ratio: auto; height: calc(100vh - 120px); max-height: none; }
    .hud-wins { display: none; }
    .end-row { grid-template-columns: 1.4rem 22px 1fr auto; }
    .end-row .st.opt { display: none; }
}

/* Touch-Geräte: Spiel im Vollbild, damit die Buttons nicht die halbe Arena fressen */
body.touch.in-game .topbar, body.touch.in-game .volume-box, body.touch.in-game .controls-hint { display: none; }
body.touch.in-game .arena { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-height: none; aspect-ratio: auto; border-radius: 0; border: none; z-index: 40; }
body.touch.in-game .touch-controls button { opacity: 0.75; }
body.touch .hud-fuse { width: min(320px, 50%); }
