:root {
	color-scheme: dark;
	--bg: #101719;
	--panel: #192326;
	--panel-raised: #202c2f;
	--line: #344347;
	--text: #e5eeec;
	--muted: #9aacab;
	--teal: #55d8b4;
	--green: #8bcf9b;
	--amber: #e8ad5d;
	--red: #f07870;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: radial-gradient(ellipse at 50% 0, #1b292b 0, var(--bg) 48rem); color: var(--text); min-height: 100vh; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px; background: #0b1113; border-bottom: 1px solid var(--line); color: var(--text); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
header h1 { margin: 0; font-size: 18px; }
.radar-mark { width: 34px; height: 34px; flex: none; position: relative; overflow: hidden; border: 1px solid var(--teal); border-radius: 50%; background: radial-gradient(circle, var(--amber) 0 2px, transparent 2.6px), repeating-radial-gradient(circle, transparent 0 6px, rgba(85, 216, 180, .34) 6.5px 7.5px), linear-gradient(90deg, transparent 49%, rgba(85, 216, 180, .24) 49% 51%, transparent 51%), linear-gradient(transparent 49%, rgba(85, 216, 180, .24) 49% 51%, transparent 51%); }
.radar-mark::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(85, 216, 180, .58), rgba(85, 216, 180, .04) 68deg, transparent 72deg); animation: radar-sweep 4s linear infinite; }
.radar-mark::after { content: ""; position: absolute; width: 4px; height: 4px; top: calc(50% - 2px); left: calc(50% - 2px); border-radius: 50%; background: var(--amber); box-shadow: 8px -7px 0 -1px var(--teal); }
@keyframes radar-sweep { to { transform: rotate(360deg); } }
header #user { display: flex; gap: 12px; align-items: center; }
main { max-width: 1000px; margin: 24px auto; padding: 0 16px; display: grid; gap: 16px; }
.card { background: rgba(25, 35, 38, .94); border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: 0 12px 28px rgba(0, 0, 0, .14); }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.center { text-align: center; padding: 40px 16px; }
#login-form { max-width: 460px; margin: 20px auto 0; }
#channel-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
#channel-bar select { margin: 0; min-width: 240px; }
#invitation-form { align-items: center; }
#invitation-form select { margin: 0; }
#invitation-created { display: flex; gap: 8px; margin: 16px 0; }
#invitation-created[hidden] { display: none; }
#invitation-list { overflow-x: auto; }
#invitation-list button:disabled { cursor: default; opacity: .55; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tiles .card { display: grid; gap: 6px; }
.tiles strong { font-size: 26px; color: var(--teal); }
.label, .muted, .legend { color: var(--muted); font-size: 13px; }
.error { color: var(--red); }
button, .button { background: var(--teal); color: #10201d; border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; text-decoration: none; font-size: 14px; display: inline-block; font-weight: 650; }
button:hover, .button:hover { background: #79e5c5; }
button.secondary { background: var(--panel-raised); color: var(--text); border: 1px solid var(--line); }
button.secondary:hover { background: #2a393c; }
button.danger { background: #a9433e; color: #fff; }
button:disabled { opacity: .55; }
form { display: flex; gap: 8px; flex-wrap: wrap; }
input, select { flex: 1; min-width: 200px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #111a1c; color: var(--text); font-size: 14px; }
input::placeholder { color: #829494; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
select { flex: none; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel-raised); }
canvas { width: 100%; height: auto; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 12px; }
.dot.a { background: var(--teal); } .dot.b { background: var(--green); } .dot.c { background: var(--amber); }
#history { margin-top: 16px; }
.not-owner .owner-only { display: none !important; }
#admin-list { padding-left: 18px; }
#admin-list li { margin: 6px 0; }
header #channel-select { margin: 0; min-width: 0; }
@media (max-width: 600px) {
	header { padding: 10px 14px; }
	header #user { gap: 8px; }
	#user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	main { margin: 16px auto; }
	#invitation-created { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

#viewer-log { max-height: 480px; overflow-y: auto; }
.log-entry { background: var(--panel-raised); border-left: 3px solid #9b59ff; border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; }
.log-entry p { margin: 4px 0; }
.log-entry pre { white-space: pre-wrap; background: var(--bg); padding: 8px; border-radius: 4px; }

#log-filter { width: 100%; max-width: 360px; margin-bottom: 8px; }
.log-entry mark { background: var(--amber); color: #101719; border-radius: 2px; }

.chart-wrap { position: relative; }
#chart { cursor: crosshair; }
.chart-tip { position: absolute; top: 8px; z-index: 2; pointer-events: none; max-width: 320px; background: #0b1113; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.5; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.chart-tip[hidden] { display: none; }

.steam-avatar { width: 64px; height: 64px; border-radius: 6px; float: right; }

.twitch-preview { overflow: hidden; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; margin: 8px 0; }
.twitch-preview p { margin: 4px 0; }

#login-form { display: flex; justify-content: center; }
#login-form button { background: #9146ff; color: #fff; padding: 12px 28px; font-size: 16px; }
#login-form button:hover { background: #a970ff; }
.snapshot-panel { margin-top: 12px; padding: 12px 14px; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 6px; }
.snapshot-panel[hidden] { display: none; }
#snapshot-filter { width: 100%; max-width: 360px; }
.snapshot-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; margin: 8px 0; }
.viewer-chip { padding: 4px 10px; font-weight: 500; }

.header-logo { display: block; height: 48px; width: auto; border-radius: 6px; }
.banner { display: flex; justify-content: center; padding: 16px 16px 0; }
.banner img { display: block; width: 100%; max-width: 460px; height: auto; -webkit-mask-image: radial-gradient(ellipse at center, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse at center, #000 55%, transparent 100%); }
