/* Rollstuhl Rally – Comic-Design: dicke Tusche-Konturen, harte Schatten, kräftige Farben */
:root {
  --ink: #1d1a3a;
  --ink-2: #3a3566;
  --paper: #fffaf0;
  --paper-2: #fff1d6;
  --card: #ffffff;
  --muted: #6b6690;
  --sun: #ffc93c;
  --sun-d: #f29e02;
  --coral: #ff6b6b;
  --coral-d: #e5484d;
  --mint: #2ec4a0;
  --mint-d: #12a07f;
  --sky: #4cc9f0;
  --grape: #8b5cf6;
  --grape-d: #6d3fe0;
  --berry: #ff4f8b;
  --text: #1d1a3a;
  --radius: 22px;
  --bw: 3px;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Lilita One', 'Nunito', system-ui, sans-serif;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b2754; color: var(--text); font-family: var(--font); font-weight: 600; -webkit-tap-highlight-color: transparent; }
body { user-select: none; -webkit-user-select: none; touch-action: none; }
canvas#game { position: fixed; inset: 0; display: block; }
[hidden] { display: none !important; }
button { font-family: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
kbd { font-family: inherit; font-weight: 800; background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-bottom-width: 3px; border-radius: 7px; padding: 0 6px; font-size: 0.82em; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; cursor: pointer; color: var(--ink);
  background: var(--card); border: var(--bw) solid var(--ink);
  padding: 11px 18px; border-radius: 16px; font-size: 1.02rem; font-weight: 800;
  box-shadow: 0 5px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: 0 3px 0 var(--ink); }
.btn-primary { background: var(--sun); }
.btn-primary:hover { background: #ffd666; }
.btn-danger { background: var(--coral); color: #fff; }
.btn-danger:hover { background: #ff8585; }
.btn-green { background: var(--mint); color: #fff; }
.btn-green:hover { background: #45d4b0; }
.btn-xl { font-family: var(--display); font-weight: 400; font-size: 1.9rem; letter-spacing: 0.02em; padding: 14px 34px; border-radius: 22px; width: 100%; box-shadow: 0 7px 0 var(--ink); }
.btn-xl:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--ink); }
.btn-sm { padding: 7px 12px; font-size: 0.9rem; border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
.btn-block { width: 100%; }
.btn-back { width: 46px; height: 46px; padding: 0; font-size: 1.9rem; line-height: 1; display: grid; place-items: center; font-family: var(--display); background: var(--sun); }
.btn-icon { width: 48px; height: 48px; padding: 0; display: grid; place-items: center; background: var(--card); }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.btn-col { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.play-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; position: relative; overflow: hidden; }
.play-btn svg { width: 28px; height: 28px; }
.play-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.55) 45%, transparent 60%); transform: translateX(-100%); animation: shine 3.2s ease-in-out infinite; pointer-events: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: 12px max(16px, var(--safe-r)) 0 max(16px, var(--safe-l)); pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.coins-chip, .points-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: var(--bw) solid var(--ink); padding: 5px 14px 5px 7px; border-radius: 999px; font-weight: 900; font-size: 1.08rem; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-sm); }
.coin-icon { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 32%, #fff6b3 0 18%, #ffd43b 19% 58%, #f59f00 60%); border: 2.5px solid var(--ink); flex: none; position: relative; display: inline-block; }
.coin-icon::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid rgba(160,90,0,0.45); }
.star-icon { width: 24px; height: 24px; flex: none; display: inline-block; 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 1.8l3.1 6.4 7 1-5.1 4.9 1.2 7L12 17.8l-6.2 3.3 1.2-7L1.9 9.2l7-1z' fill='%23ff4f8b' stroke='%231d1a3a' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.account-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: var(--bw) solid var(--ink); color: var(--ink); padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: var(--shadow-sm); }
.account-chip:hover { background: var(--paper-2); }
.account-chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #b8b4d6; border: 2px solid var(--ink); }
.dot.on { background: var(--mint); }

/* ---------- Screens ---------- */
.screen { position: fixed; inset: 0; z-index: 10; display: none; overflow-y: auto; padding: 76px 16px calc(28px + var(--safe-b)); }
.screen.active { display: flex; justify-content: center; align-items: flex-start; }
.screen:not(#screen-menu).active { background: radial-gradient(rgba(29,26,58,0.18) 1.4px, transparent 1.6px) 0 0 / 14px 14px, rgba(29,26,58,0.35); }
#screen-menu.active { align-items: safe center; }

/* Hauptmenü */
.menu-layout { width: min(1040px, 100%); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 34px; align-items: center; }
.menu-hero { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.logo { margin: 0 0 4px; position: relative; display: flex; flex-direction: column; line-height: 0.92; font-size: clamp(3rem, 8vw, 5.4rem); }
.logo > span { color: #fff; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; text-shadow: 4px 5px 0 var(--ink); width: max-content; }
.logo .logo-2 { color: var(--sun); transform: rotate(-4deg) translateX(16px); transform-origin: left; }
.logo .burst { position: absolute; right: 2%; top: -8%; width: clamp(92px, 14vw, 128px); aspect-ratio: 1; background: var(--berry); clip-path: polygon(50% 0%, 61% 18%, 82% 10%, 80% 32%, 100% 40%, 84% 55%, 96% 76%, 74% 76%, 68% 100%, 50% 86%, 32% 100%, 26% 76%, 4% 76%, 16% 55%, 0% 40%, 20% 32%, 18% 10%, 39% 18%); display: grid; place-items: center; animation: wobble 4s ease-in-out infinite; -webkit-text-stroke: 0; text-shadow: none; }
.logo .burst i { font-style: normal; font-size: clamp(0.8rem, 1.5vw, 1.05rem); color: #fff; text-shadow: 2px 2px 0 var(--ink); text-align: center; line-height: 1.05; -webkit-text-stroke: 0; }
.tagline { margin: 0; font-size: 1.15rem; font-weight: 800; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.menu-current { display: flex; gap: 14px; align-items: center; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); }
.menu-preview { width: 140px; height: 104px; flex: none; background: radial-gradient(ellipse at 50% 80%, #ffe7a8 0 42%, transparent 44%); }
.menu-current-info { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; text-align: left; font-size: 1rem; }
.menu-current-info .label { color: var(--muted); font-weight: 700; }
.menu-current-info .value { font-weight: 900; }
.menu-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 20px; border: var(--bw) solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; font-family: inherit; min-height: 84px; }
.tile:hover { transform: translate(-2px, -2px) rotate(-0.6deg); box-shadow: 8px 8px 0 var(--ink); }
.tile:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.tile:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.tile-ico { width: 52px; height: 52px; border-radius: 16px; border: var(--bw) solid var(--ink); display: grid; place-items: center; flex: none; color: var(--ink); }
.tile-ico svg { width: 28px; height: 28px; }
.tile-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tile-txt b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; letter-spacing: 0.01em; overflow-wrap: anywhere; hyphens: auto; }
.tile-txt small { color: var(--muted); font-weight: 700; font-size: 0.82rem; line-height: 1.2; }
.t-challenges .tile-ico { background: var(--grape); color: #fff; }
.t-medals .tile-ico { background: var(--sun); }
.t-garage .tile-ico { background: var(--sky); }
.t-maps .tile-ico { background: var(--mint); color: #fff; }
.t-lb .tile-ico { background: var(--berry); color: #fff; }
.t-settings .tile-ico { background: #d9d5f2; }
.hint { color: #fff; font-size: 0.88rem; margin: 2px 0 0; text-shadow: 1px 1px 0 var(--ink); font-weight: 700; }

/* Panels */
.panel { position: relative; width: min(760px, 100%); background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 26px; padding: 18px; box-shadow: 8px 8px 0 var(--ink); }
.panel::before { content: ''; position: absolute; right: 18px; top: 14px; width: 120px; height: 60px; background: radial-gradient(rgba(29,26,58,0.12) 1.6px, transparent 1.8px) 0 0 / 9px 9px; border-radius: 12px; pointer-events: none; }
.panel.wide { width: min(1100px, 100%); }
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; position: relative; z-index: 1; }
.panel-head h2 { margin: 0; font-size: 2.1rem; background: linear-gradient(transparent 58%, rgba(255,201,60,0.85) 58%, rgba(255,201,60,0.85) 92%, transparent 92%); padding: 0 6px; }

/* ---------- Garage ---------- */
.garage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; }
.chair-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.chair-card { position: relative; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 18px; padding: 8px; cursor: pointer; text-align: center; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .12s; }
.chair-card:hover { transform: translateY(-2px) rotate(-0.8deg); }
.chair-card.selected { background: #fff2c2; box-shadow: 5px 5px 0 var(--ink); }
.chair-card canvas { width: 100%; height: 88px; display: block; border-radius: 12px; }
.chair-card .name { font-family: var(--display); font-size: 1.05rem; }
.chair-card .price { display: inline-flex; align-items: center; gap: 5px; font-size: 0.92rem; font-weight: 900; }
.chair-card .price .coin-icon { width: 17px; height: 17px; border-width: 2px; }
.chair-card .price .coin-icon::after, .upg .btn .coin-icon::after, .lock .coin-icon::after, .ch .reward .coin-icon::after, .ch-bonus .coin-icon::after { display: none; }
.chair-card.locked canvas { filter: grayscale(0.9) contrast(0.8) brightness(1.05); opacity: 0.7; }
.badge { position: absolute; top: 6px; right: 6px; font-size: 0.72rem; font-weight: 900; background: var(--mint); color: #fff; padding: 2px 9px; border-radius: 999px; border: 2px solid var(--ink); }
.badge.el { background: var(--sky); color: var(--ink); left: 6px; right: auto; }
.chair-detail { background: var(--card); border: var(--bw) solid var(--ink); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); }
.chair-detail h3 { margin: 0; font-size: 1.8rem; }
.chair-detail .desc { margin: 0; color: var(--ink-2); font-weight: 700; }
.detail-preview { width: 100%; height: 160px; border-radius: 16px; background: radial-gradient(ellipse at 50% 115%, #ffe7a8 0 46%, #fff7e3 47% 100%); border: 2px dashed rgba(29,26,58,0.25); }
.stat { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; font-size: 0.95rem; font-weight: 800; }
.stat .bar { height: 14px; background: #ece9fb; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--sky) 0 8px, #6fd6f5 8px 16px); border-right: 2px solid var(--ink); transition: width .3s; }
.upgrades { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.upg { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.upg .title { font-family: var(--display); font-size: 1.08rem; display: flex; justify-content: space-between; align-items: baseline; }
.upg .lvl { color: var(--muted); font-family: var(--font); font-weight: 800; font-size: 0.82rem; }
.upg .pips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.upg .pips i { height: 9px; border-radius: 4px; background: #e6e2f7; border: 1.5px solid rgba(29,26,58,0.35); }
.upg .pips i.on { background: var(--sun); border-color: var(--ink); }
.upg .small { font-size: 0.8rem; color: var(--ink-2); min-height: 2.2em; font-weight: 700; }
.upg .btn { padding: 7px; font-size: 0.95rem; display: inline-flex; gap: 6px; justify-content: center; align-items: center; }
.upg .btn .coin-icon { width: 18px; height: 18px; border-width: 2px; }
.upg.builtin { opacity: 0.75; }
.upg-btns { display: flex; gap: 6px; }
.upg-btns .btn { flex: 1; }
.btn.mount { flex: 0 0 auto; background: #e6e2f7; }
.btn.mount.on { background: var(--mint); color: #fff; }

/* ---------- Strecken ---------- */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.map-card { position: relative; border-radius: 20px; overflow: hidden; border: var(--bw) solid var(--ink); background: var(--card); cursor: pointer; color: var(--ink); text-align: left; padding: 0; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
.map-card:hover { transform: translate(-2px, -2px) rotate(0.6deg); box-shadow: 6px 6px 0 var(--ink); }
.map-card.selected { background: #fff2c2; box-shadow: 6px 6px 0 var(--ink); }
.map-card canvas { width: 100%; height: 124px; display: block; border-bottom: var(--bw) solid var(--ink); }
.map-card .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.map-card .name { font-family: var(--display); font-size: 1.35rem; }
.map-card .desc { font-size: 0.88rem; color: var(--ink-2); font-weight: 700; }
.map-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.92rem; margin-top: 4px; font-weight: 800; }
.map-card.locked canvas { filter: grayscale(0.85) brightness(0.9); }
.lock { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; }
.lock .coin-icon { width: 18px; height: 18px; border-width: 2px; }
.map-medal { position: absolute; top: 8px; right: 8px; filter: drop-shadow(2px 2px 0 var(--ink)); }
.feats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.feats span { font-size: 0.72rem; background: var(--paper-2); border: 1.5px solid var(--ink); padding: 1px 8px; border-radius: 99px; font-weight: 800; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 8px 2px; margin-bottom: 12px; scrollbar-width: thin; }
.tab { flex: none; background: var(--card); color: var(--ink); border: 2.5px solid var(--ink); padding: 7px 14px; border-radius: 999px; font-size: 0.95rem; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.tab:hover { background: var(--paper-2); }
.tab.active { background: var(--ink); color: #fff; }
.tabs.small .tab { flex: 1; }
.small-tabs { margin-top: -4px; }
.seg { display: inline-flex; border: var(--bw) solid var(--ink); border-radius: 14px; overflow: hidden; margin-bottom: 12px; box-shadow: 0 4px 0 var(--ink); }
.seg-btn { border: 0; background: var(--card); color: var(--ink); font-weight: 900; padding: 8px 16px; cursor: pointer; font-size: 0.98rem; }
.seg-btn + .seg-btn { border-left: var(--bw) solid var(--ink); }
.seg-btn.active { background: var(--sun); }

/* ---------- Bestenliste ---------- */
.lb-body { min-height: 200px; }
.lb-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-variant-numeric: tabular-nums; }
.lb-table th { text-align: left; font-weight: 800; color: var(--muted); font-size: 0.8rem; padding: 2px 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.lb-table td { padding: 9px 10px; background: var(--card); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font-weight: 800; }
.lb-table td:first-child { border-left: 2px solid var(--ink); border-radius: 12px 0 0 12px; }
.lb-table td:last-child { border-right: 2px solid var(--ink); border-radius: 0 12px 12px 0; }
.lb-table td.num { text-align: right; font-weight: 900; }
.lb-table tr.me td { background: #fff2c2; }
.rank { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #ece9fb; border: 2px solid var(--ink); font-weight: 900; font-size: 0.9rem; }
.rank.r1 { background: var(--sun); }
.rank.r2 { background: #dfe6ee; }
.rank.r3 { background: #f0a868; }
.lb-empty { text-align: center; color: var(--ink-2); padding: 40px 10px; font-weight: 700; }
.lb-me { margin-top: 10px; font-size: 0.98rem; font-weight: 700; }

/* ---------- Einstellungen ---------- */
.settings h3 { margin: 20px 0 6px; font-size: 1.25rem; color: var(--grape-d); }
.settings h3:first-child { margin-top: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 2px dashed rgba(29,26,58,0.15); font-size: 1.02rem; font-weight: 700; }
input[type=range] { width: min(240px, 50vw); accent-color: var(--grape); }
select { font-family: inherit; font-weight: 800; font-size: 1rem; background: var(--card); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 12px; padding: 7px 10px; }
.toggle { appearance: none; width: 54px; height: 30px; border-radius: 99px; background: #d9d5f2; border: 2.5px solid var(--ink); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: transform .2s; box-sizing: border-box; }
.toggle:checked { background: var(--mint); }
.toggle:checked::after { transform: translateX(24px); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--ink); cursor: pointer; padding: 0; }
.swatch.active { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.swatch.auto { background: conic-gradient(#ff6b6b, #ffc93c, #2ec4a0, #4cc9f0, #8b5cf6, #ff6b6b); }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(rgba(255,255,255,0.08) 1.4px, transparent 1.6px) 0 0 / 12px 12px, rgba(29,26,58,0.62); padding: 16px; animation: fade .15s; }
.modal-card { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 26px; padding: 24px; box-shadow: 8px 8px 0 var(--ink); animation: pop .25s cubic-bezier(.3,1.6,.6,1); }
.modal-card.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.modal-card h2 { margin: 0 0 10px; font-size: 2rem; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--card); color: var(--ink); font-size: 1.4rem; font-weight: 900; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 0.92rem; font-weight: 800; }
.field input { font-family: inherit; font-weight: 700; font-size: 1.05rem; padding: 11px 12px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--card); color: var(--ink); user-select: text; -webkit-user-select: text; box-shadow: inset 0 3px 0 rgba(29,26,58,0.08); }
.field input:focus { outline: 3px solid var(--sky); outline-offset: 1px; }
.form-error { color: var(--coral-d); min-height: 1.2em; margin: 0 0 8px; font-size: 0.92rem; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stats-grid div { background: var(--card); border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px; }
.stats-grid b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.stats-grid span { color: var(--muted); font-size: 0.85rem; font-weight: 800; }

/* Ergebnis */
.over-reason { font-family: var(--display); font-size: 1.5rem; color: #fff; background: var(--coral); border: var(--bw) solid var(--ink); padding: 4px 18px; border-radius: 14px; transform: rotate(-2deg); box-shadow: var(--shadow-sm); text-shadow: 2px 2px 0 var(--ink); }
.over-distance { font-family: var(--display); font-size: 4rem; line-height: 1; color: #fff; -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; text-shadow: 4px 5px 0 var(--ink); }
.over-points { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; background: #ffe3ef; border: 2.5px solid var(--ink); padding: 5px 14px; border-radius: 999px; }
.over-points b { font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.over-record { background: var(--sun); color: var(--ink); font-weight: 900; padding: 4px 14px; border-radius: 99px; border: 2.5px solid var(--ink); animation: pulse 0.8s infinite alternate; }
.over-record.small-rec { padding: 0 8px; font-size: 0.8rem; }
.over-rows { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.over-rows div { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; font-weight: 800; }
.over-rows .total { font-size: 1.2rem; background: var(--sun); }
.over-rank { min-height: 1.2em; font-weight: 700; }
.over-medals, .over-challenges { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.om { display: flex; align-items: center; gap: 10px; background: #fff2c2; border: 2px solid var(--ink); border-radius: 14px; padding: 6px 10px; text-align: left; font-size: 0.9rem; animation: pop .3s ease-out; font-weight: 700; }
.om b { display: block; }
.over-challenges div { background: #ece4ff; border: 2px solid var(--ink); border-radius: 14px; padding: 8px 10px; font-size: 0.92rem; text-align: left; font-weight: 700; }
.over-challenges b { color: var(--grape-d); display: block; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px max(14px, var(--safe-r)) 0 max(14px, var(--safe-l)); }
.hud-left { display: flex; flex-direction: column; }
.hud-distance { font-family: var(--display); font-size: 2.6rem; line-height: 1; color: #fff; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 3px 4px 0 var(--ink); font-variant-numeric: tabular-nums; }
.hud-distance small { font-size: 1.2rem; }
.hud-best { font-size: 0.9rem; color: #fff; font-weight: 800; text-shadow: 1px 1px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); }
.hud-energy { display: flex; align-items: center; gap: 8px; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 999px; padding: 6px 12px; margin-top: 2px; box-shadow: var(--shadow-sm); }
.bolt { width: 14px; height: 20px; background: var(--sun); clip-path: polygon(60% 0, 0 58%, 42% 58%, 30% 100%, 100% 38%, 56% 38%); }
.hud-energy .bar { width: clamp(90px, 22vw, 220px); height: 16px; border-radius: 99px; background: #ece9fb; border: 2.5px solid var(--ink); overflow: hidden; }
.hud-energy .fill { height: 100%; width: 100%; background: repeating-linear-gradient(-45deg, #ffb703 0 8px, #ffd166 8px 16px); border-right: 2px solid var(--ink); transition: width .15s linear; }
.hud-energy .fill.el { background: repeating-linear-gradient(-45deg, #1fa7d6 0 8px, #4cc9f0 8px 16px); }
.hud-energy .fill.low { background: repeating-linear-gradient(-45deg, #e5484d 0 8px, #ff6b6b 8px 16px); animation: blink .5s infinite alternate; }
.hud-energy.regen { background: #dcfce7; }
.hud-energy.regen .elabel::after { content: ' +'; color: var(--mint-d); }
.elabel { font-size: 0.8rem; font-weight: 900; color: var(--ink); min-width: 60px; }
.bolt.battery { width: 22px; height: 13px; clip-path: none; background: var(--sky); border: 2px solid var(--ink); border-radius: 3px; position: relative; }
.bolt.battery::after { content: ''; position: absolute; right: -5px; top: 2px; width: 3px; height: 5px; background: var(--ink); border-radius: 1px; }
.bolt.stamina { width: 20px; height: 18px; clip-path: none; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath d='M13 22.5 11.3 21C5.2 15.6 1 11.9 1 7.4 1 3.8 3.8 1 7.4 1c2 0 4 .9 5.6 2.4C14.6 1.9 16.6 1 18.6 1 22.2 1 25 3.8 25 7.4c0 4.5-4.2 8.2-10.3 13.6z' fill='%23ff6b6b' stroke='%231d1a3a' stroke-width='2.2'/%3E%3C/svg%3E"); }
.hud-right { display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.points-chip .combo { background: var(--berry); color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 0 7px; font-size: 0.85rem; animation: pulse .5s infinite alternate; }
.pause-icon { width: 15px; height: 18px; border-left: 5px solid var(--ink); border-right: 5px solid var(--ink); }
.hud-fps { position: absolute; left: 14px; bottom: 8px; font-size: 0.8rem; color: #fff; font-weight: 800; text-shadow: 1px 1px 0 var(--ink); }

.touch { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 max(18px, var(--safe-r)) calc(18px + var(--safe-b)) max(18px, var(--safe-l)); }
.pedal { pointer-events: auto; width: clamp(110px, 22vw, 170px); height: clamp(110px, 26vh, 170px); border-radius: 30px; border: var(--bw) solid var(--ink); color: #fff; font-family: var(--display); font-size: 1.2rem; letter-spacing: 0.02em; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; opacity: 0.9; touch-action: none; box-shadow: 0 7px 0 var(--ink); position: relative; text-shadow: 2px 2px 0 var(--ink); }
.pedal::before { content: ''; position: absolute; top: 24%; left: 50%; width: 0; height: 0; transform: translateX(-50%); border: 18px solid transparent; filter: drop-shadow(2px 2px 0 var(--ink)); }
.pedal.brake { background: var(--coral); }
.pedal.brake::before { border-right: 26px solid #fff; border-left: 0; }
.pedal.gas { background: var(--mint); }
.pedal.gas::before { border-left: 26px solid #fff; border-right: 0; }
.pedal.down { transform: translateY(6px); box-shadow: 0 1px 0 var(--ink); opacity: 1; }
.jump-btn { pointer-events: auto; margin-left: auto; margin-right: 14px; margin-bottom: 8px; width: clamp(78px, 13vw, 106px); height: clamp(78px, 13vw, 106px); border-radius: 50%; border: var(--bw) solid var(--ink); background: var(--sun); color: var(--ink); font-family: var(--display); font-size: 1.05rem; display: grid; place-items: end center; padding-bottom: 14px; position: relative; opacity: 0.92; box-shadow: 0 6px 0 var(--ink); touch-action: none; }
.jump-btn::before { content: ''; position: absolute; top: 20%; left: 50%; transform: translateX(-50%); border: 14px solid transparent; border-bottom: 20px solid var(--ink); border-top: 0; }
.jump-btn.down { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); opacity: 1; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(40px); background: var(--paper); color: var(--ink); border: var(--bw) solid var(--ink); padding: 10px 18px; border-radius: 16px; z-index: 60; opacity: 0; transition: all .25s cubic-bezier(.3,1.5,.6,1); pointer-events: none; font-weight: 800; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-sm); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
body.ingame .toast { top: 74px; bottom: auto; transform: translateX(-50%) translateY(-20px); }
body.ingame .toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Herausforderungen ---------- */
.pill { background: var(--coral); color: #fff; font-size: 0.8rem; font-weight: 900; min-width: 26px; height: 26px; border-radius: 99px; display: inline-grid; place-items: center; padding: 0 6px; border: 2px solid var(--ink); position: absolute; top: -10px; right: -8px; animation: pulse .8s infinite alternate; }
.count { background: var(--ink); color: #fff; font-size: 0.78rem; padding: 1px 8px; border-radius: 99px; font-variant-numeric: tabular-nums; width: max-content; margin-top: 3px; font-weight: 800; }
.streak { margin-left: auto; background: #ffe6cc; color: var(--ink); border: 2.5px solid var(--ink); padding: 4px 12px; border-radius: 99px; font-weight: 900; font-size: 0.9rem; box-shadow: 0 3px 0 var(--ink); }
.ch-section { margin-bottom: 20px; }
.ch-head { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 10px; gap: 10px; }
.ch-head h3 { margin: 0; font-size: 1.45rem; }
.ch-timer { color: var(--muted); font-size: 0.88rem; white-space: nowrap; font-weight: 800; }
.ch-list { display: flex; flex-direction: column; gap: 10px; }
.ch { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.ch.done { background: #e3f9f1; }
.ch.claimed { opacity: 0.6; box-shadow: none; }
.ch .txt { font-weight: 900; }
.ch .bar { grid-column: 1; height: 12px; background: #ece9fb; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
.ch .bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--grape) 0 8px, #a98bfa 8px 16px); }
.ch.done .bar i { background: repeating-linear-gradient(-45deg, var(--mint) 0 8px, #6ee0c3 8px 16px); }
.ch .meta { grid-column: 1; font-size: 0.82rem; color: var(--muted); font-weight: 800; }
.ch .side { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ch .reward { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; }
.ch .reward .coin-icon { width: 18px; height: 18px; border-width: 2px; }
.ch .check { color: var(--mint-d); font-weight: 900; font-size: 0.9rem; }
.ch-bonus { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff2c2; border: 2.5px dashed var(--ink); border-radius: 16px; padding: 10px 14px; font-size: 0.95rem; font-weight: 800; }
.ch-bonus .chest { width: 32px; height: 26px; border-radius: 7px 7px 4px 4px; background: linear-gradient(180deg, #f08c2e 0 40%, #b85c12 40%); border: 2.5px solid var(--ink); position: relative; flex: none; }
.ch-bonus .chest::after { content: ''; position: absolute; left: 50%; top: 30%; width: 7px; height: 8px; transform: translateX(-50%); background: var(--sun); border: 1.5px solid var(--ink); border-radius: 2px; }
.ch-bonus .grow { flex: 1; }
.ch-bonus .coin-icon { width: 16px; height: 16px; border-width: 2px; vertical-align: -3px; }
.tag-el { display: inline-flex; align-items: center; gap: 4px; background: var(--sky); color: var(--ink); border: 2px solid var(--ink); padding: 1px 10px; border-radius: 99px; font-family: var(--font); font-size: 0.8rem; font-weight: 900; vertical-align: middle; margin-left: 8px; }

/* ---------- Medaillen ---------- */
.medal-summary { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; position: relative; z-index: 1; }
.ms { display: inline-flex; align-items: center; gap: 3px; font-weight: 900; }
.ms-total { color: var(--muted); font-size: 0.9rem; font-weight: 800; }
.medal-group { margin: 18px 0 10px; font-size: 1.35rem; color: var(--grape-d); }
.medal-group:first-child { margin-top: 0; }
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.medal-card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow-sm); }
.medal-card.locked .medal-icon { opacity: 0.6; filter: grayscale(0.7); }
.medal-icon { flex: none; }
.medal-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.medal-name { font-family: var(--display); font-size: 1.1rem; }
.medal-info .bar { height: 10px; background: #ece9fb; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; margin-top: 3px; }
.medal-info .bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--sun) 0 8px, #ffe08a 8px 16px); }
.medal-next { color: var(--ink-2); font-weight: 700; }
.tier { font-family: var(--font); font-size: 0.72rem; font-weight: 900; padding: 1px 8px; border-radius: 99px; vertical-align: middle; border: 2px solid var(--ink); }
.tier.t1 { background: #f0a868; }
.tier.t2 { background: #dfe6ee; }
.tier.t3 { background: var(--sun); }
.tier.t4 { background: #a5f3fc; }
.tier-pips { display: flex; gap: 4px; margin-top: 2px; }
.tier-pips i { width: 20px; height: 7px; border-radius: 4px; background: #ece9fb; border: 1.5px solid rgba(29,26,58,0.4); }
.tier-pips i.t1 { background: #f0a868; border-color: var(--ink); }
.tier-pips i.t2 { background: #dfe6ee; border-color: var(--ink); }
.tier-pips i.t3 { background: var(--sun); border-color: var(--ink); }
.tier-pips i.t4 { background: #a5f3fc; border-color: var(--ink); }

/* ---------- Animationen ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0.85) rotate(-2deg); opacity: 0; } }
@keyframes pulse { to { transform: scale(1.07); } }
@keyframes blink { to { opacity: 0.55; } }
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes wobble { 0%, 100% { transform: rotate(10deg) scale(1); } 50% { transform: rotate(4deg) scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (hover: none) { .desktop-only { display: none; } }
@media (max-width: 900px) {
  .menu-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 560px; }
  #screen-menu.active { align-items: flex-start; }
  .garage { grid-template-columns: 1fr; }
  .chair-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .chair-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upgrades { grid-template-columns: 1fr; }
  .menu-preview { width: 110px; height: 84px; }
  .hud-distance { font-size: 1.9rem; }
  .row { font-size: 0.95rem; }
  .tile { padding: 10px 8px; gap: 6px; min-height: 0; flex-direction: column; text-align: center; }
  .tile-txt { align-items: center; }
  .tile-ico { width: 44px; height: 44px; border-radius: 13px; }
  .tile-txt b { font-size: 1rem; }
  .tile-txt small { display: none; }
  .logo { font-size: 3.2rem; }
  .logo .burst { right: 0; top: 0; width: 78px; }
  .logo .burst i { font-size: 0.72rem; }
  .menu-current { padding: 8px 12px; }
  .btn-xl { font-size: 1.6rem; }
  .panel-head h2 { font-size: 1.7rem; }
  .points-chip { padding: 4px 10px 4px 6px; font-size: 0.95rem; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .screen { padding-top: 64px; }
  #screen-menu.active { align-items: flex-start; }
  .menu-layout { grid-template-columns: 1fr 1fr; gap: 18px; max-width: none; }
  .menu-hero { gap: 10px; }
  .logo { font-size: 2.7rem; }
  .logo .burst { display: none; }
  .tagline, .hint { display: none; }
  .menu-current { padding: 6px 10px; }
  .menu-preview { height: 66px; width: 92px; }
  .btn-xl { padding: 8px; font-size: 1.5rem; }
  .menu-tiles { gap: 10px; }
  .tile { min-height: 60px; padding: 8px 10px; }
  .tile-ico { width: 40px; height: 40px; }
  .tile-ico svg { width: 22px; height: 22px; }
  .tile-txt small { display: none; }
}

/* ---------- Menü: 9 Kacheln, Level, Tagesbonus ---------- */
.menu-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { flex-direction: column; text-align: center; gap: 8px; padding: 12px 8px; min-height: 0; }
.tile-txt { align-items: center; }
.tile-txt b { font-size: clamp(0.85rem, 1.1vw, 1.08rem); }
.tile-txt small { font-size: 0.74rem; }
.t-tourney .tile-ico { background: #ff8a3d; color: #fff; }
.t-driver .tile-ico { background: #ffd6e7; }
.t-friends .tile-ico { background: #b8f2e6; }
.topbar-left { display: flex; gap: 10px; align-items: center; }
.level-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 999px; padding: 5px 12px; box-shadow: var(--shadow-sm); cursor: pointer; color: var(--ink); font-family: inherit; }
.level-chip b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; white-space: nowrap; }
.level-chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.lv-bar { display: inline-block; width: 64px; height: 10px; border-radius: 99px; background: #ece9fb; border: 2px solid var(--ink); overflow: hidden; vertical-align: middle; }
.lv-bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--grape) 0 6px, #a98bfa 6px 12px); }
.lv-bar.big { width: 160px; height: 14px; }
.lv-badge { display: inline-block; background: var(--grape); color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; font-family: var(--display); font-size: 0.95rem; white-space: nowrap; }
.daily-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.daily-btn, .wheel-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.daily-btn { background: #ffe3ef; }
.wheel-btn { background: #e0f7ff; }
.daily-btn svg, .wheel-btn svg { width: 24px; height: 24px; }
.dot-new { position: absolute; top: -8px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--coral); border: 2.5px solid var(--ink); animation: pulse .7s infinite alternate; }

/* ---------- Fahrer-Editor ---------- */
.driver { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 18px; }
.driver-stage { background: radial-gradient(ellipse at 50% 110%, #ffe7a8 0 45%, #fff7e3 46% 100%); border: var(--bw) solid var(--ink); border-radius: 22px; padding: 12px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
.driver-stage canvas { width: 100%; height: 320px; }
.driver-stage p { margin: 0; text-align: center; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm); cursor: pointer; font-family: inherit; color: var(--ink); }
.item b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.item:hover { transform: translateY(-2px); }
.item.equipped { background: #e3f9f1; }
.item.locked { background: #f4f2fb; }
.it-state { font-size: 0.82rem; font-weight: 900; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.it-state.on { color: var(--mint-d); }
.it-state.buy .coin-icon { width: 16px; height: 16px; border-width: 2px; }
.it-state.buy .coin-icon::after { display: none; }
.it-state.lock { color: var(--grape-d); }
.it-color { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--ink); display: block; }
.color-grid { display: flex; flex-direction: column; }

/* ---------- Turnier ---------- */
.tourney-card { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; background: #fff1e0; border: var(--bw) solid var(--ink); border-radius: 20px; padding: 14px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.tourney-card canvas { width: 100%; height: 150px; }
.tourney-info { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.tourney-week { font-family: var(--display); font-size: 1.5rem; color: #e8590c; }
.tourney-info .btn { align-self: flex-start; margin-top: 4px; }

/* ---------- Freunde ---------- */
.friend-add { display: flex; gap: 10px; margin-bottom: 4px; }
.friend-add input { flex: 1; font-family: inherit; font-weight: 700; font-size: 1.05rem; padding: 10px 12px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--card); color: var(--ink); user-select: text; -webkit-user-select: text; min-width: 0; }
.friend-add input:focus { outline: 3px solid var(--sky); }
.friend-list { display: flex; flex-direction: column; gap: 10px; }
.friend { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow-sm); }
.friend-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.friend-info b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.name-link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: rgba(29,26,58,0.3); }
.name-link:hover { text-decoration-color: var(--sun-d); }
.inline-toggle { border: 0; padding: 0 0 8px; justify-content: flex-start; gap: 10px; font-size: 0.95rem; }

/* ---------- Profil ---------- */
.profile-card { width: min(520px, 100%); }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.profile-head h2 { margin: 0 0 4px; }
.profile-avatar { width: 130px; height: 120px; flex: none; background: radial-gradient(ellipse at 50% 100%, #ffe7a8 0 48%, #fff7e3 49%); border: 2.5px solid var(--ink); border-radius: 18px; }
.profile-lv { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.profile-medals { display: flex; gap: 16px; justify-content: center; margin: 4px 0 8px; }
.profile-table td, .profile-table th { padding: 6px 10px; }
.profile-actions { margin-top: 12px; flex-wrap: wrap; }

/* ---------- Tagesbonus & Glücksrad ---------- */
.daily-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--card); font-weight: 800; font-size: 0.85rem; }
.day b { display: inline-flex; align-items: center; gap: 3px; font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.day b .coin-icon { width: 16px; height: 16px; border-width: 2px; }
.day b .coin-icon::after { display: none; }
.day small { font-size: 0.68rem; color: var(--grape-d); text-align: center; }
.day.done { background: #e3f9f1; opacity: 0.75; }
.day.today { background: var(--sun); transform: rotate(-2deg) scale(1.05); box-shadow: var(--shadow-sm); }
.day:last-child { grid-column: span 2; background: #ffe3ef; }
.day:last-child.today { background: var(--sun); }
.wheel-wrap { position: relative; width: min(320px, 78vw); aspect-ratio: 1; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(5px 6px 0 var(--ink)); }
.wheel-pointer { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 34px solid var(--coral); filter: drop-shadow(0 3px 0 var(--ink)); }
.wheel-result { min-height: 1.4em; font-weight: 900; font-size: 1.05rem; margin: 0; }
#wheelSpin { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#wheelSpin .coin-icon { width: 18px; height: 18px; border-width: 2px; }
#wheelSpin .coin-icon::after { display: none; }

/* ---------- Ergebnis: XP und Teilen ---------- */
.over-xp { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.over-xp b { font-family: var(--display); font-weight: 400; color: var(--grape-d); font-size: 1.15rem; }
.over-levelup { width: 100%; background: #ece4ff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 12px; font-weight: 700; animation: pop .3s ease-out; }
.over-levelup b { color: var(--grape-d); }
.btn-share { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #e0f7ff; }
.btn-share svg { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .driver { grid-template-columns: 1fr; }
  .driver-stage canvas { height: 220px; }
}
@media (max-width: 520px) {
  .menu-tiles { gap: 8px; }
  .tile-txt b { font-size: 0.92rem; }
  .tourney-card { grid-template-columns: 1fr; }
  .tourney-card canvas { height: 120px; }
  .level-chip .lv-bar { width: 40px; }
  .daily-btn, .wheel-btn { font-size: 1rem; padding: 9px 8px; }
  .profile-head { flex-direction: column; text-align: center; }
  .profile-lv { justify-content: center; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .menu-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tile { flex-direction: column; text-align: center; padding: 6px 4px; gap: 4px; }
  .tile-txt { align-items: center; }
  .tile-txt b { font-size: 0.72rem; hyphens: manual; overflow-wrap: normal; letter-spacing: 0; }
  .tile-ico { width: 32px; height: 32px; border-radius: 10px; }
  .tile-ico svg { width: 18px; height: 18px; }
  .daily-row { gap: 8px; }
  .daily-btn, .wheel-btn { padding: 6px; font-size: 1rem; }
  .count { display: none; }
}

/* ---------- Tutorial ---------- */
.coach { position: absolute; left: 50%; top: 74px; transform: translateX(-50%); width: min(520px, calc(100% - 28px)); background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow); pointer-events: auto; animation: pop .3s cubic-bezier(.3,1.6,.6,1); }
.coach::after { content: ''; position: absolute; left: 30px; bottom: -14px; border: 12px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.coach-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.coach-steps i { width: 22px; height: 8px; border-radius: 99px; background: #e6e2f7; border: 1.5px solid var(--ink); }
.coach-steps i.done { background: var(--mint); }
.coach-steps i.now { background: var(--sun); }
.coach-steps span { margin-left: auto; font-size: 0.78rem; font-weight: 900; color: var(--muted); }
.coach-text { margin: 0 0 8px; font-size: 1.08rem; font-weight: 800; line-height: 1.35; }
.coach-text kbd { font-size: 0.9em; }
.coach-actions { display: flex; gap: 8px; justify-content: flex-end; }
.coach-skip { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); text-decoration: underline; }
.coach-skip:hover { background: transparent; color: var(--ink); }

/* ---------- Untertitel für Töne ---------- */
.captions { position: absolute; left: max(14px, var(--safe-l)); bottom: calc(150px + var(--safe-b)); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; pointer-events: none; }
.captions div { background: rgba(29,26,58,0.88); color: #fff; font-weight: 800; padding: 4px 10px; border-radius: 10px; font-size: 1rem; animation: fade .2s; }
@media (hover: hover) and (pointer: fine) { .captions { bottom: 24px; } }

/* ---------- Ein-Tasten-Modus ---------- */
.action-btn { pointer-events: auto; margin-left: auto; width: clamp(150px, 30vw, 240px); height: clamp(110px, 26vh, 170px); border-radius: 34px; border: var(--bw) solid var(--ink); background: var(--sun); color: var(--ink); font-family: var(--display); font-size: 1.5rem; box-shadow: 0 7px 0 var(--ink); touch-action: none; opacity: 0.92; }
.action-btn.down { transform: translateY(6px); box-shadow: 0 1px 0 var(--ink); opacity: 1; }

.row > span { display: flex; flex-direction: column; gap: 2px; }
.row-sub { font-size: 0.8rem; font-weight: 700; }

/* ---------- Barrierefreiheit: Darstellung ---------- */
body.big-text { font-size: 118%; }
body.big-text .coach-text { font-size: 1.3rem; }
body.big-text .hud-distance { font-size: 3rem; }
body.big-text .captions div { font-size: 1.25rem; }
body.big-touch .pedal { width: clamp(140px, 28vw, 220px); height: clamp(140px, 34vh, 220px); }
body.big-touch .jump-btn { width: clamp(100px, 17vw, 140px); height: clamp(100px, 17vw, 140px); }
body.big-touch .action-btn { width: clamp(200px, 40vw, 320px); height: clamp(140px, 34vh, 220px); }
body.hc { --muted: #2b2650; --ink-2: #1d1a3a; --paper: #ffffff; --paper-2: #fff3c4; }
body.hc .panel, body.hc .modal-card, body.hc .tile, body.hc .chair-card, body.hc .map-card, body.hc .coach { border-width: 4px; }
body.hc .screen:not(#screen-menu).active { background: rgba(29,26,58,0.75); }
body.hc .tagline, body.hc .hint, body.hc .hud-best { background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 8px; text-shadow: none; width: max-content; max-width: 100%; }
body.hc .btn:focus-visible, body.hc .tile:focus-visible { outline: 4px solid #ffb703; outline-offset: 3px; }
body.hc .muted, body.hc .small { color: #1d1a3a; }
body.hc .pedal, body.hc .jump-btn, body.hc .action-btn { opacity: 1; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; }
@media (max-height: 560px) and (orientation: landscape) {
  .coach { top: 56px; width: min(420px, 52vw); padding: 8px 12px; }
  .coach-text { font-size: 0.92rem; margin-bottom: 4px; }
  .coach-steps { margin-bottom: 3px; }
  .coach-actions .btn { padding: 4px 10px; font-size: 0.8rem; }
  body.big-text .coach-text { font-size: 1.05rem; }
  .captions { bottom: 12px; left: 50%; transform: translateX(-50%); align-items: center; }
}

/* ---------- Verein ---------- */
.t-club .tile-ico { background: #b8f2e6; }
.head-link { margin-left: auto; position: relative; z-index: 1; }
.club-intro { margin: 0 0 12px; font-weight: 700; }
.club-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 16px; }
.club-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow-sm); }
.club-row svg { flex: none; }
.club-row-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.club-row-info b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.club-tag { display: inline-block; font-family: var(--font); font-weight: 900; font-size: 0.72rem; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 6px; vertical-align: middle; letter-spacing: 0.04em; }
.club-create { background: var(--card); border: 2.5px solid var(--ink); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.club-create summary { font-family: var(--display); font-size: 1.25rem; cursor: pointer; }
.club-create form { margin-top: 12px; }
.club-create-grid { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; }
.club-preview { display: grid; place-items: center; }
.swatches.left { justify-content: flex-start; }
.symbol-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.sym { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; padding: 4px; cursor: pointer; line-height: 0; }
.sym.active { background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.club-head { display: flex; gap: 16px; align-items: center; background: #e6fbf5; border: var(--bw) solid var(--ink); border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.club-head svg { flex: none; filter: drop-shadow(3px 3px 0 var(--ink)); }
.club-head h3 { margin: 0; font-size: 1.7rem; }
.club-head p { margin: 2px 0 6px; font-weight: 700; }
.club-chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; font-weight: 800; }
.club-chips > span { background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; }
.club-chips > span:empty { display: none; }
.role-badge { display: inline-block; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; font-size: 0.78rem; font-weight: 900; white-space: nowrap; }
.role-badge.r-leader { background: var(--sun); }
.role-badge.r-vice { background: var(--sky); }
.role-badge.r-member { background: #ece9fb; }
.club-event-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.club-event-head h3 { margin: 0; font-size: 1.5rem; }
.club-event-head p { margin: 2px 0 0; font-weight: 700; }
.club-progress { position: relative; margin: 22px 6px 8px; }
.cp-bar { height: 22px; background: #ece9fb; border: var(--bw) solid var(--ink); border-radius: 99px; overflow: hidden; }
.cp-bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--mint) 0 10px, #6ee0c3 10px 20px); border-right: 3px solid var(--ink); transition: width .5s; }
.cp-mark { position: absolute; top: -10px; width: 20px; height: 42px; margin-left: -10px; border: 2.5px solid var(--ink); border-radius: 8px; }
.cp-mark.c0 { background: #f0a868; } .cp-mark.c1 { background: #dfe6ee; } .cp-mark.c2 { background: var(--sun); }
.club-event-total { font-weight: 700; margin-bottom: 12px; }
.club-event-total b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.chests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chest-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px 8px; box-shadow: var(--shadow-sm); opacity: 0.8; }
.chest-card.reached { opacity: 1; background: #fff6d6; }
.chest-card b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.chest-ico { width: 46px; height: 36px; border-radius: 9px 9px 5px 5px; border: 2.5px solid var(--ink); position: relative; }
.chest-ico::after { content: ''; position: absolute; left: 50%; top: 32%; width: 9px; height: 10px; transform: translateX(-50%); background: var(--sun); border: 2px solid var(--ink); border-radius: 2px; }
.chest-card.c0 .chest-ico { background: linear-gradient(180deg, #e08a4a 0 42%, #a8551e 42%); }
.chest-card.c1 .chest-ico { background: linear-gradient(180deg, #e2e8f0 0 42%, #94a3b8 42%); }
.chest-card.c2 .chest-ico { background: linear-gradient(180deg, #ffd166 0 42%, #e09f00 42%); }
.chest-card.reached .chest-ico { animation: wobble 1.6s ease-in-out infinite; }
.chest-reward { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; }
.chest-reward .coin-icon { width: 16px; height: 16px; border-width: 2px; }
.chest-reward .coin-icon::after { display: none; }
.club-sub { margin: 18px 0 8px; font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--grape-d); }
.club-top { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-weight: 800; }
.club-top li { display: flex; justify-content: space-between; gap: 10px; }
.club-leave { margin-top: 18px; text-align: right; }
.club-cell { display: inline-flex; align-items: center; gap: 8px; }
.profile-club { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; margin-bottom: 4px; }
.chat { height: min(46vh, 380px); overflow-y: auto; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.msg { max-width: 80%; align-self: flex-start; background: #ece9fb; border: 2px solid var(--ink); border-radius: 14px 14px 14px 4px; padding: 6px 10px; display: flex; flex-direction: column; user-select: text; -webkit-user-select: text; }
.msg b { font-size: 0.8rem; color: var(--grape-d); }
.msg span { font-weight: 700; overflow-wrap: anywhere; }
.msg time { font-size: 0.7rem; color: var(--muted); align-self: flex-end; }
.msg.mine { align-self: flex-end; background: #fff2c2; border-radius: 14px 14px 4px 14px; }
.msg.sys { align-self: center; background: transparent; border: 0; color: var(--muted); font-size: 0.82rem; font-weight: 800; padding: 2px; }
.chat-form { margin-bottom: 4px; }
@media (max-width: 520px) {
  .chests { grid-template-columns: 1fr; }
  .club-head { flex-direction: column; text-align: center; }
  .club-chips { justify-content: center; }
  .club-event-head { flex-direction: column; }
  .club-create-grid { grid-template-columns: 1fr; justify-items: center; }
}
.friend-info .name-link { text-align: left; align-self: flex-start; }
