:root {
  color-scheme: light;
  --bg: #f2ecdd;
  --paper: #fffdf5;
  --ink: #14120f;
  --muted: #6d675c;
  --yellow: #ffd23f;
  --border: 3px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
body { min-width: 320px; max-width: 520px; margin: 0 auto; padding: 16px 14px 28px; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; border-radius: 0; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h1, h2 { font-weight: 800; overflow-wrap: anywhere; }
p { line-height: 1.5; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.wordmark { text-decoration: none; font-size: 1.6rem; font-weight: 900; }
.connection, .fine, .progress, .status, .player-status { color: var(--muted); font-size: .8rem; }
.connection { white-space: nowrap; }
.error { border: var(--border); background: var(--yellow); padding: 10px 12px; margin-bottom: 14px; overflow-wrap: anywhere; }
.notice { margin-bottom: 14px; font-size: .85rem; }
.panel { background: var(--paper); border: var(--border); padding: 18px 16px; }
.panel > * + * { margin-top: 14px; }
form { display: grid; gap: 8px; }
label { font-size: .85rem; font-weight: 700; }
input:not([type="file"]), select { width: 100%; min-height: 48px; background: var(--paper); border: var(--border); padding: 10px 12px; font-size: 1rem; }
input::placeholder { color: var(--muted); opacity: 1; }
select { text-overflow: ellipsis; }
.create-row { display: flex; align-items: center; gap: 10px; }
.create-row input { width: 76px; flex-shrink: 0; }
#join-form { border-top: var(--border); padding-top: 18px; margin-top: 18px; }
.code-input { text-align: center; text-transform: uppercase; letter-spacing: .2em; }
.button { display: block; width: 100%; min-height: 48px; background: var(--paper); border: var(--border); padding: 10px 12px; font-size: .95rem; font-weight: 800; text-align: center; text-decoration: none; }
.button.primary, .guess-option.selected { background: var(--yellow); }
.button:disabled, .guess-option:disabled { opacity: .45; cursor: default; }
.photo-field { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 0; }
.photo-field > div { min-width: 0; flex: 1; }
input[type="file"] { display: block; width: 100%; margin: 6px 0; font-size: .75rem; }
input[type="file"]::file-selector-button { background: var(--paper); border: 1px solid var(--ink); padding: 6px 8px; margin-right: 6px; cursor: pointer; }
.text-button { background: none; border: 0; padding: 6px 0; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.roster, .reveal-list { list-style: none; padding: 0; }
.roster { display: grid; gap: 10px; }
.roster li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.identity { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; font-weight: 600; text-align: left; }
.player-name { min-width: 0; overflow-wrap: anywhere; }
.avatar { width: 36px; height: 36px; flex-shrink: 0; object-fit: cover; border: 1px solid var(--ink); }
.avatar.large { width: 56px; height: 56px; }
.player-status { flex-shrink: 0; }
.player-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.player-heading > .fine { flex-shrink: 0; }
.text-link { display: inline-block; font-size: .85rem; }
.guess-list { display: grid; gap: 10px; }
.guess-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 48px; background: var(--paper); border: var(--border); padding: 10px 12px; text-align: left; }
.vote-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .85rem; }
.vote-table th, .vote-table td { padding: 8px 0; text-align: right; }
.vote-table th:first-child, .vote-table td:first-child { width: 60%; text-align: left; padding-right: 8px; }
.vote-table thead { border-bottom: 1px solid var(--ink); }
.vote-table tbody tr + tr { border-top: 1px solid var(--ink); }
.reveal-list { display: grid; gap: 12px; }
.reveal-list li + li { border-top: 1px solid var(--ink); padding-top: 12px; }
.reveal-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.reveal-list .fine { margin-top: 6px; }

@media (max-width: 380px) {
  .wordmark { font-size: 1.35rem; }
  .connection { font-size: .7rem; }
  .create-row input { width: 68px; }
  .button { font-size: .85rem; }
  .vote-table { font-size: .8rem; }
  .vote-table .avatar { width: 28px; height: 28px; }
}
