@font-face { font-family: 'Cinzel'; src: url(assets/fonts/cinzel.woff2) format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url(assets/fonts/rajdhani-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url(assets/fonts/rajdhani-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url(assets/fonts/rajdhani-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #07080c;
  --ink: #f2ead8;
  --muted: #a9a08c;
  --gold: #e6bd6a;
  --gold-hi: #fff0c2;
  --gold-lo: #7a5420;
  --aether: #6ff2ff;
  --void: #c070ff;
  --danger: #ff5a6a;
  --glass: rgba(14, 16, 24, 0.78);
  --glass-hi: rgba(30, 34, 48, 0.9);
  --edge: linear-gradient(135deg, #f4d58a, #8a5f22 45%, #f0cf7c 70%, #6d4a18);
  --ui: clamp(10px, min(1.05vw, 2.4vh), 17px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; font-family: 'Rajdhani', system-ui, sans-serif; font-weight: 600; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; font-size: var(--ui); z-index: 10; }
#hud button, #hud .hero-card, #hud .infobox, #hud .overlay.open { pointer-events: auto; }

/* ---------------------------------------------------------------- Lader */
#loader { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; gap: 24px; background: radial-gradient(circle at 50% 40%, #1a1630, #050508 70%); transition: opacity .5s; }
#loader.done { opacity: 0; pointer-events: none; }
.ld-logo { font-family: 'Cinzel'; font-weight: 800; font-size: clamp(28px, 6vw, 72px); letter-spacing: .12em; background: linear-gradient(#fff3c8, #e0a84a 55%, #7a4a14); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(111, 242, 255, .35)); }
.ld-bar { height: 3px; width: 260px; margin: auto; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 40%; background: var(--aether); animation: ld 1.1s infinite ease-in-out; }
@keyframes ld { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------------------------------------------------------------- Bausteine */
.btn { display: block; width: 100%; padding: .7em 1.4em; margin: .45em 0; font-family: 'Cinzel'; font-weight: 700; font-size: 1.05em; letter-spacing: .06em; color: var(--ink); background: linear-gradient(180deg, rgba(40, 44, 60, .95), rgba(16, 18, 26, .95)); border: 1px solid rgba(230, 189, 106, .55); border-radius: 4px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 18px rgba(0, 0, 0, .45); transition: transform .12s, box-shadow .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); border-color: var(--gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 18px rgba(230, 189, 106, .25); }
.btn.primary { color: #1c1206; background: linear-gradient(180deg, #ffe7a6, #e2ad55 50%, #a8711f); border-color: #ffe3a0; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.btn small { font-family: 'Rajdhani'; font-size: .7em; color: var(--muted); margin-left: .5em; }
.panel { position: relative; background: linear-gradient(180deg, var(--glass-hi), var(--glass)); border: 1px solid rgba(230, 189, 106, .45); border-radius: 6px; padding: 1.6em 2em; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 0 40px rgba(111, 242, 255, .05); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.panel::before { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(230, 189, 106, .15); border-radius: 4px; pointer-events: none; }
.panel h2 { margin: 0 0 .8em; font-family: 'Cinzel'; font-weight: 800; letter-spacing: .08em; text-align: center; color: var(--gold-hi); text-shadow: 0 0 20px rgba(230, 189, 106, .4); }

/* ---------------------------------------------------------------- Hauptmenü */
#menu { position: fixed; inset: 0; z-index: 50; display: none; }
#menu.open { display: block; }
.menu-bg { position: absolute; inset: 0; background: var(--keyart, none) center / cover, radial-gradient(ellipse at 50% 30%, #2a1e4a 0%, #0d0b18 55%, #040406 100%); }
.menu-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 4, 8, .85) 0%, rgba(4, 4, 8, .35) 45%, rgba(4, 4, 8, 0) 70%), linear-gradient(0deg, rgba(4, 4, 8, .7), transparent 40%); }
.menu-inner { position: absolute; left: calc(6vw + var(--safe-l)); top: 50%; transform: translateY(-50%); width: min(420px, 80vw); }
.logo { margin: 0; font-family: 'Cinzel'; font-weight: 800; font-size: clamp(34px, 5.4vw, 86px); letter-spacing: .1em; line-height: 1; }
.logo span { background: linear-gradient(#fff6d6, #f0c66e 45%, #9a6420 80%, #f7d98a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .5)) drop-shadow(0 0 24px rgba(111, 242, 255, .3)); }
.has-logo .logo { height: clamp(70px, 11vw, 170px); background: var(--logo) left center / contain no-repeat; }
.has-logo .logo span { display: none; }
.tagline { margin: .6em 0 2em; color: var(--muted); font-size: clamp(14px, 1.4vw, 20px); letter-spacing: .04em; }
.menu-buttons .btn { text-align: left; }
.menu-foot { position: absolute; right: calc(16px + var(--safe-r)); bottom: 10px; color: rgba(255, 255, 255, .35); font-size: 12px; }
.maps { position: absolute; inset: 0; display: none; place-items: center; background: rgba(3, 3, 8, .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.maps.open { display: grid; }
.maps-panel, .help { width: min(640px, 92vw); }
.map-list { display: grid; gap: 12px; margin-bottom: 1em; }
.map-card { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 4px 16px; padding: 1em 1.2em; background: rgba(255, 255, 255, .04); border: 1px solid rgba(111, 242, 255, .3); border-radius: 4px; }
.map-card:hover { border-color: var(--aether); background: rgba(111, 242, 255, .08); }
.map-card b { font-family: 'Cinzel'; font-size: 1.2em; color: var(--gold-hi); }
.map-card span { grid-column: 1; color: var(--muted); }
.map-card .stars { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; color: var(--gold); font-size: 1.6em; letter-spacing: .1em; }
.help ul { padding-left: 1.1em; line-height: 1.5; color: #ddd3bd; }
.help li { margin-bottom: .5em; }
.help b { color: var(--gold-hi); }
.menu-toast { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); padding: .7em 1.4em; background: var(--glass-hi); border: 1px solid var(--aether); border-radius: 4px; }

/* ---------------------------------------------------------------- HUD oben */
.hud-top { position: absolute; top: 1.2vh; left: calc(1.2vw + var(--safe-l)); display: flex; gap: .7em; align-items: center; }
.res { display: flex; align-items: center; gap: .45em; padding: .35em .9em .35em .5em; background: linear-gradient(180deg, rgba(20, 22, 32, .9), rgba(8, 9, 14, .85)); border: 1px solid rgba(230, 189, 106, .45); border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.res b { font-size: 1.35em; font-weight: 700; min-width: 2.2em; }
.res span { color: var(--muted); font-size: .85em; text-transform: uppercase; letter-spacing: .1em; padding-left: .4em; }
.ico { width: 1.5em; height: 1.5em; display: inline-block; border-radius: 50%; }
.ico-core { background: radial-gradient(circle at 40% 35%, #fff, #6ff2ff 40%, #0a6b9a 80%); box-shadow: 0 0 10px var(--aether); clip-path: polygon(50% 0, 90% 45%, 50% 100%, 10% 45%); border-radius: 0; }
.ico-gold { background: radial-gradient(circle at 35% 30%, #fff8d0, #f0c050 45%, #8a5a10 90%); box-shadow: 0 0 8px rgba(240, 192, 80, .6); }
.res.cores b { color: #bff8ff; }
.res.gold b { color: #ffe08a; }
.mutation { display: flex; gap: .4em; }
.mut { padding: .25em .7em; border-radius: 3px; font-size: .9em; background: rgba(80, 20, 110, .75); border: 1px solid rgba(192, 112, 255, .6); color: #f0d8ff; box-shadow: 0 0 12px rgba(192, 112, 255, .3); }
.mut::before { content: '⬢ '; color: var(--void); }
.hud-right { position: absolute; top: 1.2vh; right: calc(1.2vw + var(--safe-r)); display: flex; gap: .5em; }
.btn-round { width: 2.8em; height: 2.8em; border-radius: 50%; border: 1px solid rgba(230, 189, 106, .6); background: radial-gradient(circle at 50% 30%, #2c3040, #0b0c12); font-weight: 700; font-size: 1.05em; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.btn-round:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(230, 189, 106, .4); }

/* ---------------------------------------------------------------- HUD unten */
.hud-bottom { position: absolute; left: calc(1.2vw + var(--safe-l)); bottom: 1.6vh; display: flex; gap: .7em; align-items: flex-end; }
.hud-powers { position: absolute; right: calc(1.2vw + var(--safe-r)); bottom: 1.6vh; display: flex; flex-direction: column; gap: .55em; }
.hero-card { display: flex; align-items: center; gap: .6em; padding: .4em .9em .4em .4em; background: linear-gradient(180deg, rgba(20, 22, 32, .92), rgba(8, 9, 14, .88)); border: 1px solid rgba(230, 189, 106, .5); border-radius: 999px 12px 12px 999px; cursor: pointer; }
.hero-card.active { border-color: var(--aether); box-shadow: 0 0 18px rgba(111, 242, 255, .45); }
.portrait { width: 4.2em; height: 4.2em; border-radius: 50%; border: 2px solid var(--gold); background: #1c2a3a center 20% / cover no-repeat; box-shadow: inset 0 0 12px rgba(0, 0, 0, .6); }
.hero-info { display: grid; gap: .2em; min-width: 7em; }
.hero-info b { font-family: 'Cinzel'; color: var(--gold-hi); }
.hero-info span { font-size: .85em; color: var(--muted); }
.bar { height: .45em; background: rgba(0, 0, 0, .6); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #39c4ff, #9ff6ff); transition: width .2s; }
.bar.xp { height: .25em; }
.bar.xp i { background: linear-gradient(90deg, #c08a2a, #ffe08a); }
.power { position: relative; width: 4.4em; height: 4.4em; border-radius: 50%; border: 2px solid rgba(230, 189, 106, .7); background: radial-gradient(circle at 50% 35%, #31364a, #0b0c12 75%); box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 14px rgba(111, 242, 255, .15); overflow: hidden; }
.power::after { content: ''; position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, .72) var(--cd, 0%), transparent 0); border-radius: 50%; }
.power.active { border-color: var(--aether); box-shadow: 0 0 22px rgba(111, 242, 255, .6); }
.power.off { filter: grayscale(1) brightness(.6); }
.power em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 1.3em; font-weight: 700; z-index: 2; text-shadow: 0 2px 4px #000; }
.power kbd, .rb kbd { position: absolute; bottom: 2px; right: 50%; transform: translateX(50%); font: 700 .65em 'Rajdhani'; color: var(--muted); z-index: 3; }
.pw { position: absolute; inset: 0; border-radius: 50%; background: center / contain no-repeat; display: grid; place-items: center; font-style: normal; font-size: 1.7em; }
.pw-meteor { background-image: var(--ico-meteor, none); }
.pw-reinforce { background-image: var(--ico-reinforce, none); }
.pw-chrono { background-image: var(--ico-chrono, none); }
.pw-blade { background-image: var(--ico-blade, none); }
:root:not(.icons) .pw-meteor::before { content: '☄'; color: #ff9a4a; }
:root:not(.icons) .pw-reinforce::before { content: '⚔'; color: #ffe08a; }
:root:not(.icons) .pw-chrono::before { content: '⧗'; color: var(--aether); }
:root:not(.icons) .pw-blade::before { content: '✦'; color: #9ff6ff; }
.charges { position: absolute; top: 0; right: 0; z-index: 3; min-width: 1.3em; padding: 0 .3em; border-radius: 999px; background: var(--aether); color: #04161a; font-size: .8em; }

/* ---------------------------------------------------------------- Welle rufen */
.wave-call { position: absolute; left: 0; top: 0; width: 5.2em; height: 5.2em; margin: -2.6em 0 0 -2.6em; border-radius: 50%; border: none; background: radial-gradient(circle, #3a1458, #12061f 70%); color: #f6e6ff; display: none; place-items: center; text-align: center; line-height: 1; font-weight: 700; box-shadow: 0 0 24px rgba(192, 112, 255, .6); animation: callPulse 1.6s infinite; }
.wave-call.show { display: grid; }
.wc-ring { position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--void) var(--p, 360deg), rgba(255, 255, 255, .1) 0); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); }
.wc-label { font-family: 'Cinzel'; font-size: .8em; }
.wc-time { position: absolute; bottom: -1.5em; color: #ffe08a; font-size: .9em; text-shadow: 0 1px 3px #000; }
@keyframes callPulse { 50% { box-shadow: 0 0 40px rgba(255, 79, 216, .8); } }
.wave-preview { position: absolute; display: none; min-width: 15em; padding: .8em 1em; background: var(--glass-hi); border: 1px solid rgba(192, 112, 255, .6); border-radius: 6px; }
.wave-preview.open { display: block; }
.wave-preview h3 { margin: 0 0 .4em; font-family: 'Cinzel'; color: #f0d8ff; }
.wave-preview ul { list-style: none; margin: 0; padding: 0; }
.wave-preview li { display: flex; align-items: center; gap: .5em; margin: .2em 0; }
.wave-preview li img { width: 2em; height: 2em; object-fit: contain; }
.wave-preview li i { color: var(--muted); font-size: .85em; }
.wave-preview p { margin: .5em 0 0; color: #ffe08a; }

/* ---------------------------------------------------------------- Ringmenü */
.radial { position: absolute; width: 0; height: 0; display: none; }
.radial.open { display: block; }
.radial::before { content: ''; position: absolute; width: 15em; height: 15em; margin: -7.5em; border-radius: 50%; border: 1px dashed rgba(230, 189, 106, .35); background: radial-gradient(circle, rgba(0, 0, 0, .0) 40%, rgba(0, 0, 0, .35) 70%, transparent 72%); pointer-events: none; animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rb { position: absolute; left: 0; top: 0; width: 4.6em; height: 4.6em; margin: -2.3em; transform: translate(calc(var(--x) * var(--k, 1)), calc(var(--y) * var(--k, 1))); border-radius: 50%; border: 2px solid rgba(230, 189, 106, .8); background: radial-gradient(circle at 50% 30%, #2f3446, #0b0c12 80%); box-shadow: 0 6px 16px rgba(0, 0, 0, .6); display: grid; place-items: center; animation: pop .18s ease-out backwards; pointer-events: auto; }
.rb:hover { border-color: var(--gold-hi); box-shadow: 0 0 18px rgba(230, 189, 106, .55); z-index: 2; }
.rb img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 2px 3px #000); }
.rb .cost { position: absolute; bottom: -.9em; padding: .05em .5em; border-radius: 999px; background: #1a1206; border: 1px solid var(--gold); color: #ffe08a; font-size: .8em; }
.rb .lbl { position: absolute; bottom: -.9em; padding: .05em .4em; border-radius: 999px; background: #0d1a20; border: 1px solid var(--aether); color: #c8faff; font-size: .72em; white-space: nowrap; }
.rb.poor { filter: grayscale(.9) brightness(.65); }
.rb.poor .cost { color: var(--danger); border-color: var(--danger); }
.rb.disabled { opacity: .5; }
.rb kbd { bottom: auto; top: -1.1em; }
.ri { font-style: normal; font-size: 1.7em; }
.ri-up::before { content: '▲'; color: #9cff7a; }
.ri-spec-a::before { content: 'Ⅰ'; color: var(--gold-hi); font-family: 'Cinzel'; }
.ri-spec-b::before { content: 'Ⅱ'; color: var(--gold-hi); font-family: 'Cinzel'; }
.ri-sell::before { content: '⬇'; color: #ffd27a; }
.ri-target::before { content: '◎'; color: var(--aether); }
.ri-rally::before { content: '⚑'; color: #ffd27a; }
.ri-fuse::before { content: '⧉'; color: var(--void); }
.rb.spec { width: 5em; height: 5em; margin: -2.5em; border-color: var(--gold-hi); }
.rb.fuse { border-color: var(--void); }
@keyframes pop { from { transform: translate(0, 0) scale(.3); opacity: 0; } }

/* ---------------------------------------------------------------- Werteanzeige */
.infobox { position: absolute; right: calc(7.2em + var(--safe-r)); bottom: 1.6vh; width: 19em; padding: .9em 1.1em; background: linear-gradient(180deg, var(--glass-hi), var(--glass)); border: 1px solid rgba(230, 189, 106, .5); border-radius: 6px; display: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.infobox.open { display: block; }
.infobox h3 { margin: 0 0 .3em; font-family: 'Cinzel'; color: var(--gold-hi); }
.infobox p { margin: 0 0 .5em; color: #d7ccb4; font-weight: 500; }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox td { padding: .12em 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.infobox td:last-child { text-align: right; color: #bff8ff; }
.infobox s { color: var(--muted); }
.infobox .price { margin-top: .5em; text-align: right; color: #ffe08a; font-size: 1.1em; }
.infobox ul { margin: .4em 0 0; padding-left: 1.1em; }

/* ---------------------------------------------------------------- Meldungen */
.aimhint { position: absolute; top: 9vh; left: 50%; transform: translateX(-50%); padding: .5em 1.2em; border-radius: 999px; background: rgba(8, 30, 36, .88); border: 1px solid var(--aether); color: #c8faff; display: none; }
.aimhint.open { display: block; }
.toasts { position: absolute; top: 15vh; left: 50%; transform: translateX(-50%); display: grid; gap: .4em; justify-items: center; }
.toast { padding: .45em 1.2em; border-radius: 4px; background: var(--glass-hi); border: 1px solid rgba(230, 189, 106, .55); animation: toastIn .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.bad { border-color: var(--danger); color: #ffd0d6; box-shadow: 0 0 18px rgba(255, 90, 106, .35); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.banner { position: absolute; top: 30%; left: 0; right: 0; text-align: center; opacity: 0; pointer-events: none; }
.banner h2 { margin: 0; font-family: 'Cinzel'; font-weight: 800; font-size: clamp(30px, 5vw, 76px); letter-spacing: .14em; color: var(--gold-hi); text-shadow: 0 0 30px rgba(230, 189, 106, .6), 0 4px 0 #000; }
.banner p { margin: .2em 0 0; font-size: clamp(14px, 1.6vw, 24px); color: #e6dcff; text-shadow: 0 2px 6px #000; }
.banner.open { animation: banner 2.6s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.3); letter-spacing: .4em; } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }

/* ---------------------------------------------------------------- Pause und Ende */
.overlay { position: absolute; inset: 0; display: none; place-items: center; background: rgba(2, 3, 6, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.overlay.open { display: grid; }
.overlay .panel { width: min(440px, 90vw); text-align: center; animation: toastIn .3s ease-out; }
.overlay .hint { color: var(--muted); font-size: .85em; font-weight: 500; }
.end .stars { font-size: 3.4em; color: var(--gold); letter-spacing: .15em; text-shadow: 0 0 24px rgba(230, 189, 106, .7); margin-bottom: .2em; }
.end.lost h2 { color: #ffb3bd; }
.stats { width: 100%; margin: .5em 0 1em; border-collapse: collapse; }
.stats td { padding: .3em 0; border-bottom: 1px solid rgba(255, 255, 255, .07); text-align: left; }
.stats td:last-child { text-align: right; color: #bff8ff; }

/* ---------------------------------------------------------------- Handy */
#rotate { position: fixed; inset: 0; z-index: 200; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6vh; padding: 8vw; text-align: center; background: linear-gradient(rgba(4, 4, 10, .72), rgba(4, 4, 10, .9)), var(--keyart, none) 70% center / cover, #050508; }
#rotate p { margin: 0; font-family: 'Cinzel'; font-weight: 700; font-size: 5vw; letter-spacing: .06em; color: var(--gold-hi); text-shadow: 0 2px 8px #000; }
.rot-logo { width: 80vw; height: 26vw; background: var(--logo, none) center / contain no-repeat; }
.rot-phone { width: 30vw; height: 30vw; background: var(--rotate, none) center / contain no-repeat; display: grid; place-items: center; }
:root:not(.has-rotate) .rot-phone i { width: 12vw; height: 21vw; border: .9vw solid var(--gold); border-radius: 2.4vw; box-shadow: 0 0 4vw rgba(111, 242, 255, .5), inset 0 0 3vw rgba(111, 242, 255, .35); animation: rot 2.4s ease-in-out infinite; }
@keyframes rot { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }
.rb.armed { border-color: var(--aether); box-shadow: 0 0 20px rgba(111, 242, 255, .7); transform: translate(var(--x), var(--y)) scale(1.12); z-index: 3; }

/* Handy quer: alles kompakter, Werte als schmale Leiste unten in der Mitte */
@media (max-height: 520px) {
  .res { padding: .2em .7em .2em .35em; }
  .res b { font-size: 1.2em; }
  .res span { display: none; }
  .hud-top { top: .6em; gap: .4em; }
  .hud-right { top: .6em; }
  .btn-round { width: 2.6em; height: 2.6em; }
  .hero-card { padding: .25em; border-radius: 999px; }
  .hero-info { min-width: 3.2em; }
  .hero-info b, .hero-info span { display: none; }
  .portrait { width: 3.6em; height: 3.6em; }
  .hud-powers { bottom: .6em; gap: .4em; }
  .power { width: 4em; height: 4em; }
  .hud-bottom { bottom: .6em; }
  .infobox { left: 50%; right: auto; bottom: .5em; transform: translateX(-50%); width: min(30em, 62vw); padding: .45em .8em; }
  .infobox h3 { font-size: 1.05em; margin: 0; display: inline; }
  .infobox p { display: none; }
  .infobox table { display: flex; flex-wrap: wrap; gap: .1em .9em; margin-top: .2em; }
  .infobox tbody { display: contents; }
  .infobox tr { display: flex; gap: .35em; }
  .infobox td { border: 0; padding: 0; }
  .infobox td:first-child { color: var(--muted); }
  .infobox .price { display: inline; margin: 0 0 0 .8em; font-size: 1em; }
  .toasts { top: 4.2em; }
  .aimhint { top: 3.6em; }
  .banner h2 { font-size: 2.6em; }
  .wave-call { width: 4.4em; height: 4.4em; margin: -2.2em 0 0 -2.2em; }
  .wave-preview { font-size: .9em; }
  .panel { padding: 1em 1.4em; }
  .panel h2 { margin-bottom: .4em; font-size: 1.4em; }
  .btn { padding: .5em 1.2em; margin: .3em 0; }
  .map-list { max-height: 52vh; }
  .menu-inner { width: min(380px, 46vw); }
  .tagline { margin: .4em 0 1em; }
}
@media (pointer: coarse) {
  :root { --ui: clamp(10px, min(1.6vw, 2.6vh), 16px); }
  .rb { width: 5.2em; height: 5.2em; margin: -2.6em; }
  kbd { display: none; }
}

/* ---------------------------------------------------------------- Mehrspieler */
.mp-panel { position: absolute; top: 5.4em; right: calc(1.2vw + var(--safe-r)); display: grid; gap: .5em; justify-items: end; }
.mp-peer { padding: .4em .9em; background: rgba(40, 10, 60, .85); border: 1px solid rgba(192, 112, 255, .6); border-radius: 999px; }
.mp-peer b { font-family: 'Cinzel'; color: #f0d8ff; margin-right: .6em; }
.mp-send { display: grid; grid-template-columns: auto; gap: 1em; }
.tribute { position: relative; width: 3.8em; height: 3.8em; border-radius: 10px; border: 1px solid rgba(192, 112, 255, .7); background: radial-gradient(circle at 50% 35%, #3a1a50, #10061a); pointer-events: auto; }
.tribute img { width: 80%; height: 70%; object-fit: contain; }
.tribute b { position: absolute; top: .1em; right: .3em; font-size: .75em; }
.tribute .cost { position: absolute; bottom: -.8em; left: 50%; transform: translateX(-50%); padding: 0 .4em; border-radius: 999px; background: #1a1206; border: 1px solid var(--gold); color: #ffe08a; font-size: .75em; }
.tribute.poor { filter: grayscale(.9) brightness(.6); }
.lobby { width: min(560px, 92vw); }
.lobby label { display: block; margin: .6em 0 .2em; color: var(--muted); }
.lobby input { width: 100%; padding: .6em .8em; font: inherit; font-size: 1.1em; color: var(--ink); background: rgba(0, 0, 0, .4); border: 1px solid rgba(230, 189, 106, .5); border-radius: 4px; user-select: text; -webkit-user-select: text; }
.lobby .row { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }
.lobby .code { font-family: 'Cinzel'; font-size: 3em; letter-spacing: .3em; text-align: center; color: var(--aether); text-shadow: 0 0 20px rgba(111, 242, 255, .5); margin: .2em 0; user-select: text; -webkit-user-select: text; }
.lobby ul { list-style: none; padding: 0; margin: .6em 0; }
.lobby li { padding: .4em .6em; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.lobby .err { color: #ffb3bd; min-height: 1.2em; }
.lobby p { color: #d7ccb4; font-weight: 500; }
.map-card.locked { opacity: .45; cursor: not-allowed; filter: grayscale(.7); }
.map-list { max-height: 60vh; overflow-y: auto; }


/* ---------------------------------------------------------------- Gemalte Oberfläche (ChatGPT-Bogen) */
.uikit .btn { position: relative; height: 3.3em; padding: 0 1.2em; display: flex; align-items: center; justify-content: center; background: none; border-style: solid; border-width: 0 2.4em; border-image: var(--ui-btn) 0 72 fill / 0 2.4em stretch; border-radius: 0; box-shadow: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); color: #f6ead0; text-shadow: 0 2px 3px #000; }
.uikit .btn.primary { border-image-source: var(--ui-btn-gold); color: #241505; text-shadow: 0 1px 0 rgba(255, 240, 200, .6); }
.uikit .btn:hover { transform: translateY(-1px) scale(1.01); filter: drop-shadow(0 0 12px rgba(111, 242, 255, .45)) drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.uikit .menu-buttons .btn { justify-content: flex-start; }
.uikit .panel { background: none; border-style: solid; border-width: 3.2em 3.4em; border-image: var(--ui-panel) 66 70 fill / 3.2em 3.4em stretch; border-radius: 0; padding: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .7)); }
.uikit .panel::before { display: none; }
.uikit .panel h2 { margin-top: -.6em; }
.uikit .infobox, .uikit .wave-preview { background: none; border-style: solid; border-width: 1.6em 1.7em; border-image: var(--ui-panel) 66 70 fill / 1.6em 1.7em stretch; border-radius: 0; padding: 0; box-shadow: none; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .7)); }
.uikit .rb, .uikit .btn-round, .uikit .wave-call { border: none; background: radial-gradient(circle, #1a1d2a 0 56%, transparent 58%); box-shadow: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .7)); }
.uikit .rb::before, .uikit .btn-round::before, .uikit .wave-call::before { content: ''; position: absolute; inset: -14%; background: var(--ui-ring) center / contain no-repeat; pointer-events: none; z-index: 2; }
.uikit .rb.armed::before, .uikit .rb:hover::before { filter: brightness(1.3) drop-shadow(0 0 8px rgba(111, 242, 255, .9)); }
.uikit .rb img { width: 70%; height: 70%; position: relative; z-index: 1; }
.uikit .rb .cost, .uikit .rb .lbl, .uikit .rb kbd { z-index: 3; }
.uikit .wave-call .wc-ring { inset: 6%; }
.uikit .ri { display: block; width: 1.9em; height: 1.9em; background: center / contain no-repeat; }
.uikit .ri::before { content: none; }
.uikit .ri-up { background-image: var(--ico-up); }
.uikit .ri-sell { background-image: var(--ico-sell); }
.uikit .ri-target { background-image: var(--ico-target); }
.uikit .ri-rally { background-image: var(--ico-rally); }
.uikit .ri-fuse { background-image: var(--ico-fuse); width: 2.4em; }
.uikit .ri-spec-a, .uikit .ri-spec-b { background: none; width: auto; height: auto; font-size: 1.9em; }
.uikit .ri-spec-a::before { content: 'Ⅰ'; }
.uikit .ri-spec-b::before { content: 'Ⅱ'; }
.uikit #h-pause { color: transparent; }
.uikit #h-pause::after { content: ''; position: absolute; inset: 26%; background: var(--ico-pause) center / contain no-repeat; }
.uikit .btn-round { position: relative; }
.uikit .ico-core { background: var(--ico-core) center / contain no-repeat; box-shadow: none; clip-path: none; filter: drop-shadow(0 0 4px rgba(111, 242, 255, .7)); }
.uikit .ico-gold { background: var(--ico-coin) center / contain no-repeat; box-shadow: none; }
.uikit .res { background: linear-gradient(180deg, rgba(26, 24, 30, .92), rgba(10, 9, 14, .9)); border: 2px solid #b8893d; box-shadow: inset 0 0 0 1px rgba(255, 230, 160, .25), 0 4px 12px rgba(0, 0, 0, .6); }
.uikit .map-card { border: 2px solid #b8893d; background: linear-gradient(180deg, rgba(36, 34, 44, .85), rgba(12, 12, 18, .85)); box-shadow: inset 0 0 0 1px rgba(255, 230, 160, .2); }

.btn-round.sound { position: absolute; top: calc(1.2vh + env(safe-area-inset-top, 0px)); right: calc(1.2vw + var(--safe-r)); font-size: 1.2em; pointer-events: auto; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: .5em; }
.btn.small { font-size: .85em; }


/* ---------------------------------------------------------------- Fenster: Kopf, scrollbarer Inhalt, feste Knopfleiste */
#menu { font-size: clamp(12px, min(1.15vw, 3.2vh), 17px); }
.maps .panel, .overlay .panel { display: flex; flex-direction: column; max-height: calc(100dvh - 1.2em); }
.panel h2 { flex: none; }
.panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #b8893d transparent; }
.panel-actions { flex: none; margin-top: .5em; }
.panel-actions.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: .5em; }
.panel-actions .btn { margin: 0; }
.map-list { max-height: none; }
.help .credit { list-style: none; margin-top: .8em; color: var(--muted); font-size: .9em; }
.lobby .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4em; align-items: start; }
.lobby .col { display: grid; gap: .45em; min-width: 0; }
.lobby .col .btn { margin: 0; }
.lobby label { margin: 0; }
.lobby p { margin: .2em 0; line-height: 1.35; font-size: .95em; }
.lobby .code { font-size: 2.6em; letter-spacing: .22em; }
.btn[disabled] { opacity: .55; filter: grayscale(.6); cursor: default; }
.btn-round.sound { font-size: 1.1em; line-height: 1; }
.uikit .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Handy quer: schmalere Rahmen, kompaktere Knöpfe, keine Tastaturhinweise */
@media (max-height: 520px) {
  .maps .panel, .overlay .panel { max-height: calc(100dvh - .8em); }
  .maps-panel, .help { width: min(560px, 80vw); }
  .lobby { width: min(620px, 94vw); }
  .overlay .panel { width: min(400px, 72vw); }
  .uikit .panel { border-width: 2.1em 2.3em; border-image-width: 2.1em 2.3em; }
  .uikit .panel h2 { margin: -.9em 0 .3em; font-size: 1.35em; }
  .uikit .btn { height: 2.7em; border-width: 0 1.7em; border-image-width: 0 1.7em; padding: 0 .4em; font-size: .95em; }
  .lobby input { padding: .45em .6em; font-size: 1em; }
  .lobby .code { font-size: 2.1em; }
  .help ul { line-height: 1.35; font-size: .95em; }
  .help li { margin-bottom: .35em; }
  .map-card { padding: .6em .9em; }
  .map-card b { font-size: 1.05em; }
  .end .stars { font-size: 2.2em; }
  .stats { margin: .2em 0 .5em; font-size: .92em; }
  .stats td { padding: .15em 0; }
  .toggles { gap: .4em; }
}
@media (pointer: coarse) { .overlay .hint { display: none; } }


/* ---------------------------------------------------------------- Schwierigkeit und Ätherschmiede */
.map-card { cursor: default; }
.diffs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: .45em; margin-top: .45em; }
.diff { display: grid; gap: .1em; justify-items: center; padding: .4em .3em; border-radius: 6px; border: 1px solid rgba(230, 189, 106, .55); background: linear-gradient(180deg, rgba(44, 40, 52, .95), rgba(14, 14, 20, .95)); font-family: 'Cinzel'; font-weight: 700; }
.diff em { font-style: normal; font-size: .9em; }
.diff i { font-style: normal; color: var(--gold); letter-spacing: .08em; }
.diff:hover:not([disabled]) { border-color: var(--gold-hi); box-shadow: 0 0 12px rgba(230, 189, 106, .4); }
.diff[disabled] { opacity: .4; }
.diff-veteran { border-color: rgba(120, 200, 255, .6); }
.diff-albtraum { border-color: rgba(255, 90, 140, .6); }
.forge { width: min(860px, 94vw); }
.forge-stars { text-align: center; margin: -.2em 0 .5em; color: var(--gold-hi); font-family: 'Cinzel'; font-weight: 700; }
.perk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: .5em; padding: .1em; }
.perk { position: relative; display: grid; grid-template-columns: 3em 1fr; grid-template-rows: auto auto auto; column-gap: .6em; text-align: left; padding: .5em .6em; border-radius: 6px; border: 1px solid rgba(230, 189, 106, .5); background: linear-gradient(180deg, rgba(40, 38, 48, .95), rgba(12, 12, 18, .95)); }
.perk img { grid-row: 1 / 4; width: 3em; height: 3em; object-fit: contain; border-radius: 50%; }
.perk b { font-family: 'Cinzel'; color: var(--gold-hi); font-size: .95em; }
.perk span { color: #cfc5ae; font-weight: 500; font-size: .82em; line-height: 1.25; }
.perk .pips { display: flex; gap: .25em; margin-top: .25em; }
.perk .pips u { width: .9em; height: .35em; border-radius: 2px; background: rgba(255, 255, 255, .15); text-decoration: none; }
.perk .pips u.on { background: var(--aether); box-shadow: 0 0 6px var(--aether); }
.perk em { position: absolute; top: .45em; right: .6em; font-style: normal; color: #ffe08a; font-weight: 700; }
.perk.poor em { color: var(--danger); }
.perk.max { border-color: var(--aether); }
.perk:hover:not(.max) { border-color: var(--gold-hi); }
@media (max-height: 520px) {
  .perk-grid { grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); }
  .perk span { display: none; }
  .forge-stars { margin: -.4em 0 .3em; }
}


/* ---------------------------------------------------------------- Geführte erste Wellen */
.tut { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 5; }
.tut.open { display: block; }
.tut-ping { position: absolute; left: var(--px); top: var(--py); width: 3.4em; height: 3.4em; margin: -1.7em; border-radius: 50%; border: 3px solid var(--aether); box-shadow: 0 0 18px var(--aether), inset 0 0 12px rgba(111, 242, 255, .5); animation: ping 1.2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.tut-box { position: absolute; left: var(--bx); top: calc(var(--py) - 2.6em); transform: translateY(-100%); max-width: min(22em, 70vw); padding: .6em .9em; border-radius: 8px; background: rgba(8, 26, 32, .94); border: 1px solid var(--aether); color: #e8fbff; font-weight: 600; line-height: 1.3; box-shadow: 0 0 20px rgba(111, 242, 255, .35); }
.tut.below .tut-box { top: calc(var(--py) + 2.6em); transform: none; }
.tut-box small { display: block; margin-top: .25em; color: var(--muted); font-size: .8em; }


/* ---------------------------------------------------------------- Archiv und Erfolge */
.archive { width: min(900px, 94vw); }
.tabs { display: flex; gap: .4em; justify-content: center; margin-bottom: .5em; flex: none; flex-wrap: wrap; }
.tab { padding: .35em 1em; border-radius: 999px; border: 1px solid rgba(230, 189, 106, .5); background: rgba(0, 0, 0, .35); font-family: 'Cinzel'; font-weight: 700; color: var(--muted); }
.tab.on { color: #1c1206; background: linear-gradient(180deg, #ffe7a6, #c8902f); border-color: #ffe3a0; }
.arch-sum { text-align: center; margin: 0 0 .5em; color: var(--gold-hi); }
.ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(16em, 1fr)); gap: .45em; }
.ach { position: relative; display: grid; grid-template-columns: 2.4em 1fr; column-gap: .6em; padding: .5em .6em; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(10, 10, 16, .7); opacity: .75; }
.ach.done { opacity: 1; border-color: rgba(230, 189, 106, .7); background: linear-gradient(180deg, rgba(60, 46, 20, .7), rgba(16, 12, 6, .8)); }
.ach-ico { grid-row: 1 / 5; width: 2.4em; height: 2.4em; background: var(--ico-star, none) center / contain no-repeat; filter: grayscale(1) brightness(.5); }
.ach.done .ach-ico { filter: drop-shadow(0 0 6px rgba(255, 210, 120, .7)); }
.ach b { font-family: 'Cinzel'; color: var(--gold-hi); font-size: .92em; }
.ach span { font-weight: 500; font-size: .82em; color: #cfc5ae; line-height: 1.25; }
.ach .bar { display: block; height: .35em; margin-top: .3em; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.ach .bar u { display: block; height: 100%; background: var(--aether); }
.ach small { color: var(--muted); font-size: .75em; }
.lex { display: grid; grid-template-columns: repeat(auto-fill, minmax(14em, 1fr)); gap: .45em; }
.lex-card { display: grid; grid-template-columns: 4em 1fr; column-gap: .6em; align-items: start; padding: .5em .6em; border-radius: 6px; border: 1px solid rgba(230, 189, 106, .4); background: rgba(10, 10, 16, .7); }
.lex-card img { grid-row: 1 / 6; width: 4em; height: 4em; object-fit: contain; }
.lex-card b { font-family: 'Cinzel'; color: var(--gold-hi); }
.lex-card span { font-size: .8em; font-weight: 500; color: #cfc5ae; line-height: 1.3; }
.lex-card.unseen img { filter: brightness(0) drop-shadow(0 0 2px rgba(192, 112, 255, .8)); }
.ach-toast { border-color: var(--gold); background: linear-gradient(180deg, rgba(70, 52, 18, .95), rgba(20, 14, 6, .95)); box-shadow: 0 0 22px rgba(230, 189, 106, .5); }
.ach-toast b { color: var(--gold-hi); font-family: 'Cinzel'; margin-right: .4em; }
.new-foe { display: flex; align-items: center; gap: .6em; border-color: var(--void); }
.new-foe img { width: 2.6em; height: 2.6em; object-fit: contain; }
.new-foe b { color: #f0d8ff; font-family: 'Cinzel'; margin-right: .4em; }
@media (max-height: 520px) {
  .ach span { font-size: .78em; }
  .lex-card span:nth-of-type(n+3) { display: none; }
  .lex-card img { width: 3em; height: 3em; }
  .lex-card { grid-template-columns: 3em 1fr; }
}


/* ---------------------------------------------------------------- Tageswelle */
.daily { width: min(860px, 94vw); }
.daily-day { font-family: 'Cinzel'; font-weight: 700; color: var(--gold-hi); margin: 0; }
.mods { margin: .3em 0; padding-left: 1.1em; color: #ffd0e8; line-height: 1.35; }
.daily-me { color: var(--aether); }
.board { width: 100%; border-collapse: collapse; font-size: .92em; }
.board th { text-align: left; color: var(--muted); font-weight: 600; padding: .2em .3em; border-bottom: 1px solid rgba(230, 189, 106, .4); }
.board td { padding: .25em .3em; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.board tr.me td { color: var(--aether); font-weight: 700; }
.rb.banned { filter: grayscale(1) brightness(.45); pointer-events: none; }
.rb.banned::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--danger); font-size: 2em; z-index: 4; }
