:root {
    color-scheme: dark;
    --bg: #14161a;
    --panel: #1c1f26;
    --panel-2: #232733;
    --line: #2e3440;
    --text: #e6e9ef;
    --muted: #98a2b3;
    --accent: #6aa9ff;
    --good: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

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

header.top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0 1.25rem;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

header.top .brand { font-weight: 700; letter-spacing: .2px; padding: .9rem 0; }
header.top nav { display: flex; gap: .25rem; flex-wrap: wrap; }
header.top nav a {
    padding: .9rem .7rem;
    color: var(--muted);
    border-bottom: 2px solid transparent;
}
header.top nav a.active { color: var(--text); border-bottom-color: var(--accent); }
header.top .spacer { margin-left: auto; }

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

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.75rem 0 .6rem; }

.grid { display: grid; gap: 1rem; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.stat .value { font-size: 1.9rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

.badge {
    display: inline-block;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-size: .75rem;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--muted);
    white-space: nowrap;
}
.badge.good { color: var(--good); border-color: #14532d; }
.badge.warn { color: var(--warn); border-color: #78350f; }
.badge.bad { color: var(--bad); border-color: #7f1d1d; }

button, .btn {
    font: inherit;
    padding: .4rem .8rem;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary { background: #1d4ed8; border-color: #1d4ed8; }
button.danger { background: #7f1d1d; border-color: #7f1d1d; }

input, select, textarea {
    font: inherit;
    padding: .4rem .55rem;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: #12141a;
    color: var(--text);
    width: 100%;
}

label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .2rem; }
.field { margin-bottom: .7rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }

.progress { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

.notice {
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    background: var(--panel);
    border-radius: 8px;
    padding: .7rem .9rem;
    margin-bottom: 1rem;
}

.card-review { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; }
.card-review img.poster { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.sheet {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: #0d0f13;
    border-radius: 8px;
    border: 1px solid var(--line);
    margin-top: .6rem;
}
.sheet-link { display: block; }
.sheet-hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }

.breakdown { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.breakdown span {
    font-size: .78rem;
    padding: .1rem .45rem;
    border-radius: 6px;
    background: var(--panel-2);
    border: 1px solid var(--line);
}
.breakdown span.neg { color: var(--bad); }
.breakdown span.pos { color: var(--good); }

.login { max-width: 340px; margin: 12vh auto; }
