/* Clip Awards */
:root {
  --bg: #0c0d10;
  --surface: #15171c;
  --surface-2: #1e2128;
  --border: #2a2e37;
  --text: #eceef2;
  --muted: #9aa1ad;
  --accent: #00d6b0;
  --ok: #3ecf8e;
  --warn: #f5b942;
  --danger: #ff5c5c;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: var(--warn); }
[hidden] { display: none !important; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; display: grid; gap: 16px; align-content: start; }

/* ---------- Bausteine ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0; width: 100%;
}
input[type=color] { padding: 2px; height: 38px; width: 80px; }
input[type=file] { padding: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
label input, label select, label textarea { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.btn.primary { background: var(--accent); border-color: transparent; color: #0b0c0d; font-weight: 700; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.ok { color: var(--ok); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: default; }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.phase-submit, .badge.phase-submit_vote, .badge.phase-vote, .badge.phase-live { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.badge.phase-results { background: #f5b94222; color: var(--warn); }
.badge.st-pending { background: #f5b94222; color: var(--warn); }
.badge.st-approved { background: #3ecf8e22; color: var(--ok); }
.badge.st-rejected { background: #ff5c5c22; color: var(--danger); }

.flash { max-width: 1000px; margin: 12px auto 0; padding: 10px 16px; border-radius: 10px; background: #3ecf8e1a; border: 1px solid #3ecf8e55; }
.flash.error { background: #ff5c5c1a; border-color: #ff5c5c66; }
.notice { padding: 10px 14px; border-radius: 10px; background: #f5b9421a; border: 1px solid #f5b94255; margin: 0; }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--surface-2);
  border: 1px solid var(--border); border-left: 4px solid var(--ok); padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { border-left-color: var(--danger); }

/* ---------- Kopfzeile ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.topnav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.who { padding: 0 6px; }

/* ---------- Seiten ---------- */
.hero { padding: 24px 0 4px; }
.hero h1 { font-size: 2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.round-card, .action { display: grid; gap: 6px; text-decoration: none; color: var(--text); align-content: start; }
.round-card:hover, a.action:hover { border-color: var(--accent); }
.round-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--surface-2); border-radius: 8px; }
.round-card .badge { justify-self: start; }
.action.primary { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.action strong { font-size: 1.05rem; }

.round-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.round-logo { width: 96px; height: 96px; object-fit: contain; border-radius: 16px; background: var(--surface-2); }
.round-head h1 { margin: 2px 0 6px; }
.prose { white-space: normal; }

.form { display: grid; gap: 12px; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: end; }
.two-col .full, .two-col p { grid-column: 1 / -1; margin: 0; }
.two-col > .btn { justify-self: start; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.inline-form label { flex: 1 1 200px; }
.logo-preview { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: var(--surface-2); }
.phase-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.plain { margin: 0; padding-left: 18px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.inline-danger summary { list-style: none; }
.inline-danger[open] summary { display: none; }
.danger-zone summary { cursor: pointer; color: var(--danger); }

/* ---------- Clip-Listen ---------- */
.clip-list, .ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.clip-list li, .ranking li { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; flex-wrap: wrap; }
.thumb { flex: 0 0 auto; width: 128px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty { color: var(--muted); font-size: 1.4rem; }
.clip-meta { flex: 1 1 220px; display: grid; gap: 2px; min-width: 0; }
.clip-meta strong { overflow-wrap: anywhere; }
.clip-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form + .clip-list { margin-top: 14px; }
.clip-list.manage li.st-pending { border-color: #f5b94288; }
.clip-list.manage li.st-rejected { opacity: .6; }

.ranking .rank { width: 44px; text-align: center; font-size: 1.3rem; font-weight: 800; }
.ranking .top { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.ranking .top-1 { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.score { display: grid; justify-items: end; gap: 2px; margin-left: auto; }
.stars-static { --v: 0; position: relative; font-size: 1.1rem; letter-spacing: 2px; color: var(--border); }
.stars-static::before { content: "★★★★★"; }
.stars-static::after { content: "★★★★★"; position: absolute; inset: 0; width: calc(var(--v) / 5 * 100%); overflow: hidden; color: #ffcc33; white-space: nowrap; }

/* ---------- Voting ---------- */
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.vote-card { display: grid; gap: 10px; }
.embed { aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.stars { display: flex; gap: 6px; justify-content: center; }
.star { background: none; border: 0; font-size: 2.6rem; line-height: 1; color: var(--border); cursor: pointer; padding: 0 2px; transition: transform .1s, color .1s; }
.star.on, .star.hover { color: #ffcc33; }
.star:hover { transform: scale(1.12); }
.stars.small .star { font-size: 1.3rem; }
.vote-actions { display: flex; justify-content: center; }
.mine summary { cursor: pointer; font-weight: 600; }
.mine .clip-list { margin-top: 12px; }
.done h2 { margin: 0 0 6px; }

.player-dialog { width: min(960px, 94vw); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.player-dialog::backdrop { background: #000b; }
.player-dialog form { display: flex; justify-content: flex-end; margin-top: 10px; }

@media (max-width: 600px) {
  .thumb { width: 96px; }
  .round-logo { width: 64px; height: 64px; }
  .star { font-size: 2.2rem; }
}
