:root {
  --bg: #090c0b;
  --bg2: #0f1412;
  --panel: #141b18;
  --panel2: #1a231f;
  --line: #26322c;
  --text: #ece8dc;
  --muted: #8f998f;
  --gold: #d4af37;
  --gold2: #f3d77a;
  --gold-dark: #8a6d1c;
  --green: #1f8a4c;
  --felt: #0d4a2c;
  --red: #d94848;
  --up: #3ecf7a;
  --down: #ef5b5b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212,175,55,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(31,138,76,.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: Cinzel, Georgia, serif; letter-spacing: .02em; margin: 0 0 .6em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; color: var(--gold2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.error { color: var(--down); min-height: 1.2em; margin: .2em 0; font-size: .9rem; }
.up { color: var(--up); } .down { color: var(--down); }

/* ---------- Münze / Logo ---------- */
.coin {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold2), var(--gold) 55%, var(--gold-dark));
  color: #241c06; font: 800 18px Cinzel, Georgia, serif;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.25), inset 0 -3px 6px rgba(0,0,0,.3), 0 2px 8px rgba(212,175,55,.35);
  flex: none;
}
.coin.sm { width: 20px; height: 20px; font-size: 11px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.coin.big { width: 84px; height: 84px; font-size: 44px; margin: 0 auto 10px; display: grid; animation: spin 6s ease-in-out infinite; }
@keyframes spin { 0%, 70% { transform: rotateY(0) } 85% { transform: rotateY(180deg) } 100% { transform: rotateY(360deg) } }
.brand {
  font-family: Cinzel, Georgia, serif; font-weight: 800;
  background: linear-gradient(180deg, var(--gold2), var(--gold) 60%, var(--gold-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1.brand { text-align: center; font-size: 2.2rem; margin: 0; }

/* ---------- Buttons / Inputs ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: .6em 1.1em; border-radius: 10px; font: 600 .95rem Inter, sans-serif; cursor: pointer;
  transition: transform .1s, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #241c06; border-color: var(--gold-dark); }
.btn.green { background: linear-gradient(180deg, #2aa65e, var(--green)); border-color: #145c33; }
.btn.red { background: linear-gradient(180deg, #e46060, #b83333); border-color: #7a1f1f; }
.btn.ghost { background: transparent; }
.btn.link { background: none; border: none; color: var(--muted); text-decoration: underline; }
.btn.sm { padding: .35em .7em; font-size: .82rem; }
.btn.block { width: 100%; }
input, select, textarea {
  width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: .65em .8em; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.15); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .8em; }
label input, label select, label textarea { margin-top: .3em; }
.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.row > .btn { flex: none; }
.row > input { min-width: 110px; }

/* ---------- Anmelden ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card {
  width: 100%; max-width: 400px; background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow);
  position: relative;
}
.auth-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 20px; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(212,175,55,.6), transparent 40%, transparent 60%, rgba(212,175,55,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.tabs { display: flex; background: var(--bg2); border-radius: 12px; padding: 4px; margin: 18px 0; border: 1px solid var(--line); }
.tab { flex: 1; border: 0; background: none; color: var(--muted); padding: .55em; border-radius: 9px; font: 600 .95rem Inter; cursor: pointer; }
.tab.active { background: var(--panel2); color: var(--gold2); }
.big-emoji { font-size: 56px; }

/* ---------- Layout ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: none; background: rgba(15,20,18,.92); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-size: 1.3rem; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: .6em .8em; border-radius: 10px; color: var(--muted);
  font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(212,175,55,.16), transparent); color: var(--gold2); box-shadow: inset 3px 0 0 var(--gold); }
.nav-item .ico { width: 22px; text-align: center; }
.nav-item.soon { opacity: .45; }
.nav-item.soon::after { content: "bald"; margin-left: auto; font-size: .68rem; border: 1px solid var(--line); border-radius: 6px; padding: 0 .4em; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.sidebar-foot { font-size: .82rem; color: var(--muted); padding: 10px 8px 0; border-top: 1px solid var(--line); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #555; vertical-align: middle; }
.dot.on { background: var(--up); box-shadow: 0 0 8px var(--up); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: rgba(9,12,11,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.search { position: relative; flex: 1; max-width: 340px; }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 30;
}
.suggest-item { display: flex; align-items: center; gap: 10px; padding: .55em .8em; cursor: pointer; }
.suggest-item:hover, .suggest-item.sel { background: var(--panel2); }
.suggest-item small { margin-left: auto; color: var(--muted); }
.balances { display: flex; gap: 8px; margin-left: auto; }
.bal {
  display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: .35em .85em; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bal.flash-up { animation: flashUp .9s; } .bal.flash-down { animation: flashDown .9s; }
@keyframes flashUp { 30% { border-color: var(--up); box-shadow: 0 0 14px rgba(62,207,122,.5); } }
@keyframes flashDown { 30% { border-color: var(--down); box-shadow: 0 0 14px rgba(239,91,91,.5); } }
.icon-btn { position: relative; background: var(--panel); border: 1px solid var(--line); color: var(--text); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 1.05rem; flex: none; }
.badge { position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.notif-wrap { position: relative; }
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 30;
}
.notif { display: flex; gap: 10px; padding: .7em .9em; border-bottom: 1px solid var(--line); font-size: .9rem; }
.notif.unread { background: rgba(212,175,55,.06); }
.notif small { display: block; color: var(--muted); font-size: .75rem; }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.me-text { display: flex; flex-direction: column; line-height: 1.15; }
.me-text small { color: var(--gold); font-size: .72rem; }
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2b3a33, #151d19); border: 2px solid var(--gold-dark); font-size: 18px; flex: none;
  position: relative;
}
.avatar.lg { width: 96px; height: 96px; font-size: 52px; border-width: 3px; border-color: var(--gold); }
.avatar .dot { position: absolute; bottom: 0; right: 0; border: 2px solid var(--bg); }
.avatar.lg .dot { width: 18px; height: 18px; border-width: 3px; bottom: 4px; right: 4px; }

/* ---------- Ticker ---------- */
.ticker { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); background: #0c110f; font-size: .85rem; overflow: hidden; }
.ticker-label { background: var(--red); color: #fff; font-weight: 800; letter-spacing: .1em; padding: .4em .8em; font-size: .72rem; display: grid; place-items: center; }
.ticker-track { flex: 1; overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-inner { display: inline-flex; gap: 40px; white-space: nowrap; padding: .45em 0; animation: scroll 60s linear infinite; }
.ticker-inner:hover { animation-play-state: paused; }
@keyframes scroll { from { transform: translateX(0) } to { transform: translateX(-50%) } }

/* ---------- Inhalt ---------- */
.view { padding: 24px; max-width: 1240px; width: 100%; margin: 0 auto; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: 1.4fr 1fr; }
.card { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .value.gold { color: var(--gold2); }
.stat .sub { color: var(--muted); font-size: .8rem; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }
.xpbar { height: 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin-top: 8px; }
.xpbar > div { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold2)); transition: width .6s; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; align-items: center; padding: .55em 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.list-item:last-child { border-bottom: 0; }
.list-item small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.feed { max-height: 380px; overflow-y: auto; }
.feed .list-item { animation: fadeIn .4s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px) } }
.soon-card { display: flex; gap: 14px; align-items: center; opacity: .8; }
.soon-card .big { font-size: 34px; }

/* ---------- Rangliste ---------- */
.lb { width: 100%; border-collapse: collapse; }
.lb th { text-align: left; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: .6em .8em; border-bottom: 1px solid var(--line); }
.lb td { padding: .65em .8em; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lb tr.player { cursor: pointer; transition: background .2s; }
.lb tr.player:hover { background: var(--panel2); }
.lb tr.me { background: rgba(212,175,55,.07); }
.lb tr.moved-up { animation: rowUp 2s; } .lb tr.moved-down { animation: rowDown 2s; }
@keyframes rowUp { 0% { background: rgba(62,207,122,.25) } }
@keyframes rowDown { 0% { background: rgba(239,91,91,.2) } }
.rank { font-weight: 800; width: 56px; }
.rank-1 { color: #ffd54a; } .rank-2 { color: #cfd8dc; } .rank-3 { color: #d7935a; }
.who { display: flex; align-items: center; gap: 10px; }
.lvl { font-size: .72rem; border: 1px solid var(--gold-dark); color: var(--gold2); padding: 0 .45em; border-radius: 6px; }
.adm { font-size: .68rem; background: var(--red); color: #fff; padding: 0 .4em; border-radius: 5px; font-weight: 700; }
.arrow { font-size: .75rem; margin-left: 4px; }
.right { text-align: right; }

/* ---------- Profil ---------- */
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.profile-head .info { flex: 1; min-width: 220px; }
.profile-head h2 { font-size: 1.9rem; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; margin-bottom: 12px; }
.avatar-pick button { font-size: 24px; height: 48px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); cursor: pointer; }
.avatar-pick button.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,.3); }
.empty { color: var(--muted); font-size: .9rem; padding: 1em 0; text-align: center; }

/* ---------- Markt ---------- */
.market-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
.grid.cols-2b { grid-template-columns: 1fr 1fr; }
.ticker-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.coin.big-sm { width: 46px; height: 46px; font-size: 24px; }
.big-price { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; transition: color .3s; }
.big-price.tick-up { animation: tickUp .8s; } .big-price.tick-down { animation: tickDown .8s; }
@keyframes tickUp { 20% { color: var(--up); } } @keyframes tickDown { 20% { color: var(--down); } }
.chg { font-weight: 700; font-size: .85rem; padding: .15em .5em; border-radius: 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chg.up { background: rgba(62,207,122,.12); } .chg.down { background: rgba(239,91,91,.12); }
.hl { margin-left: auto; display: grid; grid-template-columns: auto auto; gap: 0 10px; font-size: .85rem; align-items: baseline; }
.range-btns { display: flex; gap: 6px; margin-bottom: 8px; }
.chart { width: 100%; height: 320px; display: block; cursor: crosshair; touch-action: pan-y; }
.modal-card .chart { height: 220px; }
.trade .tabs { margin-top: 0; }
.trade-bal { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: .9rem; flex-wrap: wrap; }
.trade-bal .coin.sm { vertical-align: middle; }
.pct { margin: -4px 0 6px; gap: 6px; }
.pct .btn { flex: 1; }
.check { display: inline-flex; gap: 6px; align-items: center; margin: 0; white-space: nowrap; }
.check input { width: auto; margin: 0; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.asset-card {
  position: relative; background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.asset-card:hover { transform: translateY(-2px); border-color: var(--gold-dark); }
.asset-card.owned { border-color: rgba(212,175,55,.5); }
.mine-badge { position: absolute; top: 10px; right: 10px; font-size: .7rem; font-weight: 700; background: var(--gold); color: #241c06; padding: .1em .5em; border-radius: 6px; }
.ac-top { display: flex; align-items: center; gap: 10px; }
.ac-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-size: 24px; flex: none; }
.ac-ico.sm { width: 30px; height: 30px; font-size: 16px; border-radius: 8px; }
.ac-ico.lg { width: 60px; height: 60px; font-size: 34px; }
.ac-name { min-width: 0; }
.asset-card.owned .ac-name { padding-right: 44px; }
.ac-name b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-name small { color: var(--muted); font-size: .78rem; }
.ac-price { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-meta { color: var(--muted); font-size: .82rem; }
.supply { display: flex; align-items: center; gap: 8px; }
.supply small { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.supply-bar { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.supply-bar > div { height: 100%; background: linear-gradient(90deg, var(--green), var(--up)); }
.stars { color: var(--gold2); letter-spacing: 1px; font-size: .9rem; white-space: nowrap; }
.stars .off { color: var(--line); }
.holdings { display: flex; flex-direction: column; }
.holding { display: flex; align-items: center; gap: 12px; padding: .7em 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.holding:last-child { border-bottom: 0; }
.h-main { flex: 1; min-width: 180px; }
.h-main small { display: block; color: var(--muted); font-size: .78rem; }
.h-actions { display: flex; gap: 6px; flex-wrap: wrap; }
a.soon-card.new { opacity: 1; border-color: rgba(212,175,55,.4); }
a.soon-card.new:hover { border-color: var(--gold); }
.announce-banner.market { background: linear-gradient(90deg, #6b5310, #b58d1f, #6b5310); color: #fff8e0; }

@media (max-width: 1000px) {
  .market-grid, .grid.cols-2b { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .chart { height: 240px; }
  .big-price { font-size: 1.5rem; }
}

#xFeed { overflow-x: hidden; }
#xFeed .list-item { flex-wrap: wrap; row-gap: 2px; }

/* Kaufdruck-Anzeige */
.pressure { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.pressure > div { height: 100%; transition: width .5s; }
.pr-buy { background: linear-gradient(90deg, #1f8a4c, var(--up)); }
.pr-sell { background: linear-gradient(90deg, var(--down), #a32b2b); }

/* ---------- Kontoauszug ---------- */
.tx-filters { margin-bottom: 8px; }
.tx-filters select { max-width: 240px; }
.tx-row { display: flex; align-items: center; gap: 12px; padding: .7em .2em; border-bottom: 1px solid var(--line); }
.tx-row:last-child { border-bottom: 0; }
.tx-row.fresh { animation: rowUp 2s; }
.tx-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; flex: none; }
.tx-main { flex: 1; min-width: 0; }
.tx-main small, .tx-amt small { display: block; color: var(--muted); font-size: .75rem; }
.tx-who { color: var(--gold2); }
.tx-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Admin ---------- */
.role { font-size: .7rem; font-weight: 700; padding: .1em .5em; border-radius: 6px; white-space: nowrap; }
.role-owner { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #241c06; }
.role-admin { background: #7a1f1f; color: #ffd9d9; }
.role-mod { background: #1d3f73; color: #d6e6ff; }
.admin-badge { color: var(--red); }
.table-wrap { overflow-x: auto; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + .track { background: var(--red); }
.switch input:checked + .track.green-on { background: var(--green); }
.event-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.switch input:checked + .track::after { transform: translateX(20px); }
.tag { font-size: .72rem; padding: .1em .5em; border-radius: 6px; border: 1px solid var(--line); }
.tag.red { border-color: var(--red); color: var(--down); }

/* ---------- Toasts / Modal ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 32px); }
.toast {
  background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  padding: .75em 1em; border-radius: 12px; box-shadow: var(--shadow); min-width: 240px; max-width: 360px;
  animation: toastIn .3s; display: flex; gap: 10px; align-items: flex-start;
}
.toast.err { border-left-color: var(--red); }
.toast.announce { border-left-color: var(--red); background: linear-gradient(90deg, rgba(217,72,72,.18), var(--panel2)); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) } }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.announce-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 95; padding: 14px 20px; text-align: center; font-weight: 600;
  background: linear-gradient(90deg, #7a1f1f, #b83333, #7a1f1f); box-shadow: var(--shadow); animation: slideDown .4s;
}
@keyframes slideDown { from { transform: translateY(-100%) } }

/* ---------- Chat ---------- */
.chat-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; z-index: 60; display: flex; flex-direction: column;
  background: rgba(13,18,16,.98); border-left: 1px solid var(--line); box-shadow: var(--shadow); animation: chatIn .25s;
}
@keyframes chatIn { from { transform: translateX(40px); opacity: 0; } }
body.chat-open .main { margin-right: 360px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head .icon-btn { margin-left: auto; width: 32px; height: 32px; font-size: .85rem; }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { display: flex; gap: 8px; align-items: flex-start; animation: fadeIn .25s; }
.chat-msg .avatar { width: 30px; height: 30px; font-size: 16px; }
.chat-bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 6px 10px; min-width: 0; max-width: 100%; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .chat-bubble { background: rgba(212,175,55,.1); border-color: rgba(212,175,55,.35); border-radius: 14px 4px 14px 14px; }
.chat-meta { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.chat-meta b { color: var(--gold2); }
.chat-meta small { color: var(--muted); }
.chat-body { font-size: .9rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.mention { color: #8fa6ff; font-weight: 600; }
.mention.me { background: rgba(143,166,255,.18); border-radius: 4px; padding: 0 3px; }
.chat-tools { margin-left: auto; display: none; gap: 2px; }
.chat-msg:hover .chat-tools { display: inline-flex; }
.chat-tools button { background: none; border: 0; cursor: pointer; font-size: .85rem; padding: 0 2px; opacity: .7; }
.chat-tools button:hover { opacity: 1; }
.chat-system { text-align: center; font-size: .78rem; color: var(--muted); }
.chat-emojis { display: flex; gap: 4px; padding: 6px 12px 0; overflow-x: auto; }
.chat-emojis button { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; cursor: pointer; font-size: .95rem; color: var(--text); flex: none; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 14px; }

.mobile-only { display: none; }
@media (max-width: 1100px) {
  body.chat-open .main { margin-right: 0; }
}

/* ---------- Handy ---------- */
@media (max-width: 1000px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mobile-only { display: inline-block; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .topbar { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .search { order: 10; max-width: none; flex-basis: 100%; }
  .me-text { display: none; }
  .me-chip { padding: 3px; }
  .bal { padding: .3em .6em; font-size: .85rem; }
  .view { padding: 16px; }
  .notif-panel { position: fixed; left: 16px; right: 16px; top: 60px; width: auto; }
  .chat-drawer { width: 100%; }
  .hide-sm { display: none; }
  .stat .value { font-size: 1.2rem; }
}
