:root {
  color-scheme: light;
  --ink: #191815;
  --muted: #76736b;
  --gold: #d5a945;
  --gold-light: #f5e6bd;
  --paper: #f8f6f0;
  --panel: #fffefa;
  --line: #e8e3d6;
  --green: #477754;
  --red: #a43931;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: #795a18; }
.hidden { display: none !important; }
.site-header { height: 76px; padding: 0 max(24px, calc((100% - 1180px) / 2)); display: flex; justify-content: space-between; align-items: center; background: #141310; color: white; }
.brand { display: inline-flex; gap: 12px; align-items: center; color: white; text-decoration: none; }
.brand img { display: block; }
.brand strong, .brand small { display: block; letter-spacing: .13em; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: var(--gold); font-size: 9px; }
.connection-status { color: #dcc782; font-size: 12px; }
main { max-width: 1180px; min-height: calc(100vh - 142px); padding: 46px 24px 64px; margin: 0 auto; }
.auth-shell { min-height: 610px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 70px; }
.auth-copy { max-width: 580px; padding: 32px 0; }
.eyebrow { margin: 0 0 10px; color: #98701d; font-weight: 800; font-size: 11px; letter-spacing: .17em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(40px, 6vw, 64px); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 20px; }
.auth-copy h1 em { color: #ae8127; font-weight: 400; }
.auth-copy > p:not(.eyebrow) { max-width: 470px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.feature-note { margin-top: 45px; color: #5d584c; font-size: 14px; }
.gold-dot { display: inline-block; width: 9px; height: 9px; margin-right: 9px; border-radius: 50%; background: var(--gold); }
.panel { padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 35px #48370d0a; }
.auth-form h2 { margin-bottom: 8px; font-family: Georgia, serif; font-size: 28px; }
.muted { color: var(--muted); }
.auth-form .muted { font-size: 14px; margin-bottom: 26px; }
label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; padding: 12px 13px; border: 1px solid #d9d3c6; border-radius: 7px; background: white; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #d5a94522; }
textarea { resize: vertical; }
.phone-entry { display: flex; align-items: center; margin-bottom: 16px; overflow: hidden; border: 1px solid #d9d3c6; border-radius: 7px; background: white; }
.phone-entry span { padding: 0 13px; color: #615a4b; border-right: 1px solid #eee9df; }
.phone-entry input { border: 0; box-shadow: none; }
.consent-copy { margin: 14px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0; color: #5f5b53; font-size: 12px; font-weight: 500; line-height: 1.5; }
.checkbox-row input { width: 16px; height: 16px; margin: 0; accent-color: #ab7a18; }
.button { display: inline-flex; min-height: 42px; padding: 10px 16px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 750; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: #191815; color: white; }
.button-primary:hover { background: #38352e; }
.button-quiet { background: #f3efe5; border-color: #e7e0d1; color: #38342c; }
.full-width { width: 100%; margin-top: 10px; }
.form-message { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 13px; }
.form-message.success { color: var(--green); }
.dev-code { margin-top: 8px; padding: 9px; border-radius: 6px; background: #f6efdb; color: #675019; font-size: 12px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: #795a18; font-size: 12px; font-weight: 700; text-decoration: underline; }
#otpFields { margin-top: 14px; }
#otpInput { letter-spacing: .3em; }
.app-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.app-heading h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); }
.account-tools { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; margin-bottom: 24px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { padding: 13px 17px; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; }
.tab.active { border-bottom-color: var(--gold); color: var(--ink); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 34px 0 18px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 31px; }
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.create-hunt-card {
  display: flex;
  min-height: 245px;
  padding: 25px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: 1px dashed #b49b66;
  border-radius: 12px;
  background: linear-gradient(145deg, #fffdf7, #f5f0e3);
  color: #59471e;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.create-hunt-card:hover { transform: translateY(-3px); border-color: #987324; box-shadow: 0 14px 28px #49391114; }
.create-hunt-plus { display: grid; width: 64px; height: 64px; place-items: center; border: 1px solid #d7c69d; border-radius: 50%; background: #fff; color: #9c7627; font-size: 42px; font-weight: 300; line-height: 1; }
.create-hunt-title { font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.event-card { overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; color: var(--ink); }
.event-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.event-image { height: 155px; display: grid; place-items: center; background: linear-gradient(135deg, #25231e, #4c412a); color: #d9b65d; font-family: Georgia, serif; font-size: 24px; }
.event-image img { width: 100%; height: 100%; object-fit: cover; }
.event-card-body { padding: 17px; }
.event-card h3 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 20px; }
.event-card p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.empty-message, .empty-state { color: var(--muted); }
.empty-message { padding: 22px 0; }
.event-detail { margin-top: 24px; }
.event-detail h2 { margin: 16px 0 7px; font-family: Georgia, serif; font-size: 30px; }
.event-detail p { color: #5f5b53; line-height: 1.65; }
.join-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; margin: 25px 0 9px; padding-top: 20px; border-top: 1px solid var(--line); }
.small { font-size: 12px; }
.token-pill { padding: 8px 13px; border: 1px solid #e4d199; border-radius: 30px; background: var(--gold-light); color: #5c4514; font-size: 13px; font-weight: 800; }
.hunt-card { max-width: 780px; }
.hunt-card .trial-counter { color: #96701f; font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.hunt-card h3 { margin: 14px 0; font-family: Georgia, serif; font-size: 27px; }
.hunt-card .challenge { margin-bottom: 22px; white-space: pre-wrap; line-height: 1.7; }
.challenge-image { display: block; max-width: 100%; max-height: 480px; margin: 0 0 18px; border-radius: 8px; object-fit: contain; }
.challenge-audio { display: block; width: min(100%, 520px); margin: 0 0 18px; }
.hunt-answer { display: flex; gap: 10px; }
.hunt-answer input { flex: 1; }
.hint-box { margin: 15px 0; padding: 13px; border-left: 3px solid var(--gold); background: #faf5e7; line-height: 1.5; }
.winner-banner { padding: 17px; margin-bottom: 15px; background: var(--gold-light); border-radius: 8px; font-family: Georgia, serif; font-size: 19px; }
.team-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.team-header h3 { font-family: Georgia, serif; font-size: 26px; }
.team-code { padding: 10px 14px; border-radius: 7px; background: #f5efdE; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; letter-spacing: .15em; }
.member-list { padding-left: 18px; line-height: 1.9; }
.organizer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-stack h3, .form-stack h4 { margin: 0; font-family: Georgia, serif; }
.form-stack h3 { font-size: 22px; }
.form-stack h4 { margin-top: 7px; font-size: 18px; }
.form-stack label { margin: 0; }
.form-stack label input, .form-stack label textarea, .form-stack label select { display: block; margin-top: 6px; }
.form-stack .checkbox-row { display: flex; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
fieldset legend { padding: 0 5px; color: var(--muted); font-size: 12px; }
fieldset .checkbox-row { margin: 0; }
.divider { height: 1px; margin: 5px 0; background: var(--line); }
.issued-code { padding: 15px; border-radius: 8px; background: #f5efde; color: #554112; font-family: ui-monospace, monospace; font-size: 21px; font-weight: 800; letter-spacing: .2em; }
.issued-code small { display: block; margin-top: 7px; font: 12px/1.4 system-ui; letter-spacing: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-live { margin-top: 18px; overflow-x: auto; }
.broadcast-form { display: flex; gap: 14px; align-items: end; margin-top: 16px; }
.broadcast-form label { flex: 1; }
.broadcast-form textarea { display: block; margin-top: 6px; }
.planned-trials-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbf8f0; color: #65532d; font-size: 13px; }
.planned-trials-control strong { color: var(--ink); font-size: 17px; }
.planned-trials-dialog { width: min(440px, calc(100% - 28px)); padding: 26px; border: 1px solid #d8ceb6; border-radius: 13px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px #18160e44; }
.planned-trials-dialog::backdrop { background: #17161299; backdrop-filter: blur(2px); }
.planned-trials-dialog h3 { font-family: Georgia, serif; font-size: 24px; }
.planned-trials-dialog .muted { font-size: 13px; line-height: 1.55; }
.team-management { margin-top: 20px; }
.team-management-tools { display: grid; grid-template-columns: minmax(240px, .7fr) 1fr; gap: 20px; align-items: end; }
.team-management .table-scroll { overflow-x: auto; }
.team-management .data-table { min-width: 620px; }
#createTrialForm { padding-top: 6px; }
#trialEditorEmpty { padding: 12px 0; font-size: 13px; }
.form-stack > .muted { margin: 0; font-size: 13px; line-height: 1.5; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: #716b5d; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.data-table .own-row { background: #faf4e3; }
.status-good { color: var(--green); font-weight: 700; }
.status-bad { color: var(--red); font-weight: 700; }
.global-message { padding: 12px 15px; margin-bottom: 16px; border: 1px solid #d9c785; border-radius: 7px; background: #fbf3d9; color: #554112; font-size: 13px; }
.global-message.error { border-color: #e2bcb9; background: #fff1ef; color: var(--red); }
.reconnecting { color: var(--red); }
footer { min-height: 66px; display: flex; justify-content: space-between; align-items: center; padding: 0 max(24px, calc((100% - 1180px) / 2)); background: #141310; color: #9c988d; font-size: 11px; }
footer span:first-child { color: #dcc782; font-weight: 800; letter-spacing: .12em; }

@media (max-width: 800px) {
  main { padding-top: 28px; }
  .auth-shell { grid-template-columns: 1fr; gap: 6px; }
  .auth-copy { padding: 10px 0; }
  .auth-copy h1 { font-size: 48px; }
  .feature-note { margin-top: 20px; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .organizer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header { height: 64px; padding: 0 16px; }
  .site-header .brand img { width: 36px; height: 36px; }
  main { padding: 22px 16px 42px; }
  .auth-copy h1 { font-size: 42px; }
  .auth-copy > p:not(.eyebrow) { font-size: 15px; }
  .panel { padding: 20px; }
  .app-heading { align-items: flex-start; flex-direction: column; }
  .account-tools { width: 100%; flex-wrap: wrap; }
  .event-grid { grid-template-columns: 1fr; }
  .event-image { height: 145px; }
  .join-form { grid-template-columns: 1fr; }
  .team-header { flex-direction: column; }
  .hunt-answer { flex-direction: column; }
  .broadcast-form { flex-direction: column; align-items: stretch; }
  .two-fields { grid-template-columns: 1fr; }
  footer { padding: 15px 16px; gap: 8px; flex-direction: column; align-items: flex-start; }
}

/* Editorial field-guide theme */
:root {
  --ink: #201d18;
  --muted: #777166;
  --gold: #e3b84f;
  --gold-light: #f6e8c3;
  --paper: #f2efe7;
  --panel: #fffdf7;
  --line: #e5dece;
  --green: #3b7757;
  --red: #a43931;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 88% 8%, #e6d8b638, transparent 33rem),
    radial-gradient(ellipse at 4% 42%, #d5c7a526, transparent 30rem),
    var(--paper);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(#70644812 .7px, transparent .7px);
  background-size: 6px 6px;
  content: "";
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 2;
  height: 72px;
  background: linear-gradient(110deg, #151511, #242118 72%, #30291a);
  box-shadow: 0 5px 24px #100e0a26;
}

.site-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d5a945, #f3dc99, #d5a945, transparent);
  content: "";
}

.brand { gap: 13px; }
.brand img { filter: drop-shadow(0 0 9px #ddb74d2b); }
.brand strong { letter-spacing: .18em; }
.connection-status {
  padding: 7px 11px;
  border: 1px solid #d5a94536;
  border-radius: 99px;
  background: #ffffff08;
  color: #ead59b;
  font-size: 11px;
  letter-spacing: .06em;
}

main { max-width: 1280px; }
.auth-shell { gap: clamp(40px, 8vw, 112px); }
.auth-copy { position: relative; }
.auth-copy::before {
  display: block;
  width: 70px;
  height: 3px;
  margin-bottom: 22px;
  background: linear-gradient(90deg, #9e741f, #e8c260);
  content: "";
}
.auth-copy .eyebrow { color: #87641b; }
.auth-copy h1 { font-size: clamp(48px, 6.3vw, 76px); }
.auth-copy h1 em { color: #a47821; }
.auth-copy > p:not(.eyebrow) { max-width: 430px; }
.feature-note {
  display: inline-flex;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid #d8cba8;
  border-radius: 7px;
  background: #fffaf0a8;
  box-shadow: 0 6px 20px #76612c0b;
  font-size: 12px;
}
.gold-dot { box-shadow: 0 0 0 4px #d5a94526; }
.auth-form {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid #ded5c0;
  border-radius: 15px;
  background: linear-gradient(145deg, #fffefa, #fffdf6);
  box-shadow: 0 24px 70px #49391117, 0 3px 10px #49391108;
}
.auth-form::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #9b6d15, #e6c66d, #9b6d15);
  content: "";
}
.auth-form .eyebrow { margin-top: 4px; }
.auth-form h2 { font-size: 30px; }
.button-google {
  gap: 11px;
  border-color: #d9d4c9;
  background: #fff;
  color: #302e29;
  box-shadow: 0 3px 10px #241e0e0c;
}
.button-google:hover { background: #fbfaf7; }
.button-google span { color: #4285f4; font-size: 17px; font-weight: 850; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 15px; color: #898171; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
#localLoginFields > .muted { margin: 0 0 18px; font-size: 12px; }
input, textarea, select {
  border-color: #dcd5c7;
  border-radius: 8px;
  background-color: #fffefa;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:hover, textarea:hover, select:hover { border-color: #c9b77f; }
input:focus, textarea:focus, select:focus { border-color: #ba8b27; box-shadow: 0 0 0 4px #d5a94524; }
.button { min-height: 44px; border-radius: 8px; }
.button-primary {
  border-color: #1c1a15;
  background: linear-gradient(135deg, #29271f, #151410);
  box-shadow: 0 5px 12px #1d1a1122;
}
.button-primary:hover { background: linear-gradient(135deg, #47402e, #29251b); }
.button:disabled { cursor: wait; opacity: .72; transform: none; }

.dashboard-banner {
  position: relative;
  min-height: 216px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 32px clamp(25px, 5vw, 58px);
  margin: 0 0 31px;
  border: 1px solid #5d4b25;
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 78% 28%, #b3934633, transparent 34%),
    linear-gradient(112deg, #1a1915, #242117 63%, #342b1b);
  box-shadow: 0 16px 42px #382b101f;
  color: #fffdf7;
}
.dashboard-banner::before, .dashboard-banner::after {
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid #d1aa5140;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.dashboard-banner::before { top: -155px; right: 130px; }
.dashboard-banner::after { top: -128px; right: 157px; width: 226px; height: 226px; border-color: #d1aa512e; }
.dashboard-banner > div:first-child { position: relative; z-index: 1; }
.dashboard-banner .eyebrow { color: #e3c46f; }
.dashboard-banner h2 { margin: 0 0 11px; font-family: Georgia, serif; font-size: clamp(27px, 4vw, 40px); line-height: 1.12; letter-spacing: -.02em; }
.dashboard-banner h2 em { color: #e5bf5d; font-weight: 400; }
.dashboard-banner p:last-child { max-width: 470px; margin: 0; color: #d0cabb; font-size: 13px; line-height: 1.6; }
.banner-seal {
  position: absolute;
  top: 50%;
  right: 15%;
  width: 105px;
  height: 105px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid #e3bc5b8a;
  border-radius: 50%;
  color: #e7c567;
  transform: translateY(-50%) rotate(-9deg);
  box-shadow: 0 0 0 7px #d7b24a0b, inset 0 0 0 4px #d7b24a12;
}
.banner-seal span { font-family: Georgia, serif; font-size: 32px; line-height: 1; }
.banner-seal small { margin-top: 5px; font-size: 7px; letter-spacing: .18em; text-align: center; }
.banner-coordinates { position: absolute; right: 26px; bottom: 18px; color: #c8b985; font: 9px/1.6 ui-monospace, monospace; letter-spacing: .1em; text-align: right; }
.app-heading { margin: 0 0 20px; align-items: end; }
.app-heading h1 { font-family: Georgia, serif; font-size: clamp(30px, 4vw, 43px); }
.app-heading .eyebrow { margin-bottom: 7px; }
.account-tools { padding: 8px 11px; border: 1px solid #dfd8c9; border-radius: 9px; background: #fffdf8c9; }
.account-tools #userLabel { color: #49453c; font-weight: 650; }
.tabs {
  gap: 5px;
  padding: 5px;
  margin-bottom: 22px;
  border: 1px solid #e3dccd;
  border-radius: 10px;
  background: #eae6dc;
}
.tab { padding: 10px 16px; border: 0; border-radius: 7px; font-size: 12px; transition: background .15s, color .15s, box-shadow .15s; }
.tab:hover { background: #ffffff80; color: var(--ink); }
.tab.active { background: #fffdf8; color: #5e4613; box-shadow: 0 2px 7px #352c1916; }
.section-heading { margin: 28px 0 16px; }
.section-heading h2 { font-size: 33px; }
.panel {
  border-color: #e1daca;
  border-radius: 13px;
  background: linear-gradient(145deg, #fffefa, #fffdf7);
  box-shadow: 0 10px 30px #3f32120b, 0 2px 5px #3f321208;
}
.event-card {
  border-color: #e1daca;
  border-radius: 13px;
  box-shadow: 0 6px 18px #382d130b;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.event-card:hover { border-color: #c9a448; box-shadow: 0 14px 28px #382d1318; }
.event-image { position: relative; background: radial-gradient(circle at 70% 25%, #bd985447, transparent 34%), linear-gradient(140deg, #24231e, #413820 75%, #725d2d); }
.event-image::after {
  position: absolute;
  inset: 12px;
  border: 1px solid #e4c46842;
  border-radius: 4px;
  content: "";
}
.event-card-body { padding: 18px; }
.event-card h3 { font-size: 22px; }
.event-card p { font-size: 13px; }
.form-stack { gap: 14px; }
.form-stack h3 { font-size: 24px; }
.form-stack h4 { margin-top: 8px; color: #755819; font-size: 17px; }
.form-stack label { color: #514b3f; font-size: 12px; }
.form-stack input, .form-stack textarea, .form-stack select { font-size: 13px; font-weight: 450; }
.organizer-grid { gap: 20px; }
.organizer-grid > .panel { position: relative; overflow: hidden; }
.organizer-grid > .panel::before {
  position: absolute;
  top: 0;
  left: 28px;
  width: 42px;
  height: 3px;
  background: #c59a39;
  content: "";
}
.admin-live h3 { font-family: Georgia, serif; }
.data-table th { padding-top: 12px; padding-bottom: 12px; }
.data-table tbody tr:hover { background: #fbf7ed; }
.global-message { position: sticky; top: 10px; z-index: 3; box-shadow: 0 6px 18px #33270c14; }
footer { min-height: 72px; border-top: 2px solid #a07a2d; background: #171612; }

@media (max-width: 800px) {
  .auth-copy h1 { font-size: 58px; }
  .dashboard-banner { min-height: 195px; }
  .banner-seal { right: 7%; width: 85px; height: 85px; }
  .team-management-tools { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header { height: 64px; }
  .connection-status { padding: 6px 8px; font-size: 10px; }
  .auth-copy h1 { font-size: 46px; }
  .auth-form { padding: 26px 22px; }
  .dashboard-banner { min-height: 184px; padding: 25px 21px; margin-bottom: 22px; }
  .dashboard-banner h2 { max-width: 280px; font-size: 29px; }
  .dashboard-banner p:last-child { max-width: 250px; font-size: 11px; }
  .banner-seal { top: 22px; right: 18px; width: 53px; height: 53px; transform: rotate(-9deg); }
  .banner-seal span { font-size: 20px; }
  .banner-seal small, .banner-coordinates { display: none; }
  .app-heading { gap: 13px; }
  .app-heading h1 { font-size: 32px; }
  .account-tools { gap: 9px; }
  .tabs { margin-right: -3px; margin-left: -3px; }
  .tab { padding: 10px 12px; }
  .section-heading h2 { font-size: 29px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.empty-event-card {
  grid-column: 1 / -1;
  padding: 38px;
  border: 1px dashed #cfc4a9;
  border-radius: 13px;
  background: #fffdf7b8;
  text-align: center;
}
.empty-seal { color: #b28b35; font-size: 29px; }
.empty-event-card h3 { margin: 12px 0 7px; font-family: Georgia, serif; font-size: 24px; }
.empty-event-card p { margin: 0; color: var(--muted); font-size: 13px; }
.event-card-body { position: relative; }
.event-state { display: inline-block; margin-bottom: 11px; color: #987426; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.event-state-live { color: #32734d; }
.event-card-cta { display: flex; justify-content: space-between; align-items: center; padding-top: 13px; margin-top: 14px; border-top: 1px solid var(--line); color: #69501a; font-size: 12px; font-weight: 750; }
.event-card-cta span { font-size: 17px; }
.event-workspace { padding-top: 8px; scroll-margin-top: 24px; }
.back-link { margin-bottom: 14px; text-decoration: none; }
.event-overview {
  display: block;
}
.event-detail {
  display: grid;
  grid-template-columns: 1fr minmax(220px, .36fr);
  gap: 25px;
  align-items: stretch;
  overflow: hidden;
  padding: clamp(23px, 4vw, 40px);
  border: 1px solid #55451f;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 80% 0%, #d4ad4e20, transparent 32%),
    linear-gradient(120deg, #201f19, #30291d);
  color: #fffdf6;
  box-shadow: 0 15px 36px #342a151b;
  margin: 0;
}
.event-detail-copy { align-self: center; }
.event-detail-copy .eyebrow { color: #dfbd61; }
.event-detail h2 { margin: 0 0 12px; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; }
.event-detail-copy > p:not(.eyebrow) { max-width: 640px; margin-bottom: 20px; color: #d5d0c4; font-size: 14px; line-height: 1.65; }
.event-facts { display: flex; flex-wrap: wrap; gap: 22px; }
.event-facts span { min-width: 110px; display: grid; gap: 4px; }
.event-facts small { color: #c9ae68; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.event-facts strong { color: #f4f0e5; font-size: 12px; font-weight: 650; }
.event-countdown {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 21px;
  border: 1px solid #e2c36b59;
  border-radius: 10px;
  background: #fffdf70a;
  text-align: center;
}
.countdown-kicker { color: #e3c779; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.event-countdown > strong { margin: 12px 0; color: #fff3cb; font: 700 clamp(24px, 3vw, 34px)/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.06em; }
.countdown-footnote { color: #d5d0c2; font-size: 11px; line-height: 1.5; }
.event-countdown-live > strong { color: #b7e0bd; font: 800 22px/1 system-ui, sans-serif; letter-spacing: .12em; }
.live-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 12px; }
.live-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid #ffffff2b; border-radius: 999px; background: #ffffff0c; color: #f7f1e3; font-size: 11px; font-weight: 750; letter-spacing: .04em; cursor: pointer; }
.live-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.toggle-switch { position: relative; width: 34px; height: 19px; flex: 0 0 34px; border-radius: 999px; background: #615d53; transition: background .18s; }
.toggle-switch::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; content: ""; transition: transform .18s; }
.live-toggle input:checked + .toggle-switch { background: #5b9b66; }
.live-toggle input:checked + .toggle-switch::after { transform: translateX(15px); }
.live-toggle input:focus-visible + .toggle-switch { outline: 3px solid #dfbd61; outline-offset: 3px; }
.live-toggle:has(input:disabled) { cursor: not-allowed; opacity: .65; }
.kickstart-control { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 15px; color: #fff3cb; font-size: 12px; font-weight: 750; cursor: pointer; }
.kickstart-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.kickstart-switch { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #797364; transition: background .15s; }
.kickstart-switch::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fffdf6; content: ""; transition: transform .15s; }
.kickstart-control input:checked + .kickstart-switch { background: #4f9a68; }
.kickstart-control input:checked + .kickstart-switch::after { transform: translateX(16px); }
.kickstart-control input:focus-visible + .kickstart-switch { outline: 3px solid #e3c779; outline-offset: 3px; }
.kickstart-control input:disabled + .kickstart-switch { opacity: .75; }
.team-progress-banner { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(180px, 1fr) auto; gap: 18px; align-items: center; padding: 14px 18px; margin: 15px 0 3px; border: 1px solid #dfd0a3; border-radius: 10px; background: linear-gradient(100deg, #fffaf0, #fffdf7); box-shadow: 0 5px 15px #382d130b; }
.team-progress-copy { display: grid; gap: 4px; }
.team-progress-copy .eyebrow { margin: 0; color: #8b6a1c; }
.team-progress-copy strong { font-family: Georgia, serif; font-size: 18px; }
.team-progress-count { color: #736b5c; font-size: 11px; font-weight: 700; text-align: right; }
.team-progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #eae4d4; }
.team-progress-track > span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, #a77b20, #d3aa4f); transition: width .35s ease; }
.leaderboard-list { display: grid; gap: 11px; }
.leaderboard-team { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fffefa; }
.leaderboard-team.own-team { border-color: #d3b45e; background: #fffaf0; }
.leaderboard-team-heading { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; margin-bottom: 10px; }
.leaderboard-team-heading > strong { overflow-wrap: anywhere; font-size: 13px; }
.leaderboard-team-heading > span:last-child { color: #725820; font-size: 11px; font-weight: 750; text-align: right; }
.leaderboard-rank { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #eee8d8; color: #5e4a1e; font-size: 11px; font-weight: 800; }
.leaderboard-team-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: #787163; font-size: 10px; }
.join-prompt {
  display: grid;
  grid-template-columns: minmax(210px, .75fr) 1.25fr;
  gap: 25px;
  align-items: center;
  padding: 20px 23px;
  margin: 16px 0;
  border: 1px solid #e3d7b7;
  border-radius: 12px;
  background: linear-gradient(110deg, #fffaf0, #fffdf7);
}
.join-prompt h3 { margin: 0 0 5px; font-family: Georgia, serif; font-size: 20px; }
.join-prompt p { margin: 0; }
.join-form { grid-template-columns: 1fr 1fr auto; gap: 11px; margin: 0; padding: 0; border: 0; }
.join-form label { margin: 0; font-size: 11px; }
.join-form input { margin-top: 5px; }
.event-tabs { margin: 18px 0 4px; }
.main-tabs { width: fit-content; min-width: 100px; margin: 0 0 21px; }
.main-tabs .tab { min-width: 88px; }
.event-panel > .section-heading { margin-top: 22px; }
.not-started-message { padding: 8px 0; color: #795c21; font-family: Georgia, serif; font-size: 22px; }
.create-event-dialog { max-height: min(90vh, 900px); overflow-y: auto; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.dialog-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 26px; }
.dialog-close { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 23px; line-height: 1; }
.admin-live h3 { margin-bottom: 13px; }

@media (max-width: 800px) {
  .event-detail { grid-template-columns: 1fr; }
  .event-countdown { min-height: 130px; }
  .join-prompt { grid-template-columns: 1fr; }
  .join-form { grid-template-columns: 1fr 1fr; }
  .join-form button { grid-column: 1 / -1; }
  .team-progress-banner { grid-template-columns: 1fr auto; gap: 10px 14px; }
  .team-progress-track { grid-column: 1 / -1; grid-row: 2; }
  .team-progress-count { grid-column: 2; grid-row: 1; }
}
@media (max-width: 560px) {
  .event-detail { gap: 20px; padding: 23px 20px; }
  .event-facts { gap: 13px 19px; }
  .event-facts span { min-width: 100px; }
  .event-countdown { min-height: 106px; padding: 15px; }
  .event-countdown > strong { margin: 9px 0; }
  .join-prompt { padding: 18px; }
  .join-form { grid-template-columns: 1fr; }
  .join-form button { grid-column: auto; }
  .leaderboard-team-heading { grid-template-columns: 27px minmax(0, 1fr); }
  .leaderboard-team-heading > span:last-child { grid-column: 2; text-align: left; }
  .leaderboard-team-foot { flex-direction: column; gap: 3px; }
  .empty-event-card { padding: 30px 20px; }
}
