/* ============================================================
   Brettspiele – zentrales Stylesheet (theme-fähig, mobile-first)
   ============================================================ */

:root {
  --bg: #0f1216;
  --bg-2: #0c0f13;
  --panel: #1a1f26;
  --panel-2: #222832;
  --text: #e7edf5;
  --muted: #9fb1c7;
  --border: #2b3a52;
  --border-soft: #263753;
  --accent: #5cb3ff;
  --accent-ink: #06213a;
  --warn: #ffb44c;
  --ok: #7cf49b;
  --danger: #ff7a7a;
  --shadow: 0 6px 24px rgba(0,0,0,0.35);
  /* Layout-Variablen der Zettel */
  --cell-size: 64px;
  --gap: 8px;
  --page-pad-x: 20px;
  --board-pad: 16px;
  --radius: 12px;
}

:root[data-theme="light"] {
  --bg: #eef2f7;
  --bg-2: #e6ecf3;
  --panel: #ffffff;
  --panel-2: #f2f5fa;
  --text: #1a2230;
  --muted: #5a6b82;
  --border: #d3ddeb;
  --border-soft: #dde5f0;
  --accent: #2f7fd6;
  --accent-ink: #ffffff;
  --warn: #b9720b;
  --ok: #1f9d54;
  --danger: #cc3b3b;
  --shadow: 0 6px 20px rgba(30,50,80,0.12);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; }

/* ── Kopfbereich der Seiten ─────────────────────────── */
header.page-head { padding: 20px var(--page-pad-x) 8px; max-width: 1200px; margin: 0 auto; width: 100%; }
header.page-head h1 { margin: 0 0 6px; font-size: clamp(22px, 5vw, 30px); }
header.page-head p { color: var(--muted); margin: 0; }

/* ── Navigation ─────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--page-pad-x);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-brand { font-weight: 800; font-size: 18px; color: var(--text); white-space: nowrap; }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 8px; flex: 1; }
.nav-links a {
  color: var(--muted); padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.nav-links a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#theme-toggle {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 16px; padding: 0;
}
.nav-hamburger { display: none; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 38px; cursor: pointer; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.nav-hamburger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

@media (max-width: 860px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    position: absolute; top: 58px; right: var(--page-pad-x); left: var(--page-pad-x);
    flex-direction: column; background: var(--panel); border: 1px solid var(--border);
    border-radius: 12px; padding: 8px; box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; font-size: 16px; }
}

/* ── Layout-Container ───────────────────────────────── */
main { display: block; padding: 16px var(--page-pad-x) 40px; max-width: 1200px; margin: 0 auto; width: 100%; }
.stack { display: grid; gap: 16px; }
.grid-auto { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ── Karten ─────────────────────────────────────────── */
.card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; border: 1px solid var(--border-soft);
}
.card h2 { margin: 0 0 10px; font-size: 18px; }
.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); }

.link-card { display: block; color: inherit; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.link-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 28px rgba(0,0,0,.28); text-decoration: none; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); font-size: 12px; font-weight: 600; }

/* ── Buttons ────────────────────────────────────────── */
button, .btn {
  cursor: pointer; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 14px;
  font-family: inherit; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ── Formulare ──────────────────────────────────────── */
.form-card { max-width: 460px; margin: 24px auto; }
.form-group { margin-bottom: 14px; }
.form-group label, .field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 16px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea { min-height: 90px; resize: vertical; }
.form-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Tabellen ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
table.data th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data tbody tr:hover { background: var(--panel-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Stat-Kacheln ───────────────────────────────────── */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat-tile { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat-tile .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat-tile .value { font-size: clamp(22px, 6vw, 30px); font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat-tile .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ── Badges ─────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge.win  { background: color-mix(in srgb, var(--ok) 20%, transparent);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.badge.lose { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.badge.rank1 { background: #7a5c00; color: #ffe9a8; border-color: #b8901f; }

/* ── Spiel-Cover Grid ───────────────────────────────── */
.game-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.game-cover { aspect-ratio: 1/1; width: 100%; object-fit: cover; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border-soft); }
.game-tile .name { font-weight: 700; margin-top: 8px; }
.game-tile .meta { color: var(--muted); font-size: 12px; }
.game-thumb-sm { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--panel-2); vertical-align: middle; }

/* ── Player-Picker / Chips ──────────────────────────── */
.player-picker { display: grid; gap: 10px; }
.player-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); cursor: pointer;
}
.player-chip.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.player-chip .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--accent); flex-shrink: 0; }
.player-chip .pname { flex: 1; font-weight: 600; }
.player-chip input { width: auto; }

/* ── Bars / Meter (handgemachte Charts) ─────────────── */
.bar-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; }
.bar-track { background: var(--panel-2); border-radius: 999px; height: 12px; overflow: hidden; border: 1px solid var(--border-soft); }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--ok) 60%, var(--accent))); }
.spark { width: 100%; height: 80px; display: block; }
.spark .axis { stroke: var(--border-soft); stroke-width: 1; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.spark .dot { fill: var(--accent); }
.spark .dot.win { fill: var(--ok); }

/* ── Toasts ─────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(92vw, 420px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: #fff; flex-shrink: 0; }
.toast.success .toast-icon { background: var(--ok); } .toast.error .toast-icon { background: var(--danger); }
.toast.info .toast-icon { background: var(--accent); } .toast.warning .toast-icon { background: var(--warn); }
.toast-msg { flex: 1; font-size: 14px; }
.toast-close { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ── Footer ─────────────────────────────────────────── */
.site-footer { padding: 24px var(--page-pad-x); text-align: center; color: var(--muted); }

/* ============================================================
   Wertungszettel (bestehende + neue) – mobil optimiert
   ============================================================ */

.sheet-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.sheet-toolbar .spacer { flex: 1; }

/* Generic Mehrspieler-Sheet */
.scoreboard-layout { display: grid; gap: 16px; }
.settings-card .settings-grid { display: grid; grid-template-columns: 1fr 220px; gap: 8px; align-items: center; }
.settings-card .settings-grid label { color: var(--muted); font-size: 13px; }
.add-player-row { display: flex; gap: 8px; }
.add-player-row input { flex: 1; }

.sheet-table { border: 1px solid var(--border-soft); border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.sheet-header { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 8px; padding: 10px; background: var(--panel); border-bottom: 1px solid var(--border-soft); overflow-x: auto; }
.sheet-body { display: grid; grid-auto-flow: column; align-items: start; gap: 8px; padding: 10px; overflow-x: auto; }
.header-col { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.header-col .name-input { width: 100%; }
.header-col .total { font-weight: 700; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.header-col .delta-row { display: flex; gap: 6px; }
.header-col .delta-row input { flex: 1; min-width: 0; }
.header-col .delta-row button { flex-shrink: 0; }
.header-col .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.round-labels { display: grid; grid-auto-rows: 44px; gap: 8px; padding: 10px; border-right: 1px solid var(--border-soft); background: var(--panel); position: sticky; left: 0; z-index: 10; }
.round-col { display: grid; grid-auto-rows: 44px; gap: 8px; padding: 10px; }
.cell-round { position: relative; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; font-variant-numeric: tabular-nums; padding: 0 26px 0 10px; }
.cell-round.empty { color: var(--muted); } .cell-round.good { color: var(--ok); } .cell-round.negative { color: var(--danger); }
.cell-remove { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font-weight: 700; font-size: 12px; cursor: pointer; padding: 0; }
.no-players { color: var(--muted); font-size: 14px; margin-top: 8px; }
.winner-card { border: 1px solid var(--border); } .winner-list { line-height: 1.6; }

/* Knister-Board */
.sheet { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.board { display: grid; grid-template-columns: var(--cell-size) repeat(5, var(--cell-size)) var(--cell-size); grid-template-rows: var(--cell-size) repeat(5, var(--cell-size)); gap: var(--gap); padding: var(--board-pad); background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); }
.col-top { grid-column: 2 / span 5; grid-row: 1; display: grid; grid-template-columns: repeat(5, var(--cell-size)); gap: var(--gap); }
.row-right { grid-column: 7; grid-row: 2 / span 5; display: grid; grid-template-rows: repeat(5, var(--cell-size)); gap: var(--gap); }
.grid { grid-column: 2 / span 5; grid-row: 2 / span 5; display: grid; grid-template-columns: repeat(5, var(--cell-size)); grid-template-rows: repeat(5, var(--cell-size)); gap: var(--gap); }
.diag-left-top { grid-column: 1; grid-row: 1; } .diag-right-top { grid-column: 7; grid-row: 1; }
.cell { display: grid; place-items: center; background: var(--panel-2); border-radius: 8px; }
.cell.diag { background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); }
.cell input { width: 100%; height: 100%; text-align: center; font-size: 22px; color: var(--text); background: transparent; border: none; outline: none; }
.cell input:focus { box-shadow: 0 0 0 2px var(--accent) inset; border-radius: 8px; }
.scores { padding: 16px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); min-width: 260px; }
.scores h2 { margin: 8px 0; font-size: 16px; color: var(--muted); }
.score-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.score-item { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; }
.score-item .label { color: var(--muted); font-size: 12px; }
.score-item .points { font-weight: 600; }
.total { display: flex; justify-content: space-between; font-size: 18px; padding: 10px; background: var(--panel-2); border-radius: 8px; border: 1px solid var(--border); }
.score-box { display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--text); border-radius: 8px; font-weight: 700; }
.score-box.diag { background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); }

/* Kniffel / Qwixx / Wizard – gemeinsame Grid-Zettel */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 12px; }
table.matrix { border-collapse: collapse; width: 100%; min-width: max-content; }
table.matrix th, table.matrix td { border: 1px solid var(--border-soft); padding: 0; text-align: center; }
table.matrix thead th { background: var(--panel); padding: 8px 10px; position: sticky; top: 0; z-index: 5; }
table.matrix td.rowlabel, table.matrix th.rowlabel { background: var(--panel); text-align: left; padding: 8px 10px; position: sticky; left: 0; z-index: 4; font-size: 13px; white-space: nowrap; }
table.matrix input { width: 64px; min-width: 56px; height: 42px; text-align: center; border: none; background: transparent; border-radius: 0; font-size: 16px; }
table.matrix input:focus { box-shadow: 0 0 0 2px var(--accent) inset; }
table.matrix tr.subtotal td, table.matrix tr.total td { background: var(--panel-2); font-weight: 700; }
table.matrix td.calc { font-variant-numeric: tabular-nums; font-weight: 600; padding: 8px; min-width: 56px; }

/*
 * Spaltenkopf: Spielername.
 *
 * Die 64px oben gelten fuer Punktefelder und sind dort richtig - fuer einen
 * Namen sind sie es nicht: "Anna Müller" war darin nicht mehr lesbar. Das
 * Namensfeld bekommt deshalb seine eigene Breite und darf mit der Spalte
 * wachsen; min-width haelt die Spalte auch bei kurzen Namen benutzbar.
 */
table.matrix th .pname {
  width: 100%;
  min-width: 96px;
  max-width: 180px;
  height: auto;
  padding: 4px 6px;
  text-align: left;
  font-weight: 700;
  font-size: 15px;
  text-overflow: ellipsis;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}
table.matrix th .pname:focus { box-shadow: 0 0 0 2px var(--accent) inset; }
/* Kopfzeile darf breiter werden als eine Punktespalte. */
table.matrix thead th { min-width: 108px; }
table.matrix thead th.rowlabel { min-width: 0; }
/* Gesamtpunkte unter dem Namen (Universal-Zettel, mode=append). */
table.matrix th .calc { display: block; font-size: 18px; font-weight: 800; padding: 2px 0; font-variant-numeric: tabular-nums; }
/* Delta-Eingabe im Kopf: Feld + Knopf nebeneinander, ohne die 64px zu erben. */
table.matrix th .add-player-row { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
table.matrix th .add-player-row input { width: 100%; min-width: 0; height: 34px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--panel-2); }

/* Multi-Board-Knister */
.kn-boards { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.kn-board { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.kn-board.me { border-color: var(--accent); }
.kn-board .kn-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kn-board .kn-head .avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; }
.kn-grid { display: grid; grid-template-columns: repeat(5, 44px); grid-template-rows: repeat(5, 44px); gap: 4px; }
.kn-cell { display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; font-variant-numeric: tabular-nums; }
.kn-cell.diag { background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); }
.kn-cell input { width: 100%; height: 100%; text-align: center; font-size: 18px; background: transparent; border: none; outline: none; color: var(--text); }
.kn-cell input:focus { box-shadow: 0 0 0 2px var(--accent) inset; border-radius: 8px; }
.kn-cell.ro { font-weight: 600; }
.kn-total { margin-top: 8px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.kn-hiddenbox { display: grid; place-items: center; width: 240px; height: 240px; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; text-align: center; padding: 12px; }
.kn-ready-badge { color: var(--ok); font-weight: 700; font-size: 13px; }
.kn-wait-badge { color: var(--warn); font-weight: 700; font-size: 13px; }

/* Qwixx-Farbreihen */
.qwixx-cell { width: 34px; height: 38px; display: inline-grid; place-items: center; margin: 2px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; font-weight: 700; user-select: none; }
.qwixx-row { padding: 8px; border-radius: 10px; margin-bottom: 8px; }
.qwixx-row.red    { background: color-mix(in srgb, #e5484d 22%, var(--panel)); }
.qwixx-row.yellow { background: color-mix(in srgb, #f5c518 24%, var(--panel)); }
.qwixx-row.green  { background: color-mix(in srgb, #30a46c 24%, var(--panel)); }
.qwixx-row.blue   { background: color-mix(in srgb, #4c8dff 24%, var(--panel)); }
.qwixx-cell.marked { background: var(--text); color: var(--bg); }
.qwixx-cell.locked { outline: 3px solid var(--accent); }

/* ── Responsive Zettel ──────────────────────────────── */
@media (max-width: 760px) {
  :root { --cell-size: calc((100vw - (var(--page-pad-x) * 2) - (var(--board-pad) * 2) - (var(--gap) * 6)) / 7); }
  .sheet { grid-template-columns: 1fr; }
  #side-scores { order: 2; } .board { order: 1; }
  .scores { min-width: unset; }
  .settings-card .settings-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .cell input { font-size: clamp(16px, 5vw, 22px); }
}

/* ── Achievements ───────────────────────────────────── */
.badge-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ach { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--panel); }
.ach.locked { opacity: .45; filter: grayscale(1); }
.ach .ach-ico { font-size: 26px; line-height: 1; }
.ach .ach-title { font-weight: 700; font-size: 14px; }
.ach .ach-desc { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ── Modal ──────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 200; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 18px; }
.modal h2 { margin: 0 0 12px; }
.save-row { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; margin-bottom: 8px; }
.save-row .lbl { font-weight: 600; }
.save-row .sc { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ── Home / Hero ────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), var(--panel)); }
.hero h1 { margin: 0; } .hero p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .hero { grid-template-columns: 1fr; } }
