@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  color-scheme: dark;
  --base: #211724;
  --panel: #2c2131;
  --surface: #382940;
  --ink: #fff7e9;
  --muted: #d8c9dc;
  --line: #655068;
  --accent: #efc9ff;
  --yellow: #ffe04f;
  --shadow: #110814ad;
  --danger: #ffbbc7;
  font: 16px/1.5 Inter, system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --base: #f4ead4;
  --panel: #fff8e8;
  --surface: #efe1cf;
  --ink: #261c2c;
  --muted: #564759;
  --line: #ad98a3;
  --accent: #633d80;
  --shadow: #775c5b32;
  --danger: #8e1739;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--base);
}
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: url('/art/background.webp') center / cover no-repeat;
}
[data-theme="light"] body::before { filter: invert(1) grayscale(.75); opacity: .17; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
p { color: var(--muted); }
.frame { width: min(1070px, calc(100% - 66px)); margin-inline: auto; }
.top {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand { font-size: clamp(1.12rem, 2.6vw, 1.54rem); font-weight: 900; letter-spacing: -.05em; white-space: nowrap; }
.brand span { color: var(--accent); }
nav { display: flex; gap: clamp(12px, 3vw, 30px); align-items: center; font-size: .88rem; font-weight: 700; }
nav a { color: var(--accent); }
.plain { border: 0; background: transparent; color: inherit; padding: 0; text-align: left; }
.plain:hover, nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
main { padding-top: clamp(28px, 5vw, 68px); }

.catalog-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 25px; }
.catalog-head h1 {
  font-size: clamp(3.15rem, 10vw, 7.7rem);
  line-height: .86;
  letter-spacing: -.065em;
  font-weight: 900;
}
.catalog-head h1 span { color: var(--accent); }
.catalog-head p { margin-top: 13px; font-size: clamp(.94rem, 2vw, 1.14rem); font-weight: 600; }
.catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2.7vw, 29px); }
.catalog-ad { margin: 34px auto 0; max-width: 970px; padding-top: 12px; border-top: 1px solid var(--line); }
.catalog-ad > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .75rem; }
.catalog-ad [data-ad-content] { min-height: 90px; }
.game-tile {
  --tile: #ffde53;
  color: #26192d;
  background: #fdf0d8;
  border: 2px solid #26192d;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--shadow);
  transform-origin: center bottom;
  transition: transform .28s cubic-bezier(.18,.85,.26,1.35), box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.chain-tile { --tile: #c6b5ff; background: #e9e0fa; }
@media (hover: hover) {
  .game-tile:hover, .game-tile:focus-within { transform: translateY(-5px) rotate(-.35deg); box-shadow: 8px 11px 0 var(--shadow); }
  .chain-tile:hover, .chain-tile:focus-within { transform: translateY(-5px) rotate(.35deg); }
}
.cover { position: relative; overflow: hidden; border-bottom: 2px solid #26192d; background: var(--tile); }
.cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.08;
  object-fit: cover;
  object-position: center 41%;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.chain-tile .cover img { object-position: center 50%; }
.game-tile:hover .cover img { transform: scale(1.045); }
.cover span {
  position: absolute;
  left: 13px;
  top: 13px;
  color: #26192d;
  background: var(--tile);
  border: 1px solid #26192d;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: .73rem;
  font-weight: 800;
  text-transform: uppercase;
}
.game-copy { padding: clamp(17px, 3vw, 27px); display: grid; grid-template-rows: auto auto 1fr auto; flex: 1; gap: 9px; }
.game-copy h2 { font-size: clamp(1.65rem, 4vw, 3.05rem); font-weight: 900; line-height: .99; letter-spacing: -.052em; }
.game-copy p { color: #48364b; font-size: .94rem; max-width: 43ch; }
.game-copy .actions { margin-top: 5px; }
.game-meta { color: #4c3b50; font-size: .77rem; font-weight: 750; display: flex; gap: 12px; }
.game-meta span { border-left: 1px solid #a18b9b; padding-left: 12px; }
.game-tile .secondary { color: #26192d; background: transparent; border-color: #836d81; }
.game-tile .secondary:hover { background: #28173512; }
.chain-tile .primary { color: #23163d; background: var(--tile); border-color: #6b54ad; }
.chain-tile .primary:hover { background: #d2c5ff; }
.game-tile :focus-visible { outline-color: #5c2b7c; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.primary, .secondary, .number, .gear, .danger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .55em;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  padding: 7px 14px;
  transition: background .17s, transform .17s, box-shadow .17s;
}
.primary { background: var(--yellow); color: #29192d; border-color: #97803d; }
.secondary, .number, .gear { color: var(--ink); background: var(--surface); border-color: var(--line); }
.primary:hover { background: #fff195; }
.secondary:hover, .number:hover, .gear:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.primary:active, .secondary:active, .number:active, .danger:active { transform: translateY(2px); }
.primary:disabled, .secondary:disabled, .number:disabled, .danger:disabled { opacity: .65; }
.danger { background: #ffd1da; color: #690d29; border-color: #9e3354; }
.danger:hover { background: #ffb5c4; }
.footer { color: var(--muted); border-top: 1px solid var(--line); margin-top: 38px; padding: 19px 48px 28px 0; font-size: .81rem; font-weight: 850; }
.gear {
  position: fixed;
  bottom: max(13px, env(safe-area-inset-bottom));
  right: max(13px, env(safe-area-inset-right));
  z-index: 2;
  font-size: 1.5rem;
  width: 49px;
  height: 49px;
  padding: 0;
  box-shadow: 0 3px 0 var(--shadow);
}
.gear span { display: inline-block; transition: transform .28s; }
.gear:hover span { transform: rotate(31deg); }

dialog {
  color: var(--ink);
  background: var(--panel);
  width: min(520px, calc(100% - 28px));
  max-height: calc(100dvh - 34px);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: clamp(18px, 4vw, 28px);
  box-shadow: 7px 8px 0 var(--shadow);
}
dialog[open] { animation: opening .25s cubic-bezier(.19,.8,.27,1.12); }
dialog::backdrop { background: #130c1ab2; }
dialog h2 { margin-bottom: 14px; font-size: clamp(1.35rem, 3.5vw, 1.85rem); line-height: 1.1; overflow-wrap: anywhere; }
dialog .actions { margin-top: 16px; }
dialog li + li { margin-top: 8px; }
.sample { margin: 14px 0; }
.sample summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.sample-card { display: flex; gap: 11px; align-items: stretch; margin-top: 9px; background: #fff1d1; color: #281a2d; border-radius: 9px; overflow: hidden; }
.sample-card img { width: min(27%, 115px); height: auto; object-fit: cover; }
.sample-card ul { padding: 10px 9px 10px 17px; margin: 0; font-size: .81rem; }
dialog label:not(.avatar-choice) { display: grid; gap: 5px; margin: 10px 0; color: var(--muted); font-weight: 650; }
input:not([type=radio]), textarea, select {
  min-height: 44px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--base);
  color: var(--ink);
  padding: 8px 11px;
}
textarea { resize: vertical; }
#code { text-transform: uppercase; }
.form-error, #entry-error { color: var(--danger); }
.avatar-picker { border: 0; margin: 0; padding: 0; min-width: 0; }
.avatar-picker legend { margin-bottom: 7px; color: var(--muted); font-weight: 650; }
.avatar-options { display: flex; gap: 10px; }
.avatar-choice { position: relative; cursor: pointer; }
.avatar-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-choice img { display: block; width: 59px; height: 59px; border-radius: 9px; object-fit: cover; border: 2px solid var(--line); }
.avatar-choice input:checked + img { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar-choice input:focus-visible + img { outline: 3px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 5px var(--surface); }
.settings-list { display: grid; gap: 6px; }
#room-settings { display: grid; gap: 6px; }
.setting-row {
  width: 100%; min-height: 43px; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 5px 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
}
.setting-row:hover { border-color: var(--accent); }
.setting-row strong { margin-left: auto; color: var(--accent); font-size: .79rem; }
.tool-icon { width: 23px; flex: none; text-align: center; color: var(--accent); font-weight: 850; font-size: 1.22rem; }
#status:not(:empty) {
  position: fixed; z-index: 3; bottom: 16px; left: 16px; max-width: calc(100vw - 82px);
  background: var(--panel); color: var(--ink); padding: 10px 15px; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 3px 3px 0 var(--shadow); animation: opening .2s ease-out;
}

.eyebrow { color: var(--accent); font-weight: 800; font-size: .8rem; margin-bottom: 7px; }
.room-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 19px; flex-wrap: wrap; }
.room-head h1 { font-size: clamp(2.45rem, 7vw, 4.75rem); line-height: .98; letter-spacing: -.073em; }
.room-code { font: 800 1rem ui-monospace, monospace; color: var(--accent); letter-spacing: .04em; }
.rules-link { color: var(--muted); margin-right: 4px; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(263px, .46fr); align-items: start; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: clamp(16px, 2.7vw, 27px); }
.stage { min-height: 270px; display: grid; align-content: start; gap: 15px; justify-items: start; }
.stage h2 { font-size: clamp(1.45rem, 4vw, 2.55rem); line-height: 1.11; letter-spacing: -.055em; overflow-wrap: anywhere; }
.stage p { max-width: 62ch; }
.stage-enter { animation: stage-in .26s ease-out; }
.decks { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 2px; }
.deck {
  display: grid; text-align: left; align-content: start; gap: 2px; padding: 0 0 8px; min-height: 115px;
  border-radius: 9px; border: 2px solid transparent; overflow: hidden; overflow-wrap: anywhere;
  transition: transform .24s cubic-bezier(.19,.8,.27,1.3);
}
.deck[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 2px; }
.deck:not(:disabled):hover { transform: translateY(-4px) rotate(-1.5deg); }
.deck:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.deck img { width: 100%; height: auto; aspect-ratio: 1.9; object-fit: cover; display: block; margin-bottom: 4px; }
.deck strong, .deck small { padding: 0 7px; }
.deck small { font-size: .7rem; font-weight: 550; }
.face { font-size: 2.1rem; font-weight: 900; line-height: 1; padding: 6px 7px 4px; min-height: 38px; }
.white { background: #fff1d1; color: #281a2d; }
.gray { background: #dcccf5; color: #281a2d; }
.black { background: #241729; color: #fff2ed; border-color: #78617c; }
.random { background: #edbbf0; color: #281a2d; }
.round-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .83rem; }
.chip { border: 1px solid transparent; border-radius: 4px; padding: 3px 8px; font-size: .75rem; font-weight: 800; }
.chip.black { border-color: #78617c; }
.roll { display: block; border-radius: 5px; }
.question-card {
  width: 100%; display: grid; grid-template-columns: minmax(100px, .8fr) minmax(0, 1.7fr); align-items: stretch;
  border-radius: 10px; border: 1px solid #6c526c; overflow: hidden;
  box-shadow: 4px 4px 0 var(--shadow);
}
.question-art { display: block; width: 100%; height: 100%; min-height: 136px; object-fit: cover; }
.question-card > div { padding: clamp(14px, 2.6vw, 24px); align-self: center; }
.question-card > div > span { display: block; font-size: .69rem; letter-spacing: .075em; font-weight: 850; margin-bottom: 6px; }
.question-card h2 { font-size: clamp(1.18rem, 3vw, 2.05rem); }
.card-enter { animation: deal .39s cubic-bezier(.18,.78,.24,1.18) both; }
.hint { color: var(--muted); font-size: .9rem; }
.numbers { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; width: min(100%, 435px); }
.number { min-width: 0; padding-inline: 0; font-size: clamp(1.1rem, 3vw, 1.65rem); }
.number.picked, .number.picked:disabled { opacity: 1; transform: translateY(-4px); background: #ffe08b; color: #29192d; border-color: #ffc654; box-shadow: 0 4px 0 #9d6e29; }
.scale { display: flex; justify-content: space-between; width: min(100%, 435px); font-size: .76rem; color: var(--muted); margin-top: -8px; }
.roster h2 { font-size: 1.2rem; display: flex; justify-content: space-between; }
.roster h2 span { color: var(--accent); font-size: .89rem; }
.roster ul, .tally { list-style: none; padding: 0; width: 100%; margin: 8px 0 0; }
.roster li, .tally li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.roster li:last-child, .tally li:last-child { border: 0; }
.roster li div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.roster small { display: block; color: var(--muted); font-size: .71rem; }
.avatar { display: block; flex: none; width: 37px; height: 37px; border-radius: 7px; object-fit: cover; }
.eggs, .answer-pill { flex: none; font-weight: 800; }
.eggs { font-size: .82rem; }
.answer-pill { border: 1px solid var(--line); border-radius: 6px; color: var(--accent); padding: 1px 5px; }
.tally li { justify-content: space-between; overflow-wrap: anywhere; }
.celebrate, .verdict { color: var(--accent); }
.celebrate { font-size: 4.6rem; line-height: 1; }
.chain-lobby-art { width: 100%; height: auto; aspect-ratio: 3.1; object-fit: cover; border-radius: 9px; }
.word-card { background: #c5b3ff; border: 1px solid #654b91; width: 100%; color: #261a42; border-radius: 10px; padding: 15px 20px; }
.word-card p { color: #42305b; font-size: .82rem; font-weight: 700; margin-bottom: 4px; }
.word-form { width: 100%; }
.word-form label { display: block; font-weight: 700; margin-bottom: 5px; }
.word-form .actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.word-trail { padding: 0; margin: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.word-trail li { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; overflow-wrap: anywhere; max-width: 100%; }
.word-trail small { display: block; font-size: .68rem; color: var(--muted); }
.copied { animation: ping .31s ease-out; }
@keyframes deal { from { opacity: 0; transform: translateY(13px) rotate(-2.3deg) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes opening { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes stage-in { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes ping { 50% { transform: scale(1.045); } }

@media (max-width: 820px) {
  .frame { width: calc(100% - 36px); }
  .room-grid { grid-template-columns: minmax(0, 1fr) minmax(207px, .45fr); }
  .decks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 630px) {
  .top { min-height: 64px; }
  nav { font-size: .79rem; }
  .catalog, .room-grid { grid-template-columns: minmax(0, 1fr); }
  .catalog-head { align-items: start; flex-wrap: wrap; }
  .catalog-head p { margin-top: 8px; }
  .cover img { aspect-ratio: 1.85; }
  .room-head .actions { gap: 8px; }
  .question-card { grid-template-columns: minmax(73px, .65fr) minmax(0, 1.5fr); }
  .question-art { min-height: 115px; }
  .gear { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.ui-icon { display: block; flex: none; width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.closed-game { display: inline-flex; align-items: center; gap: 9px; color: #473751; font-weight: 750; min-height: 44px; }
.gear { background: #f1dfba; border-color: #aa9573; }
.gear .ui-icon { width: 31px; height: 31px; transition: transform .22s; }
.gear:hover .ui-icon { transform: rotate(12deg); }
#settings {
  position: fixed;
  inset: auto max(13px, env(safe-area-inset-right)) max(70px, calc(env(safe-area-inset-bottom) + 62px)) auto;
  width: min(284px, calc(100vw - 27px));
  z-index: 4;
  margin: 0;
  max-height: min(310px, calc(100dvh - 92px));
  padding: 10px;
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink);
}
.settings-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 4px 8px; }
.settings-head h2 { margin: 0; font-size: 1rem; }
.settings-head button { font-size: .73rem; color: var(--muted); }
#settings .settings-list, #room-settings { gap: 4px; }
#settings .setting-row { min-height: 36px; font-size: .79rem; padding: 4px 7px; gap: 7px; }
#settings .setting-row strong { font-size: .68rem; }
.avatar-options { display: grid; grid-template-columns: repeat(5, max-content); gap: 8px; }
.avatar-upload { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.avatar-upload .photo-preview { object-fit: cover; border-radius: 7px; border: 1px solid var(--line); flex: none; }
.avatar-upload label { min-width: 0; font-size: .8rem; }
.avatar-upload .avatar-file { max-width: 100%; min-height: 32px; font-size: .75rem; padding: 4px; }
.avatar-file::file-selector-button { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); padding: 3px 6px; font: inherit; cursor: pointer; }
.avatar-choice img { width: clamp(39px, 13vw, 57px); height: auto; aspect-ratio: 1; }

.in-room main { padding-top: clamp(18px, 3vw, 39px); }
.room-head {
  align-items: center;
  padding: 11px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
}
.room-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.room-title > img { width: 41px; height: 41px; border-radius: 9px; }
.room-title h1 { font-size: clamp(1.12rem, 2.5vw, 1.45rem); letter-spacing: -.045em; line-height: 1.05; }
.room-title p { font-size: .75rem; margin-top: 3px; }
.soft-icon, .invite-chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
}
.soft-icon:hover, .invite-chip:hover { border-color: var(--accent); }
.invite-chip span:first-of-type { font: 800 .93rem ui-monospace, monospace; letter-spacing: .07em; }
.invite-text { font-weight: 750; font-size: .78rem; }
.stage { background: var(--panel); border-color: var(--line); border-radius: 16px; padding: clamp(14px, 2.7vw, 25px); }
.stage > * { min-width: 0; max-width: 100%; }
.round-meta > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.deck-heading { display: flex; justify-content: space-between; align-items: end; width: 100%; gap: 10px; }
.deck-heading h2 { font-size: clamp(1.3rem, 3vw, 2rem); }
.deck-heading p { font-size: .78rem; }
.decks { gap: 10px; }
.deck { position: relative; min-height: 115px; padding: 7px; gap: 0; box-shadow: 2px 3px 0 var(--shadow); }
.deck .deck-art { border-radius: 6px; aspect-ratio: 1.25; margin: 0; }
.deck .die-preview { object-fit: contain; background: #f4e5c7; }
.deck > div { display: flex; flex-direction: column; padding: 5px 1px 0; }
.deck strong, .deck small { padding: 0; }
.deck[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 3px; }
.roster { padding: 12px; border-radius: 14px; }
.roster-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; margin: 0 1px 8px; }
.roster-head h2 { font-size: .97rem; }
.seats { display: flex; gap: 2px; }
.seats .ui-icon { width: 16px; height: 16px; border-radius: 3px; }
.roster ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; margin: 0; }
.roster li, .roster li:last-child { border: 0; padding: 5px; }
.roster li:not(:first-child) { border-top: 1px solid var(--line); }
.roster-name strong, .roster-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-name strong { display: block; font-size: .86rem; }
.roster-name .presence::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; vertical-align: 1px; border-radius: 50%; background: currentColor; }
.roster-name .presence[data-kind="online"] { color: #a7e9a5; }
.roster-name .presence[data-kind="bot"] { color: var(--accent); }
.roster li[data-presence-kind="offline"] .avatar { filter: grayscale(1); opacity: .7; }
.roster li[data-presence-kind="offline"] .roster-name strong { color: var(--muted); text-decoration: line-through; }
[data-theme="light"] .roster-name .presence[data-kind="online"] { color: #306c3b; }
.roster li .avatar { width: 36px; height: 36px; }
.eggs { display: inline-flex; gap: 4px; align-items: center; }
.eggs .ui-icon { width: 16px; height: 16px; }
.celebrate .ui-icon { width: 65px; height: 65px; border-radius: 10px; }
.question-card { border-radius: 13px; }
.roster li[data-player-menu] { -webkit-touch-callout: none; user-select: none; }
.roster li:has(.kick-player) { position: relative; padding-right: 28px; }
.kick-player {
  position: absolute; top: 2px; right: 1px; width: 25px; height: 25px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1;
}
.kick-player:hover, .kick-player:focus-visible { background: var(--surface); color: var(--danger); }
#player-menu {
  position: fixed; inset: 0 auto auto 0; margin: 0; width: min(230px, calc(100vw - 16px)); padding: 8px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 6px 21px var(--shadow);
}
#player-menu h2 { margin: 1px 3px 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .85rem; }
#player-menu .setting-row { min-height: 33px; padding: 3px 6px; font-size: .76rem; }
.menu-controls { display: flex; gap: 4px; align-items: center; padding: 2px 3px; font-size: .7rem; color: var(--muted); }
.menu-controls span { margin-right: auto; }
.mini-action { padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); }
.mini-action:disabled { opacity: .38; }
#settings .rounds-control { margin: 0; display: flex; }
.rounds-control input { margin-left: auto; width: 64px; min-height: 28px; padding: 1px 5px; text-align: center; }
.ballot {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(11px, 2.5vw, 18px);
}
.ballot { display: grid; gap: 9px; }
.ballot-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: start; justify-content: space-between; }
.ballot-head p { font-size: .73rem; font-weight: 750; color: var(--accent); }
.ballot-head h2 { font-size: clamp(1.3rem, 3vw, 2rem); margin-top: 3px; }
.revealed-name h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ballot > p { font-size: .8rem; }
.ballot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.ballot-card {
  display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 7px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; transition: transform .15s, border-color .15s;
}
.ballot-card img { width: clamp(34px, 8vw, 59px); height: auto; border-radius: 6px; }
.ballot-card span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .77rem; font-weight: 800; }
.ballot-card small { font-size: .65rem; color: var(--muted); }
.ballot-card:not(:disabled):hover { transform: translateY(-2px); border-color: var(--accent); }
.ballot-card.selected { border-color: var(--accent); outline: 1px solid var(--accent); }
.ballot-question { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); }
.ballot-question span { display: block; font-size: .7rem; font-weight: 800; margin-bottom: 3px; }
.ballot-question h3 { line-height: 1.25; overflow-wrap: anywhere; }
.ballot-card .ballot-answer { color: var(--accent); font-size: .75rem; }
.ballot-answer b { font-size: .95rem; }
#player-menu .score-value { width: 66px; min-height: 30px; text-align: center; padding: 2px 5px; font-weight: 850; }
#player-menu .score-value::-webkit-inner-spin-button, #player-menu .score-value::-webkit-outer-spin-button { appearance: none; margin: 0; }
.round-intro {
  width: 100%; min-height: 220px; display: grid; justify-items: center; align-content: center; gap: 8px;
  padding: 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.round-intro img { width: clamp(74px, 20vw, 118px); height: auto; aspect-ratio: 1; border-radius: 9px; animation: intro-art .55s cubic-bezier(.19,.83,.26,1.2) both; }
.round-intro img.rolling-die { animation: roll-colored-die .62s cubic-bezier(.2,.7,.26,1.16) both; }
.round-intro strong { font-size: clamp(1.4rem, 5vw, 2.5rem); line-height: 1; animation: intro-text .38s .1s ease-out both; }
.round-intro small { font-weight: 800; }
@keyframes intro-art { from { opacity: .2; transform: translateY(15px) rotate(-12deg) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes intro-text { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes roll-colored-die {
  0% { opacity: 0; transform: translate(-28px, -17px) rotate(-135deg) scale(.65); }
  65% { opacity: 1; transform: translate(6px, 3px) rotate(14deg) scale(1.05); }
  100% { opacity: 1; transform: none; }
}
.awards { width: 100%; }
.awards h3 { font-size: 1rem; margin-bottom: 6px; }
.awards ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 0; margin: 0; list-style: none; }
.awards li { display: flex; min-width: 0; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 6px; border-radius: 8px; }
.awards li > img { border-radius: 7px; }
.awards li > div { flex: 1; min-width: 0; }
.awards strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.awards small { color: var(--muted); font-size: .68rem; }
.awards .voted-for { display: block; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.awards .voted-for b { color: var(--ink); }
.egg-delta { display: flex; gap: 4px; align-items: center; padding: 4px 7px; border-radius: 6px; color: var(--muted); font-weight: 850; }
.egg-delta.earned { background: #ffe18a; color: #281930; }
.question-card.composition-1 { grid-template-columns: minmax(0, 1.7fr) minmax(93px, .8fr); border-width: 2px; }
.question-card.composition-1 .question-art { grid-column: 2; grid-row: 1; }
.question-card.composition-1 > div { grid-column: 1; grid-row: 1; padding-left: 20px; }
.question-card.composition-2 { grid-template-columns: 1fr; }
.question-card.composition-2 .question-art { height: clamp(65px, 11vw, 126px); min-height: 0; object-position: center 46%; }
.question-card.composition-2 > div { border-top: 1px solid #6c526c; }
.secret-card, .reveal-card {
  --persona: #ffe35c;
  width: 100%; overflow: hidden; display: grid; grid-template-columns: minmax(104px, .85fr) minmax(0, 1.3fr);
  color: #26192d; background: var(--persona); border: 2px solid #39273b; border-radius: 15px;
  box-shadow: 5px 5px 0 var(--shadow);
}
.persona-1 { --persona: #ffc6ed; }
.persona-2 { --persona: #c1eaff; }
.persona-3 { --persona: #ffcb82; }
.persona-4 { --persona: #e1f49a; }
.persona-5 { --persona: #e5cdff; }
.persona-6 { --persona: #ffb5a8; }
.persona-7 { --persona: #f2c3dd; }
.secret-card > img, .reveal-card > img { width: 100%; height: 100%; min-height: 152px; object-fit: cover; display: block; }
.secret-card > div, .reveal-card > div { padding: clamp(13px, 3vw, 25px); align-self: center; }
.secret-card span, .reveal-card p { display: block; color: #452b48; font-size: .74rem; font-weight: 850; margin-bottom: 4px; }
.secret-card p { color: #3f3140; line-height: 1.42; margin-top: 8px; font-size: .91rem; }
.reveal-card h2 { font-size: clamp(1.5rem, 5vw, 3rem); }
.reveal-card span { font-size: .84rem; font-weight: 650; }
.revealed-name { display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; }
.revealed-name img { border-radius: 8px; width: 35px; height: 35px; object-fit: cover; }
.winner-strip { width: 100%; display: flex; align-items: center; gap: 12px; background: #ffe8a0; color: #2a2030; padding: 14px; border-radius: 13px; }
.winner-strip > div { min-width: 0; }
.winner-strip p { color: #452d45; font-size: .81rem; font-weight: 850; }
.winner-strip span { font-size: .8rem; }
.goose-history { width: 100%; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; list-style: none; }
.goose-history li { display: flex; align-items: center; gap: 7px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.goose-history img { width: 46px; height: 46px; flex: none; border-radius: 5px; }
.goose-history small, .goose-history span { display: block; color: var(--muted); font-size: .69rem; }
.goose-history strong { display: block; }
@media (max-width: 630px) {
  .invite-text { display: none; }
  .room-head { gap: 7px; padding: 6px 7px; }
  .room-head .actions { gap: 4px; }
  .room-title { gap: 5px; }
  .room-title > img { width: 31px; height: 31px; }
  .room-title h1 { font-size: 1rem; }
  .room-title p { font-size: .68rem; }
  .invite-chip, .soft-icon { min-height: 35px; padding: 4px 6px; }
  .deck-heading { align-items: start; flex-direction: column; gap: 3px; }
  .decks .deck-art { aspect-ratio: 2.15; }
  .secret-card, .reveal-card { grid-template-columns: minmax(82px, .75fr) minmax(0, 1.4fr); }
  .secret-card p { font-size: .79rem; }
  .goose-history { grid-template-columns: 1fr; }
}
.spectator-banner { display:flex; align-items:center; gap:7px; width:100%; color:var(--muted); font-size:.76rem; }
.spectator-banner .ui-icon { width:22px; height:22px; }
.spectator-banner > button { margin-left:auto; padding:5px 9px; font-size:.72rem; min-height:30px; }
.spectator-roster { margin-top:12px; padding-top:9px; border-top:1px solid var(--line); }
.spectator-roster h3 { display:flex; align-items:center; gap:7px; font-size:.75rem; color:var(--muted); margin-bottom:5px; }
.spectator-roster h3 span { font-size:.65rem; opacity:.8; }
.spectator-roster > ul { max-height:180px; overflow:auto; scrollbar-width:thin; }
.spectator-roster .roster-name strong { font-size:.78rem; }
.spectator-roster .spectator-join{flex:none;min-height:36px;padding:5px 8px;font-size:.72rem}
body:not(.in-room) .frame { width: min(1240px, calc(100% - 36px)); }
body:not(.in-room) #app { padding-top:clamp(9px,2vw,28px); }
.catalog-head { display:grid; justify-items:center; justify-content:stretch; gap:16px; margin:14px 0 22px; text-align:center; }
.catalog-head h1 { font-size:clamp(2.5rem,6vw,4.35rem); line-height:1; margin:0; }
.catalog-tabs { display:flex; flex-wrap:wrap; justify-content:center; gap:7px; }
.catalog-tabs .secondary { padding:8px 13px; font-size:.82rem; }
.catalog-tabs a[aria-current=page] { background:var(--accent); color:#231727; border-color:var(--accent); font-weight:800; }
#home .catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
#home .catalog[hidden] { display:none; }
#home .cover img { aspect-ratio:1.72; }
#home .cover span { top:8px; left:8px; font-size:.59rem; padding:3px 6px; }
#home .game-copy { padding:12px; gap:8px; }
#home .game-copy h2 { font-size:clamp(1.125rem,2vw,1.75rem); line-height:1.1; text-wrap:balance; }
#home .game-copy p { font-size:.8rem; line-height:1.42; margin:0; }
#home .game-meta { font-size:.64rem; gap:6px; flex-wrap:wrap; }
#home .game-meta span { padding-left:6px; }
#home .game-copy .actions { gap: 8px; }
#home .game-copy .actions:has(.catalog-rules) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: stretch;
}
#home .game-copy .primary {
  min-height: 44px;
  padding: 8px;
  font-size: .875rem;
  line-height: 1.25;
  white-space: nowrap;
}
#home .catalog-rules {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0;
  background: #fff8f264;
}
#home .catalog-rules:hover { background: #fff8f2c2; }
@media (min-width: 1180px) {
  #home .catalog { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.public-rooms { width:min(100%,720px); margin-inline:auto; }
.public-rooms-head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; }
.public-rooms-head h2 { margin:0; }
#public-room-list { max-height:none; overflow:visible; }
@media (max-width: 849px) {
  #home .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  body:not(.in-room) .frame { width: calc(100% - 24px); }
  .catalog-head { margin: 5px 0 14px; gap: 9px; }
  #home .catalog { gap: 8px; }
  #home .cover img { aspect-ratio: 1.95; }
  #home .game-copy { padding: 8px; gap: 5px; grid-template-rows: auto 1fr auto; }
  #home .game-copy p { display: none; }
  #home .game-copy .actions { margin-top: 2px; gap: 4px; }
  #home .game-copy .primary { font-size: .6875rem; font-weight: 700; padding-inline: 2px; }
  #home .game-meta { gap: 3px; }
  #home .game-meta span { padding-left: 3px; }
}
@media (max-width: 374px) {
  #home .catalog { grid-template-columns: minmax(0, 1fr); }
  #home .game-copy .primary { font-size: .875rem; }
}
