﻿:root {
    color-scheme: light;
    --ink: #20243a;
    --muted: #555d73;
    --accent: #5545a6;
    --border: #dedfea;
}

body { background: #f8f8fc; color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.skip-link { position: absolute; top: -4rem; left: 1rem; z-index: 10; padding: .65rem 1rem; background: #fff; color: #302277; border: 2px solid #5545a6; border-radius: .4rem; }
.skip-link:focus { top: 1rem; }
a:focus-visible { outline: 3px solid #5545a6; outline-offset: 4px; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.site-header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #5545a6; color: #fff; font-weight: 800; }
.header-label, .eyebrow, .section-badge { font-size: .7rem; font-weight: 750; letter-spacing: .12em; }
.header-label { color: #626a7d; }
.main-content { padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: 6rem; }
.intro { max-width: 720px; margin-bottom: clamp(4rem, 8vw, 6rem); }
.eyebrow { color: var(--accent); margin-bottom: 1rem; }
h1 { font-size: clamp(2.7rem, 6vw, 4.8rem); line-height: 1.08; font-weight: 750; letter-spacing: -.055em; }
h1 span { color: var(--accent); }
.intro-copy { max-width: 560px; margin: 1.5rem 0 0; color: var(--muted); font-size: 1.1rem; line-height: 1.7; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading .eyebrow { margin-bottom: .5rem; }
h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; }
.section-copy { color: var(--muted); margin: 0; }
.section-badge { flex-shrink: 0; color: #504488; background: #eeebfa; padding: .55rem .75rem; border-radius: 2rem; letter-spacing: .06em; }
.empty-state { background: #fff; border: 1px solid var(--border); border-radius: 1rem; padding: clamp(3rem, 7vw, 5rem) 1.5rem; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1.5rem; border-radius: 20px; background: #f0edfc; color: #5545a6; font-size: 1.8rem; }
.empty-state h3 { font-size: 1.25rem; font-weight: 700; }
.empty-state p { max-width: 420px; margin: .75rem auto 0; color: var(--muted); line-height: 1.65; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
@media (max-width: 575.98px) { .header-label { display: none; } .section-heading, .footer-inner { align-items: flex-start; flex-direction: column; } }
.add-section { margin-bottom: 5rem; }
.game-form { display: grid; gap: 1rem; max-width: 720px; margin-top: 1.5rem; padding: 1.5rem; background: #fff; border: 1px solid var(--border); border-radius: 1rem; }
.game-form label { display: block; margin-bottom: .4rem; font-weight: 650; }
.game-form .form-control:focus, .game-form .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(85, 69, 166, .2); }
.add-button { justify-self: start; padding: .7rem 1.25rem; border: 0; border-radius: .5rem; background: var(--accent); color: #fff; font-weight: 700; }
.add-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.form-success, .form-error { margin: 1rem 0 0; font-weight: 600; }
.form-success { color: #17613c; }
.form-error, .field-error { color: #a02232; }
.field-error { margin: .4rem 0 0; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1.25rem; }
.game-card { overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 1rem; }
.game-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #eeebfa; }
.game-card-body { padding: 1.25rem; }
.game-card h3 { margin: .65rem 0; font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.game-card p { margin: 0; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.game-status { color: #504488; font-size: .75rem; font-weight: 700; }
.card-actions, .confirm-actions { display: flex; align-items: center; gap: 1rem; }
.card-actions { margin-top: 1.25rem; }
.card-actions a, .confirm-actions a { color: #403184; font-weight: 650; }
.remove-button { padding: .7rem 1.25rem; border: 0; border-radius: .5rem; background: #a02232; color: #fff; font-weight: 700; }
.remove-button:focus-visible { outline: 3px solid #a02232; outline-offset: 3px; }
.library-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.library-controls label { display: block; margin-bottom: .4rem; font-weight: 650; }
.library-controls > div { min-width: 180px; }
.game-card .game-rating { margin-bottom: .65rem; color: #504488; font-weight: 700; }
.theme-toggle { padding: .5rem .85rem; border: 1px solid var(--border); border-radius: .5rem; background: transparent; color: var(--ink); font-weight: 650; }
.theme-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[data-theme="dark"] { color-scheme: dark; --ink: #f0effa; --muted: #c2c3d4; --accent: #c4b8ff; --border: #55536c; }
[data-theme="dark"] body { background: #171622; }
[data-theme="dark"] .site-header, [data-theme="dark"] .game-form, [data-theme="dark"] .game-card, [data-theme="dark"] .empty-state { background: #242331; }
[data-theme="dark"] .section-badge, [data-theme="dark"] .empty-icon, [data-theme="dark"] .game-card img { background: #37334f; color: #e0d9ff; }
[data-theme="dark"] .game-status, [data-theme="dark"] .game-card .game-rating, [data-theme="dark"] .card-actions a, [data-theme="dark"] .confirm-actions a, [data-theme="dark"] .section-copy a { color: #d3c9ff; }
[data-theme="dark"] .add-button { background: #c4b8ff; color: #211b40; }
[data-theme="dark"] .form-success { color: #8de0ad; }
[data-theme="dark"] .form-error, [data-theme="dark"] .field-error { color: #ffabb4; }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select { background-color: #171622; color: var(--ink); border-color: #77748e; }
[data-theme="dark"] .form-control::placeholder { color: #b7b5ca; }
[data-theme="dark"] .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23f0effa' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
@media (max-width: 575.98px) { .library-controls > div { flex: 1 1 100%; min-width: 0; } .game-form { padding: 1rem; } }
