.card {
  position: relative; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.card-pad { padding: 22px; }
.card-hover { transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; }
.card-hover:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card-accent::before {
  content: ''; position: absolute; left: 18px; top: -1px; width: 46px; height: 4px; transform: skewX(-24deg);
  background: linear-gradient(90deg, var(--red) 0 50%, var(--blue) 50% 100%);
}
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.list-reset { list-style: none; margin: 0; padding: 0; }
.span-all { grid-column: 1 / -1; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 20px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; border: 0; border-radius: 7px; background: none; color: var(--muted);
  font: 700 0.92rem/1.2 var(--font-text); cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.tab:hover { color: var(--bone); background: var(--panel-2); }
.tab[aria-pressed='true'], .tab[aria-selected='true'] { background: var(--bolt); color: #15120a; }
.tabs select.search { width: auto; padding: 7px 12px; border: 0; background: var(--panel-2); font-weight: 600; }

.table-card { overflow: hidden; padding: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font: 700 0.76rem/1.2 var(--font-text); text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); background: rgba(8, 10, 15, 0.4); }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(240, 240, 245, 0.03); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.rank { font: 800 1.45rem/1 var(--font-display); width: 3.6em; color: var(--muted); }
tr.top-1 td.rank { color: var(--bolt); }
tr.top-2 td.rank { color: #cfd5e6; }
tr.top-3 td.rank { color: #e0975c; }
td.elo { font: 800 1.35rem/1 var(--font-display); letter-spacing: 0.02em; }
.wld { color: var(--muted); white-space: nowrap; }
.wld b { color: var(--bone); font-weight: 600; }
.controls th.p1 { color: var(--red); }
.controls th.p2 { color: var(--blue); }
kbd { display: inline-block; min-width: 1.9em; padding: 2px 8px; border: 1px solid var(--line-2); border-bottom-width: 3px; border-radius: 5px; background: var(--panel-2); font: 600 0.88rem/1.4 var(--font-text); text-align: center; }

@media (max-width: 720px) {
  .hide-sm { display: none; }
  th, td { padding: 10px 10px; }
}

.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--panel-3); object-fit: cover; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; font: 800 1rem/1 var(--font-display); color: var(--arena); background: var(--bone); }
.avatar-sm { width: 26px; height: 26px; font-size: 0.85rem; }
.avatar-big { width: 72px; height: 72px; font-size: 2rem; }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.avatar-wrap .dot { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--panel); width: 13px; height: 13px; }
.player { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; font-weight: 600; }
.player > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.player:hover { color: var(--bolt); }
.player-with-fighter { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.online { background: var(--green); box-shadow: 0 0 0 0 rgba(70, 200, 110, 0.5); animation: pulse 2.2s infinite; }
.dot.busy { background: var(--red); box-shadow: 0 0 0 0 rgba(235, 70, 70, 0.5); animation: pulse-red 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(70, 200, 110, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(70, 200, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(70, 200, 110, 0); } }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(235, 70, 70, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(235, 70, 70, 0); } 100% { box-shadow: 0 0 0 0 rgba(235, 70, 70, 0); } }
.presence { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.92rem; min-width: 0; }
.presence.on { color: #9fe8b5; }
.presence.in-match { color: #ff9b9b; }
.presence .detail { color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 4px;
  font: 700 0.8rem/1.3 var(--font-text); letter-spacing: 0.03em; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.badge.win { border-color: rgba(245, 210, 70, 0.6); color: var(--bolt); background: rgba(245, 210, 70, 0.08); }
.badge.loss { border-color: rgba(235, 70, 70, 0.45); color: #ff8b8b; }
.badge.draw { color: var(--muted); }
.badge.level { border: 0; background: var(--blue); color: #fff; font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.06em; transform: skewX(var(--skew)); }
.badge.gold { border-color: var(--bolt); color: var(--bolt); }
.delta-up { color: var(--green); font-weight: 700; }
.delta-down { color: #ff8b8b; font-weight: 700; }
.delta-zero { color: var(--muted); }

.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 40%, var(--panel-2) 80%);
  background-size: 300% 100%; animation: shimmer 1.3s infinite linear; border-radius: 6px;
}
.skeleton-line { height: 14px; margin: 8px 0; }
.skeleton-line.short { width: 45%; }
.skeleton-block { aspect-ratio: 16 / 9; border-radius: 0; }
.skeleton-row td { padding: 14px 16px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.empty-state {
  display: grid; justify-items: center; gap: 8px; text-align: center; padding: 44px 20px;
  border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); background: rgba(16, 20, 29, 0.5);
}
.empty-state .empty-icon { font: 800 2.4rem/1 var(--font-display); color: var(--dim); transform: skewX(var(--skew)); }
.empty-state strong { color: var(--bone); font: 800 1.4rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; }
.empty-state p { margin: 0; max-width: 460px; }
.error-state { border-color: rgba(235, 70, 70, 0.45); }
.notice { padding: 12px 16px; border-radius: 8px; background: rgba(235, 70, 70, 0.12); color: #ffb0b0; border: 1px solid rgba(235, 70, 70, 0.35); }

.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 28px 0 0; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 20px; border-radius: 8px; background: var(--bone); color: var(--arena); font-weight: 700; box-shadow: var(--shadow);
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); color: #fff; }

.fighter-svg { display: block; overflow: visible; }
.mini-fighter { display: inline-flex; width: 30px; justify-content: center; flex: 0 0 auto; }
.fighter-cell { width: 48px; }
.mirror { transform: scaleX(-1); }

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-tile { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.weapon-bars { display: grid; gap: 8px; max-width: 640px; }
.weapon-bar { display: grid; grid-template-columns: 10rem 1fr 3rem; align-items: center; gap: 12px; }
.bar-track { height: 10px; background: var(--line); overflow: hidden; transform: skewX(-20deg); }
.bar-fill { display: block; height: 100%; background: #6e7898; }
.bar-fill.top { background: linear-gradient(90deg, var(--red), var(--bolt)); }
.achievements { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 12px; }
.achievement {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); opacity: 0.5; transition: opacity 0.15s, transform 0.15s;
}
.achievement:hover { opacity: 0.85; }
.achievement.unlocked { opacity: 1; border-color: rgba(245, 210, 70, 0.45); background: linear-gradient(180deg, rgba(245, 210, 70, 0.07), var(--panel)); }
.achievement.unlocked:hover { transform: translateY(-2px); }
.achievement .medal { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; font-size: 1.4rem; border: 3px solid var(--line); color: var(--muted); background: var(--arena); }
.achievement.unlocked .medal { border-color: var(--bolt); color: var(--bolt); background: #282214; box-shadow: 0 0 18px rgba(245, 210, 70, 0.25); }
.achievement-title { font-weight: 700; }
@media (max-width: 520px) {
  .weapon-bar { grid-template-columns: 7rem 1fr 2.5rem; }
  .achievements, .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.level-svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.lv-sky { fill: #0b1020; }
.lv-platform { fill: #2c3348; stroke: #59648a; stroke-width: 4; }
.lv-shape { fill: #2c3348; stroke: #8a95bd; stroke-width: 5; }
.lv-hill { fill: rgba(245, 210, 70, 0.14); stroke: rgba(245, 210, 70, 0.6); stroke-width: 4; stroke-dasharray: 18 12; }
.lv-barrel { fill: #c8402f; stroke: #2a0d08; stroke-width: 4; }
.lv-pad { fill: #f5d246; }
.lv-spikes { fill: #b8bfd6; }
.lv-mover { fill: #3e5a9c; stroke: #8fb0ff; stroke-width: 4; }
.lv-mover-ghost { fill: none; stroke: #8fb0ff; stroke-width: 3; stroke-dasharray: 14 10; opacity: 0.6; }
.lv-portal { fill: rgba(150, 220, 255, 0.25); stroke: #96dcff; stroke-width: 5; }
.lv-weapon { fill: #f5d246; opacity: 0.85; }
.lv-oneway { fill: rgba(44, 51, 72, 0.55); stroke: #8a95bd; stroke-width: 4; stroke-dasharray: 16 10; }
.lv-ice { fill: #9fd8f0; stroke: #e4f6ff; }
.lv-belt { fill: none; stroke: #f5d246; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.lv-crate { fill: #8a5a2b; stroke: #3a240f; stroke-width: 4; }

.media-card { display: flex; flex-direction: column; overflow: hidden; }
.media-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #05070b; overflow: hidden; border-bottom: 1px solid var(--line); }
.media-thumb img, .media-thumb .level-svg { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.card-hover:hover .media-thumb img, .card-hover:hover .media-thumb .level-svg { transform: scale(1.04); }
.media-thumb .chip {
  position: absolute; left: 10px; top: 10px; padding: 3px 9px; background: rgba(8, 10, 15, 0.8); color: var(--bone);
  font: 700 0.75rem/1.3 var(--font-text); letter-spacing: 0.08em; text-transform: uppercase; border-radius: 4px;
}
.media-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.media-title { margin: 0; font: 800 1.35rem/1.1 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; overflow-wrap: anywhere; }
.media-title a { text-decoration: none; }
.media-title a::after { content: ''; position: absolute; inset: 0; }
.media-card .player, .media-card button, .media-card .media-actions a { position: relative; z-index: 1; }
.media-meta { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.88rem; }
.media-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.counts { display: inline-flex; gap: 14px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.counts span { display: inline-flex; align-items: center; gap: 4px; }
.counts .liked { color: var(--red); }
.icon-inline { width: 15px; height: 15px; flex: none; }
.media-actions { align-items: center; }
.media-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.like.liked { background: rgba(235, 70, 70, 0.18); color: #ff8080; }

/* Tracks: Wellenform + Abspiel-Knopf (/tracks, Maps mit Musik, Spielerseite) */
.toolbar-group { display: flex; flex: 1 1 320px; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; }
.media-thumb .chip-music { left: auto; right: 10px; color: var(--bolt); }
.track-preview { display: flex; align-items: center; gap: 12px; min-width: 0; }
.play-btn {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%;
  background: var(--bolt); color: #15120a; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.play-btn:hover { transform: scale(1.07); box-shadow: 0 0 0 5px rgba(245, 210, 70, 0.16); }
.play-btn:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }
.play-btn .icon { width: 18px; height: 18px; fill: currentColor; }
.wave { flex: 1; min-width: 0; height: 56px; }
.wave rect { fill: var(--line-2); transition: fill 0.12s; }
.track-preview.playing .wave rect { fill: #4a5372; }
.track-preview.playing .wave rect.played { fill: var(--bolt); }
.track-card { --genre: var(--blue); }
.track-card.genre-synthwave { --genre: #d454e8; }
.track-card.genre-chiptune { --genre: var(--green); }
.track-card.genre-rock { --genre: var(--red); }
.track-card.genre-lofi { --genre: #e0975c; }
.track-head { padding: 18px 16px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--genre) 24%, #090c12), #090c12 72%); }
.track-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 1.4em; }
.track-chips .chip, .track-facts span {
  padding: 2px 9px; border-radius: 4px; font: 700 0.75rem/1.4 var(--font-text); letter-spacing: 0.06em; text-transform: uppercase;
}
.track-chips .chip { background: rgba(8, 10, 15, 0.75); color: var(--bone); }
.track-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.track-facts span { border: 1px solid var(--line); color: var(--muted); }
.map-music { display: grid; gap: 8px; padding: 10px 12px; background: rgba(8, 10, 15, 0.5); border: 1px solid var(--line); border-radius: 8px; position: relative; z-index: 1; }
.map-music-title { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 0.85rem; font-weight: 600; overflow-wrap: anywhere; }
.map-music .play-btn { width: 36px; height: 36px; }
.map-music .play-btn .icon { width: 15px; height: 15px; }
.map-music .wave { height: 34px; }
