:root {
    --bg: #07111f;
    --bg-soft: #0c1628;
    --panel: rgba(14, 24, 42, 0.92);
    --panel-2: rgba(18, 30, 53, 0.92);
    --border: rgba(148, 163, 184, 0.18);
    --text: #eef4ff;
    --muted: #9fb1d1;
    --blue: #4f8cff;
    --gold: #f6c25b;
    --gold-2: #f59e0b;
    --green: #22c55e;
    --red: #ef4444;
    --orange: #fb923c;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Inter, Arial, sans-serif;
    background:
      radial-gradient(circle at top left, rgba(79, 140, 255, 0.18), transparent 25%),
      radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 20%),
      linear-gradient(180deg, #06101d 0%, #0a1424 100%);
    color: var(--text);
    min-height: 100vh;
}

a { color: inherit; }
.glass {
    background: linear-gradient(180deg, rgba(17, 28, 49, 0.94), rgba(11, 20, 36, 0.94));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}
.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}
.login-shell { width: min(100%, 460px); }
.login-card, .panel {
    border-radius: 24px;
    padding: 24px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 18px 0;
    padding: 20px 24px;
    border-radius: 24px;
}
.topbar h1, .panel h2, .panel h3, .login-card h1 { margin: 0; }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.user-chip, .pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
}
.pill.accent {
    background: rgba(79, 140, 255, 0.14);
    border-color: rgba(79, 140, 255, 0.35);
}
.pill.tier.easy { color: #86efac; }
.pill.tier.medium { color: #fdba74; }
.pill.tier.hard { color: #fca5a5; }
.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
    color: var(--gold);
}
.muted { color: var(--muted); }
.layout {
    display: grid;
    gap: 20px;
    padding: 20px 18px 24px;
}
.layout-2col {
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
    align-items: start;
}
.panel-fullwidth { grid-column: 1 / -1; }
.hero-panel {
    grid-column: 1 / -1;
    padding: 26px;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}
.panel-header.compact { margin-bottom: 14px; }
.status-pills { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.moderator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    align-items: start;
}
.show-panel { min-width: 0; }
.question-stage {
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.question-stage::after {
    content: "";
    position: absolute;
    inset: auto -20% -50% auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(246,194,91,0.18), transparent 60%);
    pointer-events: none;
}
.question-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(246,194,91,0.14);
    color: var(--gold);
    border: 1px solid rgba(246,194,91,0.28);
    margin-bottom: 14px;
    font-weight: 700;
}
.question-box {
    font-size: clamp(24px, 2.1vw, 34px);
    line-height: 1.35;
    font-weight: 700;
    color: #fff8e6;
}
.question-box.empty {
    color: #d4def0;
}
.stage-help { margin-top: 10px; }
.answers {
    display: grid;
    gap: 12px;
}
.answers-show {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.answer-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(14, 24, 42, 1), rgba(9, 16, 30, 1));
    color: var(--text);
    padding: 18px 16px;
    text-align: left;
    min-height: 92px;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.answer-button:hover:not([disabled]) {
    transform: translateY(-1px);
    border-color: rgba(79,140,255,.45);
    box-shadow: 0 10px 24px rgba(79,140,255,.12);
}
.answer-button.selected {
    border-color: rgba(246,194,91,.55);
    box-shadow: 0 0 0 2px rgba(246,194,91,.28);
    background: linear-gradient(180deg, rgba(54, 39, 11, 0.9), rgba(32, 24, 10, 0.95));
}
.answer-button.correct {
    border-color: rgba(34,197,94,.55);
    background: linear-gradient(180deg, rgba(16, 66, 38, 0.95), rgba(10, 44, 25, 0.95));
}
.answer-button.wrong {
    border-color: rgba(239,68,68,.55);
    background: linear-gradient(180deg, rgba(89, 20, 20, 0.95), rgba(60, 13, 13, 0.95));
}
.answer-button[disabled] {
    opacity: 1;
    cursor: default;
}
.answer-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    font-weight: 800;
    flex: 0 0 42px;
}
.answer-text {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}
.state-tag {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}
.state-tag.picked { background: rgba(246,194,91,.15); color: var(--gold); }
.state-tag.good { background: rgba(34,197,94,.18); color: #86efac; }
.state-tag.bad { background: rgba(239,68,68,.16); color: #fca5a5; }
.card-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.mini-card {
    border-radius: 18px;
    background: var(--panel-2);
    border: 1px solid rgba(255,255,255,.08);
    padding: 14px 16px;
    display: grid;
    gap: 6px;
}
.mini-label {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.selection-status .ok { color: #86efac; }
.selection-status .bad { color: #fca5a5; }
.controls-lg { margin-top: 18px; }
.button-row {
    display: flex;
    gap: 10px;
}
.button-row.wrap { flex-wrap: wrap; }
.button-row form { flex: 1 1 200px; }
input, select, textarea, button, .btn {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(8, 14, 26, 0.9);
    color: var(--text);
    box-sizing: border-box;
    font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
.field { display: grid; gap: 8px; color: var(--muted); }
.form-grid { display: grid; gap: 14px; }
.form-grid-2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field-full { grid-column: 1 / -1; }
.form-actions { margin-top: 4px; }
button, .btn {
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}
button, .btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f8cff);
    color: white;
}
button.secondary, .btn.secondary { background: #344256; }
button.danger { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.error {
    padding: 12px 14px;
    background: rgba(127,29,29,.88);
    border: 1px solid rgba(239,68,68,.22);
    border-radius: 14px;
    margin-bottom: 14px;
}
.levels-panel {
    padding: 18px;
    border-radius: 24px;
}
.levels {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.levels-show li {
    padding: 12px 14px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,.08);
}
.levels li.easy { background: rgba(20, 83, 45, 0.78); }
.levels li.medium { background: rgba(146, 64, 14, 0.84); }
.levels li.hard { background: rgba(127, 29, 29, 0.84); }
.levels li.active {
    box-shadow: 0 0 0 3px rgba(246,194,91,.45);
    transform: scale(1.02);
}
.level-index {
    font-size: 20px;
    min-width: 42px;
}
.level-label {
    text-align: right;
    font-size: 13px;
    color: rgba(255,255,255,.88);
}
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}
.data-table th, .data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: left;
    vertical-align: top;
}
.data-table th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.difficulty-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.difficulty-pill.easy { background: rgba(34,197,94,.15); color: #86efac; }
.difficulty-pill.medium { background: rgba(251,146,60,.16); color: #fdba74; }
.difficulty-pill.hard { background: rgba(239,68,68,.16); color: #fca5a5; }

@media (max-width: 1100px) {
    .layout-2col, .moderator-grid { grid-template-columns: 1fr; }
    .answers-show { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .topbar { margin: 10px 10px 0; padding: 16px; }
    .layout { padding: 12px 10px 18px; }
    .hero-panel, .panel, .login-card { padding: 18px; }
    .status-pills { justify-content: flex-start; }
    .card-strip, .form-grid-2col { grid-template-columns: 1fr; }
    .question-box { font-size: 22px; }
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn-small {
    padding: 10px 12px;
    font-size: 14px;
}
.actions-cell {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.actions-cell form {
    margin: 0;
}
.row-editing td {
    background: rgba(79, 140, 255, 0.08);
}


.user-admin-grid { display:grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 1.2rem; align-items:start; }
.card-subpanel { background: rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 1rem; }
.inline-user-form { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; }
.inline-user-form select, .inline-user-form input { min-width: 120px; }
@media (max-width: 1100px) { .user-admin-grid { grid-template-columns: 1fr; } }
