:root {
  color-scheme: light;
  --green: #0a5d2b;
  --dark-green: #10422b;
  --gold: #bb9959;
  --text: #172821;
  --muted: #53635b;
  --surface: #fff;
  --background: #f5f5ef;
  --border: #dde4d9;
  --tint: #edf5ef;
  --error: #9b3027;
  --panel-shadow: 0 20px 48px -33px #153c2a5c, 0 2px 6px #223c2110;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 100% 0, #e7eee3 0, transparent 44rem), var(--background);
  color: var(--text);
}
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3 { letter-spacing: -.035em; }
h1 { font-size: clamp(2.25rem, 5vw, 3.8rem); line-height: 1.07; }
h2 { font-size: 1.45rem; line-height: 1.2; }
h3 { font-size: 1.05rem; }
p { line-height: 1.5; }
button, input, select { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.site-header { background: #fffffff0; border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1248px;
  min-height: 74px;
  margin: auto;
  padding: 0 32px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--dark-green); font-size: 1.125rem; font-weight: 760; text-decoration: none; }
.brand::before {
  content: "";
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 33% 33%, #f4dfaf 2.3px, transparent 2.8px),
    radial-gradient(circle at 67% 33%, #fff 2.3px, transparent 2.8px),
    radial-gradient(circle at 33% 67%, #fff 2.3px, transparent 2.8px),
    radial-gradient(circle at 67% 67%, #fff 2.3px, transparent 2.8px),
    var(--dark-green);
}
.page-role { font-size: .875rem; color: var(--muted); }
.container { flex: 1; width: 100%; max-width: 1248px; margin-inline: auto; padding: clamp(28px, 5.5vw, 76px) 32px 0; }
.start-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.credit { width: 100%; max-width: 1248px; margin-inline: auto; padding: 20px 32px 24px; text-align: end; color: var(--muted); font-size: 1rem; }
.intro, .panel { border-radius: 26px; box-shadow: var(--panel-shadow); }
.intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  min-height: 500px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(26px, 4.7vw, 60px);
  border: 1px solid #326b46;
  background:
    radial-gradient(ellipse at 100% 100%, #326648 0, transparent 65%),
    linear-gradient(145deg, #164931, #09291f 70%);
  color: white;
}
.eyebrow { margin-bottom: 12px; color: var(--dark-green); font-size: .78rem; font-weight: 750; letter-spacing: .095em; text-transform: uppercase; }
.intro .eyebrow { display: flex; align-items: center; gap: 10px; color: #ebcf97; }
.intro .eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--gold); }
.intro h1 { font-size: clamp(1.85rem, 4.3vw, 4rem); }
.intro h1 em {
  display: block;
  margin-top: .05em;
  color: #efdaad;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.12em;
  font-weight: 400;
  letter-spacing: -.05em;
}
.intro-copy { max-width: 330px; margin-top: 23px; color: #e0ebe1; }
.intro-art {
  position: absolute;
  z-index: -1;
  right: -22px;
  bottom: -18px;
  width: 232px;
  height: 182px;
  pointer-events: none;
}
.intro-art span {
  position: absolute;
  width: 111px;
  height: 111px;
  border: 1px solid #f6ebcc5c;
  border-radius: 25px;
  background: radial-gradient(circle, #f6ebcc8a 3px, transparent 4px) center / 21px 21px, linear-gradient(145deg, #3e7356, #214b38);
  box-shadow: 0 16px 28px #051d1670, inset 0 1px 0 #ffffff35;
}
.intro-art span:nth-child(1) { top: 43px; left: 4px; transform: rotate(-21deg); }
.intro-art span:nth-child(2) { top: 8px; left: 72px; transform: rotate(13deg); }
.intro-art span:nth-child(3) {
  top: 62px;
  left: 108px;
  transform: rotate(26deg);
  background: radial-gradient(circle, #52432376 3px, transparent 4px) center / 21px 21px, linear-gradient(145deg, #e9cf90, #a67f48);
}
.panel { min-width: 0; padding: clamp(22px, 3.2vw, 40px); background: var(--surface); border: 1px solid var(--border); }
.start-panel { display: flex; flex-direction: column; justify-content: center; }
.start-panel h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); }
.start-panel h2::before, .member-panel > .eyebrow::before {
  content: "";
  display: block;
  width: 35px;
  height: 3px;
  margin-bottom: 17px;
  border-radius: 3px;
  background: var(--gold);
}
.logout-form { display: grid; gap: 8px; justify-items: start; margin-top: 18px; }
.stack { display: grid; gap: 18px; margin-top: 25px; }
label { display: grid; gap: 8px; font-size: .92rem; font-weight: 650; }
input, select { min-width: 0; border: 1px solid #bccbc0; border-radius: 12px; background: #fafbf8; color: var(--text); }
input { width: 100%; min-height: 51px; padding: 11px 14px; }
#login-form input { font-variant-numeric: tabular-nums; }
input::placeholder { color: #69736d; }
.button { display: inline-flex; min-height: 48px; padding: 11px 17px; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 700; text-align: center; }
.button:disabled { opacity: .52; cursor: default; }
.primary { background: linear-gradient(145deg, #14653a, #10452c); color: white; box-shadow: 0 4px 10px #10452c27, inset 0 1px 0 #ffffff20; }
.primary:hover:not(:disabled) { background: var(--dark-green); }
.secondary { background: var(--surface); border-color: #bccbc0; color: var(--dark-green); }
.secondary:hover:not(:disabled) { background: var(--tint); }
.stack .primary { justify-content: space-between; }
.text-link { align-self: flex-start; margin-top: 22px; color: var(--dark-green); font-size: .9rem; font-weight: 700; }
.error { color: var(--error); font-size: .92rem; }
.message { max-width: 580px; margin: auto; }
.message p { margin-top: 12px; }

.session-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding: 0 0 22px; border-bottom: 1px solid #cbd7cd; }
.session-heading h1 { font-size: clamp(2rem, 4.3vw, 3.5rem); }
.live-label { display: inline-flex; flex: none; width: max-content; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 12px; background: var(--tint); color: var(--dark-green); font-size: .875rem; font-weight: 700; }
.live-label > span:first-child { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.dashboard { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.7fr); align-items: start; gap: 24px; }
.invite > p { margin-top: 10px; color: var(--muted); }
.qr-frame { display: grid; place-items: center; margin: 20px 0; padding: 10px; border: 1px solid var(--border); border-radius: 18px; background: radial-gradient(circle at 15% 0, #e0eddf, #f5f7f2 68%); }
.qr { display: block; width: min(100%, 256px); height: auto; aspect-ratio: 1; margin: 12px auto; }
.qr-frame .qr { margin: 0; border-radius: 12px; background: white; }
.invite-actions { display: grid; gap: 9px; }
.share-link { min-height: 36px; font-size: .82rem; color: var(--muted); }
.inline-status { font-size: .85rem; color: var(--dark-green); }
.roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.count { padding: 3px 9px; border-radius: 20px; background: var(--tint); color: var(--dark-green); font-weight: 750; }
.settings { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.settings input { width: 110px; }
.draw-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; margin-top: 18px; border-radius: 13px; background: var(--tint); }
.draw-bar p, .empty { color: var(--muted); font-size: .9rem; }
.roster .error { margin: 12px 0; }
.roster-content, #roster-content { margin-top: 18px; }
.person-list { margin: 0; padding: 0; list-style: none; }
.person-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 9px 0; }
.person-list li + li { border-top: 1px solid var(--border); }
.person-list li span { overflow-wrap: anywhere; }
.person-list select { flex: none; max-width: 113px; min-height: 36px; padding: 3px; font-size: .8rem; }
.team-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.team { min-width: 0; border: 1px solid var(--border); border-radius: 15px; padding: 15px; background: linear-gradient(#eef5eb, white 82px); }
.team header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--dark-green); }
.team header span { color: var(--muted); font-size: .8rem; }

.member-panel { max-width: 520px; margin: 0 auto; }
.member-panel h1 { font-size: clamp(2rem, 7vw, 3rem); }
.member-panel .error, .member-copy { margin-top: 12px; }
.member-copy { color: var(--muted); }
.member-panel:has(.team-number) { text-align: center; }
.member-panel:has(.team-number) > .eyebrow::before { margin-inline: auto; }
.team-number {
  display: grid;
  place-items: center;
  min-height: 148px;
  margin-top: 20px;
  padding: 12px 20px;
  border: 1px solid #4e7858;
  border-radius: 18px;
  background: radial-gradient(ellipse at 100% 100%, #356e4b, transparent 70%), #143f2b;
  color: #fae3ad;
  font-size: clamp(3.5rem, 14vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
}
dialog { width: min(calc(100% - 24px), 720px); max-height: calc(100% - 24px); border: 0; border-radius: 24px; padding: 20px; color: var(--text); }
dialog::backdrop { background: #072c19d9; }
.close-projector { display: flex; margin-left: auto; }
.projector-content { text-align: center; padding: 0 10px 18px; }
.projector-content h2 { margin-bottom: 7px; font-size: clamp(1.65rem, 4vw, 2.65rem); }
.projector-qr { width: min(100%, 360px, 55dvh); }
.projector-content .live-label { margin: auto; }

@media (max-width: 760px) {
  .header-inner { min-height: 64px; padding-inline: 20px; }
  .container, .credit { padding-inline: 16px; }
  .start-grid, .dashboard { grid-template-columns: 1fr; gap: 14px; }
  .intro { min-height: 315px; }
  .intro-art { transform: scale(.78); transform-origin: bottom right; }
  .session-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 430px) {
  .page-role { display: none; }
  .intro-art { opacity: .52; }
  .intro-copy { max-width: 240px; }
  .draw-bar { align-items: stretch; flex-direction: column; }
}
