/* ═══════════════════════════════════════════════════
   Brettspiel-Abstimmung · Design System
   Theme: Spielabend — Dark wood, warm amber
═══════════════════════════════════════════════════ */

:root {
  --bg:          #12141f;
  --surface:     #1c1f30;
  --surface2:    #252840;
  --border:      #2e3255;
  --border-light:#3a3f6e;

  --gold:        #f0b429;
  --gold-dim:    #c4922a;
  --gold-glow:   rgba(240,180,41,0.15);

  --text:        #e8e9f5;
  --text-muted:  #7e84b0;
  --text-dim:    #4a5080;

  --green:       #38c97a;
  --red:         #e05252;
  --blue:        #5b8af5;
  --orange:      #f07c30;

  --pts-5: #f0b429;
  --pts-4: #5b8af5;
  --pts-3: #38c97a;
  --pts-2: #f07c30;
  --pts-1: #9b87d4;

  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 20px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --transition: 0.18s ease;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito', system-ui, sans-serif;
}

/* ─── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #fff; }

/* ─── Layout ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

/* ─── Navbar ─────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nav-brand:hover { color: var(--gold); opacity: 0.85; }

.nav-links { display: flex; align-items: center; gap: 1rem; }

.nav-user {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nav-link, .btn-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color var(--transition);
}
.nav-link:hover, .btn-link:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 0.25rem; }

.home-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}
.home-more { margin-top: 1rem; }
.form-group textarea { resize: vertical; min-height: 8rem; }

/* Rich-text content — shared by the public page (.home-info) and the Trix editor content.
   Restores list/quote/code styling that the global reset (* { margin:0; padding:0 }) strips,
   so the editor is a true WYSIWYG match for the rendered page (incl. nested lists). */
.home-info h1, .home-info h2,
.form-card trix-editor h1, .form-card trix-editor h2 { font-size: 1.35rem; margin: 0.5rem 0; }
.home-info ul, .home-info ol,
.form-card trix-editor ul, .form-card trix-editor ol { padding-left: 1.6rem; margin: 0.4rem 0; }
.home-info ul, .form-card trix-editor ul { list-style: disc; }
.home-info ol, .form-card trix-editor ol { list-style: decimal; }
.home-info li, .form-card trix-editor li { margin: 0.15rem 0; }
.home-info blockquote, .form-card trix-editor blockquote {
  border-left: 3px solid var(--border-light);
  padding-left: 1rem;
  margin: 0.5rem 0;
  color: var(--text-muted);
}
.home-info pre, .form-card trix-editor pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin: 0.5rem 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
}
.home-info a, .form-card trix-editor a { color: var(--gold); }

/* Trix editor (admin) — dark theme. Scoped under .form-card so it beats trix.css,
   which is loaded after style.css. */
.form-card trix-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.3rem 0.4rem;
}
.form-card trix-toolbar .trix-button-row { flex-wrap: wrap; }   /* no horizontal scrollbar */
.form-card trix-toolbar .trix-button-group { border-color: var(--border); margin-bottom: 0.25rem; }
.form-card trix-toolbar .trix-button { background: transparent; }
.form-card trix-toolbar .trix-button::before { filter: invert(1); opacity: 0.8; }  /* black icons → light */
.form-card trix-toolbar .trix-button.trix-active { background: var(--gold-glow); }
.form-card trix-toolbar .trix-button.trix-active::before { opacity: 1; }
.form-card trix-editor {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 20rem;
  padding: 0.9rem 1rem;
}
.form-card trix-editor:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.form-card trix-editor a { color: var(--gold); }

.badge-admin {
  background: var(--gold);
  color: #111;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

/* ─── Footer ─────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ─── Page Header ────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.subtitle { color: var(--text-muted); font-size: 0.95rem; }
.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--gold); }

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--gold);
  color: #111;
}
.btn-primary:hover:not(:disabled) {
  background: #ffd060;
  color: #111;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(240,180,41,0.3);
}
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c43d3d; }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 0.8rem 1.8rem; font-size: 1.05rem; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.78rem; }

/* ─── Alerts ─────────────────────────────────────── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border-left: 3px solid;
}
.alert-error   { background: rgba(224,82,82,0.12);  border-color: var(--red);   color: #ff9090; }
.alert-success { background: rgba(56,201,122,0.12); border-color: var(--green); color: #6feaaa; }
.alert-info    { background: rgba(91,138,245,0.12); border-color: var(--blue);  color: #94b8ff; }
.alert-warning { background: rgba(240,124,48,0.12); border-color: var(--orange);color: #ffaa70; }

/* ─── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  appearance: none;
  color-scheme: dark;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-group input::placeholder { color: var(--text-dim); }
.form-hint { color: var(--text-dim); font-size: 0.8rem; margin-top: 0.3rem; display: block; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }
.form-card, .admin-form { max-width: 640px; }
.checkbox-group label { display: flex; align-items: center; gap: 0.5rem; text-transform: none; font-size: 0.95rem; }

/* ─── Auth pages ─────────────────────────────────── */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 3rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-icon { font-size: 2.5rem; text-align: center; margin-bottom: 1rem; }
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 0.4rem;
}
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.8rem; }
.auth-form { display: flex; flex-direction: column; gap: 0; }

/* ─── Home / Round card ──────────────────────────── */
.round-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}
.round-card.active-round { border-color: var(--gold-dim); }

.round-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.round-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.phase-badge {
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.phase-submit { background: rgba(91,138,245,0.2); color: #94b8ff; border: 1px solid var(--blue); }
.phase-vote   { background: rgba(240,180,41,0.2); color: var(--gold); border: 1px solid var(--gold-dim); }
.phase-closed { background: rgba(56,201,122,0.2); color: var(--green); border: 1px solid var(--green); }

.deadlines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.deadline-item {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
}
.deadline-label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.deadline-value { font-weight: 600; font-size: 0.92rem; }

.round-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hint { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.75rem; }
.hint.warning { color: #ffaa70; }
.hint.success { color: var(--green); }

.my-submissions-preview { margin-top: 0.75rem; }

/* ─── Past rounds ────────────────────────────────── */
.past-rounds h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rounds-list { display: flex; flex-direction: column; gap: 0.5rem; }
.round-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all var(--transition);
}
.round-item:hover { border-color: var(--gold-dim); color: var(--text); }
.round-name { flex: 1; font-weight: 600; }
.round-date { color: var(--text-muted); font-size: 0.85rem; }
.round-arrow { color: var(--text-dim); }

/* ─── Empty state ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ─── Submit page ────────────────────────────────── */
.submit-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.submit-form-card, .my-games-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.submit-form-card h2, .my-games-card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
}

/* BGG Autocomplete */
.search-input-wrapper { position: relative; }
.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-dim);
}
.bgg-results {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow);
  margin-top: 2px;
}
.bgg-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.bgg-result:last-child { border-bottom: none; }
.bgg-result:hover { background: var(--border); }
.bgg-title { font-weight: 500; }
.bgg-year { color: var(--text-muted); font-size: 0.82rem; }
.bgg-no-results, .bgg-error {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  list-style: none;
}

.game-search-wrapper { position: relative; }

.selected-game {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: var(--gold-glow);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.selected-label { font-size: 0.82rem; color: var(--text-muted); }
.selected-title { font-weight: 600; flex: 1; }
.btn-clear { background: none; border: none; cursor: pointer; color: var(--text-dim); font-size: 1rem; line-height: 1; padding: 0.1rem; }
.btn-clear:hover { color: var(--red); }

/* My games list */
.my-games-list { list-style: none; margin-bottom: 1rem; }
.my-game-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.my-game-item:last-child { border-bottom: none; }
.game-title { flex: 1; font-weight: 500; }
.bonus-tag {
  font-size: 0.75rem;
  color: var(--green);
  background: rgba(56,201,122,0.12);
  padding: 0.1em 0.5em;
  border-radius: 4px;
}
.btn-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem;
  border-radius: 4px;
  transition: all var(--transition);
}
.btn-delete:hover { color: var(--red); background: rgba(224,82,82,0.1); }

.count-badge {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.15em 0.5em;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
}

.progress-bar-wrapper {
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1rem;
}
.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ─── Vote page ──────────────────────────────────── */
.vote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.vote-progress {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}
.vote-progress span { color: var(--gold); }

.points-legend { display: flex; gap: 0.5rem; align-items: center; }
.pts-pill {
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.pts-pill.pts-5 { background: rgba(240,180,41,0.2); color: var(--pts-5); }
.pts-pill.pts-4 { background: rgba(91,138,245,0.2); color: var(--pts-4); }
.pts-pill.pts-3 { background: rgba(56,201,122,0.2); color: var(--pts-3); }
.pts-pill.pts-2 { background: rgba(240,124,48,0.2); color: var(--pts-2); }
.pts-pill.pts-1 { background: rgba(155,135,212,0.2); color: var(--pts-1); }

.games-vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.vote-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  transition: all var(--transition);
}
.vote-card:hover { border-color: var(--border-light); }
.vote-card.has-vote { border-color: var(--gold-dim); background: linear-gradient(135deg, var(--surface), rgba(240,180,41,0.05)); }

.vote-card-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.game-meta { margin-bottom: 0.75rem; }
.bonus-badge {
  font-size: 0.75rem;
  color: var(--green);
  background: rgba(56,201,122,0.1);
  padding: 0.2em 0.5em;
  border-radius: 4px;
}

.points-buttons {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.9rem;
}
.pts-btn {
  flex: 1;
  padding: 0.5rem 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.pts-btn:hover:not(.selected) { border-color: var(--border-light); color: var(--text); }
.pts-btn.used-by-other { opacity: 0.3; }

/* Point button colors when selected */
.pts-btn[data-points="5"].selected { background: rgba(240,180,41,0.2); border-color: var(--pts-5); color: var(--pts-5); }
.pts-btn[data-points="4"].selected { background: rgba(91,138,245,0.2); border-color: var(--pts-4); color: var(--pts-4); }
.pts-btn[data-points="3"].selected { background: rgba(56,201,122,0.2); border-color: var(--pts-3); color: var(--pts-3); }
.pts-btn[data-points="2"].selected { background: rgba(240,124,48,0.2); border-color: var(--pts-2); color: var(--pts-2); }
.pts-btn[data-points="1"].selected { background: rgba(155,135,212,0.2); border-color: var(--pts-1); color: var(--pts-1); }

.bga-link { font-size: 0.85rem; color: var(--text-dim); transition: color var(--transition); }
.bga-link:hover { color: var(--gold); }

.vote-submit-bar {
  position: sticky;
  bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.vote-hint { color: var(--text-muted); font-size: 0.88rem; }
.vote-hint.success { color: var(--green); }

/* ─── Results ────────────────────────────────────── */
.results-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.live-badge { color: #ff7070; }

.results-list { display: flex; flex-direction: column; gap: 0.75rem; }

.result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 1rem;
  align-items: start;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}
.result-item:hover { border-color: var(--border-light); }
.result-item.rank-1 { border-color: var(--pts-5); background: linear-gradient(135deg, var(--surface), rgba(240,180,41,0.07)); }
.result-item.rank-2 { border-color: #b0b0c0; }
.result-item.rank-3 { border-color: #aa7050; }

.rank-badge {
  font-size: 1.6rem;
  text-align: center;
  grid-row: 1 / 3;
}

.result-info { grid-column: 2; }
.result-title {
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.result-submitters { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

.result-scores {
  text-align: right;
  grid-row: 1 / 3;
}
.score-total {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
}
.score-breakdown { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Prices & budget ────────────────────────────── */
.budget-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gold-glow);
  border: 1px solid var(--gold-dim);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}
.budget-banner strong { color: var(--gold); }

.game-price,
.result-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-glow);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  white-space: nowrap;
}

.vote-card-title .vc-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.score-bonus { color: var(--green); }

.result-bar-wrapper {
  grid-column: 1 / 4;
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.result-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 2px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.locked-results {
  text-align: center;
  padding: 4rem 2rem;
}
.lock-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.locked-results h2 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 0.5rem; }
.locked-results p { color: var(--text-muted); margin-bottom: 1.5rem; }

.my-votes-summary {
  margin-top: 2rem;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.my-votes-summary h3 { font-size: 0.95rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.my-votes-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.my-vote-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.my-vote-pts {
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.1em 0.5em;
  border-radius: 4px;
}
.my-vote-pts.pts-5 { background: rgba(240,180,41,0.2); color: var(--pts-5); }
.my-vote-pts.pts-4 { background: rgba(91,138,245,0.2); color: var(--pts-4); }
.my-vote-pts.pts-3 { background: rgba(56,201,122,0.2); color: var(--pts-3); }
.my-vote-pts.pts-2 { background: rgba(240,124,48,0.2); color: var(--pts-2); }
.my-vote-pts.pts-1 { background: rgba(155,135,212,0.2); color: var(--pts-1); }

/* ─── Admin ──────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.section-header h2 { font-family: var(--font-display); font-size: 1.25rem; }

.admin-list { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-item-compact { padding: 0.5rem 0.9rem; }
.admin-item-info { display: flex; flex-direction: column; gap: 0.2rem; }
.admin-item-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: flex-start; }

.games-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.games-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.games-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.games-table tr:last-child td { border-bottom: none; }

.merge-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; align-items: start; }
.merge-games-list, .merge-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
/* min-width:0 lets the grid item shrink below the table's intrinsic width;
   overflow-x lets the wide table scroll inside the card instead of overflowing. */
.merge-games-list { min-width: 0; overflow-x: auto; }
.merge-games-list h2, .merge-form-card h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.merge-arrow { text-align: center; color: var(--text-muted); margin: 0.5rem 0; font-size: 0.85rem; }

.rename-details summary { cursor: pointer; list-style: none; }
.rename-details summary::-webkit-details-marker { display: none; }
.rename-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  align-items: center;
}
.rename-form input {
  flex: 1;
  padding: 0.35rem 0.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
}
.rename-form input:focus { outline: none; border-color: var(--gold); }
/* Price needs only a few chars — fixed width so it doesn't stretch the table column.
   min-width:0 overrides the flex default (min-width:auto = the input's size-based width). */
.rename-form input[name="price"] { flex: 0 0 7rem; min-width: 0; }

/* ─── Library & roles ─────────────────────────────── */
.library-toolbar { margin-bottom: 1.25rem; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.library-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition);
}
.library-card:hover { border-color: var(--border-light); }
.library-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: var(--radius); background: var(--surface2); }
.inline-hint { text-transform: none; font-weight: 400; font-size: 0.78rem; color: var(--text-dim); }
.library-card-title { font-weight: 700; color: var(--text); text-decoration: none; display: block; }
a.library-card-title:hover { color: var(--gold); }
.library-card-rating { color: var(--gold); font-size: 0.82rem; }

/* Game detail page */
.game-detail { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.game-detail-cover {
  width: 220px; max-width: 100%;
  aspect-ratio: 1 / 1; object-fit: contain;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.game-detail-body { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 0.75rem; }
.game-detail-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.game-detail-notes { color: var(--text-muted); }
.game-detail-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.rating-summary { color: var(--gold); font-weight: 700; }

/* Star rating input (radios as stars) + rating list */
.star-input { display: inline-flex; flex-direction: row-reverse; }
.star-input input { display: none; }
.star-input label { font-size: 1.9rem; line-height: 1; color: var(--text-dim); cursor: pointer; padding: 0 0.05rem; transition: color var(--transition); }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--gold); }
.rating-form { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; margin-bottom: 1.25rem; max-width: 480px; }
.rating-form textarea {
  width: 100%; padding: 0.5rem 0.7rem; resize: vertical;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body);
}
.rating-list { display: flex; flex-direction: column; gap: 0.6rem; }
.rating-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.9rem; }
.rating-head { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.2rem; }
.rating-stars { color: var(--gold); letter-spacing: 1px; }
.rating-empty { color: var(--text-dim); }
.rating-comment { color: var(--text-muted); font-size: 0.9rem; }

/* Play-rounds / tables */
.playround { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; display: flex; gap: 0.8rem; align-items: flex-start; }
.playround-cover-link { flex-shrink: 0; line-height: 0; }
.playround-cover { width: 170px; aspect-ratio: 1; object-fit: contain; border-radius: var(--radius); background: var(--surface2); display: block; }
.playround-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }

/* Game mechanics chips (library detail + play-rounds) */
.mechanics { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.mechanic { font-size: 0.72rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; padding: 0.12rem 0.55rem; color: var(--text-muted); }

/* Erklärbär */
.chip-form { display: inline; }
.chip-x { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0 0 0.3rem; }
.chip-x:hover { color: var(--red); }
.explainer-self { margin-top: 0.6rem; }
.explainer-add { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.6rem; }
.explainer-add select { padding: 0.4rem 0.6rem; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font-body); }
.explainer-note { font-size: 0.85rem; color: var(--gold); }

/* Game results (tracking) */
.game-records { font-size: 0.85rem; color: var(--text-muted); }
.game-record-link { font-size: 0.85rem; }
.result-entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.9rem 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.result-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.result-game { font-weight: 700; color: var(--text); text-decoration: none; }
a.result-game:hover { color: var(--gold); }
.result-scores-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.result-score-item { background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.88rem; }
.result-winner { border-color: var(--gold-dim); }
.results-players-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin: 0.5rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }
.results-players { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.result-player-row { display: flex; gap: 0.5rem; }
.result-player-row select { flex: 1; }
.result-player-row select, .result-player-row input {
  padding: 0.5rem 0.6rem; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body);
}
.result-player-row input { width: 7rem; color-scheme: dark; }
.playround-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.playround-title { font-weight: 700; color: var(--text); text-decoration: none; }
a.playround-title:hover { color: var(--gold); }
.playround-members { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.playround-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.2rem; }
.playround-offer { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.playround-offer input[type="text"] {
  flex: 1; min-width: 180px; padding: 0.5rem 0.7rem;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body);
}
.playround-offer input[type="number"] {
  width: 6rem; padding: 0.5rem 0.6rem;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body);
  color-scheme: dark;
}
.library-card-meta { display: flex; align-items: center; gap: 0.5rem; }
.library-card-notes { font-size: 0.85rem; color: var(--text-muted); }
.library-card-actions { display: flex; gap: 0.4rem; margin-top: auto; padding-top: 0.25rem; flex-wrap: wrap; }
.loan-status { font-size: 0.82rem; }
.loan-in { color: var(--green); }
.loan-out { color: var(--orange); }
.my-loans {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.my-loans h2 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 0.6rem; }

.badge-buyer {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(56,201,122,0.12);
  padding: 0.15em 0.5em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-form { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.5rem; align-items: flex-start; }
.role-form label { font-size: 0.85rem; display: flex; align-items: center; gap: 0.35rem; }
.role-form input[type="date"] {
  padding: 0.3rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
}

/* ─── Events (game nights) ────────────────────────── */
.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition);
}
.event-row:hover { border-color: var(--border-light); }
.event-row-main { display: flex; flex-direction: column; gap: 0.2rem; }
.event-title { font-weight: 700; }
.event-row-stats { white-space: nowrap; }
.event-notes { color: var(--text-muted); margin-top: 0.5rem; }

.event-section { margin-top: 1.75rem; }
.event-section h2 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.8rem; }

.chip-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
}

.play-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
}
.play-game { font-weight: 600; }

.play-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.play-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}
.play-option:hover { border-color: var(--border-light); }

.badge-special {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--orange);
  background: rgba(240,124,48,0.12);
  padding: 0.15em 0.5em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* ─── Stats ───────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--gold); line-height: 1; }
.stat-label { font-size: 0.82rem; color: var(--text-muted); }

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.leaderboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
}
.leaderboard h2 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 0.75rem; }
.lb-list { list-style: none; counter-reset: lb; display: flex; flex-direction: column; gap: 0.45rem; }
.lb-list li { counter-increment: lb; display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
.lb-list li::before { content: counter(lb) "."; color: var(--text-dim); font-weight: 700; }
.lb-name { flex: 1; }
.lb-name a { color: var(--text); text-decoration: none; }
.lb-name a:hover { color: var(--gold); }
.lb-count { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

/* ─── Trophies ────────────────────────────────────── */
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.trophy {
  display: flex;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
}
.trophy.earned { border-color: var(--gold-dim); background: linear-gradient(135deg, var(--surface), var(--gold-glow)); }
.trophy.locked { opacity: 0.55; }
.trophy-icon { font-size: 1.8rem; line-height: 1; }
.trophy.locked .trophy-icon { filter: grayscale(1); }
.trophy-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.trophy-name { font-weight: 700; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.trophy-level { font-size: 0.7rem; font-weight: 700; color: var(--gold); background: var(--gold-glow); padding: 0.1em 0.4em; border-radius: 4px; }
.trophy-desc { font-size: 0.82rem; color: var(--text-muted); }
.trophy-detail { font-size: 0.8rem; color: var(--green); }
.trophy-progress { font-size: 0.78rem; color: var(--text-dim); }
.trophy-max { color: var(--gold); }

/* ─── Purchasing ──────────────────────────────────── */
.purchase-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
}
.purchase-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.purchase-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.receive-form { display: inline-flex; gap: 0.3rem; align-items: center; }
.receive-form input {
  width: 6rem;
  min-width: 0;
  padding: 0.3rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  /* Open menu floats below the navbar as an overlay (doesn't push content down) */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .navbar.nav-open .nav-links { display: flex; }
  .nav-links .nav-link,
  .nav-links .nav-user,
  .nav-links .btn-link { width: 100%; padding: 0.85rem 1.5rem; text-align: center; }
  .nav-links form { width: 100%; }
  .nav-links .nav-link:hover,
  .nav-links .btn-link:hover { background: var(--surface2); }
  .submit-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .merge-layout { grid-template-columns: 1fr; }
  .deadlines { grid-template-columns: 1fr; }
  .vote-submit-bar { flex-direction: column; align-items: stretch; }
  .result-item { grid-template-columns: 40px 1fr; align-items: center; }
  .result-scores { grid-column: 2; grid-row: auto; text-align: left; }
  .result-bar-wrapper { grid-column: 1 / 3; }
}
