:root {
  color-scheme: dark;
  --bg: #08040c;
  --panel: #160a20;
  --panel-2: #1d1028;
  --ink: #fffaf2;
  --muted: #b8a9bf;
  --line: rgba(229, 178, 82, 0.28);
  --gold: #f1c466;
  --gold-2: #b67b24;
  --purple: #9c4bd4;
  --green: #82eba0;
  --danger: #e4576c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 20% 0%, rgba(75, 18, 103, .28), transparent 34rem), linear-gradient(180deg, #09040e, #050308); color: var(--ink); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 999; background: var(--gold); color: #170b05; padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.topbar, .admin-top { min-height: 74px; display: flex; align-items: center; gap: 2rem; padding: 0 4vw; border-bottom: 1px solid var(--line); background: rgba(7, 3, 11, .92); }
.brand { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1; }
.brand strong { font-size: 1.7rem; letter-spacing: -.05em; }
.brand strong span { color: var(--gold); }
.brand small { margin-top: .35rem; color: var(--muted); font-size: .59rem; letter-spacing: .24em; }
.event-clock { margin-left: auto; display: flex; gap: 1.2rem; color: var(--muted); align-items: center; }
.event-clock b { color: #ffe29b; }
.top-link, .ghost-button { border: 1px solid var(--line); padding: .68rem 1rem; border-radius: 999px; text-decoration: none; background: rgba(255,255,255,.02); color: var(--ink); }
.test-banner { text-align: center; padding: .55rem 1rem; background: #6b3200; color: #ffe8bd; font-weight: 800; letter-spacing: .08em; font-size: .82rem; }
.page-shell { width: min(1320px, 94vw); margin: 2.4rem auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(430px, .9fr); gap: 1.35rem; align-items: start; }
.match-card, .chat-card, .admin-panel, .login-card { background: linear-gradient(180deg, rgba(27, 12, 38, .97), rgba(13, 7, 18, .98)); border: 1px solid var(--line); border-radius: 1.45rem; box-shadow: var(--shadow); }
.match-card { padding: 2.4rem; }
.eyebrow { margin: 0 0 .65rem; color: var(--gold); font-weight: 900; letter-spacing: .15em; font-size: .76rem; }
h1, h2, p { overflow-wrap: anywhere; }
.match-card h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 4rem); line-height: .98; letter-spacing: -.055em; }
.event-notice { color: var(--muted); font-size: 1.08rem; margin: 1.1rem 0 .75rem; }
.event-date { display: flex; gap: .8rem; flex-wrap: wrap; color: var(--muted); }
.event-date b { color: #ffe29b; }
.matchup { margin: 2rem 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.05rem; align-items: center; }
.channel-card { min-height: 345px; padding: 1.55rem; border: 1px solid var(--line); border-radius: 1rem; background: linear-gradient(145deg, rgba(43, 20, 54, .72), rgba(18, 9, 24, .92)); display: flex; flex-direction: column; }
.channel-left { box-shadow: inset 4px 0 0 #d4a844; }
.channel-right { box-shadow: inset -4px 0 0 var(--purple); }
.channel-card > p { color: var(--gold); letter-spacing: .12em; font-size: .8rem; margin: 0 0 1rem; }
.channel-card h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1.06; margin: 0; }
.score { display: block; margin: auto 0 .35rem; font-size: clamp(4rem, 9vw, 6.2rem); color: #ffe08c; line-height: .9; }
.presence { color: var(--muted); }
.channel-card a { margin-top: 1rem; text-decoration: none; }
.versus { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--gold-2); color: var(--gold); font-weight: 900; background: #0d0710; }
.round-strip { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: .85rem; background: rgba(2,1,4,.45); color: var(--muted); }
.round-strip strong { color: #ffe08c; }
.how-it-works { margin-top: 1.7rem; }
.how-it-works h2 { font-size: 1.15rem; margin: 0 0 .65rem; }
.how-it-works p { margin: 0; color: var(--muted); line-height: 1.65; }
.chat-card { overflow: hidden; }
.chat-heading { padding: 1.35rem 1.45rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-bottom: 1px solid var(--line); }
.chat-heading h1, .chat-heading h2 { margin: 0; font-size: 1.55rem; }
.room-status { border: 1px solid rgba(130,235,160,.35); color: var(--green); border-radius: 999px; padding: .42rem .7rem; font-weight: 900; font-size: .72rem; letter-spacing: .12em; }
.room-status.closed { color: #ffadb9; border-color: rgba(228,87,108,.45); }
.message-list { height: 430px; overflow: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: .7rem; scrollbar-color: #5a306e transparent; }
.chat-message { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.025); border-radius: .85rem; padding: .85rem 1rem; }
.chat-message.official-message { border-color: rgba(241,196,102,.42); background: rgba(241,196,102,.06); }
.message-meta { display: flex; gap: .55rem; align-items: center; }
.message-meta strong { font-size: .92rem; }
.message-meta span { border-radius: 999px; padding: .2rem .45rem; background: rgba(156,75,212,.18); color: #d9b8ef; font-size: .62rem; letter-spacing: .08em; }
.message-meta time { margin-left: auto; color: var(--muted); font-size: .72rem; }
.chat-message p { margin: .55rem 0 0; line-height: 1.45; }
.empty-message { color: var(--muted); text-align: center; margin: auto; }
.chat-form { border-top: 1px solid var(--line); padding: 1rem 1.2rem 1.25rem; display: grid; gap: .8rem; }
label, legend { color: var(--muted); font-size: .78rem; }
label { display: grid; gap: .4rem; }
input, textarea, select { width: 100%; color: var(--ink); background: #09050d; border: 1px solid rgba(255,255,255,.12); border-radius: .62rem; padding: .75rem .8rem; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(241,196,102,.1); }
textarea { resize: vertical; }
fieldset { min-width: 0; border: 1px solid rgba(255,255,255,.08); border-radius: .8rem; padding: .8rem; }
.team-options { display: flex; gap: .55rem; flex-wrap: wrap; }
.team-options label { display: block; }
.team-options input { position: absolute; opacity: 0; pointer-events: none; }
.team-options span { display: inline-block; padding: .55rem .75rem; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: var(--muted); }
.team-options input:checked + span { border-color: var(--gold-2); color: #ffe09a; background: rgba(241,196,102,.08); }
.form-actions { display: flex; gap: 1rem; justify-content: space-between; align-items: center; min-height: 42px; }
.form-actions > span { color: var(--muted); font-size: .8rem; }
button { border: 0; border-radius: 999px; padding: .72rem 1.05rem; background: linear-gradient(180deg, #f3c76f, #d99e43); color: #241000; font-weight: 850; }
button:disabled { opacity: .5; cursor: not-allowed; }
.safety-note { margin: 0; color: #8f8198; font-size: .72rem; line-height: 1.45; }
.site-footer { width: min(1320px, 94vw); margin: 0 auto 2.5rem; display: flex; gap: 2rem; align-items: end; justify-content: space-between; color: var(--muted); }
.site-footer > div { display: grid; gap: .35rem; }
.site-footer strong { color: #ffe09a; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.15rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.noscript { text-align: center; color: #ffadb9; }
.embed-body { min-height: 100vh; background: transparent; padding: 0; }
.embed-card { border-radius: 0; min-height: 100vh; }
.embed-card .message-list { height: min(58vh, 520px); }
.admin-body { background: radial-gradient(circle at 12% 0, rgba(89,25,116,.22), transparent 36rem), #09050d; }
.admin-top { justify-content: space-between; }
.admin-shell { width: min(1160px, 92vw); margin: 2.5rem auto; }
.admin-title { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.admin-title h1 { margin: 0 0 .4rem; font-size: 2rem; }
.admin-title p { margin: 0; color: var(--muted); }
#adminStatus { color: var(--green); }
.error-text { color: #ff9cab !important; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-panel { padding: 1.2rem; border-radius: 1rem; }
.admin-panel h2 { margin: .15rem 0 1rem; }
.admin-form { display: grid; gap: .85rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.admin-form fieldset { display: grid; gap: .75rem; }
.check-row { display: flex; align-items: center; gap: .6rem; }
.check-row input { width: auto; }
.admin-panel hr { border: 0; border-top: 1px solid var(--line); margin: 1.3rem 0; }
.button-stack { display: flex; flex-wrap: wrap; gap: .65rem; }
.ghost-button { background: rgba(255,255,255,.035); color: var(--ink); }
.danger-button { background: var(--danger); color: #fff; }
.message-admin { margin-top: 1rem; }
.panel-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.admin-messages { display: grid; }
.admin-message-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1rem .45rem; border-top: 1px solid rgba(255,255,255,.07); }
.admin-message-row p { margin: .45rem 0 0; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; justify-content: end; }
.row-actions button { padding: .55rem .72rem; font-size: .75rem; }
.muted-text { opacity: .48; text-decoration: line-through; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(460px, 94vw); padding: 2rem; }
.login-card h1 { margin: 2rem 0 .6rem; }
.login-card > p { color: var(--muted); }
.login-card form { display: grid; gap: 1rem; margin-top: 1.5rem; }

@media (max-width: 980px) {
  .page-shell { grid-template-columns: 1fr; }
  .chat-card { order: 2; }
  .message-list { height: 520px; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .topbar { padding: .8rem 1rem; gap: .8rem; flex-wrap: wrap; }
  .event-clock { order: 3; width: 100%; margin: 0; justify-content: space-between; font-size: .83rem; }
  .top-link { margin-left: auto; font-size: .75rem; }
  .page-shell { width: min(100% - 1.25rem, 1320px); margin: 1rem auto; }
  .match-card { padding: 1.15rem; }
  .matchup { grid-template-columns: 1fr; }
  .versus { margin: 0 auto; }
  .channel-card { min-height: 265px; }
  .round-strip { align-items: flex-start; flex-direction: column; }
  .message-list { height: 440px; }
  .site-footer { align-items: flex-start; flex-direction: column; padding: 0 .2rem; }
  .admin-top { padding: .8rem 1rem; }
  .admin-shell { width: min(100% - 1.2rem, 1160px); margin: 1rem auto; }
  .admin-title { align-items: flex-start; flex-direction: column; }
  .field-grid { grid-template-columns: 1fr; }
  .admin-message-row { grid-template-columns: 1fr; }
  .row-actions { justify-content: start; }
}
