:root {
  color-scheme: dark;
  --bg: #0b0b14;
  --bg-cell: #1a1a26;
  --bg-cell-2: #242433;
  --fill: rgb(118 118 128 / .24);
  --material: rgb(18 18 28 / .95);
  --label: #ffffff;
  --label-2: rgb(235 235 245 / .62);
  --label-3: rgb(235 235 245 / .32);
  --separator: rgb(84 84 88 / .55);
  --tint: #ffd60a;
  --on-tint: #1a1500;
  --red: #ff453a;
  --green: #30d158;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f2f2f7; --bg-cell: #ffffff; --bg-cell-2: #f2f2f7;
    --fill: rgb(118 118 128 / .12); --material: rgb(249 249 249 / .95);
    --label: #000; --label-2: rgb(60 60 67 / .62); --label-3: rgb(60 60 67 / .3);
    --separator: rgb(60 60 67 / .2);
    --tint: #c99700; --on-tint: #fff;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--label); font: 400 16px/1.35 var(--font); }
body { min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

/* ---------- Start / Name ---------- */
.hero { padding: calc(40px + var(--safe-t)) 20px 8px; text-align: center; }
.hero .moon { font-size: 56px; line-height: 1; }
.hero h1 { font-size: 30px; margin: 12px 0 4px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--label-2); }
.page { max-width: 560px; margin: 0 auto; padding: 0 16px calc(32px + var(--safe-b)); }
.card { background: var(--bg-cell); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.field { display: block; width: 100%; padding: 13px 14px; border-radius: 10px; border: 0; background: var(--fill); font-size: 17px; margin-bottom: 10px; outline: none; }
.field:focus { box-shadow: 0 0 0 2px var(--tint); }
.field.code { text-transform: uppercase; letter-spacing: .25em; font-weight: 600; text-align: center; }
.btn { display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px; background: var(--tint); color: var(--on-tint); font-weight: 600; font-size: 17px; }
.btn.secondary { background: var(--fill); color: var(--label); }
.btn:disabled { opacity: .5; }
.muted { color: var(--label-2); font-size: 14px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: .5px solid var(--separator); text-decoration: none; }
.list-row:first-of-type { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .chev { color: var(--label-3); font-size: 20px; }
.err { color: var(--red); font-size: 14px; min-height: 1em; margin: 4px 0 0; }

/* ---------- Lobby-Header ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--material); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); padding: calc(10px + var(--safe-t)) 16px 10px; border-bottom: .5px solid var(--separator); }
.topbar-row { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; }
.topbar h1 { font-size: 20px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.topbar .sub { font-size: 12px; color: var(--label-2); font-weight: 500; }
.icon-btn { border: 0; background: var(--fill); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.icon-btn.tint { background: var(--tint); color: var(--on-tint); }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 2px; scrollbar-width: none; max-width: 760px; margin: 0 auto; }
.filters::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; border: 0; background: var(--fill); padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.chip-btn.on { background: var(--label); color: var(--bg); }

/* ---------- Programm ---------- */
.content { max-width: 760px; margin: 0 auto; padding: 0 16px calc(110px + var(--safe-b)); }
.hour { position: sticky; top: var(--hdr-h, 64px); z-index: 10; display: flex; align-items: baseline; gap: 10px; padding: 16px 4px 8px; background: var(--bg); margin: 0 -16px; padding-left: 20px; padding-right: 20px; }
.hour .t { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hour .badge-now { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.hour .badge-past { color: var(--label-3); font-size: 13px; }
.hour.past .t { color: var(--label-3); }

.talk { background: var(--bg-cell); border-radius: var(--radius); padding: 14px 14px 12px; margin-bottom: 10px; position: relative; border-left: 5px solid var(--bc, var(--fill)); }
.talk.picked { box-shadow: inset 0 0 0 1.5px var(--tint); }
.talk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding-right: 44px; }
.when { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hall { display: inline-flex; align-items: center; gap: 6px; background: var(--bc); color: #fff; font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 8px; text-decoration: none; line-height: 1.2; }
.hall .b { opacity: .85; font-weight: 600; }
.talk h3 { font-size: 17px; line-height: 1.28; margin: 0 0 8px; letter-spacing: -.01em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--fill); color: var(--label-2); }
.tag.en { background: #5e5ce6; color: #fff; }
.learn { font-size: 15px; margin: 0 0 6px; }
.speaker { font-size: 13px; color: var(--label-2); margin: 0; }
.star { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; line-height: 44px; color: var(--label-3); }
.star.on { color: var(--tint); }
.who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.who:empty { display: none; }
.avatar { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; padding: 2px 9px 2px 2px; border-radius: 999px; background: var(--fill); }
.avatar i { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: #000; background: var(--c); }
.empty { text-align: center; color: var(--label-2); padding: 40px 16px; }

/* ---------- Freunde ---------- */
.friend { background: var(--bg-cell); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.friend-top { display: flex; align-items: center; gap: 10px; }
.friend-top .avatar-lg { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #000; background: var(--c); flex: none; }
.friend-top .nm { font-weight: 700; font-size: 17px; }
.friend-top .me { color: var(--label-2); font-weight: 500; font-size: 14px; }
.loc { margin-top: 10px; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loc .ago { color: var(--label-2); font-size: 13px; }
.plan { margin-top: 10px; border-top: .5px solid var(--separator); padding-top: 10px; }
.plan-row { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 5px 0; align-items: start; }
.plan-row .h { font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-row .x { font-size: 14px; }
.plan-row .x .hall { font-size: 12px; padding: 2px 7px; margin-bottom: 3px; }
.plan-row.now .h { color: var(--red); }
.plan-row.past { opacity: .4; }
.plan-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--label-2); font-weight: 700; }

/* ---------- Ort-Leiste + Tabbar ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--material); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--separator); padding-bottom: var(--safe-b); }
.dock-loc { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 760px; margin: 0 auto; padding: 10px 16px; border: 0; background: none; text-align: left; border-bottom: .5px solid var(--separator); }
.dock-loc .pin { font-size: 20px; }
.dock-loc .grow { flex: 1; min-width: 0; }
.dock-loc .l1 { font-size: 12px; color: var(--label-2); }
.dock-loc .l2 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-loc .go { color: var(--tint); font-weight: 600; font-size: 15px; }
.tabs { display: flex; max-width: 760px; margin: 0 auto; }
.tab { flex: 1; border: 0; background: none; padding: 8px 0 6px; font-size: 11px; font-weight: 600; color: var(--label-2); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tab .ic { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tab.on { color: var(--tint); }
.tab.on .ic { filter: none; opacity: 1; }
.tab .cnt { font-variant-numeric: tabular-nums; }

/* ---------- Sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 50; animation: fade .15s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg-cell); border-radius: 16px 16px 0 0; max-height: 88dvh; overflow-y: auto; padding: 8px 16px calc(20px + var(--safe-b)); animation: up .2s ease-out; max-width: 640px; margin: 0 auto; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 0 auto 10px; }
.sheet h2 { font-size: 20px; margin: 4px 0 12px; }
.sheet .grp { font-size: 13px; font-weight: 700; color: var(--label-2); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { border: 0; background: var(--fill); border-radius: 10px; padding: 12px 10px; text-align: left; font-size: 15px; font-weight: 600; border-left: 4px solid var(--bc, transparent); }
.opt.on { box-shadow: inset 0 0 0 2px var(--tint); }
.opt small { display: block; font-weight: 500; color: var(--label-2); font-size: 12px; }
.row-inline { display: flex; gap: 8px; }
.row-inline .field { margin: 0; }
.row-inline .btn { width: auto; padding: 0 18px; }
.share-link { word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--fill); padding: 12px; border-radius: 10px; margin-bottom: 10px; user-select: all; }
.big-code { font-size: 34px; font-weight: 800; letter-spacing: .2em; text-align: center; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }

#toast { position: fixed; left: 50%; bottom: calc(130px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--label); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.offline { background: var(--red); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 4px; }

@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40%); opacity: .5 } }

/* ---------- Vortrag-Details ---------- */
.tappable { cursor: pointer; }
.more { border: 0; background: none; color: var(--tint); font-weight: 600; font-size: 15px; padding: 10px 0 0; }
.detail-title { font-size: 22px !important; line-height: 1.25; margin: 4px 0 10px !important; letter-spacing: -.01em; }
.detail-body { margin-top: 8px; }
.detail-body h3 { font-size: 17px; margin: 18px 0 6px; }
.detail-body h4 { font-size: 15px; margin: 14px 0 4px; color: var(--label-2); }
.detail-body p { margin: 0 0 8px; font-size: 16px; line-height: 1.45; }

/* ---------- Admin ---------- */
.admin-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: .5px solid var(--separator); }
.admin-row:first-of-type { border-top: 0; }
.admin-row .grow { flex: 1; min-width: 0; font-weight: 600; }
.admin-row .avatar { padding: 2px; }
.icon-btn.danger { color: var(--red); }
.btn.danger { background: var(--red); color: #fff; }

/* ---------- Voting ---------- */
.summary { background: linear-gradient(135deg, rgb(255 214 10 / .16), rgb(255 159 10 / .08)); border: 1px solid rgb(255 214 10 / .35); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.sum-win { display: flex; gap: 10px; align-items: flex-start; }
.trophy { font-size: 30px; line-height: 1; }
.sum-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--tint); margin-bottom: 4px; }
.sum-talk { font-weight: 700; font-size: 15px; line-height: 1.3; margin-top: 4px; }
.sum-talk .hall { font-size: 12px; padding: 2px 7px; }
.sum-going { margin-top: 10px; padding-top: 10px; border-top: .5px solid var(--separator); }
.sum-going .sum-label { color: var(--green); }
.sum-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.sum-row .hall { font-size: 12px; padding: 2px 7px; }
.sum-row .arrow { color: var(--label-2); }
.sum-open { margin-top: 8px; font-size: 13px; }
.badge-go { background: var(--green); color: #000; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.talk.winner { box-shadow: 0 0 0 2px var(--tint), 0 6px 24px rgb(255 214 10 / .18); }
.ribbon { position: absolute; top: -9px; left: 14px; background: var(--tint); color: var(--on-tint); font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.talk.winner .talk-head { margin-top: 4px; }
.votes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.vote-count { font-size: 13px; font-weight: 800; color: var(--tint); margin-right: 2px; }
.go-count { font-size: 13px; font-weight: 800; color: var(--green); margin-right: 2px; }
.talk-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.talk-actions .more { padding: 0; }
.go-btn { border: 1.5px solid var(--green); background: none; color: var(--green); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 700; }
.go-btn.on { background: var(--green); color: #000; }
.go-btn.big { padding: 14px; border-radius: 12px; font-size: 17px; width: 100%; }
.detail-actions { display: grid; gap: 8px; margin: 10px 0 4px; }
.plan-row.final .h { color: var(--green); }

/* ---------- Profmatch ---------- */
body.match-mode { overscroll-behavior: none; }
.match { display: flex; flex-direction: column; align-items: center; }
.match-head { width: 100%; max-width: 440px; padding: 14px 0 6px; text-align: center; }
.match-title { font-size: 24px; font-weight: 900; letter-spacing: -.02em; background: linear-gradient(90deg, #ff375f, #ff9f0a, #ffd60a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.progress { height: 4px; background: var(--fill); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #ff375f, #ffd60a); transition: width .3s; }
.stack { position: relative; width: 100%; max-width: 440px; height: min(58dvh, 520px); margin-top: 10px; }
.mcard { position: absolute; inset: 0; background: var(--bg-cell); border-radius: 22px; padding: 20px 18px; overflow: hidden; display: flex; flex-direction: column; border-top: 6px solid var(--bc); box-shadow: 0 10px 30px rgb(0 0 0 / .35); touch-action: none; user-select: none; -webkit-user-select: none; }
.mcard:not(.top) { transform: scale(.94) translateY(14px); opacity: .7; }
.mcard.top { cursor: grab; z-index: 2; }
.mcard-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mtime { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mcard h2 { font-size: 22px; line-height: 1.22; margin: 0 0 12px; letter-spacing: -.01em; }
.mlearn { font-size: 16px; margin: 0 0 10px; }
.mlikers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.mcard .more { align-self: flex-start; }
.stamp { position: absolute; top: 26px; font-size: 34px; font-weight: 900; letter-spacing: .06em; border: 4px solid; border-radius: 10px; padding: 2px 10px; opacity: 0; pointer-events: none; z-index: 3; }
.stamp.like { left: 18px; color: var(--green); transform: rotate(-14deg); }
.stamp.nope { right: 18px; color: var(--red); transform: rotate(14deg); }
.stamp.super { left: 50%; top: auto; bottom: 30%; transform: translateX(-50%) rotate(-6deg); color: #64d2ff; }
.mbtns { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 18px 0 8px; }
.mbtn { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--bg-cell); font-size: 28px; box-shadow: 0 4px 14px rgb(0 0 0 / .3); transition: transform .1s; }
.mbtn:active { transform: scale(.9); }
.mbtn.nope { color: var(--red); }
.mbtn.like { color: var(--green); font-size: 32px; }
.mbtn.super { width: 52px; height: 52px; font-size: 22px; }
.mbtn.undo { width: 44px; height: 44px; font-size: 20px; color: var(--tint); }
.mbtn:disabled { opacity: .3; }
.center { text-align: center; }
.match-done { width: 100%; max-width: 440px; text-align: center; padding-top: 10px; }
.big-emoji { font-size: 64px; }
.match-done h2 { margin: 6px 0 4px; }
.done-row { display: flex; gap: 10px; text-align: left; background: var(--bg-cell); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.done-row .h { font-weight: 800; font-variant-numeric: tabular-nums; }
.done-row .grow { flex: 1; font-size: 14px; }
.done-row .hall { font-size: 11px; padding: 1px 6px; }
.match-overlay { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / .78); display: grid; place-items: center; padding: 20px; animation: fade .2s; overflow: hidden; }
.match-box { position: relative; text-align: center; max-width: 380px; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); color: #fff; }
.match-big { font-size: 38px; font-weight: 900; font-style: italic; letter-spacing: -.02em; background: linear-gradient(90deg, #ff375f, #ffd60a); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.match-avatars { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 18px 0 8px; flex-wrap: wrap; }
.match-avatars .heart { font-size: 28px; animation: beat .8s infinite; }
.match-talk { font-size: 19px; font-weight: 800; margin: 6px 0 10px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; background: var(--c); border-radius: 2px; animation: fall 2.4s var(--d) ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes beat { 50% { transform: scale(1.25); } }
