/* HugoPredict: prediction market layout, dense and quick. */

:root {
  color-scheme: dark;
  --ground: #16202b;
  --panel: #202e3c;
  --panel-hi: #2a3b4c;
  --input: #111a23;
  --line: #33475a;
  --text: #f2f6fa;
  --muted: #a4b4c3;
  --faint: #8596a6;

  --blue: #3b9df0;
  --blue-deep: #1f6fd1;
  --yes: #33c26d;
  --yes-ink: #5fdc92;
  --yes-wash: rgba(51, 194, 109, 0.16);
  --yes-wash-hi: rgba(51, 194, 109, 0.28);
  --no: #ef5a48;
  --no-ink: #ff8b7c;
  --no-wash: rgba(239, 90, 72, 0.16);
  --no-wash-hi: rgba(239, 90, 72, 0.28);
  --gold: #f0bd4b;

  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { background: var(--ground); scrollbar-color: var(--line) var(--ground); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--text);
  font: 400 15px/1.5 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--blue);
}
::selection { background: var(--blue); color: #fff; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(22px, 2.6vw, 30px); }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; text-wrap: pretty; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ja { color: var(--yes-ink); }
.nein { color: var(--no-ink); }
.gold { color: var(--gold); }
.blue { color: var(--blue); }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--blue); color: #fff; padding: 8px 14px; font-weight: 600; border-radius: 8px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 20px; padding-bottom: 56px; outline: none; overflow-x: clip; }

/* ---------- Top bar ---------- */
.bar { position: sticky; top: 0; z-index: 30; background: var(--ground); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1320px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; flex-shrink: 0; }
.brand img { width: 40px; height: 40px; display: block; }
.search { flex: 1; min-width: 120px; max-width: 460px; }
.search input { width: 100%; height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; background: var(--panel); outline: none; transition: border-color 140ms ease; }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--blue); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { padding: 8px 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-radius: 8px; transition: color 140ms ease; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--text); }
.account { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.purse { display: flex; flex-direction: column; text-decoration: none; line-height: 1.2; text-align: right; padding: 2px 6px; }
.purse small { color: var(--muted); font-size: 12px; }
.purse b { color: var(--yes-ink); font-size: 15px; font-weight: 700; }
.head { width: 32px; height: 32px; image-rendering: pixelated; border-radius: 8px; background: var(--panel); display: block; }
.head.sm { width: 24px; height: 24px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  min-height: 40px; padding: 8px 16px; border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; font-weight: 600;
  background: var(--panel-hi); color: var(--text);
  transition: background-color 140ms ease, color 140ms ease, transform 140ms var(--ease);
}
.btn:hover { background: #33475a; }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary, .btn-ja { background: var(--blue-deep); color: #fff; }
.btn-primary:hover, .btn-ja:hover { background: #2a7fe4; }
.btn-yes { background: var(--yes-wash); color: var(--yes-ink); }
.btn-yes:hover { background: var(--yes); color: #04170c; }
.btn-no, .btn-nein { background: var(--no-wash); color: var(--no-ink); }
.btn-no:hover, .btn-nein:hover { background: var(--no); color: #fff; }
.btn-gold { background: var(--blue-deep); color: #fff; }
.btn-gold:hover { background: #2a7fe4; }
.btn-quiet { background: transparent; color: var(--muted); padding: 8px 10px; }
.btn-quiet:hover { background: var(--panel); color: var(--text); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.btn-block { width: 100%; min-height: 48px; font-size: 16px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 500; }
.input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: var(--input); color: var(--text); transition: border-color 140ms ease; }
.input:focus { border-color: var(--blue); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 84px; }
/* iPhone: Datumsfelder halten sonst ihre eigene Breite und ragen über den Rand */
input.input[type='datetime-local'], input.input[type='date'] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input.input::-webkit-date-and-time-value { text-align: left; }
.row-gap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border-radius: var(--radius); padding: 20px; }
.panel > h2 { margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title p { margin-top: 4px; color: var(--muted); }
.split-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tag.live { color: var(--yes-ink); }
.tag.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--yes); }
.tag.warn { color: var(--gold); }
.tag.bad { color: var(--no-ink); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.slot { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; font-size: 21px; line-height: 1; background: var(--panel-hi); border-radius: 8px; }
.slot.lg { width: 60px; height: 60px; font-size: 32px; border-radius: 10px; }

/* ---------- Home: featured market ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; padding: 22px; margin-bottom: 18px; background: var(--panel); border-radius: var(--radius); min-height: 240px; }
.feature-q { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.feature-q .lead { display: flex; gap: 14px; align-items: center; }
.feature-q h1 { margin-top: 4px; }
.feature-q h1 a { text-decoration: none; }
.feature-q h1 a:hover { color: var(--blue); }
.feature-outcomes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.feature-outcomes .btn { flex: 1 1 120px; min-height: 46px; }
.feature-chart { min-width: 0; }
.odds-big { display: flex; align-items: baseline; gap: 10px; }
.odds-big b { font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 4px; align-items: center; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.filters button { border: 0; background: none; min-height: 36px; padding: 6px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background-color 140ms ease, color 140ms ease, transform 140ms var(--ease); }
.filters button:hover { color: var(--text); }
.filters button:active { transform: scale(0.97); }
.filters button[aria-pressed='true'] { color: var(--text); background: var(--panel-hi); }
.filters .gap { flex: 1; min-width: 12px; }

/* ---------- Market cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 14px; min-height: 172px;
  background: var(--panel); border-radius: var(--radius); transition: background-color 140ms ease;
  animation: enter 280ms var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.card-top { display: flex; gap: 10px; align-items: flex-start; }
.card-top h3 { flex: 1; min-width: 0; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; }
.card-top h3 a { text-decoration: none; }
.card-top h3 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.card-top h3 a:focus-visible { outline: none; }
.card-top h3 a:focus-visible::after { outline: 2px solid var(--blue); outline-offset: 2px; }
.card .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; z-index: 1; margin-top: auto; }
.card .foot-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--faint); }
.card.done { opacity: 0.75; }
.card .result { margin-top: auto; }
.gauge { position: relative; flex-shrink: 0; width: 60px; height: 44px; display: block; text-align: center; }
.gauge svg { display: block; width: 60px; height: 34px; }
.gauge-fill { transition: stroke-dasharray 260ms var(--ease); }
.gauge b { position: absolute; left: 0; right: 0; top: 15px; font-size: 14px; font-weight: 700; line-height: 1; }
.gauge small { position: absolute; left: -4px; right: -4px; top: 32px; font-size: 11px; color: var(--muted); line-height: 1; }
.mini { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; margin-top: auto; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; padding: 4px 8px; margin: 0 -8px; border-radius: 6px; text-decoration: none; transition: background-color 140ms ease; }
.mini-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row b { font-weight: 700; }
.more { font-size: 13px; }
.skeleton { min-height: 172px; border-radius: var(--radius); background: var(--panel); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------- Market page ---------- */
.back { display: inline-block; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.market { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.detail { min-width: 0; }
.market-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.market-head .meta { margin-top: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); margin-top: 8px; }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.chart { display: block; width: 100%; height: auto; margin-top: 12px; }
.chart text { fill: var(--faint); font: 12px var(--body); }
/* The one authored moment: the price history draws itself once on arrival. */
.chart-line { stroke-dasharray: 1; animation: draw 620ms cubic-bezier(0.77, 0, 0.175, 1) both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.chart-dot { animation: dot 200ms var(--ease) 560ms both; }
@keyframes dot { from { opacity: 0; } }
.rules { white-space: pre-wrap; color: var(--muted); max-width: 70ch; }
.rows { display: flex; flex-direction: column; }
.outcome-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.outcome-row:first-child { border-top: 0; }
.outcome-name { flex: 1; min-width: 0; font-weight: 600; }
.outcome-row b { font-size: 18px; font-weight: 700; }
.outcome-row.won .outcome-name { color: var(--yes-ink); }
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feed-row:first-child { border-top: 0; }
.feed-row .when { margin-left: auto; color: var(--faint); font-size: 13px; white-space: nowrap; }

/* ---------- Trade box ---------- */
.side { position: sticky; top: 84px; }
.trader { background: var(--panel); border-radius: var(--radius); padding: 16px; }
.trader > h2 { margin-bottom: 8px; }
.seg { display: flex; gap: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 0 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; cursor: pointer; font-weight: 600; color: var(--muted); transition: color 140ms ease, border-color 140ms ease; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { color: var(--text); border-bottom-color: var(--text); }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.pick-many { grid-template-columns: 1fr; max-height: 216px; overflow-y: auto; overscroll-behavior: contain; }
.pick button { display: flex; justify-content: center; gap: 6px; min-height: 50px; padding: 8px 12px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 16px; background: var(--panel-hi); color: var(--muted); transition: background-color 140ms ease, color 140ms ease, transform 140ms var(--ease); }
.pick-many button { justify-content: space-between; min-height: 44px; font-size: 15px; }
.pick-many button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick button:active { transform: scale(0.97); }
.pick .p-yes[aria-pressed='true'] { background: var(--yes); color: #04170c; }
.pick .p-no[aria-pressed='true'] { background: var(--no); color: #fff; }
.amount { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.amount-in { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; min-width: 0; flex: 1; }
.amount input { width: 100%; min-width: 0; background: none; border: 0; outline: none; padding: 0; text-align: right; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.amount input::placeholder { color: var(--faint); }
.amount i { font-style: normal; font-size: 24px; font-weight: 700; color: var(--muted); }
.quick { display: flex; gap: 6px; margin: 10px 0 14px; }
.quick button { flex: 1; min-height: 34px; border: 0; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); background: var(--panel-hi); transition: background-color 140ms ease, transform 140ms var(--ease); }
.quick button:hover { background: #33475a; }
.quick button:active { transform: scale(0.97); }
/* Fixed heights keep the buy button from jumping while the preview changes. */
.receipt { font-size: 14px; margin: 0; display: flex; flex-direction: column; gap: 4px; min-height: 76px; }
.receipt div { display: flex; justify-content: space-between; gap: 12px; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; font-weight: 600; }
.receipt .win { align-items: baseline; }
.receipt .win dt { color: var(--text); font-weight: 600; }
.receipt .win dd { color: var(--yes-ink); font-size: 22px; font-weight: 700; }
.trader .note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; }
.trader .why { font-size: 14px; line-height: 1.4; color: var(--no-ink); min-height: 2.8em; padding-top: 4px; }
.holdings { display: flex; flex-direction: column; }
.holdings div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.holdings div:first-child { border-top: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 0 10px 10px; }
.table td { padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.table .r { text-align: right; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank { font-size: 16px; font-weight: 700; color: var(--muted); width: 36px; }
.rank.r1 { color: var(--gold); }
.rank.r2 { color: #d8dee4; }
.rank.r3 { color: #e0915a; }

/* ---------- Wallet ---------- */
.balance { font-size: clamp(34px, 5vw, 46px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0; }
.cmd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 14px; margin: 12px 0; background: var(--input); border-radius: 10px; }
.cmd code { overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: var(--text); }
.steps { margin: 0; padding-left: 22px; color: var(--muted); }
.steps li { margin: 4px 0; }
.steps b { color: var(--text); font-weight: 600; }

/* ---------- Auth ---------- */
.auth { max-width: 440px; margin: 32px auto; display: flex; flex-direction: column; gap: 12px; }
.auth-logo { width: 148px; height: 148px; display: block; margin: 0 auto; }
.auth h1 { text-align: center; margin-bottom: 4px; }
.auth .field { margin: 4px 0 14px; }
.auth .input { font-size: 22px; font-weight: 700; letter-spacing: 0.14em; text-align: center; text-transform: uppercase; }

/* ---------- Toasts & footer ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 360px; padding: 12px 16px; border-radius: 10px; background: #0f1720; color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); animation: rise 200ms var(--ease); }
.toast.err { background: #4a1712; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.bot-status::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; background: var(--faint); vertical-align: 1px; }
.bot-status.on::before { background: var(--yes); }

/* ---------- Karten: Restzeit, Bieter, große Prozent ---------- */
.ends { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--panel-hi); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ends.soon { background: rgba(240, 189, 75, 0.16); color: var(--gold); }
.bidders { display: inline-flex; align-items: center; gap: 0; }
.bidders .head { margin-right: -6px; border: 2px solid var(--panel); }
.bidders small { margin-left: 10px; color: var(--muted); }
.bidders > span { margin-left: 12px; }
.bidders > span:first-child { margin-left: 0; }
.head.xs { width: 20px; height: 20px; border-radius: 5px; }
.big-pct { display: flex; align-items: baseline; gap: 8px; position: relative; z-index: 1; }
.big-pct b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--blue); }
.big-pct span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Ladeplatzhalter */
.skel { background: var(--panel); border-radius: 8px; animation: pulse 1.4s ease-in-out infinite; }
.skel-title { width: 40%; height: 30px; }
.skel-line { width: 70%; height: 16px; margin-top: 10px; }
/* Konfetti und Einführung */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }
.onboarding { text-align: center; }
.onboarding h2 { margin: 10px 0 14px; }
.onb-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.onb-steps li { display: flex; gap: 12px; align-items: flex-start; }
.onb-steps li > span { font-size: 24px; line-height: 1; }
.onb-steps p { color: var(--muted); font-size: 14px; }
.onb-steps code { font-size: 13px; background: var(--input); padding: 1px 5px; border-radius: 5px; }

/* ---------- Mein Profil ---------- */
.eyebrow { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.eyebrow.gold { color: var(--gold); }
.eyebrow.blue { color: var(--blue); }
.me-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.skin-stage { display: grid; place-items: center; height: 300px; margin: -4px -4px 14px; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #2a3b4c, #0d141b 70%); }
.skin-stage { position: relative; overflow: hidden; }
.skin-stage img { height: 230px; width: auto; image-rendering: pixelated; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5)); }
.skin-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity 280ms ease; }
.skin-canvas.ready { opacity: 1; }
.skin-canvas:active { cursor: grabbing; }
.skin-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.me-name { font-size: 24px; margin-bottom: 12px; }
.profile-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: center; margin-bottom: 16px; }
.profile-top .skin-stage { margin: 0; }
@media (max-width: 720px) { .profile-top { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
.kv { padding: 10px 12px; border-radius: 10px; background: var(--input); margin-top: 8px; }
.kv code { font-size: 12px; overflow-wrap: anywhere; }
.discord-card { background: linear-gradient(160deg, #262c48, var(--panel) 60%); }
.discord-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--input); }
.discord-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #5865f2; color: #fff; font-weight: 800; font-size: 18px; flex-shrink: 0; }
@media (max-width: 720px) { .me-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Wallet: Einzahlen ---------- */
.pay-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 14px 0 4px; }
.pay-pill { min-height: 34px; padding: 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--input); color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
.pay-pill:disabled { opacity: 0.35; cursor: not-allowed; }
.pay-pill.on { background: var(--yes-wash); border-color: var(--yes); color: var(--yes-ink); }
.pay-custom { grid-column: 1 / -1; width: 100%; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--input); color: var(--text); font-size: 16px; outline: none; }
.pay-custom:focus { border-color: var(--blue); }
.deposit .cmd .btn.copied { background: var(--yes); color: #04170c; }

/* ---------- Admin ---------- */
.admin-tabs { margin-bottom: 16px; flex-wrap: wrap; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--no); color: #fff; font-size: 12px; font-weight: 700; }
.cover { border: 1px solid var(--line); }
.cover.ok { border-color: rgba(51, 194, 109, 0.5); }
.cover.bad { border-color: rgba(239, 90, 72, 0.7); background: #2a1e22; }
.cover-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.cover-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; font-weight: 800; flex-shrink: 0; background: var(--panel-hi); }
.cover.ok .cover-icon { background: var(--yes); color: #04170c; }
.cover.bad .cover-icon { background: var(--no); color: #fff; }
.cover-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cover-grid div { display: flex; flex-direction: column; background: var(--input); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.cover-grid small { color: var(--muted); font-size: 12px; }
.cover-grid b { font-size: 18px; font-weight: 800; }
.templates { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
#close-chips { margin: 0 0 8px; }
.chip { border: 1px solid var(--line); background: var(--input); color: var(--text); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.on, .chip:active { background: var(--blue-deep); border-color: var(--blue-deep); }
.more-opts { margin: 4px 0 10px; }
.more-opts summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; padding: 6px 0; }
.preview { pointer-events: none; }
.preview .card { animation: none; }
.admin-market { padding: 14px 0; border-top: 1px solid var(--line); }
.admin-market:first-of-type { border-top: 0; padding-top: 0; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.admin-actions select { flex: 1; min-width: 150px; padding: 7px 10px; }
.edit-form { margin-top: 12px; padding: 14px; background: var(--input); border-radius: 10px; }
.player-list { display: flex; flex-direction: column; }
.player-row { border-top: 1px solid var(--line); }
.player-row:first-child { border-top: 0; }
.player-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.player-name { flex: 1; min-width: 0; }
.player-detail { padding: 4px 0 14px; }
.credit-row { display: flex; gap: 8px; flex-wrap: wrap; }
.credit-row .input { flex: 1; min-width: 130px; }
.credit-btns { display: flex; gap: 8px; width: 100%; }
.credit-btns .btn { flex: 1; }
.podium-spot.empty { opacity: 0.45; }
.podium-spot.empty .podium-head { display: block; }
.dialog { max-width: 420px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); padding: 20px; }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog h2 { margin-bottom: 10px; }
.dialog-list { margin: 10px 0 0; padding-left: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@media (max-width: 720px) { .cover-grid { grid-template-columns: minmax(0, 1fr); } .stat-grid .stat b { font-size: 18px; } }

/* ---------- App (PWA) ---------- */
html { overscroll-behavior-y: none; }
.bar { padding-top: env(safe-area-inset-top); }
.standalone .nav a, .standalone .brand { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.install { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #0f1720; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); animation: rise 240ms var(--ease); }
.install img { border-radius: 10px; flex-shrink: 0; }
.install-text { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; color: var(--muted); }
.install-text b { color: var(--text); font-size: 15px; }
.install-x { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 6px; cursor: pointer; }
@media (min-width: 721px) { .install { left: auto; right: 20px; bottom: 20px; max-width: 380px; } }

/* ---------- Vorschläge (Dropdown) ---------- */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; display: flex; flex-direction: column; padding: 6px; border-radius: 12px; background: #0f1720; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); max-height: 60vh; overflow-y: auto; }
.suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; color: var(--text); }
.suggest-item.active, .suggest-item:hover { background: var(--panel-hi); }
.suggest-item img { border-radius: 6px; image-rendering: pixelated; flex-shrink: 0; }
.suggest-icon { width: 24px; text-align: center; font-size: 18px; flex-shrink: 0; }
.suggest-text { display: flex; flex-direction: column; min-width: 0; }
.suggest-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-text small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Share, podium, profile ---------- */
.market-head .share { margin-left: auto; align-self: flex-start; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; margin-bottom: 16px; }
.podium-spot { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; text-align: center; min-width: 0; }
.podium-spot b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-spot span { font-size: 13px; font-weight: 600; }
.podium-head { width: 56px; height: 56px; border-radius: 12px; image-rendering: pixelated; background: var(--panel); }
.podium-block { width: 100%; margin-top: 6px; border-radius: 10px 10px 4px 4px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #0d141b; }
.podium-spot.p1 .podium-block { height: 86px; background: var(--gold); }
.podium-spot.p2 .podium-block { height: 62px; background: #d8dee4; }
.podium-spot.p3 .podium-block { height: 46px; background: #e0915a; }
.podium-spot.p1 .podium-head { width: 68px; height: 68px; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 14px; image-rendering: pixelated; background: var(--panel-hi); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat small { color: var(--muted); font-size: 13px; }
.stat b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 13px; }

/* ---------- Nav icons (bottom bar on phones) ---------- */
.nav svg { display: none; width: 22px; height: 22px; }
.show-sm { display: none; }

/* ---------- Hover only where a pointer can really hover ---------- */
@media (hover: hover) and (pointer: fine) {
  .card:hover { background: #263647; }
  .mini-row:hover { background: var(--panel-hi); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .market { grid-template-columns: 1fr; }
  .side { position: static; }
  .feature { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 860px) {
  .bar-in { height: auto; flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 6px; }
  .account { margin-left: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .nav { order: 4; flex-basis: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 720px) {
  /* iPhone zoomt beim Tippen in Felder unter 16 px hinein und bleibt vergrößert – daher 16 px */
  input, select, textarea, .search input, .input { font-size: 16px; }
  /* Kompakte Kopfzeile: Logo, Guthaben, Kopf – Suche darunter */
  .bar-in { gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  .brand { font-size: 17px; }
  .brand img { width: 34px; height: 34px; }
  .purse small, #logout { display: none; }
  .show-sm { display: inline-flex; }
  /* Navigation als Leiste unten, wie in einer App */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; order: 0; flex-basis: auto; margin: 0; gap: 0;
    display: flex; justify-content: space-around; overflow: visible;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(22, 32, 43, 0.96); border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }
  .nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; border-radius: 10px; }
  .nav a.active { color: var(--blue); }
  .nav svg { display: block; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* Prognose: Bieten direkt unter Chart und Kursen, Trades danach */
  .market { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .market > .stack:first-child { display: contents; }
  .market .detail { order: 1; }
  .market .side { order: 2; }
  .market > .stack:first-child > .panel { order: 3; }
  /* Tabellen als Karten */
  .hide-sm { display: none; }
  .table.stackable thead { display: none; }
  .table.stackable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
  .table.stackable tr:first-child { border-top: 0; }
  .table.stackable td { border: 0; padding: 0; text-align: left; }
  .table.stackable td.title { grid-column: 1 / -1; font-weight: 600; margin-bottom: 4px; }
  .table.stackable td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--faint); }
  .split-2, .row-gap { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 20px; }
  .panel { padding: 16px; }
  .chart text { font-size: 26px; }
  .wrap, .bar-in { padding-left: 16px; padding-right: 16px; }
  .toasts { left: 16px; right: 16px; }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .chart-line, .chart-dot, .toast { animation: none; }
  .gauge-fill { transition: none; }
  .btn:active, .pick button:active, .quick button:active, .filters button:active { transform: none; }
}

/* 3D-Skin: erst Ladeschimmer, dann die Figur; das flache Bild nur, wenn 3D nicht geht */
.skin-stage .skin-fallback { display: none; }
.skin-stage.static .skin-fallback { display: block; }
.skin-stage.static .skin-loading { display: none; }
.skin-loading { width: 70px; height: 170px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); animation: pulse 1.4s ease-in-out infinite; }
