/* Wolkenraser – Oberfläche (eigene Gestaltung) */
:root {
  --yellow: #ffcc1f; --yellow-d: #d98f00; --purple: #8a4dff; --purple-d: #5a26c4; --ink: #2a1a50;
  --panel: rgba(38, 24, 92, 0.84); --panel-b: rgba(255, 255, 255, 0.22); --white: #fff;
  --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #7cc4ff; font-family: var(--font); color: var(--white); user-select: none; -webkit-user-select: none; touch-action: none; }
#app { position: fixed; inset: 0; overflow: hidden; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.screen { position: absolute; inset: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }

/* ---------- Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px;
  font-size: 18px; padding: 12px 22px; border-radius: 16px; min-height: 48px; transition: transform 0.08s, filter 0.15s; position: relative; }
.btn:active { transform: translateY(3px); }
.btn.yellow { background: linear-gradient(#ffe05a, var(--yellow)); color: var(--ink); box-shadow: 0 5px 0 var(--yellow-d), 0 8px 16px rgba(0, 0, 0, 0.25); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.btn.purple { background: linear-gradient(#a274ff, var(--purple)); color: #fff; box-shadow: 0 5px 0 var(--purple-d), 0 8px 16px rgba(0, 0, 0, 0.25); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.btn.green { background: linear-gradient(#6ef08a, #2fc75a); color: #0e3a1c; box-shadow: 0 5px 0 #1e8a3c, 0 8px 16px rgba(0, 0, 0, 0.25); }
.btn.big { font-size: 34px; padding: 14px 44px; min-height: 76px; border-radius: 22px; letter-spacing: 2px; }
.btn.small { font-size: 15px; padding: 8px 14px; min-height: 40px; border-radius: 12px; }
.btn:disabled { filter: grayscale(0.8) brightness(0.8); cursor: default; }
.iconbtn { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(#a274ff, var(--purple)); box-shadow: 0 4px 0 var(--purple-d), 0 6px 12px rgba(0, 0, 0, 0.2); display: inline-flex; align-items: center; justify-content: center; position: relative; color: #fff; }
.iconbtn svg { width: 28px; height: 28px; }
.iconbtn:active { transform: translateY(3px); }
.iconbtn.gift { background: linear-gradient(#ffe05a, var(--yellow)); box-shadow: 0 4px 0 var(--yellow-d), 0 6px 12px rgba(0, 0, 0, 0.2); }
.iconbtn .dot { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: #ff3050; border: 2px solid #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.25); } }
.iconbtn.gift.ready { animation: wiggle 1.6s infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-10deg); } 85% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }

.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 2px solid var(--panel-b); border-radius: 999px; padding: 6px 16px 6px 6px; font-weight: 900; font-size: 22px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.pill.small { font-size: 18px; padding: 4px 12px 4px 4px; }
.coin { display: inline-block; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6b0 0 12%, #ffd23a 13% 55%, #e09a00 56% 100%); box-shadow: inset 0 0 0 3px #c07800, 0 2px 0 rgba(0, 0, 0, 0.25); position: relative; flex: none; }
.coin::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid rgba(160, 90, 0, 0.6); }
.pill.small .coin { width: 24px; height: 24px; }
.pill.small .coin::after { inset: 6px; }
.coin.tiny { width: 16px; height: 16px; box-shadow: inset 0 0 0 2px #c07800; }
.coin.tiny::after { inset: 4px; border-width: 1px; }

.panel { background: var(--panel); border: 2px solid var(--panel-b); border-radius: 20px; box-shadow: 0 8px 24px rgba(20, 10, 60, 0.3); backdrop-filter: blur(4px); }

/* ---------- Garage ---------- */
.topbar { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .tr { display: flex; gap: 10px; }
.topbar h2 { margin: 0; font-size: 26px; font-weight: 900; text-shadow: 0 3px 0 rgba(40, 20, 100, 0.5); }
.seg { display: inline-flex; background: var(--panel); border: 2px solid var(--panel-b); border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 12px; font-weight: 900; font-size: 17px; background: transparent; color: #d8ccff; }
.seg button svg { width: 30px; height: 20px; }
.seg button.on { background: linear-gradient(#ffe05a, var(--yellow)); color: var(--ink); box-shadow: 0 3px 0 var(--yellow-d); }

.arrow { position: absolute; top: 40%; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(#ffe05a, var(--yellow)); color: var(--ink); box-shadow: 0 5px 0 var(--yellow-d), 0 8px 16px rgba(0, 0, 0, 0.25); display: flex; align-items: center; justify-content: center; }
.arrow svg { width: 34px; height: 34px; }
.arrow.left { left: 290px; } .arrow.right { right: 24px; }
.arrow:active { transform: translateY(3px); }

#vehInfo { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; }
#vehName { font-size: 40px; font-weight: 900; letter-spacing: 1px; text-shadow: 0 3px 0 #4a2aa0, 0 0 18px rgba(60, 20, 160, 0.35); white-space: nowrap; }
#vehSub { margin-top: 4px; font-size: 16px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; background: rgba(38, 24, 92, 0.6); padding: 4px 12px; border-radius: 999px; }
#vehSub.locked { background: rgba(200, 30, 60, 0.75); }
#vehDots { margin-top: 8px; display: flex; gap: 6px; justify-content: center; }
#vehDots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); }
#vehDots i.on { background: var(--yellow); box-shadow: 0 0 0 2px var(--ink); }

#statsPanel { position: absolute; left: 14px; top: 76px; width: 260px; padding: 12px 14px; }
.stat { margin: 6px 0 10px; }
.stat .lab { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.bar { height: 14px; background: rgba(0, 0, 0, 0.35); border-radius: 8px; overflow: hidden; display: flex; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.25); }
.bar .b { background: linear-gradient(#ffe05a, #ffb800); }
.bar .u { background: linear-gradient(#7dff9a, #2fc75a); }
.vdesc { font-size: 13px; color: #d8ccff; margin-top: 4px; line-height: 1.3; }

#tuning { position: absolute; left: 14px; bottom: max(14px, env(safe-area-inset-bottom)); width: min(820px, calc(100% - 300px)); padding: 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; padding: 9px 12px; border-radius: 12px; background: rgba(138, 77, 255, 0.55); font-weight: 900; font-size: 15px; color: #fff; box-shadow: 0 3px 0 rgba(60, 20, 140, 0.8); white-space: nowrap; }
.tabs button.on { background: linear-gradient(#ffe05a, var(--yellow)); color: var(--ink); box-shadow: 0 3px 0 var(--yellow-d); }
.items { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; min-height: 96px; max-height: 236px; overflow-y: auto; padding: 4px 2px 6px; }
.item { width: 84px; padding: 8px 4px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.12); border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; font-weight: 800; font-size: 12px; color: #fff; }
.item:hover { background: rgba(255, 255, 255, 0.2); }
.item.eq { border-color: var(--yellow); background: rgba(255, 204, 31, 0.18); }
.item .sw { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.85); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; }
.item .sw svg { width: 40px; height: 40px; }
.item .pr { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.item .lock { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; }
.item .tick { position: absolute; top: 3px; right: 5px; color: var(--yellow); font-size: 16px; }
.item.dim { opacity: 0.55; }
.uprow { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 1px 6px; font-weight: 800; }
.uprow .btn.small { min-height: 36px; padding: 4px 12px; }
.pips { display: flex; gap: 5px; }
.pips i { flex: 1; height: 14px; border-radius: 5px; background: rgba(0, 0, 0, 0.35); max-width: 46px; }
.pips i.on { background: linear-gradient(#7dff9a, #2fc75a); box-shadow: 0 2px 0 #1e8a3c; }
.uprow .btn { min-width: 112px; }
.hint { width: 100%; text-align: center; color: #d8ccff; font-weight: 800; padding: 4px 0; }

#startBox { position: absolute; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
#nextLevel { background: var(--panel); border-radius: 12px; padding: 6px 12px; font-weight: 800; font-size: 14px; }
#btnStart.buy { background: linear-gradient(#6ef08a, #2fc75a); color: #0e3a1c; box-shadow: 0 5px 0 #1e8a3c, 0 8px 16px rgba(0, 0, 0, 0.25); font-size: 26px; }

/* ---------- Streckenwahl ---------- */
#levels { background: linear-gradient(rgba(40, 20, 110, 0.35), rgba(40, 20, 110, 0.55)); }
#lvGrid { position: absolute; top: 80px; left: 0; right: 0; bottom: 0; overflow-y: auto; padding: 10px 20px 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; align-content: start; max-width: 1100px; margin: 0 auto; }
.lv { position: relative; border-radius: 20px; padding: 14px 10px 12px; background: linear-gradient(#a274ff, var(--purple)); box-shadow: 0 6px 0 var(--purple-d), 0 10px 18px rgba(0, 0, 0, 0.25); text-align: center; font-weight: 900; color: #fff; min-height: 150px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lv .n { font-size: 46px; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.lv .nm { font-size: 15px; }
.lv .st { display: flex; gap: 4px; margin-top: 4px; }
.lv .bt { font-size: 12px; color: #e8dcff; }
.lv.next { background: linear-gradient(#ffe05a, var(--yellow)); color: var(--ink); box-shadow: 0 6px 0 var(--yellow-d), 0 10px 18px rgba(0, 0, 0, 0.25); }
.lv.next .bt { color: #5a3a00; }
.lv.locked { background: linear-gradient(#8a86a8, #6a6688); box-shadow: 0 6px 0 #4a4668; color: #d0cce0; cursor: not-allowed; }
.lv .lk { width: 34px; height: 34px; margin-top: 6px; }
.star { width: 26px; height: 26px; display: inline-block; }
.star path { fill: rgba(0, 0, 0, 0.3); stroke: rgba(255, 255, 255, 0.5); stroke-width: 1; }
.star.on path { fill: #ffd23a; stroke: #b07000; }

#lvWorld { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; width: min(560px, 94vw); justify-content: space-between; }
#lvWorld .wtitle { text-align: center; font-weight: 900; display: flex; flex-direction: column; line-height: 1.1; text-shadow: 0 2px 0 rgba(40, 20, 100, 0.6); }
#lvWorld .wtitle b { font-size: 28px; color: var(--yellow); }
#lvWorld .wtitle span { font-size: 13px; }
#lvWorld button[disabled] { opacity: 0.35; }
#lvDots { position: absolute; top: 140px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 10px; }
#lvDots button { min-width: 30px; height: 30px; border-radius: 15px; background: rgba(255, 255, 255, 0.25); color: #fff; font-weight: 900; font-size: 13px; border: 2px solid rgba(255, 255, 255, 0.5); padding: 0 6px; }
#lvDots button.on { background: var(--yellow); color: var(--ink); border-color: #fff; }
#lvDots button.lockedw { opacity: 0.55; }
#lvDots button .ws { font-size: 10px; margin-left: 2px; }
#lvGrid { top: 182px; grid-template-columns: repeat(5, 1fr); max-width: 1000px; }

/* ---------- HUD ---------- */
#dmg { margin-top: 4px; display: flex; align-items: center; gap: 6px; font-size: 12px; }
#dmg .dbar { width: 110px; height: 10px; border-radius: 6px; background: rgba(38, 24, 92, 0.6); border: 2px solid rgba(255, 255, 255, 0.6); overflow: hidden; }
#dmgFill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ef08a, #ffd23a 55%, #ff4a3a); background-size: 110px 100%; transition: width 0.2s; }
#dmg.hot .dbar { animation: dmgPulse 0.6s infinite alternate; }
@keyframes dmgPulse { to { box-shadow: 0 0 10px 2px #ff4a3a; } }
#dmgTxt { min-width: 34px; font-variant-numeric: tabular-nums; }
.sharebox input { width: 100%; font-size: 14px; padding: 8px; border-radius: 10px; border: 2px solid var(--purple); margin: 8px 0; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud button { pointer-events: auto; }
.hud-tl { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 14px; font-weight: 900; text-shadow: 0 2px 0 rgba(40, 20, 100, 0.6), 0 0 8px rgba(40, 20, 100, 0.4); }
#hudLevel { font-size: 16px; }
#hudTime { font-size: 30px; font-variant-numeric: tabular-nums; }
.hud-tc { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(420px, 40vw); }
#prog { position: relative; height: 14px; background: rgba(38, 24, 92, 0.6); border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 10px; }
#progFill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #ffe05a, #ffb800); border-radius: 8px; }
#progMarks i { position: absolute; top: -4px; width: 4px; height: 18px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px var(--purple-d); }
#progMarks i.fin { background: repeating-linear-gradient(#000 0 4px, #fff 4px 8px); width: 6px; }
#progCar { position: absolute; top: -7px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #fff; border: 4px solid var(--purple); }
.hud-tr { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; display: flex; gap: 10px; align-items: center; }
#speedo { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); text-align: center; font-weight: 900; text-shadow: 0 3px 0 rgba(40, 20, 100, 0.6); }
#speedo b { display: block; font-size: 48px; line-height: 1; font-variant-numeric: tabular-nums; }
#speedo span { font-size: 14px; }
#msg { position: absolute; top: 28%; left: 0; right: 0; text-align: center; font-size: 46px; font-weight: 900; color: #fff; text-shadow: 0 4px 0 #5a26c4, 0 0 22px rgba(90, 38, 196, 0.6); opacity: 0; transform: scale(0.6); transition: opacity 0.2s, transform 0.25s cubic-bezier(.3, 1.6, .5, 1); }
#msg.show { opacity: 1; transform: scale(1); }
#msg.warn { text-shadow: 0 4px 0 #c0203a, 0 0 22px rgba(200, 30, 60, 0.6); }
#msg.gold { color: #ffe05a; text-shadow: 0 4px 0 #a06000, 0 0 22px rgba(160, 96, 0, 0.6); }
#count { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: 120px; font-weight: 900; color: var(--yellow); text-shadow: 0 6px 0 var(--yellow-d), 0 0 30px rgba(0, 0, 0, 0.3); }
#fade { position: absolute; inset: 0; background: #fff; opacity: 0; transition: opacity 0.25s; }
#fade.on { opacity: 0.85; }

#touch { position: absolute; inset: 0; pointer-events: none; }
#touch .tl-group, #touch .tr-group { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; gap: 14px; align-items: flex-end; pointer-events: auto; }
#touch .tl-group { left: 16px; }
#touch .tr-group { right: 16px; }
.tbtn { width: 86px; height: 86px; border-radius: 50%; background: rgba(38, 24, 92, 0.55); border: 3px solid rgba(255, 255, 255, 0.75); color: #fff; font-weight: 900; font-size: 15px; display: flex; align-items: center; justify-content: center; touch-action: none; }
.tbtn svg { width: 44px; height: 44px; }
.tbtn.gas { width: 104px; height: 104px; background: rgba(255, 204, 31, 0.85); color: var(--ink); border-color: #fff; font-size: 20px; }
.tbtn.brake { background: rgba(138, 77, 255, 0.8); }
.tbtn.small { width: 62px; height: 62px; font-size: 12px; }
.tbtn.on { transform: scale(0.92); filter: brightness(1.25); }

/* ---------- Fenster ---------- */
.modal { position: absolute; inset: 0; background: rgba(30, 15, 80, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.card { background: linear-gradient(#3e2a96, #2a1a70); border: 3px solid rgba(255, 255, 255, 0.35); border-radius: 26px; padding: 22px 24px; width: min(440px, 100%); max-height: 100%; overflow-y: auto; text-align: center; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0 0 4px; font-size: 30px; font-weight: 900; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }
.card h2.big { font-size: 52px; color: var(--yellow); text-shadow: 0 5px 0 var(--yellow-d); }
.card p { margin: 0; color: #e0d8ff; line-height: 1.4; }
.card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.card .row .btn { flex: 1 1 0; min-width: 110px; }
.stars { display: flex; justify-content: center; gap: 10px; }
.stars i { width: 64px; height: 64px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.5 7 .8-5.2 4.8 1.4 7L12 17.6 5.8 21l1.4-7L2 9.3l7-.8z' fill='%23000' fill-opacity='.3' stroke='%23fff' stroke-opacity='.5'/%3E%3C/svg%3E"); transform: scale(0.8); transition: transform 0.3s cubic-bezier(.3, 1.8, .5, 1); }
.stars i.on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.5 7 .8-5.2 4.8 1.4 7L12 17.6 5.8 21l1.4-7L2 9.3l7-.8z' fill='%23ffd23a' stroke='%23b07000' stroke-width='1.2'/%3E%3C/svg%3E"); transform: scale(1.1); }
.ftime { font-size: 32px; font-weight: 900; font-variant-numeric: tabular-nums; }
.finfo { color: #d8ccff; font-weight: 700; font-size: 15px; }
.fcoins { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 26px; font-weight: 900; color: var(--yellow); }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; font-size: 18px; background: rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 10px 14px; }
.tog input { width: 24px; height: 24px; accent-color: var(--yellow); }
.qsel { display: flex; gap: 6px; }
.qsel button { flex: 1; padding: 8px 4px; border-radius: 10px; background: rgba(138, 77, 255, 0.55); font-weight: 900; font-size: 14px; }
.qsel button.on { background: var(--yellow); color: var(--ink); }
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.day { border-radius: 14px; padding: 8px 4px; background: rgba(255, 255, 255, 0.1); font-weight: 900; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 3px solid transparent; }
.day.done { opacity: 0.55; }
.day.today { border-color: var(--yellow); background: rgba(255, 204, 31, 0.2); }
.day b { display: inline-flex; gap: 4px; align-items: center; font-size: 15px; }
.small-print { font-size: 12px; color: #b8acf0; line-height: 1.4; }

#toast { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%) translateY(20px); background: rgba(30, 15, 80, 0.92); border: 2px solid rgba(255, 255, 255, 0.4); padding: 10px 18px; border-radius: 14px; font-weight: 800; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 30; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#rotateHint { position: absolute; bottom: 210px; left: 50%; transform: translateX(-50%); background: rgba(30, 15, 80, 0.8); padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 800; pointer-events: none; white-space: nowrap; }

#loading { position: absolute; inset: 0; background: linear-gradient(#2f86f0, #bfe6ff); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 50; transition: opacity 0.4s; }
#loading.done { opacity: 0; pointer-events: none; }
.logo { font-size: 56px; font-weight: 900; color: #fff; text-shadow: 0 5px 0 #5a26c4; letter-spacing: 1px; }
.logo span { color: var(--yellow); text-shadow: 0 5px 0 var(--yellow-d); }
.lbar { width: 220px; height: 14px; border-radius: 8px; background: rgba(0, 0, 0, 0.2); overflow: hidden; }
.lbar i { display: block; height: 100%; width: 30%; background: var(--yellow); animation: lb 1s infinite ease-in-out alternate; }
@keyframes lb { to { margin-left: 70%; } }
#loadMsg { font-weight: 800; }
.noscript { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #2f86f0; font-size: 20px; }

/* ---------- Responsiv: Hochformat (Handy) ---------- */
@media (max-width: 700px) {
  .topbar { left: 8px; right: 8px; gap: 6px; }
  .pill { font-size: 18px; padding: 4px 10px 4px 4px; }
  .pill .coin { width: 24px; height: 24px; }
  .seg button { padding: 6px 8px; font-size: 13px; gap: 4px; }
  .seg button svg { width: 22px; height: 15px; }
  .topbar .tr { gap: 6px; }
  .iconbtn { width: 40px; height: 40px; border-radius: 12px; }
  .iconbtn svg { width: 24px; height: 24px; }
  #btnFull { display: none; }
  #vehInfo { top: 60px; }
  #vehName { font-size: 30px; }
  .arrow { top: 25%; width: 50px; height: 50px; }
  .arrow svg { width: 26px; height: 26px; }
  .arrow.left { left: 10px; } .arrow.right { right: 10px; }
  #statsPanel { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 300px); padding: 8px 12px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  #statsPanel .stat { margin: 2px 0 4px; }
  #statsPanel .stat .lab { font-size: 12px; margin-bottom: 2px; }
  #statsPanel .bar { height: 10px; }
  #statsPanel .vdesc { display: none; }
  #tuning { left: 8px; right: 8px; width: auto; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); padding: 8px; }
  .tabs button { font-size: 13px; padding: 8px 9px; }
  .items { max-height: 150px; min-height: 150px; gap: 7px; }
  .item { width: calc((100% - 28px) / 5); min-width: 58px; font-size: 11px; padding: 6px 2px 4px; }
  .item .sw { width: 36px; height: 36px; }
  .uprow { grid-template-columns: 1fr auto; row-gap: 4px; font-size: 13px; }
  .uprow .pips { grid-column: 1 / 3; grid-row: 2; }
  .uprow .btn { min-width: 96px; font-size: 13px; min-height: 34px; padding: 4px 8px; }
  #startBox { left: 8px; right: 8px; bottom: max(10px, env(safe-area-inset-bottom)); flex-direction: row; align-items: center; gap: 8px; }
  #nextLevel { flex: 1; font-size: 12px; }
  .btn.big { font-size: 26px; min-height: 60px; padding: 8px 26px; flex: 1.4; }
  #lvGrid { top: 66px; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 8px 12px 30px; }
  .topbar h2 { font-size: 20px; }
  .lv { min-height: 128px; }
  .lv .n { font-size: 38px; }
  .hud-tc { top: 64px; width: 70vw; }
  #hudTime { font-size: 24px; }
  #msg { font-size: 34px; }
  #speedo { bottom: auto; top: 90px; }
  #speedo b { font-size: 34px; }
  .tbtn { width: 76px; height: 76px; }
  .tbtn.gas { width: 92px; height: 92px; }
  .tbtn.small { width: 56px; height: 56px; }
  #touch .tl-group, #touch .tr-group { gap: 10px; }
  #touch .tl-group { left: 10px; } #touch .tr-group { right: 10px; }
  .card { padding: 18px 16px; }
  .card h2.big { font-size: 42px; }
  .stars i { width: 52px; height: 52px; }
}

/* ---------- Responsiv: flaches Querformat (Handy quer) ---------- */
@media (max-height: 500px) {
  .topbar { top: 6px; }
  .pill { font-size: 17px; padding: 3px 10px 3px 3px; }
  .pill .coin { width: 22px; height: 22px; }
  .iconbtn { width: 38px; height: 38px; border-radius: 11px; }
  .iconbtn svg { width: 22px; height: 22px; }
  .seg button { padding: 5px 10px; font-size: 13px; }
  #vehInfo { top: 48px; }
  #vehName { font-size: 24px; }
  #vehSub { font-size: 12px; padding: 2px 10px; }
  #vehDots { display: none; }
  .arrow { top: 36%; width: 46px; height: 46px; }
  .arrow svg { width: 24px; height: 24px; }
  .arrow.left { left: 206px; } .arrow.right { right: 14px; }
  #statsPanel { top: 52px; left: 8px; width: 190px; padding: 6px 10px; }
  .stat { margin: 2px 0 4px; }
  .stat .lab { font-size: 11px; margin-bottom: 2px; }
  .bar { height: 9px; }
  .vdesc { display: none; }
  #tuning { left: 8px; bottom: 6px; width: calc(100% - 200px); padding: 6px; }
  .tabs button { font-size: 12px; padding: 6px 8px; }
  .items { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; min-height: 0; max-height: none; margin-top: 6px; gap: 6px; padding-bottom: 4px; }
  .item { width: 62px; min-width: 62px; padding: 4px 2px; font-size: 10px; gap: 2px; }
  .item .sw { width: 30px; height: 30px; }
  .uprow { grid-template-columns: 100px 1fr auto; font-size: 12px; padding: 1px 4px; }
  .uprow .btn { min-height: 28px; font-size: 12px; padding: 2px 8px; min-width: 80px; }
  #tuning .items.up { flex-direction: column; flex-wrap: nowrap; overflow: visible; }
  #startBox { right: 8px; bottom: 8px; gap: 6px; }
  #nextLevel { font-size: 11px; padding: 4px 8px; max-width: 180px; text-align: center; }
  .btn.big { font-size: 22px; min-height: 52px; padding: 6px 22px; }
  #lvGrid { top: 54px; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 6px 12px 20px; }
  .lv { min-height: 112px; padding: 8px 6px; }
  .lv .n { font-size: 30px; }
  .lv .nm { font-size: 12px; }
  .star { width: 18px; height: 18px; }
  #hudTime { font-size: 22px; }
  #hudLevel { font-size: 13px; }
  .hud-tc { top: 10px; width: 34vw; }
  #speedo { top: auto; bottom: 10px; }
  #speedo b { font-size: 30px; }
  #msg { font-size: 30px; top: 22%; }
  #count { font-size: 80px; top: 26%; }
  .tbtn { width: 70px; height: 70px; }
  .tbtn.gas { width: 84px; height: 84px; }
  .tbtn.small { width: 52px; height: 52px; }
  .card { padding: 12px 16px; gap: 8px; }
  .card h2 { font-size: 22px; }
  .card h2.big { font-size: 34px; }
  .stars i { width: 40px; height: 40px; }
  .ftime { font-size: 24px; }
  .btn { min-height: 40px; font-size: 15px; padding: 8px 14px; }
  #toast { bottom: 80px; }
}

/* --- Feinschliff v1 --- */
#finish .card { width: min(540px, 100%); }
#finish .card .row .btn { white-space: nowrap; }
@media (max-width: 700px) {
  #touch .tr-group .tbtn.small { position: absolute; left: 0; bottom: calc(100% + 10px); }
  .tbtn { width: 68px; height: 68px; font-size: 13px; }
  .tbtn.gas { width: 86px; height: 86px; }
  .tbtn.small { width: 54px; height: 54px; font-size: 11px; }
}
@media (max-width: 420px) {
  .seg button svg { display: none; }
  .seg button { padding: 6px 9px; }
  .pill { font-size: 16px; padding: 3px 8px 3px 3px; gap: 5px; }
}
@media (max-height: 500px) {
  .uprow { row-gap: 0; gap: 6px; }
  .uprow .btn, .uprow .btn.small { min-height: 26px; padding: 1px 8px; }
  #touch .tr-group .tbtn.small { position: absolute; left: 0; bottom: calc(100% + 8px); }
}
/* Querformat (niedrige Höhe, breit): Tuning links als Spalte, Fahrzeug rechts */
@media (max-height: 500px) and (min-width: 701px) {
  #tuning { top: 50px; bottom: 6px; width: 46vw; display: flex; flex-direction: column; }
  .tabs { flex-wrap: wrap; overflow: visible; }
  .tabs button { flex: 1 0 28%; padding: 5px 4px; }
  .items { flex-wrap: wrap; overflow-y: auto; overflow-x: hidden; flex: 1; align-content: flex-start; }
  .item { width: 64px; min-width: 64px; }
  #tuning .items.up { overflow-y: auto; }
  .uprow { grid-template-columns: 88px 1fr auto; font-size: 11px; }
  .uprow .btn, .uprow .btn.small { min-width: 70px; font-size: 11px; }
  #statsPanel { top: auto; bottom: 8px; left: calc(46vw + 16px); width: auto; right: 200px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; padding: 4px 10px; }
  .stat { margin: 2px 0; }
  #vehInfo { left: 73vw; top: 46px; }
  .arrow.left { left: calc(46vw + 16px); } .arrow.right { right: 10px; }
  .arrow { top: 42%; }
}
@media (max-width: 700px) {
  .uprow { row-gap: 2px; padding: 0 4px; }
  .uprow .btn, .uprow .btn.small { min-height: 30px; }
  #tuning .items.up { gap: 4px; }
}

/* ---------- v2: Welten-Seiten responsiv ---------- */
@media (max-width: 700px) {
  #lvWorld { top: 60px; gap: 8px; }
  #lvWorld .wtitle b { font-size: 22px; }
  #lvDots { top: 118px; gap: 5px; }
  #lvDots button { min-width: 26px; height: 26px; font-size: 12px; }
  #lvGrid { top: 182px; grid-template-columns: repeat(2, 1fr); }
  #dmg .dbar { width: 80px; }
}
@media (max-height: 500px) {
  #lvWorld { top: 4px; width: min(420px, 50vw); }
  #lvWorld .wtitle b { font-size: 18px; }
  #lvWorld .wtitle span { font-size: 11px; }
  #lvWorld .iconbtn { width: 36px; height: 36px; }
  #lvDots { top: 50px; gap: 4px; }
  #lvDots button { min-width: 24px; height: 22px; font-size: 11px; border-width: 1px; }
  #lvDots button .ws { display: none; }
  #lvGrid { top: 80px; grid-template-columns: repeat(5, 1fr); }
  .lv { min-height: 96px; }
  .lv .bt { display: none; }
  #dmg { font-size: 11px; }
  #dmg .dbar { width: 70px; height: 8px; }
}
@media (max-height: 500px) and (max-width: 700px) { #lvGrid { grid-template-columns: repeat(5, 1fr); } }
@media (max-height: 500px) { #levels .topbar h2 { display: none; } }
.lv.show::after { content: 'SPEZIAL'; position: absolute; top: 6px; right: 8px; font-size: 9px; letter-spacing: 1px; background: #ff4a8a; color: #fff; padding: 2px 6px; border-radius: 8px; }
