:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  --bg: #0c1b17;
  --panel: #132820;
  --lines: #345146;
  --ink: #f3f4e9;
  --muted: #b4c5b6;
  --lime: #d4ed92;
  --dark-green: #17281b;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(ellipse at 8% 9%, #254434 0, transparent 49%), var(--bg);
  font-size: 1rem;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.site-header { border-bottom: 1px solid var(--lines); }
.header-inner, .shell { width: min(1120px, 100% - 48px); margin: 0 auto; }
.header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 750;
  letter-spacing: -.045em;
}
.brand > span:last-child { color: var(--lime); }
.brand-mark {
  width: 16px;
  height: 16px;
  margin-right: 13px;
  border: 2px solid var(--lime);
  border-radius: 2px 7px 2px 7px;
  transform: rotate(45deg);
  box-shadow: 4px 4px 0 #60795a;
}
.shell { padding: 56px 0 100px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1.03; letter-spacing: -.065em; }
h2 { font-size: 1.42rem; line-height: 1.2; letter-spacing: -.03em; }
h3 { font-size: 1.15rem; line-height: 1.25; }
p { overflow-wrap: anywhere; }
.card {
  background: var(--panel);
  border: 1px solid var(--lines);
  border-radius: 16px;
  padding: 24px;
}
.welcome { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(34px, 7vw, 110px); align-items: center; padding-top: clamp(12px, 9vh, 88px); }
.intro h1 { font-size: clamp(3.5rem, 9vw, 7rem); max-width: 7.6ch; }
.eyebrow { color: var(--lime); font-size: .875rem; font-weight: 650; letter-spacing: .06em; margin-bottom: .65rem; }
.lede { max-width: 38ch; margin-top: 1.42rem; color: var(--muted); font-size: 1.12rem; }
.login { padding: clamp(22px, 4vw, 37px); }
.login p { margin: .65rem 0 1.5rem; color: var(--muted); }
.login button { margin-top: 1.25rem; width: 100%; }
label { display: block; font-size: .94rem; font-weight: 620; }
label input, label textarea, label select { margin-top: 6px; }
input, textarea, select {
  width: 100%; min-width: 0; border: 1px solid #537365; border-radius: 8px;
  background: #0b1c16; color: var(--ink); padding: 10px 12px;
}
input::placeholder { color: #9aae9f; }
input[type=file] { padding: 7px; }
input::file-selector-button {
  border: 1px solid var(--lines); border-radius: 6px; background: #294439;
  color: var(--ink); padding: 8px 12px; font: inherit; margin-right: 10px; cursor: pointer;
}
textarea { display: block; resize: vertical; }
select {
  appearance: none; padding-right: 2.5rem;
  background: linear-gradient(45deg, transparent 49%, var(--lime) 51%) calc(100% - 19px) 50% / 6px 6px no-repeat,
              linear-gradient(135deg, var(--lime) 49%, transparent 51%) calc(100% - 13px) 50% / 6px 6px no-repeat,
              #0b1c16;
}
button {
  min-height: 43px; padding: 9px 15px; border: 1px solid #537365;
  border-radius: 8px; background: #223d32; color: var(--ink); font-weight: 650;
  cursor: pointer;
}
button:hover { background: #315246; }
button.primary { background: var(--lime); color: var(--dark-green); border-color: var(--lime); }
button.primary:hover { background: #e4f5b5; }
button.quiet { background: transparent; }
button.quiet:hover { background: #21382e; }
button:disabled { opacity: .55; cursor: wait; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.game-select { width: 230px; flex-shrink: 0; }
.row-form, .game-banner { margin-bottom: 20px; }
.input-row { display: flex; gap: 8px; margin-top: 7px; }
.input-row button { flex-shrink: 0; }
.game-banner { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.game-banner h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: .45rem; }
.game-banner p:last-child, .card > p, .subtle { color: var(--muted); }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.player-columns { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
aside { display: grid; gap: 20px; }
#new-invite, #new-link { margin-top: 16px; }
#new-link p, .work p { color: var(--muted); margin-top: 9px; }
.roster { padding: 0; margin: 12px 0 0; list-style: none; }
.roster li {
  border-top: 1px solid var(--lines); min-height: 43px; padding: 8px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  overflow-wrap: anywhere;
}
.roster small { color: var(--muted); display: block; }
.roster button { min-height: 35px; padding: 4px 10px; font-size: .9rem; }
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 15px 0; }
.counts strong { display: block; font-size: 2rem; line-height: 1.15; letter-spacing: -.05em; }
.counts span { font-size: .93rem; color: var(--muted); }
progress { width: 100%; height: .55rem; accent-color: var(--lime); vertical-align: middle; }
.status {
  color: var(--lime); background: #253d2b; border-radius: 100px; padding: 4px 12px;
  font-size: .9rem; flex-shrink: 0; margin: 0 0 4px;
}
.work { min-height: 187px; }
.work .actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.upload { display: grid; gap: 14px; margin-top: 20px; }
.upload button { justify-self: start; }
.work details { margin-top: 16px; }
.work summary { cursor: pointer; font-weight: 650; }
.art { margin: 14px 0 18px; }
.art img {
  width: 100%; height: auto; max-height: 430px; display: block;
  object-fit: contain; background: #091712; border-radius: 9px;
}
.art figcaption { color: var(--muted); font-size: .95rem; margin-top: 6px; }
.feedback {
  position: fixed; z-index: 2; right: 24px; bottom: 20px;
  max-width: min(540px, calc(100% - 48px)); padding: 12px 15px;
  border: 1px solid #789269; border-radius: 9px; color: var(--ink);
  background: #233d2e; box-shadow: 0 8px 26px #0005;
}
.feedback.error { background: #482b26; border-color: #bc8875; }
@media (max-width: 710px) {
  .header-inner, .shell { width: min(100% - 32px, 520px); }
  .shell { padding-top: 34px; }
  .welcome, .columns { grid-template-columns: 1fr; }
  .welcome { padding-top: 2px; }
  .page-heading { align-items: start; flex-direction: column; }
  .card { padding: 19px; }
  .game-select { width: 100%; }
  .input-row { flex-wrap: wrap; }
  .input-row button { flex-grow: 1; }
  .game-banner { align-items: start; flex-direction: column; }
}

.host-reveal { margin-bottom: 20px; }
.reveal h2, .watching-reveal h2 { font-size: clamp(1.55rem, 4vw, 2.35rem); }
.host-reveal .art img, .watching-reveal .art img { max-height: min(59vh, 650px); }
.host-reveal .art figcaption, .watching-reveal .art figcaption {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 650;
  margin-top: 10px;
}
.reveal-notes { border-top: 1px solid var(--lines); padding-top: 14px; }
.reveal-notes p { color: var(--muted); margin-top: 6px; white-space: pre-wrap; }
.reveal-controls { border-top: 1px solid var(--lines); margin-top: 20px; padding-top: 15px; }
.reveal-controls .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.reveal-controls > p { color: var(--muted); margin-top: 9px; }
.reveal-controls label { max-width: 250px; margin-top: 15px; }
.watching-reveal { grid-template-columns: minmax(0, 1fr); }
.watching-reveal aside { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.watching-reveal .work .eyebrow { color: var(--lime); margin-top: 0; }

.reveal-heading, .gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.gallery { margin-bottom: 20px; }
.watching-reveal .gallery { margin-bottom: 0; }
.gallery-chain-picker { margin-top: 18px; max-width: 27rem; }
.gallery-chain-title { margin: 18px 0 12px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 13px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gallery-image {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--lines);
  border-radius: 10px;
  background: #0f211b;
  padding: 12px;
}
.gallery-image h4 { margin: 3px 0 0; font-size: 1rem; }
.gallery-image p { color: var(--muted); }
.gallery-image img {
  width: 100%;
  height: 164px;
  object-fit: contain;
  background: #091712;
  border-radius: 6px;
}
.download-link {
  justify-self: start;
  border: 1px solid #537365;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: #223d32;
  font-weight: 650;
  text-decoration: none;
}
.download-link:hover { background: #315246; }
.gallery-chain-title .download-link { color: var(--dark-green); background: var(--lime); }
.gallery-image .download-link { margin-top: 7px; }

.join-form h2 { margin-bottom: 15px; }
.join-form label:not(:first-child), #join-code-details label { margin-top: 10px; }
.private-sign-in { border-top: 1px solid var(--lines); margin-top: 20px; padding-top: 15px; }
.private-sign-in summary { cursor: pointer; font-weight: 650; }
.private-sign-in form { margin-top: 12px; }
.join-code-card { margin-bottom: 20px; }
#join-code-details { margin-top: 12px; max-width: 34rem; }
#join-value { font-family: ui-monospace, Consolas, monospace; font-weight: 650; letter-spacing: .08em; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 480px) {
  .header-inner { gap: 12px; }
  .header-actions button { min-height: 38px; padding: 6px 9px; font-size: .9rem; }
}
