:root {
  color-scheme: dark;
  --ground: #101f19;
  --panel: #1a3026;
  --edge: #3a5143;
  --paper: #f5eedc;
  --muted: #b4c2b2;
  --accent: #f4bd67;
  --serif: "DM Serif Text", Georgia, serif;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--paper);
  background: var(--ground);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
h1, h2, p { margin: 0; }
img { display: block; width: 100%; }
[hidden] { display: none !important; }
.shell { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.topbar { background: #11231b; border-bottom: 1px solid #52605255; }
.nav, nav { display: flex; align-items: center; }
.nav { min-height: 66px; justify-content: space-between; }
nav { gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; font: 26px var(--serif); }
.camp-mark {
  color: var(--accent);
  font: 21px/31px system-ui, sans-serif;
  border: 1px solid #a28a58;
  border-radius: 9px;
  text-align: center;
  width: 32px;
  height: 32px;
}
.quiet, .outline, .primary, .text-button, .close { font-weight: 700; }
.quiet, .outline {
  background: transparent;
  color: var(--paper);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 13px;
}
.outline { border-color: #53675a; }
.outline span { margin-left: 4px; color: var(--accent); }
.outline:disabled { opacity: .65; }
.online-button { border-color: #b79253; color: var(--accent); }
.quiet:hover, .outline:hover { background: #ffffff12; }
.hero {
  min-height: 175px;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, #172d24 3%, #1d3929eb 29%, #20392aa0 57%, #16291e28 100%),
    linear-gradient(0deg, #13261c66, #162b2322),
    url("campsite.webp") center 22% / cover;
  border-bottom: 1px solid #50604c;
}
.hero-content { padding-block: 18px 21px; }
.eyebrow, .target, .round {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}
.eyebrow { color: var(--accent); }
.hero h1 {
  font: clamp(61px, 7vw, 81px)/.98 var(--serif);
  letter-spacing: -.045em;
  margin: 3px 0 11px;
}
.hero p:last-child { color: #ecebda; font-size: 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 20px; margin-top: 19px; }
.room-strip, .lobby {
  margin-top: 19px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 14px 18px;
}
.room-strip { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.room-strip strong { font-size: 16px; letter-spacing: .1em; margin-left: 6px; }
.room-strip p, .lobby p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.room-strip input { width: 100%; }
.lobby { padding: 22px; }
#lobby-options { margin-bottom: 14px; }
#lobby-options label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.lobby ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
  padding: 0;
  margin: 17px 0;
  list-style: none;
}
.lobby li {
  border: 1px solid var(--edge);
  border-radius: 7px;
  padding: 9px 12px;
  background: #14291f;
  overflow-wrap: anywhere;
}
.table, .sidebar, .tip {
  border: 1px solid var(--edge);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px #07130e35;
}
.table {
  background: radial-gradient(ellipse at 44% 20%, #284835 0%, #1f3c2e 46%, #182f25 100%);
}
.table-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 23px;
  border-bottom: 1px solid #52705b65;
  background: #14291f6b;
}
.round { color: var(--accent); white-space: nowrap; }
.stages { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.stages li {
  padding: 4px 10px;
  border: 1px solid #71887740;
  border-radius: 20px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.stages .active { background: #f4bd671a; color: var(--accent); border-color: #f4bd6775; }
.stages .done { background: #9aa99322; }
.flop-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vw, 56px);
  min-height: 156px;
  padding: 17px;
}
h2 { font: 25px/1.14 var(--serif); }
.flop-caption p, .hand-heading p { font-size: 13px; color: var(--muted); margin-top: 5px; }
.flop { display: flex; align-items: center; gap: clamp(6px, 1.45vw, 15px); }
.deck, .flop-card, .card-slot {
  width: clamp(50px, 6.7vw, 84px);
  aspect-ratio: 321 / 449;
  border-radius: 7px;
}
.deck, .flop-card { position: relative; box-shadow: 0 4px 12px #060e0b90; }
.deck { margin-right: 7px; box-shadow: 3px 3px #c9c1a2, 6px 6px #8f8b72, 0 6px 13px #060e0b90; }
.deck img, .flop-card img, .hand-card img, .mini-hand img { border-radius: inherit; height: 100%; object-fit: cover; }
.deck span {
  position: absolute;
  right: -5px;
  bottom: -5px;
  background: #152b20;
  border: 1px solid #879682;
  border-radius: 12px;
  padding: 1px 6px;
  font-size: 10px;
}
.card-slot {
  display: grid;
  place-items: center;
  color: #98b09b8f;
  background: #142a2045;
  border: 1px dashed #78917a83;
  font-size: 25px;
}
.hand-area { border-top: 1px solid #52705b65; padding: 17px 24px 16px; background: #0a1c164d; }
.hand-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.direction {
  border-radius: 6px;
  background: #ffffff0a;
  border: 1px solid #829d824d;
  color: #cdd8c7;
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.hand {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 102px));
  justify-content: center;
  gap: clamp(6px, 1.5vw, 17px);
  margin-top: 17px;
}
.hand:empty { display: none; }
.hand-card {
  position: relative;
  display: block;
  aspect-ratio: 321 / 449;
  border-radius: 8px;
  border: 2px solid #ece1c6;
  background: #e9e1cb;
  padding: 0;
  box-shadow: 0 6px 12px #060e0b70;
  transition: transform 150ms, border-color 150ms, box-shadow 150ms;
}
button.hand-card:hover { transform: translateY(-4px); }
button.hand-card[aria-pressed="true"], .hand-card.matched {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 7px 12px #070e0baa;
}
button.hand-card[aria-pressed="true"] { transform: translateY(-6px); }
.check {
  display: none;
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--accent);
  color: #18291f;
  font-weight: 700;
  font-size: 13px;
  place-items: center;
}
[aria-pressed="true"] .check { display: grid; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 13px; margin-top: 15px; }
.actions:empty { display: none; }
.selection { font-size: 12px; color: var(--muted); }
.primary {
  padding: 10px 15px;
  min-height: 41px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #242b1f;
  font-size: 13px;
}
.primary span { margin-left: 6px; }
.primary:hover { background: #ffd18b; }
.primary:disabled { background: #405345; color: #d3dcca; border-color: #667869; }
.sidebar { padding: 17px; background: var(--panel); }
.side-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.side-heading h2 { font-size: 22px; }
.target { color: var(--accent); background: #f4bd6715; padding: 5px 8px; border-radius: 5px; white-space: nowrap; font-size: 9px; }
.score-row {
  display: grid;
  grid-template-columns: 32px 1fr auto 17px;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-bottom-color: #55715c50;
}
.score-row.current { background: #a8bca216; border: 1px solid #a8bca24d; border-radius: 7px; }
.score-row strong { font-size: 14px; text-align: right; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 700; color: #242e24; }
.tone-0 { background: #e8bd77; }
.tone-1 { background: #9fbda1; }
.tone-2 { background: #afbacb; }
.tone-3 { background: #dbab9b; }
.player-name { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.player-name small, .result-row small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.pips { display: flex; gap: 4px; }
.pips i { display: block; width: 7px; height: 7px; border: 1px solid #76917d; border-radius: 50%; }
.pips .filled { background: var(--accent); border-color: var(--accent); }
.mode { color: var(--muted); font-size: 12px; margin-top: 13px; }
.tip { background: #25372a; padding: 17px; margin-top: 14px; display: flex; gap: 11px; }
.tip-icon { color: var(--accent); background: #f4bd6718; flex: 0 0 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; }
.tip h2 { font-size: 19px; }
.tip p { color: #c7d0c0; font-size: 13px; line-height: 1.5; margin-top: 5px; }
.text-button { color: var(--accent); background: transparent; border: 0; padding: 8px 0 0; font-size: 12px; }
.text-button:hover { text-decoration: underline; }
.results { margin-top: 16px; }
.result-row { border-top: 1px solid #52705b65; font-size: 13px; }
.result-row summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 9px 0; }
.result-row summary strong::before { content: "+ "; color: var(--muted); }
.result-row[open] summary strong::before { content: "− "; }
.result-row .earned { color: var(--accent); font-weight: 700; }
.result-row p { color: var(--muted); }
.mini-hand { display: flex; gap: 6px; margin: 8px 0 12px; }
.mini-hand img { width: min(13%, 55px); border-radius: 4px; height: auto; }
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 18px 0 22px;
  color: #a5b7a7;
  font-size: 11px;
}
dialog {
  width: min(500px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #5e7563;
  border-radius: 14px;
  color: var(--paper);
  background: #1b3127;
  box-shadow: 0 18px 65px #040a07bb;
}
dialog::backdrop { background: #080f0bc9; backdrop-filter: blur(6px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.close { font-size: 22px; background: #ffffff10; border: 0; color: var(--paper); border-radius: 6px; width: 32px; height: 32px; }
dialog p, .rule-list { font-size: 14px; line-height: 1.5; color: #c6d3c5; }
.rule-list { padding-left: 22px; }
.rule-list li + li { margin-top: 7px; }
.handoff { text-align: center; }
.handoff h2 { margin: 5px 0 8px; }
.handoff button, form button { margin-top: 15px; }
form { display: grid; gap: 6px; }
form label { margin-top: 7px; font-size: 13px; font-weight: 700; }
select, input { background: #13271e; color: var(--paper); padding: 9px; border: 1px solid #62816b; border-radius: 7px; }
input { font: inherit; min-width: 0; }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
form p { margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 850px) {
  .shell { width: min(100% - 34px, 680px); }
  .layout { grid-template-columns: 1fr; }
  aside { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 12px; }
  .tip { margin-top: 0; }
  .deck, .flop-card, .card-slot { width: clamp(52px, 11vw, 92px); }
}
@media (max-width: 490px) {
  .shell { width: calc(100% - 24px); }
  .nav { min-height: 56px; }
  .brand { font-size: 22px; }
  .camp-mark { width: 25px; height: 25px; line-height: 24px; }
  nav { gap: 3px; }
  .quiet, .outline { padding: 7px 7px; font-size: 12px; }
  .hero { min-height: 188px; background-position: 61% center; }
  .hero p:last-child { font-size: 14px; }
  .layout { margin-top: 13px; gap: 12px; }
  .table-top, .hand-area { padding-inline: 12px; }
  .stages li { padding-inline: 6px; }
  .flop-area { flex-direction: column; gap: 11px; padding: 13px 9px 16px; min-height: auto; }
  .flop-caption { display: flex; align-items: baseline; gap: 8px; }
  .flop-caption h2, .hand-heading h2 { font-size: 22px; }
  .deck, .flop-card, .card-slot { width: clamp(50px, 15vw, 75px); }
  .hand-card { border-radius: 5px; border-width: 1px; }
  .actions { margin-top: 15px; }
  aside { grid-template-columns: 1fr; }
}
@media (max-width: 370px) {
  .camp-mark { display: none; }
  .brand { font-size: 19px; }
  .quiet, .outline { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

body:has(.opening:not([hidden])) {
  color-scheme: light;
  background: #f5eedc;
  color: #223a2c;
  min-height: 100vh;
}
.opening {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(30px, 6vw, 84px);
  padding-block: clamp(28px, 6vw, 76px);
}
.opening-intro { padding-top: 12px; }
.opening-intro .eyebrow { color: #48614b; }
.opening-intro h1 {
  margin-block: 14px;
  font: clamp(64px, 9vw, 116px)/.95 var(--serif);
  letter-spacing: -.05em;
}
.opening-intro img {
  margin-top: 24px;
  height: clamp(175px, 26vw, 325px);
  object-fit: cover;
  object-position: center 55%;
  border-radius: 12px;
}
.opening-panel {
  padding: clamp(20px, 3vw, 38px);
  background: #e4e9d8;
  border: 1px solid #bfc9ae;
  border-radius: 12px;
}
.opening-panel h2 { font: clamp(32px, 4vw, 47px)/1.05 var(--serif); }
.opening-modes { display: grid; grid-template-columns: 1fr 1fr; margin-block: 18px 12px; }
.opening-modes button {
  color: #2b4331;
  background: transparent;
  border: 0;
  border-bottom: 2px solid #bcc8b1;
  padding: 10px 4px;
  font-weight: 700;
}
.opening-modes button[aria-pressed="true"] { border-color: #375b40; background: #d6e0c8; }
.opening-panel :focus-visible { outline-color: #375b40; }
.opening-field { display: grid; gap: 6px; }
.opening-panel input, .opening-panel select {
  width: 100%;
  color: #223a2c;
  background: #fffdf5;
  border-color: #87967e;
  min-height: 44px;
}
.opening-panel .primary:not(:disabled) { padding: 12px 16px; background: #31583d; color: #fffdf5; }
.opening-panel .primary:hover:not(:disabled) { background: #264830; }
.opening-panel .outline { color: #223a2c; }
.opening-help, #room-error { font-size: 13px; line-height: 1.5; }
#room-error { color: #922c19; }
body:has(.opening:not([hidden])) footer { color: #48614b; }
@media (max-width: 720px) {
  .opening { grid-template-columns: 1fr; gap: 24px; }
  .opening-intro { padding-top: 0; }
  .opening-intro img { height: 150px; margin-top: 16px; }
}
