:root {
    color-scheme: dark;
    --bg: #09131f;
    --panel: #101f30;
    --line: #263a4c;
    --text: #edf4fa;
    --muted: #a8bbcc;
    --accent: #60d5bc;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 75% 0%, #14303d 0, transparent 40%), var(--bg); color: var(--text); font: 16px/1.6 system-ui, sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, .table-scroll:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
a { color: var(--accent); }
.topbar, main, footer { max-width: 1320px; margin: auto; padding: 24px 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; color: var(--text); text-decoration: none; line-height: 1.3; letter-spacing: 2px; font-size: 16px; }
.brand b { color: var(--accent); }
.brand small { display: block; margin-top: 5px; font-size: 9px; color: var(--muted); letter-spacing: 2px; }
.brand-icon { border: 1px solid var(--accent); border-radius: 10px; padding: 7px 11px; font-size: 25px; color: var(--accent); letter-spacing: -1px; }
.quiet { background: transparent; border: 1px solid var(--line); border-radius: 9px; padding: 9px 15px; }
.quiet:hover { background: var(--panel); }
.hero { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; padding: 44px 0 52px; gap: 35px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; font-weight: 700; color: var(--accent); }
h1 { font-size: clamp(32px, 4.6vw, 60px); line-height: 1.15; letter-spacing: -2px; margin: 22px 0; }
h1 span { color: var(--accent); }
h2 { margin: 3px 0 10px; font-size: 25px; letter-spacing: -.7px; }
h3 { margin: 18px 0 10px; font-size: 22px; }
.intro { max-width: 560px; color: var(--muted); font-size: 17px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pills span { font-size: 12px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; }
.hero-atom { position: relative; width: 300px; height: 300px; margin: auto; }
.orbit { width: 290px; height: 120px; border: 1px solid #60d5bc65; border-radius: 50%; position: absolute; top: 90px; left: 5px; transform: rotate(-25deg); }
.orbit::after { content: ''; position: absolute; width: 12px; height: 12px; top: 15px; right: 36px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 20px #60d5bc; }
.o2 { transform: rotate(35deg); }
.o3 { transform: rotate(95deg); }
.nucleus { position: absolute; inset: 99px; display: flex; flex-direction: column; justify-content: center; text-align: center; border-radius: 24px; border: 1px solid var(--accent); background: #14333d; box-shadow: 0 0 65px #60d5bc20; font-size: 43px; line-height: 1.3; }
.nucleus small { font-size: 7px; letter-spacing: 1px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 20px 0; }
#progress-summary { font-size: 13px; color: var(--muted); }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mode { text-align: left; padding: 24px; background: linear-gradient(140deg, #14283a, var(--panel)); border: 1px solid var(--line); border-radius: 16px; transition: transform .2s, border-color .2s; }
.mode:hover { transform: translateY(-4px); border-color: var(--accent); }
.mode p { color: var(--muted); font-size: 14px; min-height: 90px; margin-bottom: 24px; }
.mode-icon { color: var(--accent); font: 11px/1.5 monospace; letter-spacing: 1px; }
.mode-bottom { display: flex; justify-content: space-between; font-size: 13px; border-top: 1px solid var(--line); padding-top: 15px; }
.mode small { display: block; color: var(--muted); font-size: 11px; margin-top: 14px; }
.helper { font-size: 13px; color: var(--muted); }
#explorer { margin-top: 45px; }
#search-label { font-size: 11px; color: var(--muted); }
input { display: block; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; width: 250px; }
.table-scroll { overflow-x: auto; padding: 8px 4px 18px; scrollbar-color: #527080 var(--bg); }
.periodic-table { display: grid; grid-template-columns: repeat(18, minmax(48px, 1fr)); grid-template-rows: 24px repeat(7, 67px) 15px repeat(2, 67px); gap: 5px; min-width: 970px; }
.element { padding: 3px; display: flex; flex-direction: column; justify-content: center; background: color-mix(in srgb, var(--family) 12%, var(--bg)); border: 1px solid color-mix(in srgb, var(--family) 48%, var(--bg)); border-radius: 6px; color: var(--family); line-height: 1.2; }
.element small { font-size: 10px; text-align: left; }
.element strong { font-size: 21px; font-weight: 650; }
.element span { font-size: 8px; overflow: hidden; text-overflow: ellipsis; }
.element:hover:not(:disabled) { background: color-mix(in srgb, var(--family) 28%, var(--bg)); }
.element.blank { border-style: dashed; color: var(--muted); }
.element.target { outline: 3px solid #fff; outline-offset: 1px; }
.element.selected-wrong { outline: 3px solid #ff8888; }
.element.dim { opacity: .25; }
.group-number, .series { font-size: 11px; color: var(--muted); text-align: center; align-self: center; }
.series { grid-column: 3; border: 1px dashed var(--line); border-radius: 6px; }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; margin: 12px 0; font-size: 11px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--family); }
.stats { display: grid; grid-template-columns: repeat(4,1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; gap: 12px; }
.stats small { color: var(--muted); font-size: 10px; letter-spacing: 1px; display: block; }
.stats strong { font-size: 27px; }
.question-panel { text-align: center; max-width: 880px; margin: 26px auto; }
.question-panel h1 { font-size: clamp(25px,3vw,37px); letter-spacing: -.8px; }
.options { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.option { padding: 18px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 21px; }
.option:hover:not(:disabled) { border-color: var(--accent); }
.option.correct { border-color: var(--accent); background: #163d36; }
.option.wrong { border-color: #ff8c8c; background: #3c2530; }
#feedback { background: var(--panel); border-left: 3px solid var(--accent); padding: 16px; text-align: left; margin: 22px 0 16px; border-radius: 8px; }
#feedback.error { border-color: #ff8c8c; }
.primary { background: var(--accent); color: #08241e; border: 0; border-radius: 10px; font-weight: 700; padding: 12px 22px; }
.result-panel { padding: 35px; margin: 20px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; text-align: center; max-width: 820px; }
.result-panel h1 { font-size: 38px; }
.result-panel .stats { margin: 25px 0; }
.result-panel button { margin: 8px; }
footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; gap: 16px; }
dialog { width: min(520px,calc(100% - 30px)); border: 1px solid var(--line); border-radius: 18px; padding: 30px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
.close { float: right; }
.detail-symbol { font-size: 64px; color: var(--accent); }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
dt { color: var(--muted); }
dd { margin: 0; }
@media (max-width: 1000px) { .modes { grid-template-columns: repeat(2, 1fr); } .mode p { min-height: 48px; } }
@media (max-width: 650px) {
    .topbar, main, footer { padding: 18px; }
    .brand { font-size: 12px; gap: 8px; letter-spacing: 1px; }
    .brand small { font-size: 7px; letter-spacing: 1px; }
    .quiet { font-size: 12px; padding: 8px 10px; }
    .hero { grid-template-columns: 1fr; padding: 28px 0; }
    .hero-atom { display: none; }
    h1 { letter-spacing: -1px; }
    .modes { gap: 10px; }
    .mode { padding: 16px; }
    h3 { font-size: 18px; }
    .mode p { font-size: 12px; min-height: 96px; }
    .mode-bottom { font-size: 11px; }
    .section-heading { flex-wrap: wrap; gap: 10px; }
    #search-label, input { width: 100%; }
    .stats { padding: 14px; gap: 8px; }
    .stats strong { font-size: 23px; }
    .stats small { font-size: 9px; }
    .options { grid-template-columns: repeat(2,1fr); }
    .result-panel { padding: 18px; }
    .result-panel .stats { grid-template-columns: repeat(2,1fr); }
    footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
