:root {
  --bg: #14161c;
  --panel: #1d2027;
  --panel-2: #22262f;
  --ink: #e6e3da;
  --muted: #969cab;
  --line: #2c313b;
  --accent: #e0a96d;      /* warmes Gold */
  --accent-ink: #f0c089;  /* helleres Gold für Links/Hover */
  --input-bg: #161922;
  --radius: 11px;
  --shadow: 0 1px 3px rgba(0,0,0,0.45), 0 10px 32px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1100px 560px at 50% -12%, #1c212b 0%, var(--bg) 62%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); }

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(180deg, #21252e, #1a1d24);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(224,169,109,0.12);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
header.site .brand small { color: var(--accent); font-weight: 500; letter-spacing: 0.02em; }
header.site nav { display: flex; align-items: center; gap: 0.75rem; font-size: 0.92rem; }

main { max-width: 1100px; margin: 0 auto; padding: 1.9rem 1.5rem 4rem; }

h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}
.subtitle { color: var(--muted); margin: 0 0 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s, border-color 0.14s, transform 0.14s;
}
.btn:hover { background: var(--panel-2); border-color: #3a414e; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a140c; font-weight: 600; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(255,255,255,0.05); }
.btn.danger { color: #f0a3a3; }
.btn:disabled { opacity: 0.5; cursor: default; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 6px 18px rgba(0,0,0,.45), 0 16px 40px rgba(0,0,0,.4);
}
.card h3 { margin: 0 0 0.3rem; font-size: 1.12rem; font-family: "Iowan Old Style", Palatino, Georgia, serif; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.card .meta { margin-top: 0.7rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }

.pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--muted);
}
.pill.private { background: rgba(224,120,120,0.16); color: #f0b0b0; }

/* Tag-Chips – weich leuchtend (Farbe via --c) */
.tag-chip {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--c, #8a8f99) 24%, transparent);
  color: color-mix(in srgb, var(--c, #8a8f99) 65%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--c, #8a8f99) 48%, transparent);
}

/* Anzeige-Umschalter */
.viewbar { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; }
.viewbar .btn { padding: 0.3rem 0.8rem; }
.gloss-missing { margin-top: 0.2rem; font-size: 0.82rem; font-style: italic; color: #d98c6a; opacity: 0.8; }

.legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; margin: 0 0 1.25rem; }
.legend .item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.legend .swatch { width: 0.85rem; height: 0.85rem; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,0.08); }

/* Vergleichs-Grid */
.rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.row { display: grid; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row:nth-child(even) { background: var(--panel-2); }
.row.refrain { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); box-shadow: inset 3px 0 0 var(--accent); }
.row.refrain .cell .text { color: var(--accent-ink); font-style: italic; }
.cell { padding: 0.65rem 0.9rem; border-left: 1px solid var(--line); min-width: 0; }
.cell:first-child { border-left: none; }
.cell .text { font-family: Georgia, "Times New Roman", serif; font-size: 1.04rem; }
.cell.ref .text { color: var(--ink); }
.cell .gloss { margin-top: 0.25rem; padding-left: 0.6rem; border-left: 2px solid color-mix(in srgb, var(--accent) 40%, var(--line)); font-size: 0.9rem; color: var(--muted); font-style: italic; }
.cell .gloss::before { content: "DE wörtlich: "; font-style: normal; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); display: block; }
.cell .annot { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.25rem; }
.cell .note { font-size: 0.82rem; color: var(--muted); }
.colhead { display: grid; position: sticky; top: 57px; background: #20242d; z-index: 5; border: 1px solid var(--line); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; }
.colhead + .rows { border-top: none; border-radius: 0 0 var(--radius) var(--radius); }
.colhead .cell { font-weight: 600; }
.colhead .cell small { display: block; font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.colhead .cell .spotify {
  display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.45rem;
  font-size: 0.78rem; font-weight: 600; text-decoration: none;
  color: #1DB954; padding: 0.15rem 0.55rem; border: 1px solid rgba(29,185,84,0.55); border-radius: 999px;
}
.colhead .cell .spotify:hover { background: #1DB954; color: #08130b; border-color: #1DB954; }

/* Formularfelder (dunkel) */
textarea, input, select { color: var(--ink); }
textarea::placeholder, input::placeholder { color: #6b7280; }

/* Editor */
.editor-row { display: grid; gap: 0; border-bottom: 1px solid var(--line); align-items: stretch; }
.editor-cell { padding: 0.5rem; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.4rem; }
.editor-cell:first-child { border-left: none; }
.editor-cell textarea {
  width: 100%; resize: vertical; min-height: 2.4rem; font: inherit;
  font-family: Georgia, serif; padding: 0.4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg);
}
.editor-cell select, .editor-cell input[type=text] { font: inherit; font-size: 0.85rem; padding: 0.3rem; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); }
.row-tools { display: flex; align-items: center; padding: 0 0.4rem; gap: 0.2rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field label { font-size: 0.78rem; color: var(--muted); }
.field input, .field select { font: inherit; padding: 0.4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); }

.notice { padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; border: 1px solid transparent; }
.notice.info { background: rgba(96,165,250,0.12); color: #bcd2ff; border-color: rgba(96,165,250,0.25); }
.notice.error { background: rgba(220,90,90,0.14); color: #ffb4b4; border-color: rgba(220,90,90,0.3); }
.notice.ok { background: rgba(80,200,140,0.13); color: #a7f0c6; border-color: rgba(80,200,140,0.28); }

.modal { position: fixed; inset: 0; background: rgba(8,9,12,0.66); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; width: min(640px, 100%); max-height: 90vh; overflow: auto; }

.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* Login */
.login-wrap { max-width: 380px; margin: 4rem auto; }
.login-wrap .card { box-shadow: var(--shadow); }
.login-wrap .field { margin-bottom: 0.9rem; }

@media (max-width: 640px) {
  .cell .text { font-size: 0.96rem; }
  header.site { padding: 0.7rem 1rem; }
  main { padding: 1.25rem 1rem 3rem; }
}
