:root {
    color-scheme: dark;
    --bg: #0e0e11;
    --surface: #18181b;
    --surface-2: #101013;
    --hover: #242428;
    --border: #2a2a2f;
    --border-strong: #414148;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --soft: #71717a;
    --accent: #fff;
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245,158,11,.1);
    --success: #22c55e;
    --success-bg: rgba(34,197,94,.1);
    --radius: 12px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
.hidden { display: none !important; }
html { min-width: 1100px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; padding: 28px 18px 18px; background: #111114; border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 20; }
.sidebar-logo { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; text-decoration: none; font-size: 17px; font-weight: 700; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #111; font-size: 12px; }
.sidebar-nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; text-decoration: none; cursor: pointer; text-align: left; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover, .nav-item.active { background: var(--hover); color: var(--text); }
.nav-item.active { box-shadow: inset 2px 0 var(--accent); }
.sidebar-footer { margin-top: auto; }
.nav-button { font-size: 14px; }
.admin-main { margin-left: 248px; max-width: 1540px; min-height: 100vh; padding: 48px 54px 80px; animation: page-in .3s ease both; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-header h1 { margin: 0 0 7px; font-size: 29px; line-height: 1.15; letter-spacing: -.03em; }
.page-header p { margin: 0; color: var(--muted); font-size: 14px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.breadcrumbs { display: flex; gap: 8px; color: var(--soft); font-size: 13px; margin-bottom: 22px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: 13px; text-decoration: none; cursor: pointer; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn-primary { color: #111; background: #fff; }
.btn-secondary { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.btn-secondary:hover { background: var(--hover); border-color: var(--border-strong); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-warning { color: #111; background: var(--warning); }
.btn[disabled], button[disabled] { cursor: not-allowed; opacity: .45; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.panel, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card { padding: 22px; transition: transform .16s ease, border-color .16s ease; }
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { padding: 19px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.stat-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.stat-value { font-size: 25px; font-weight: 700; letter-spacing: -.03em; }
.stat-value small { color: var(--muted); font-size: 13px; font-weight: 500; }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); padding: 11px 13px; outline: none; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.textarea { min-height: 100px; resize: vertical; }
.search { max-width: 370px; }
.form-group { display: grid; gap: 7px; margin-bottom: 18px; }
.form-label { font-size: 13px; font-weight: 600; }
.form-help { color: var(--muted); font-size: 12px; }
.form-error { color: #f87171; font-size: 12px; }
.games-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.game-card { min-height: 265px; display: flex; flex-direction: column; animation: card-in .34s ease both; }
.card-head, .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { margin: 0; font-size: 18px; }
.slug { margin-top: 5px; color: var(--soft); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.card-status { margin: 24px 0; padding: 15px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.card-foot { margin-top: auto; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-open, .badge-active { color: #4ade80; background: var(--success-bg); }
.badge-closed, .badge-inactive { color: var(--muted); background: rgba(113,113,122,.12); }
.badge-warning { color: #fbbf24; background: var(--warning-bg); }
.progress { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 8px; background: var(--border); }
.progress > span { display: block; height: 100%; background: #fff; transition: width .3s ease; }
.dropdown-wrap { position: relative; }
.dropdown { display: none; position: absolute; top: 42px; right: 0; z-index: 15; min-width: 185px; padding: 6px; border: 1px solid var(--border); border-radius: 9px; background: #202024; box-shadow: 0 18px 45px rgba(0,0,0,.4); }
.dropdown.open { display: grid; animation: pop .15s ease; }
.dropdown button, .dropdown a { width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.dropdown button:hover, .dropdown a:hover { background: var(--hover); }
.dropdown .danger { color: #f87171; }
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.overlay.active { opacity: 1; pointer-events: auto; }
.modal { width: min(500px, 94vw); padding: 25px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.5); transform: translateY(8px) scale(.98); transition: transform .18s ease; }
.overlay.active .modal { transform: none; }
.modal h2 { margin: 0 0 7px; font-size: 20px; }
.modal > p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.warning-box, .info-box { padding: 13px 14px; border: 1px solid rgba(245,158,11,.25); border-radius: 8px; color: #fbbf24; background: var(--warning-bg); font-size: 13px; }
.info-box { color: #d4d4d8; border-color: var(--border); background: var(--surface-2); }
.flash-stack { position: fixed; top: 20px; right: 24px; z-index: 200; display: grid; gap: 8px; }
.flash { min-width: 280px; max-width: 460px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 9px; background: #222226; box-shadow: 0 12px 35px rgba(0,0,0,.4); animation: pop .2s ease; }
.flash-success { border-color: rgba(34,197,94,.35); }
.flash-error { border-color: rgba(239,68,68,.45); }
.empty-state { padding: 50px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.login-card { width: 410px; padding: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 24px 70px rgba(0,0,0,.45); animation: card-in .35s ease both; }
.login-card h1 { margin: 0 0 5px; font-size: 25px; }
.login-card > p { margin: 0 0 28px; color: var(--muted); }
.survey-card { padding: 25px; margin-bottom: 28px; }
.survey-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 22px 0; }
.meta-box { padding: 13px; border-radius: 8px; background: var(--surface-2); }
.meta-box span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.history-list, .data-list { display: grid; gap: 10px; }
.history-row, .data-row { display: grid; align-items: center; gap: 18px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.history-row { grid-template-columns: 1.5fr .8fr .8fr .8fr auto; }
.history-row:hover, .data-row:hover { border-color: var(--border-strong); }
.section-title { margin: 0 0 16px; font-size: 18px; }
.result-grid { display: grid; grid-template-columns: minmax(0,1fr) 440px; gap: 22px; align-items: start; }
.participant-row { grid-template-columns: 1.2fr .7fr .7fr .7fr auto; }
.participant-row[data-details-url] { cursor: pointer; }
.participant-row.is-selected { border-color: var(--border-strong); box-shadow: inset 3px 0 #fff; }
.score { font-size: 18px; font-weight: 700; }
.diff-positive { color: #4ade80; }
.diff-negative { color: #f87171; }
.answer-card { padding: 16px; border: 1px solid var(--border); border-left-width: 3px; border-radius: 9px; background: var(--surface-2); }
.answer-card.score-1 { border-color: var(--danger); }
.answer-card.score-2 { border-color: var(--warning); }
.answer-card.score-3 { border-color: var(--success); }
.answer-head { display: flex; justify-content: space-between; gap: 15px; }
.answer-comment { margin-top: 12px; color: #d4d4d8; white-space: pre-wrap; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumb { width: 78px; height: 62px; border: 1px solid var(--border); border-radius: 7px; object-fit: cover; cursor: zoom-in; }
.toolbar-note { margin: 0; color: var(--muted); font-size: 13px; }
.question-filter { width: 240px; }
.question-review-list { display: grid; gap: 10px; }
.question-review { overflow: hidden; border: 1px solid var(--border); border-left-width: 3px; border-radius: 10px; background: var(--surface); transition: border-color .16s ease, background .16s ease; }
.question-review.has-critical { border-left-color: var(--danger); }
.question-review.has-warning { border-left-color: var(--warning); }
.question-review.is-clean { border-left-color: var(--success); }
.question-review[open] { border-color: var(--border-strong); }
.question-summary { display: grid; grid-template-columns: minmax(240px,1.5fr) repeat(4,.45fr); align-items: center; gap: 18px; padding: 16px 18px; cursor: pointer; list-style: none; }
.question-summary::-webkit-details-marker { display: none; }
.question-summary::after { content: '+'; position: absolute; right: 14px; color: var(--muted); font-size: 20px; }
.question-review[open] .question-summary::after { content: '−'; }
.question-summary { position: relative; padding-right: 45px; }
.question-summary > div:not(.question-summary-title) { display: grid; gap: 2px; }
.question-summary small { color: var(--muted); font-size: 11px; }
.question-summary-title { display: grid; gap: 4px; }
.question-review-body { display: grid; gap: 10px; padding: 0 18px 18px; border-top: 1px solid var(--border); padding-top: 18px; background: var(--surface-2); }
.question-clean { padding: 12px 14px; border: 1px solid rgba(34,197,94,.25); border-radius: 8px; color: #86efac; background: var(--success-bg); }
.tabs { display: flex; gap: 5px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-color: #fff; }
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; background: rgba(0,0,0,.92); }
.lightbox.active { display: grid; }
.lightbox img { max-width: 92vw; max-height: 90vh; object-fit: contain; }
.lightbox button { position: absolute; top: 20px; right: 20px; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(9px); } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@media (max-width: 1250px) { .games-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
