:root {
  --brass: #b99059;
  --paper: #f1dfbc;
  --ink-on-paper: #32291e;
}

.topbar-controls { display: flex; flex: 0 0 auto; gap: 6px; }
.topbar-controls .button { min-width: 44px; padding-inline: 8px; white-space: nowrap; }

.pantry-seal {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 1px solid #ba965f;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 20%, #49503a, #192b23 75%);
  box-shadow: inset 0 0 0 2px #1b2519, 0 2px 4px #07140dc4;
}

.pantry-seal .cheese-mark { width: 21px; height: 17px; }
.title-heading { text-shadow: 0 2px 0 #20150e, 0 5px 23px #110d07b8; }
.title-tagline { font-weight: 630; }

.scene-title .button.primary,
.scene-lobby .lobby-start {
  border-color: #ffe4a2;
  border-radius: 5px;
  background: linear-gradient(170deg, #ffdf88, #edb95d);
  box-shadow: inset 0 0 0 2px #bc813640, 0 3px 0 #885025;
}
.scene-lobby .lobby-start:disabled {
  border-color: #988457;
  background: #424233;
  box-shadow: none;
}
.scene-title .button.secondary { border-color: #aa9670; border-radius: 5px; }
.button[aria-disabled='true'] {
  border-color: #66746a;
  color: #c3c8bc;
  background: #35463d;
  box-shadow: none;
  cursor: default;
}
.button[aria-disabled='true']:active { transform: none; }

.scene-entry .avatar-trigger { border-color: var(--brass); border-radius: 7px; }
.avatar-dialog .avatar-option { min-height: 48px; border-radius: 5px; }
.avatar-dialog .avatar-option span { font-size: .83rem; }
.avatar-dialog .avatar-thumb { object-position: center; }

.scene-lobby > .scene-header { padding-block-end: 2px; }
.scene-lobby .room-strip {
  position: relative;
  border-color: #b28a52;
  border-radius: 6px 12px 12px 6px;
  background:
    linear-gradient(90deg, #ffc56c20, transparent 30%),
    linear-gradient(155deg, #4d3926, #302a21);
}
.scene-lobby .room-strip::before {
  position: absolute;
  inset: 8px auto 8px 4px;
  border-inline-start: 1px dashed #bf9e69a6;
  content: '';
}
.scene-lobby .room-code { color: #ffe4a8; }
.scene-lobby .room-strip .mode-tag { border: 0; padding-inline-end: 0; background: none; }
.lobby-table .roster-header .stage-title { font-size: clamp(1.2rem, 5vw, 1.5rem); }
.lobby-table .lobby-seat { min-height: 71px; }
.lobby-table .player-name { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.lobby-table .player-avatar-image { object-position: center; }
.lobby-table .lobby-seat.is-you .player-name { color: #ffe4a3; }
.lobby-buttons > .button.host-options-toggle { border-color: #887659; border-radius: 5px; font-size: .86rem; }
.lobby-actions > .lobby-close { justify-self: start; margin-top: 3px; font-size: .91rem; }

.round-steps .round-step[data-state='done'] { border-color: #8a9877; }
.round-steps .round-step[data-state='current'] {
  border-color: #ebbb63;
  background: linear-gradient(#d59d4821, transparent);
  color: #ffe7a8;
}

.secret-card {
  grid-template-columns: minmax(93px, .7fr) minmax(0, 1.3fr);
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, #40271005 0 1px, transparent 1px 5px),
    linear-gradient(161deg, var(--role-fill), #fff1d7);
}
.role-copy .secret-role { font-size: clamp(1.52rem, 5.3vw, 2.55rem); }
.secret-card.is-concealed {
  border: 1px solid #a48353;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 14% 18%, #72523747, transparent 65%),
    repeating-linear-gradient(45deg, transparent 0 12px, #d8a95d17 12px 13px),
    repeating-linear-gradient(-45deg, transparent 0 12px, #d8a95d14 12px 13px),
    #20372c;
  box-shadow: inset 0 0 0 4px #1c2d24, inset 0 0 0 5px #a483535e, 0 4px 0 #10251b;
}
.secret-card.is-concealed .role-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: start;
  gap: 7px 9px;
  padding: 13px 16px;
}
.card-seal { width: 38px; }
.secret-card.is-concealed .private-toggle { grid-column: 3; grid-row: 1; }
.secret-card .private-toggle { min-height: 44px; }

body[data-scene='night'] {
  background: radial-gradient(ellipse at 50% 35%, #243527 0, #152620 50%, #101a17 86%);
}
body:has(.scene-night[data-night-stage='dawn']) {
  background: radial-gradient(ellipse at 70% 9%, #30433d, #1b2d2a 45%, #101e1c 85%);
}
.dawn-platter {
  display: block;
  width: 100%;
  height: auto;
  max-height: 310px;
  margin-block-start: 3px;
  border: 1px solid #b09366;
  border-radius: 6px;
  background: #373027;
  object-fit: cover;
  object-position: center 60%;
  box-shadow: 0 9px 22px #0a1412a3;
  animation: morning-light 680ms var(--ease-out) both;
}
@keyframes morning-light { from { filter: brightness(.65); } to { filter: brightness(1); } }
.scene-night[data-night-stage='dawn'] .scene-header p { max-width: 32rem; }
.scene-night[data-night-stage='dawn'] .host-advance-dock {
  position: static;
  padding: 4px 0 0;
  background: transparent;
}
body:has(.scene-night[data-night-stage='dawn']) .game-shell { padding-block-end: max(22px, calc(12px + var(--safe-bottom))); }

.clue-list {
  padding: 2px 13px;
  border: 1px solid #ad8758;
  border-radius: 5px;
  color: var(--ink-on-paper);
  background:
    repeating-linear-gradient(124deg, #59301309 0 1px, transparent 1px 5px),
    linear-gradient(138deg, #f4e3c5, #e7cea2);
  box-shadow: 0 3px 0 #221b1796;
}
.clue-item { border-color: #9b724e73; }
.clue-item:last-child { border: 0; }
.clue-item::before { background: #805231; }
.clue-item :is(.muted, .witness-list) { color: #4f3928; }
.chat-panel {
  padding: 0 11px 11px;
  border: 1px solid #62765f;
  border-radius: 6px;
  background: #132920b5;
}
.chat-panel .chat-line { border-radius: 6px 6px 6px 1px; }
.chat-panel .chat-line.is-you { border-radius: 6px 6px 1px 6px; }

.field-help { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.rules-example {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-block-start: 7px;
  padding: 6px 9px;
  border-inline-start: 2px solid var(--brass);
  color: #f5e4bf;
  background: #b9905918;
}
.rules-example-die {
  display: grid;
  flex: 0 0 29px;
  place-content: center;
  aspect-ratio: 1;
  border: 1px solid #bd965f;
  border-radius: 5px;
  color: #4a301d;
  background: #f0d6a1;
  font-weight: 800;
}

.conversation-note {
  border: 1px solid #ad8758;
  border-radius: 6px;
  color: var(--ink-on-paper);
  background:
    repeating-linear-gradient(124deg, #59301309 0 1px, transparent 1px 5px),
    linear-gradient(148deg, #f4e4c8, #e7ceb0);
  box-shadow: 0 3px 0 #221b1796;
}
.conversation-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px 16px;
  padding: 12px 14px;
}
.conversation-prompt { flex: 1 1 120px; font: 700 clamp(1.18rem, 4vw, 1.64rem)/1.15 var(--serif); }
.conversation-clues.button { min-height: 44px; padding-inline: 10px; color: #fff0cb; background: #31493d; font-size: .92rem; }
.conversation-starters { padding-inline: 14px; border-block-start: 1px solid #9b724e70; }
.conversation-starters summary { min-height: 44px; padding-block: 10px; color: #573821; font-size: .92rem; font-weight: 700; }
.conversation-starters summary:focus-visible { outline-color: #734a2c; }
.conversation-starters ul { display: grid; gap: 5px; margin: 0 0 13px; padding-inline-start: 20px; font-size: .93rem; }

.result-banner {
  --outcome: #355b48;
  --outcome-dark: #39634c;
  border-color: #b5a872;
  border-radius: 8px;
  background:
    repeating-linear-gradient(115deg, #65462909 0 1px, transparent 1px 6px),
    linear-gradient(140deg, #f4e5c6, #d1cc9e);
  color: #263729;
}
.result-banner .muted { color: #263729; }
.result-banner[data-winner='thief'] {
  --outcome: #ffca86;
  --outcome-dark: #704737;
  color: #fff0d3;
  background: radial-gradient(ellipse at 93% 12%, #734628, #372924 77%);
}
.result-banner[data-winner='thief'] .muted { color: #faebce; }
.verdict-reason { padding-block-start: 7px; border-block-start: 1px solid currentColor; font-size: .88rem; line-height: 1.35; }
.personal-outcome {
  width: fit-content;
  margin-top: 4px;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--outcome);
  font-size: .8rem;
  font-weight: 760;
}

.connection-band:not(.host-recovery) {
  position: sticky;
  z-index: 6;
  inset-block-start: var(--safe-top);
  border-radius: 4px;
}
.connection-band[data-status='connected'] { border-color: #9cb78d; color: #f1f5e7; background: #2f4b3e; }

.scene-seat-ended {
  padding: clamp(21px, 6vw, 32px);
  margin-block-start: clamp(10px, 3vh, 30px);
  border: 1px solid #7b7353;
  border-block-start: 2px solid #bd9b57;
  border-radius: 6px;
  background: radial-gradient(ellipse at 10% 0%, #354538, #1c3128 76%);
  box-shadow: 0 4px 0 #0c1915;
}
.scene-seat-ended .stage-title { font-size: clamp(2rem, 6vw, 2.75rem); }
.scene-seat-ended .scene-header { gap: 9px; }

.trial-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
  width: min(100%, 680px);
  margin: 0 auto 10px;
  padding: 7px 10px;
  border-inline-start: 2px solid var(--brass);
  color: #f4e5c5;
  background: #403722;
  font-size: .86rem;
  line-height: 1.3;
}
.trial-notice strong { color: #ffdb89; }
.feedback-open.button { min-height: 44px; }
.feedback-dialog .private-dialog-top .button { flex: 0 0 auto; min-width: 58px; white-space: nowrap; }
.feedback-content, .feedback-notes { display: grid; gap: 12px; }
.feedback-content { padding: 14px 16px; }
.feedback-ratings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.feedback-field { display: grid; align-content: start; gap: 4px; }
.feedback-field .input { width: 100%; min-width: 0; min-height: 44px; }
.feedback-field textarea { resize: vertical; }
.feedback-consent { display: flex; min-height: 44px; align-items: center; gap: 8px; }
.feedback-consent input { width: 18px; height: 18px; accent-color: var(--gold); }
.feedback-status { color: #ffdb89; }
.feedback-actions {
  position: sticky;
  inset-block-end: 0;
  padding: 8px 16px 12px;
  border-block-start: 1px solid var(--frame);
  background: #203229;
}
.feedback-actions .button { width: 100%; }

@media (max-width: 430px) {
  .topbar { gap: 6px; }
  .wordmark { gap: 5px; font-size: 1.13rem; }
  .pantry-seal { width: 30px; }
  .secret-card { grid-template-columns: minmax(77px, 33%) minmax(0, 1fr); }
  .role-copy { padding: 9px 10px; }
  .role-copy .secret-role { letter-spacing: -.037em; }
  .secret-card .card-seal { width: 32px; }
  .lobby-table .player-name { font-size: .77rem; }
  .grouped-utility { display: grid; grid-template-columns: 1fr; gap: 5px; }
}

@media (max-width: 350px) {
  .topbar-controls { gap: 4px; }
  .topbar-controls .button { padding-inline: 6px; font-size: .79rem; }
}

@media (max-height: 465px) and (orientation: landscape) {
  .dawn-platter { max-height: 150px; }
}
