:root {
  --bg: #050101; --panel: #160405; --line: #5c0b0c; --red: #e41e20; --accent: #ff3b3d;
  --text: #ffe9e9; --muted: #d9a5a5; --gold: #ffc533;
  --mono: Consolas, "Cascadia Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--mono); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: .04em; }
.wrap { width: min(1040px, 100%); margin: auto; padding: 0 16px; }

/* Website */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--accent); font-weight: 700; letter-spacing: .15em; text-decoration: none; }
.brand img { width: 42px; height: 30px; display: block; }
.hero { text-align: center; padding: 48px 0 56px; }
.rings { position: relative; width: min(300px, 74vw); aspect-ratio: 1; margin: 0 auto 28px; display: grid; place-items: center; }
.rings i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--red); border-left-color: var(--red); animation: spin 9s linear infinite; }
.rings i:nth-child(2) { inset: 9%; border-width: 1px; border-top-color: var(--accent); border-bottom-color: var(--accent); animation-duration: 5s; animation-direction: reverse; }
.rings i:nth-child(3) { inset: 18%; border-width: 5px; border-right-color: var(--line); border-left-color: var(--red); animation-duration: 13s; }
.rings img { width: 46%; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rings i { animation: none; } html { scroll-behavior: auto; } }
.hero h1 { font-size: clamp(2.6rem, 11vw, 4.6rem); margin: 0; letter-spacing: .14em; }
.tag { color: var(--accent); font-weight: 700; margin: 8px auto 18px; max-width: 42em; }
.lead { color: var(--muted); max-width: 40em; margin: 0 auto 28px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn { display: inline-block; padding: 12px 20px; border: 1px solid var(--red); background: var(--red); color: #fff; font: 700 15px var(--mono); text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); }
.btn:hover, .btn:focus-visible { background: var(--accent); color: #fff; outline: 2px solid var(--text); outline-offset: 2px; }
section { padding: 36px 0; border-top: 1px solid var(--line); }
section h2 { font-size: 1.5rem; margin: 0 0 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 18px; }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
footer { border-top: 1px solid var(--line); padding: 22px 0 32px; color: var(--muted); font-size: .85rem; }

/* Web app */
.app { height: 100dvh; display: flex; flex-direction: column; max-width: 860px; margin: auto; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.bar img { width: 36px; height: 26px; }
.bar b { color: var(--accent); letter-spacing: .15em; flex: 1; }
.link { background: none; border: 1px solid var(--line); color: var(--text); padding: 6px 10px; font: 13px var(--mono); cursor: pointer; }
#log { flex: 1; overflow-y: auto; padding: 14px; overflow-wrap: anywhere; }
.msg { margin: 0 0 12px; white-space: pre-wrap; }
.msg.user { color: var(--text); }
.msg.aria { color: var(--accent); }
.msg.note { color: var(--gold); }
form.input { display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
input { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 12px; font: 16px var(--mono); }
input:focus { outline: 1px solid var(--accent); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--red); width: min(440px, calc(100vw - 32px)); padding: 20px; }
dialog::backdrop { background: rgb(0 0 0 / .7); }
dialog h2 { margin-top: 0; }
dialog p { color: var(--muted); font-size: .92rem; }
dialog input { width: 100%; margin: 6px 0 14px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; }

/* Admin */
.narrow { max-width: 420px; margin: 40px auto; display: grid; gap: 12px; }
.note { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
.note.warn { color: var(--gold); }
.stat span { display: block; font-size: 1.9rem; font-weight: 700; color: var(--text); }
.stat small { color: var(--muted); }
#settings { display: grid; gap: 10px; max-width: 560px; }
#settings input[type="number"] { flex: none; width: 100%; }
#settings .btn { justify-self: start; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { flex: none; width: 18px; height: 18px; accent-color: var(--red); }
input[type="range"] { flex: none; width: 100%; padding: 0; accent-color: var(--red); }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.row-form input { flex: 2 1 180px; }
.row-form input[type="number"] { flex: 1 1 100px; }
.warn-box { border-color: var(--gold); margin-bottom: 14px; }
.warn-box p { color: var(--text); }
.warn-box code { display: block; overflow-wrap: anywhere; color: var(--gold); margin: 8px 0; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--accent); }
td .link { margin-right: 6px; }

.bar .link { white-space: nowrap; padding: 6px 8px; }
.bar b { min-width: 0; }
@media (max-width: 480px) { #status { display: none; } }
