:root {
  --bg: #14151a; --panel: #1d1f27; --panel2: #262935; --line: #323646; --text: #f2f3f7; --muted: #9aa0b4;
  --accent: #f5b83d; --accent-ink: #231a05; --good: #4cd08a; --bad: #ff6b6b; --blue: #6aa6ff;
  --radius: 14px; --tap: 48px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; } h2 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; } h3 { font-size: 1rem; margin: .8rem 0 .3rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; padding-top: calc(.6rem + env(safe-area-inset-top)); background: rgba(20,21,26,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); font-size: 1.1rem; }
.who { margin-left: auto; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 1.1rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; top: 46px; left: 0; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 12px 30px rgba(0,0,0,.5); z-index: 100; }
.menu-pop a { color: var(--text); padding: .6rem .7rem; border-radius: 8px; white-space: nowrap; }
.menu-pop a:hover { background: var(--panel2); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
main { max-width: 760px; margin: 0 auto; padding: .9rem; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; background: rgba(29,31,39,.96); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(8px); }
.tabs a { flex: 1; text-align: center; padding: .45rem .1rem .4rem; color: var(--muted); font-size: .72rem; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 56px; justify-content: center; }
.tabs a span { font-size: 1.35rem; line-height: 1; } .tabs a.on { color: var(--accent); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; margin: 0 0 .8rem; }
.card.tight { padding: .6rem .8rem; }
.row { display: flex; align-items: center; gap: .6rem; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: .6rem; } .grid.two { grid-template-columns: 1fr 1fr; } .grid.auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
button, .btn { font: inherit; min-height: var(--tap); padding: .55rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-align: center; }
button:active, .btn:active { transform: scale(.98); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.ghost { background: transparent; } button.big { min-height: 64px; font-size: 1.2rem; width: 100%; }
button.small { min-height: 36px; padding: .25rem .7rem; font-size: .85rem; } button[disabled] { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; width: 100%; min-height: var(--tap); padding: .5rem .75rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
textarea { min-height: 90px; } label { display: block; font-size: .85rem; color: var(--muted); margin: .6rem 0 .25rem; }
input[type=checkbox] { width: 22px; min-height: 22px; accent-color: var(--accent); } input[type=color] { padding: 2px; }
.check { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); color: var(--text); font-size: 1rem; margin: 0; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; background: var(--bg); min-height: 44px; } .seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; min-height: 40px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; user-select: none; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; } .chip.off { opacity: .5; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1rem; background: var(--panel2); flex: none; object-fit: cover; border: 2px solid transparent; overflow: hidden; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.8rem; }
.badge { padding: .1rem .5rem; border-radius: 999px; background: var(--panel2); font-size: .75rem; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.list > * { border-bottom: 1px solid var(--line); } .list > *:last-child { border-bottom: 0; }
.item { display: flex; align-items: center; gap: .7rem; padding: .65rem .1rem; min-height: 52px; }
table.tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; padding: .3rem .4rem; } .tbl td { padding: .5rem .4rem; border-top: 1px solid var(--line); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--panel); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 1rem; max-height: 92vh; overflow: auto; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; } }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: .4rem; z-index: 300; pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--line); padding: .6rem 1rem; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: 90vw; } .toast.bad { border-color: var(--bad); color: var(--bad); } .toast.good { border-color: var(--good); }
.empty { text-align: center; color: var(--muted); padding: 1.5rem 1rem; }
.err { color: var(--bad); }
/* Spiele */
.stage { text-align: center; padding: 1rem .5rem; }
.bigtext { font-size: 1.6rem; font-weight: 700; line-height: 1.25; margin: .8rem 0; }
.playing-card { width: 150px; height: 210px; margin: .8rem auto; border-radius: 14px; background: #fafafa; color: #222; display: grid; place-items: center; font-size: 3.2rem; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.5); position: relative; }
.playing-card.red { color: #d22; } .playing-card small { position: absolute; top: 8px; left: 10px; font-size: 1.1rem; }
.playing-card.back { background: repeating-linear-gradient(45deg, #2a3a8c, #2a3a8c 8px, #3a4cb0 8px, #3a4cb0 16px); color: transparent; }
.rule { background: var(--panel2); border-radius: 12px; padding: .8rem; margin: .6rem 0; text-align: left; } .rule b { color: var(--accent); }
.bar { height: 10px; border-radius: 6px; background: var(--panel2); overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.medal { font-size: 1.1rem; } .winner { font-size: 3rem; }
.hero { text-align: center; padding: 1.4rem .6rem; background: linear-gradient(160deg, #2a2417, var(--panel)); border: 1px solid #5a4710; border-radius: var(--radius); }
.hero .winner { animation: pop .6s ease-out; } @keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.track { display: flex; align-items: center; gap: .4rem; margin: .5rem 0; } .lane { flex: 1; height: 38px; border-radius: 10px; background: var(--panel2); position: relative; overflow: hidden; }
.horse { position: absolute; top: 3px; left: 0; font-size: 1.7rem; transition: left .7s cubic-bezier(.3,1.2,.5,1); }
.finish { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; background: repeating-linear-gradient(0deg, #fff 0 6px, #111 6px 12px); }
.bracket { display: flex; gap: 1.2rem; overflow-x: auto; padding-bottom: .6rem; } .round { display: flex; flex-direction: column; justify-content: space-around; gap: .6rem; min-width: 170px; }
.match { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; } .match > div { padding: .45rem .6rem; display: flex; justify-content: space-between; gap: .4rem; } .match > div + div { border-top: 1px solid var(--line); } .match .w { background: #2c2a14; font-weight: 700; }
.conn { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 90; padding: .3rem .8rem; border-radius: 999px; background: var(--bad); color: #fff; font-size: .8rem; }
.pcard { display: inline-grid; place-items: center; width: 46px; height: 66px; border-radius: 8px; background: #fafafa; color: #222; font-weight: 800; font-size: 1.05rem; box-shadow: 0 3px 10px rgba(0,0,0,.4); line-height: 1; text-align: center; }
.pcard.red { color: #d22; } .pcard.back { background: repeating-linear-gradient(45deg, #2a3a8c, #2a3a8c 5px, #3a4cb0 5px, #3a4cb0 10px); color: transparent; } .pcard.empty { background: transparent; border: 2px dashed var(--line); box-shadow: none; color: transparent; }
.pcards { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.pyramid { display: flex; flex-direction: column; align-items: center; gap: .35rem; margin: .8rem 0; } .pyramid .prow { display: flex; gap: .35rem; align-items: center; } .pyramid .worth { font-size: .75rem; color: var(--muted); width: 2.2rem; text-align: right; }
.tabs { justify-content: center; } .tabs a { max-width: 150px; }
