:root {
  color-scheme: light;
  --ink: #342820;
  --paper: #fff8e9;
  --line: #d9c4a8;
  --gold: #ffd477;
  --mint: #bee3d2;
  font: 15px/1.45 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #123438; }
.in-room { font-family: Nunito, "Trebuchet MS", sans-serif; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { background: var(--paper); border: 1px solid #a98763; border-radius: 9px; padding: 8px 14px; font-weight: 650; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #318278; outline-offset: 2px; }
.gold { background: var(--gold); }
.mint { background: var(--mint); }
.site-header { min-height: 64px; display: flex; align-items: center; gap: 20px; padding: 8px max(16px,calc((100% - 1120px)/2)); color: var(--paper); background: #0b2629; border-bottom: 1px solid #526d63; }
.brand { display: flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; font-weight: 750; font-size: 20px; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.header-right { margin-left: auto; display: flex; gap: 8px; }
.header-right button { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.header-right img, h2 img, #inviteBtn img { width: 24px; height: 24px; object-fit: contain; }
main { max-width: 1152px; margin: auto; padding: 24px 16px; }
.panel, .lobby, dialog { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.lobby { max-width: 760px; margin: auto; padding: 24px; }
.lobby-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.lobby-title img { width: 64px; height: 64px; object-fit: contain; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 5vw, 40px); letter-spacing: -.03em; }
h2 { font-size: 17px; }
.avatar-picker { margin: 18px 0; border: 1px solid var(--line); border-radius: 9px; }
.avatar-picker legend { padding: 0 6px; font-weight: 650; }
#avatars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
#avatars button { padding: 3px; background: #f6ead7; border-color: transparent; aspect-ratio: 1; }
#avatars button[aria-pressed=true] { background: var(--mint); border-color: #397d6d; }
#avatars img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.lobby-columns, .message-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lobby-columns form { background: #fffdf7; border: 1px solid var(--line); border-radius: 9px; padding: 16px; }
label { display: block; }
.lobby-columns label, dialog label { margin: 10px 0; font-weight: 600; }
input:not([type=range],[type=color]), .lobby-columns select { display: block; width: 100%; min-width: 0; margin-top: 4px; border: 1px solid #a98763; border-radius: 7px; background: #fff; padding: 7px 9px; }
.form-row { display: flex; gap: 10px; }
.form-row label { flex: 1; }
.feedback { color: #923a2a; margin-top: 8px; }
.feedback:empty { display: none; }
.game-room { display: grid; grid-template-columns: 230px minmax(0, 760px); justify-content: center; align-items: start; gap: 12px; }
.players-panel h2, .chat-panel h2 { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
#footerCount { margin-left: auto; font-size: 13px; }
.players-list { padding: 6px; max-height: 545px; overflow: auto; }
.player { display: flex; align-items: center; gap: 8px; padding: 6px; border-bottom: 1px solid #e9dcca; }
.player:last-child { border: 0; }
.player img { width: 44px; height: 44px; object-fit: contain; }
.player.featured { background: var(--mint); border-radius: 8px; }
.player-name { flex: 1; overflow-wrap: anywhere; font-weight: 650; }
.player-points { font-variant-numeric: tabular-nums; font-weight: 700; }
.play-area { display: grid; gap: 8px; }
.round-bar { min-height: 47px; display: flex; align-items: center; gap: 12px; padding: 6px 10px; font-weight: 700; }
@media (max-width: 620px) {
  .round-bar { flex-wrap: wrap; gap: 6px; }
}
.timer { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.timer img { width: 25px; height: 25px; object-fit: contain; }
.word-pill { margin-left: auto; overflow-wrap: anywhere; }
.canvas-wrap { background: #fff; border-block: 1px solid var(--line); }
#board { width: 100%; display: block; aspect-ratio: 3/2; touch-action: none; cursor: crosshair; }
.guesser #board { cursor: default; }
.guesser .drawing-controls { display: none; }
.drawing-controls { padding: 8px; container-type: inline-size; }
.tools, .tool-buttons, .history-tools, .size-control, .palette-row, .custom-color { display: flex; align-items: center; gap: 5px; }
.tools, .palette-row { flex-wrap: wrap; }
.tools button { display: grid; place-items: center; width: 40px; height: 38px; padding: 3px; }
.tools button.active { background: var(--gold); }
.tools img { width: 28px; height: 28px; object-fit: contain; }
.history-tools { margin-left: auto; }
.brush-settings { display: flex; flex-wrap: wrap; gap: 6px; }
.size-control {
  display: grid;
  grid-template-columns: auto minmax(44px, 76px) 4ch;
  gap: 7px;
  min-height: 38px;
  padding: 4px 8px;
  border: 1px solid #9c7f5b;
  border-radius: 8px;
  background: #f6ead2;
  font-size: 13px;
  font-weight: 800;
}
.size-control input {
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.size-control input::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: #bc9b6e; }
.size-control input::-moz-range-track { height: 6px; border-radius: 6px; background: #bc9b6e; }
.size-control input::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 2px solid #4b3422;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 1px #4b3422;
}
.size-control input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #4b3422;
  border-radius: 50%;
  background: var(--mint);
}
.size-control output {
  border-radius: 4px;
  background: var(--paper);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.palette-row { margin-top: 8px; }
.colors-all { display: grid; grid-template-columns: repeat(16, minmax(15px, 1fr)); flex: 1; gap: 4px; }
.swatch { min-width: 0; padding: 0; aspect-ratio: 1; border: 1px solid #a98763; border-radius: 5px; }
.swatch.selected { outline: 2px solid #318278; outline-offset: 1px; }
.custom-color input { width: 32px; height: 28px; padding: 0; border: 0; background: transparent; }
@container (max-width: 660px) {
  .tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .tool-buttons { grid-column: 1; grid-row: 1; }
  .history-tools { grid-column: 2; grid-row: 1; }
  .brush-settings { grid-column: 1 / -1; grid-row: 2; }
}
@container (max-width: 365px) {
  .tools button { width: 34px; height: 34px; }
  .tools img { width: 24px; height: 24px; }
}
@container (max-width: 305px) {
  .tools { display: flex; }
  .history-tools { margin-left: 0; }
}
.chat-log { height: 125px; overflow: auto; padding: 6px 10px; background: #fffdf7; overflow-wrap: anywhere; }
.message { display: flex; gap: 6px; align-items: baseline; }
.message time { margin-left: auto; color: #695a4d; font-size: 12px; white-space: nowrap; }
.message.correct { color: #21694e; font-weight: 650; }
.chat-form { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line); }
.chat-form input:not([type=range],[type=color]) { margin: 0; }
.game-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--paper); }
dialog { color: var(--ink); max-width: min(440px, calc(100% - 24px)); padding: 24px; box-shadow: 0 12px 30px #07161770; }
dialog::backdrop { background: #071617a0; }
.invite-art { display: block; width: 90px; height: 90px; object-fit: contain; margin: 0 auto 10px; }
.invite-dialog h2, .invite-dialog p { text-align: center; }
.dialog-actions, #wordChoices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
#choiceDialog { width: min(570px,calc(100% - 24px)); max-width: none; padding: 0; border: 2px solid #4b3422; border-radius: 12px; background: #fff9eb; box-shadow: 0 5px #4b3422; }
.choice-header { display: flex; align-items: center; gap: 12px; padding: 15px; background: #f8e5bb; border-bottom: 1px solid #d9bc84; }
.choice-header img { flex: none; width: 45px; height: 45px; object-fit: contain; }
.choice-header h2 { font-size: clamp(19px,3vw,24px); font-weight: 900; }
.choice-header p { color: #665139; font-size: 13px; }
.choice-timer { flex: none; margin-left: auto; padding: 3px 8px; border: 2px solid #67472a; border-radius: 7px; background: #ffcf65; font-weight: 900; font-variant-numeric: tabular-nums; }
#wordChoices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; padding: 16px 15px 20px; }
#wordChoices button { min-height: 51px; padding: 8px 7px; border: 2px solid #67472a; border-radius: 8px; background: #fff4dc; box-shadow: 0 3px #67472a; overflow-wrap: anywhere; font-weight: 850; }
#wordChoices button:hover:not(:disabled) { background: #ffdf98; transform: translateY(1px); box-shadow: 0 2px #67472a; }
@media (max-width: 390px) {
  #wordChoices { grid-template-columns: 1fr; }
  .choice-header img { width: 34px; height: 34px; }
}
@media (max-width: 720px) {
  .game-room { grid-template-columns: 1fr; }
  .players-list { display: flex; overflow: auto; }
  .player { min-width: 120px; }
  .site-header > strong { display: none; }
  #avatars { grid-template-columns: repeat(5,1fr); }
}
@media (max-width: 440px) {
  .lobby-columns, .message-columns { grid-template-columns: 1fr; }
  .site-header { gap: 6px; padding-inline: 8px; }
  .brand { font-size: 16px; }
  .header-right img { display: none; }
}
/* Match the desktop reference's 300 / 654 panel split at its native size. */
main { max-width: 1004px; }
.game-room { grid-template-columns: minmax(0,300fr) minmax(0,654fr); gap: 18px; align-items: stretch; }
.players-panel { display: flex; flex-direction: column; }
.players-list { flex: 1; }
.player { min-height: 77px; }
.player img { width: 58px; height: 58px; }
.play-area { gap: 0; }
.message-columns { grid-template-columns: 415fr 237fr; gap: 0; margin-top: 22px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.message-columns .chat-panel { border: 0; border-radius: 0; }
.message-columns .chat-panel + .chat-panel { border-left: 1px solid var(--line); }
.chat-log { height: 90px; }
.canvas-wrap { position: relative; }
#board { aspect-ratio: 900/460; }
.round-bar[hidden] + .canvas-wrap #board { aspect-ratio: 654/382; }
.waiting-art { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; }
.waiting-art img { width: 86px; height: 86px; object-fit: contain; }
.choosing-art { gap: 7px; padding: 10px; background: #fffaf0; text-align: center; }
.choosing-art img { width: clamp(44px,7vw,94px); height: clamp(44px,7vw,94px); }
.choosing-art strong { font-size: clamp(16px,2vw,24px); font-weight: 900; overflow-wrap: anywhere; }
.choosing-art p { color: #665139; }
.choosing-art .choice-timer { margin-left: 0; }
.skipped-art { background: #fffaf0; color: #694b32; padding: 12px; text-align: center; }
.skipped-art img { width: 62px; height: 62px; }
.game-status { margin-top: 8px; }
@media (max-width: 720px) {
  .game-room { grid-template-columns: 1fr; }
  .player { min-height: 54px; }
  .player img { width: 38px; height: 38px; }
}
@media (max-width: 440px) {
  .message-columns { grid-template-columns: 1fr; }
  .message-columns .chat-panel + .chat-panel { border-left: 0; border-top: 1px solid var(--line); }
  .colors-all { grid-template-columns: repeat(8, minmax(17px,1fr)); }
}
.board-panel { overflow: hidden; }
.invite-dialog { width: min(440px,calc(100% - 24px)); }
.site-header { padding-inline: max(20px,calc((100% - 1520px)/2)); }
.portal .site-header { display: grid; grid-template-columns: 1fr auto 1fr; max-width: 1240px; height: 132px; margin: auto; padding: 0 24px; gap: 20px; border: 0; background: transparent; color: #36261b; }
.portal .site-header > strong { display: none; }
.portal .brand { grid-column: 2; font-size: 40px; font-weight: 900; letter-spacing: -.065em; }
.portal .brand img { width: 41px; height: 41px; }
.portal .header-right { grid-column: 1; grid-row: 1; justify-self: start; margin: 0; }
#languageBtn { cursor: pointer; list-style: none; }
#languageBtn::-webkit-details-marker { display: none; }
.portal .languageMenu { right: auto; left: 0; transform-origin: top left; }
.portal .languageMenu .languageOption { border: 2px solid #4b3422; border-radius: 8px; }
#languageMenu .languageOption img, #languageBtn img { display: block; }
#languageMenu:not([open]) .languageMenu { display: none; }
main { width: 100%; max-width: 1560px; padding: 12px 24px 32px; }
.lobby { max-width: none; background: none; border: 0; padding: 0; }
.portal main.siteWrap { max-width: 1240px; margin-inline: auto; padding: 0 24px 32px; }
.portal .searchField { display: flex; align-items: center; padding-inline: 11px; }
.portal .searchField span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.portal .searchField input { width: 100%; margin: 0; padding: 10px 0; border: 0; background: transparent; }
.portal .sketch-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(145px,auto); align-items: end; gap: 8px; }
.portal .sketch-filters label { min-width: 0; margin: 0; }
.portal .sketch-filters select { width: 100%; min-height: 44px; margin: 0; }
@media (max-width: 620px) {
  .portal .sketch-filters { grid-template-columns: minmax(0,1fr); }
  .portal .sketch-filters .searchField { grid-column: 1 / -1; }
}
.directory-room { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px; border: 1px solid #d9c4a8; border-radius: 8px; }
.directory-room img { width: 44px; height: 44px; object-fit: contain; }
.directory-room > div { min-width: 0; overflow-wrap: anywhere; }
.directory-room small { display: block; }
.directory-room button { flex: none; margin-left: auto; }
#entryRoomName { margin-top: -4px; color: #295c69; font-weight: 700; overflow-wrap: anywhere; }
.portal #roomList:empty { display: none; }
.portal #directoryEmpty { margin-top: 17px; }
.portal #portalRefresh span { font-size: 17px; line-height: 1; }
.portal .playHeading span { text-transform: uppercase; }
#entryDialog { width: min(950px,calc(100% - 28px)); max-width: none; max-height: calc(100dvh - 28px); overflow: auto; border: 2px solid #4b3422; border-radius: 14px; box-shadow: 0 6px #4b3422, 0 20px 46px #23160d44; background: #fffaf0; }
#entryTitle { margin: 0 0 14px; color: #38271a; font-size: clamp(24px,4vw,36px); font-weight: 900; letter-spacing: -.05em; }
.entry-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); align-items: start; gap: 20px; }
#entryDialog .avatar-picker { min-width: 0; margin: 0; padding: 12px; border: 2px solid #d9bc84; background: #f8e5bb; }
#entryDialog .avatar-picker legend { padding: 0 5px; font-weight: 900; }
#entryDialog #avatars button { min-width: 0; padding: 2px; border-color: #d9bc84!important; box-shadow: none; background: #fff9eb; }
#entryDialog #avatars button:hover { transform: translateY(-2px); }
#entryDialog #avatars button[aria-pressed=true] { border-color: #49321f!important; background: #ffcf65; box-shadow: 0 3px #49321f; }
#entryDialog #avatars img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
#entryDialog .primaryAction, #entryDialog .secondaryAction { width: 100%; margin-top: 6px; font-weight: 900; }
#entryDialog .room-visibility { position: relative; display: flex; align-items: center; gap: 9px; margin-block: 14px; cursor: pointer; }
#entryDialog .room-visibility input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { display: inline-flex; align-items: center; flex: none; width: 36px; height: 21px; padding: 2px; border: 1px solid #77583b; border-radius: 20px; background: #e4d2b4; }
.switch-track::after { content: ""; width: 15px; height: 15px; border-radius: 50%; background: #fff9eb; box-shadow: 0 1px 2px #52382566; transition: transform .15s ease; }
.room-visibility input:checked + .switch-track { background: #397e69; }
.room-visibility input:checked + .switch-track::after { transform: translateX(15px); }
.room-visibility input:focus-visible + .switch-track { outline: 2px solid #397e69; outline-offset: 3px; }
#entryDialog input:not([type=checkbox],[type=hidden]), #themeSearch { min-height: 42px; border: 2px solid #c7ab83; background: #fffaf0; border-radius: 7px; }
.cozy-select-field { flex: 1; min-width: 0; font-weight: 750; }
#createForm .cozy-select-field { margin: 0 0 12px; }
.cozy-select { position: relative; margin-top: 4px; }
.cozy-select summary { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 42px; padding: 7px 10px; border: 2px solid #a7885e; border-radius: 7px; background: #fff7e5; color: #4b3422; list-style: none; font-weight: 900; cursor: pointer; }
.cozy-select summary::-webkit-details-marker { display: none; }
.cozy-select summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -3px 2px 0 0; flex: none; }
.cozy-select[open] summary { border-color: #5c4029; background: #ffefd0; }
.cozy-select[open] { z-index: 4; }
.cozy-select-menu { position: absolute; z-index: 2; top: calc(100% + 4px); inset-inline: 0; min-width: 108px; max-height: min(260px,40dvh); overflow: auto; padding: 4px; border: 2px solid #5c4029; border-radius: 8px; background: #fff9eb; box-shadow: 0 4px #5c4029; }
.portal .cozy-select-menu button { display: block; width: 100%; padding: 6px 8px; border: 0!important; border-radius: 4px!important; background: transparent; box-shadow: none; text-align: left; font-weight: 800; }
.portal .cozy-select-menu button:hover, .portal .cozy-select-menu button[aria-pressed=true] { background: #ffdf98; transform: none; box-shadow: none; }
.theme-field { display: grid; gap: 4px; margin: 12px 0; font-weight: 850; }
.theme-trigger { display: flex; align-items: center; gap: 9px; background: #fff0cb; text-align: left; }
.theme-arrow { margin-left: auto; }
.theme-art { display: block; width: 100%; aspect-ratio: 1; background: url("/assets/sketch/theme-badges-cozy.png") var(--art-x,0%) var(--art-y,0%) / 400% 300% no-repeat; }
.theme-art:is([data-theme=food],[data-theme=adventure],[data-theme=arts]) { --art-x: 33.333%; }
.theme-art:is([data-theme=transport],[data-theme=sports],[data-theme=fantasy]) { --art-x: 66.667%; }
.theme-art:is([data-theme=places],[data-theme=garden],[data-theme=science]) { --art-x: 100%; }
.theme-art:is([data-theme=animals],[data-theme=adventure],[data-theme=sports],[data-theme=garden]) { --art-y: 50%; }
.theme-art:is([data-theme=flags],[data-theme=arts],[data-theme=fantasy],[data-theme=science]) { --art-y: 100%; }
.theme-trigger .theme-art { width: 34px; flex: none; }
#themeDialog { width: min(960px,calc(100% - 24px)); max-width: none; max-height: min(820px,calc(100dvh - 24px)); padding: 0; overflow: hidden; border: 2px solid #4b3422; border-radius: 12px; box-shadow: 0 6px #4b3422; background: #fff9eb; }
#themeDialog[open] { display: flex; flex-direction: column; }
.theme-dialog-header { display: flex; align-items: center; gap: 14px; padding: 15px 20px; background: #f8e5bb; border-bottom: 2px solid #d9bc84; }
.theme-dialog-header button { padding: 4px 11px; font-size: 21px; }
.theme-dialog-header h2 { font-size: clamp(21px,3vw,31px); font-weight: 900; letter-spacing: -.04em; }
#themeCount { margin-left: auto; white-space: nowrap; color: #705333; font-size: 13px; font-weight: 800; }
.theme-dialog-filters { display: grid; gap: 8px; padding: 14px 20px; border-bottom: 1px solid #d9bc84; }
#themeSearch { margin: 0; width: 100%; }
.theme-categories { display: flex; gap: 7px; overflow: auto; padding: 1px 1px 6px; }
.theme-categories button { flex: none; background: #fffaf0; padding: 5px 10px; font-size: 13px; }
.theme-categories button[aria-pressed=true] { background: #ffcf65; }
.theme-catalog { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 15px 20px 20px; overflow: auto; }
.theme-catalog:empty { display: none; }
.theme-card { display: grid; gap: 7px; min-width: 0; padding: 7px 7px 10px; background: #fffaf0; text-align: left; }
.theme-card[aria-pressed=true] { background: #ffdf98; }
.theme-preview { display: grid; place-items: center; min-height: 0; aspect-ratio: 1.6; border: 1px solid #ddc69f; border-radius: 4px; background: #f4e8ce; }
.theme-preview .theme-art { width: min(87%,118px); }
#themeEmpty { padding: 20px; }
@media (max-width: 620px) {
  .theme-catalog { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px; }
  .theme-dialog-header, .theme-dialog-filters { padding-inline: 12px; }
  .theme-preview .theme-art { width: min(78%,105px); }
}
#entryDialog .lobby-columns { display: block; }
#entryDialog .lobby-columns h2 { display: none; }
#entryDialog #avatars { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; }
.in-room main { max-width: 1680px; padding-top: 14px; }
@media (min-width: 721px) {
  .game-room { grid-template-columns: minmax(0,301fr) minmax(0,697fr); gap: clamp(18px,1.78vw,34px); }
  .in-room main { max-width: min(86.5vw,1632px); padding-inline: 0; }
  .in-room .site-header {
    min-height: clamp(82px,14svh,112px);
    align-items: flex-end;
    padding: 8px max(6.75vw,calc((100% - 1632px)/2)) 12px;
  }
  .in-room .site-header > strong { align-self: flex-end; padding-bottom: 8px; }
  .game-room .players-list .player { min-height: 84px; }
}
@media (min-width: 1024px) {
  .in-room .site-header { position: relative; }
  .in-room .site-header {
    --board-start: calc(max(6.75vw,(100% - 1632px)/2) + min(26.1vw,492px) + clamp(18px,1.78vw,34px));
  }
  .in-room #roomSound, .in-room #inviteBtn { position: absolute; bottom: 12px; }
  .in-room #roomSound { left: var(--board-start); }
  .in-room #inviteBtn { left: calc(var(--board-start) + 50px); }
}
.game-room .player-name, .game-room .player-points { font-size: clamp(14px,1.55vw,20px); }
.game-room .player img { width: clamp(45px,5.4vw,72px); height: clamp(45px,5.4vw,72px); }
.game-room h2 { font-size: clamp(17px,1.3vw,23px); }
.game-room .chat-log { height: clamp(90px,13vh,170px); }
@media (max-width:720px) {
  main { padding-inline: 10px; }

  .game-room, .entry-layout { grid-template-columns: 1fr; }
}
.turn-progress { --track: #d5c4aa; --fill: #c5813b; display: block; width: calc(100% - 26px); height: 9px; margin: 9px 13px; accent-color: var(--fill); border-radius: 10px; overflow: hidden; }
.turn-progress::-webkit-progress-bar { background: var(--track); border-radius: 10px; }
.turn-progress::-webkit-progress-value { background: var(--fill); border-radius: 10px; }
.turn-progress::-moz-progress-bar { background: var(--fill); border-radius: 10px; }
.turn-progress[data-phase=urgent] { --fill: #ad4a46; }
.turn-progress:is([data-phase=reveal],[data-phase=finished]) { --track: #214a49; --fill: #6dc1ad; }
.game-room .colors-all { grid-template-columns: repeat(16,minmax(0,32px)); flex: 0 1 auto; width: min(100%,572px); }
.game-room .chat-log { height: clamp(78px,10vh,124px); }
.game-room .players-list { max-height: none; min-height: 0; }
#board { max-height: 49svh; }
@media (min-width: 721px) {
  .game-room:not(.show-results) .round-bar:not([hidden]) + .canvas-wrap { background: #fbf6e9; }
  .game-room:not(.show-results) .round-bar:not([hidden]) + .canvas-wrap #board {
    width: min(100%,95.86svh);
    margin-inline: auto;
    max-height: none;
  }
}
@media (max-width: 720px) {
  .game-room .colors-all { grid-template-columns: repeat(16,minmax(0,1fr)); }
  #board { max-height: none; }
}
@media (max-width: 440px) {
  .game-room .colors-all { grid-template-columns: repeat(8,minmax(0,1fr)); width: min(100%,292px); }
}
.player { width: 100%; background: transparent; border: 0; border-bottom: 1px solid #e9dcca; text-align: left; border-radius: 0; }
button.player:hover { background: #f4e8d0; }
.player:focus-visible { outline-offset: -3px; }
.player.featured:hover { background: #b3ddcc; }
.system-message, .message.correct { display: block; }
.system-message { color: #295c69; }
.log-info, .log-icon {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  margin-right: 5px;
  vertical-align: -1px;
}
.log-info { border: 1px solid currentColor; border-radius: 50%; font: bold 10px/1 system-ui; }
.log-correct {
  display: inline-block;
  width: 7px;
  height: 12px;
  margin: 0 8px 0 2px;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  vertical-align: 1px;
}
#playerDialog { width: min(420px,calc(100% - 24px)); max-width: none; padding: 0; border: 2px solid #4b3422; border-radius: 12px; background: #fff9eb; box-shadow: 0 5px #4b3422; }
.profile-header { position: relative; display: grid; place-items: center; min-height: 58px; padding: 10px 52px; background: #f8e5bb; border-bottom: 1px solid #d9bc84; }
.profile-header h2 { font-size: 20px; font-weight: 900; text-align: center; }
.profile-header form { position: absolute; right: 12px; }
.profile-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 3px; }
.profile-close img { width: 22px; height: 22px; }
.profile-body { padding: 16px; }
.profile-identity { display: grid; justify-items: center; gap: 8px; text-align: center; }
.profile-portrait { display: block; flex: none; width: 116px; height: 116px; object-fit: contain; }
#profileName { font-size: 22px; font-weight: 900; overflow-wrap: anywhere; }
#profileScore { color: #4c6759; font-weight: 800; }
.profile-actions { display: grid; gap: 10px; width: min(100%,240px); margin: 14px auto 4px; padding-top: 14px; border-top: 1px solid #d9bc84; }
.profile-header button, .profile-actions button { border: 2px solid #5c4029; border-radius: 7px; box-shadow: 0 3px #5c4029; }
.profile-header button:hover:not(:disabled), .profile-actions button:hover:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px #5c4029; }
#profileFeedback { grid-column: 1 / -1; color: #665139; font-size: 13px; font-weight: 750; }
.player-details { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.player-details .player-points { color: #4c3929; }
.player-note { color: #286070; margin-top: 3px; font-weight: 650; }
.player-note.correct { color: #21694e; }
.show-results .round-bar { display: none; }
.show-results .players-panel { background: #fffdf7; }
.show-results .players-panel h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; }
.show-results .players-list { padding: 0; }
.show-results .player { padding-inline: clamp(10px,2.3vw,36px); }
.show-results .player-name { color: #5c5146; }
@media (max-width: 720px) {
  .game-room .players-panel { min-width: 0; }
  .game-room .players-list { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
  .game-room .player { flex: 0 0 min(46%,180px); min-width: 0; padding-inline: 8px; border: 0; border-right: 1px solid #e9dcca; }
  .game-room .player:only-child { flex-basis: 100%; }
  .game-room .player:last-child { border-right: 0; }
}
.show-results .canvas-wrap { border-block: 0; container-type: inline-size; }
.show-results #board { aspect-ratio: 697/392; }
@media (min-width: 721px) {
  .show-results #board { max-height: 48svh; }
  .show-results .message-columns .chat-log { height: clamp(102px,15svh,155px); }
  .show-results .message-columns .chat-panel:last-child .chat-log { height: calc(clamp(102px,15svh,155px) + 36px); }
}
.results-art {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr);
  justify-items: center;
  padding: clamp(12px,4vh,36px) 12px clamp(14px,4vh,40px);
  background: #fffdf7;
  text-align: center;
}
.results-art h2 { font-size: clamp(22px,4.5cqw,43px); text-transform: uppercase; color: #ffcf64; paint-order: stroke fill; -webkit-text-stroke: 4px #493321; line-height: 1.15; font-weight: 900; }
.results-art p { color: #6c5644; font-size: clamp(13px,2.4cqw,21px); font-weight: 700; }
#podium {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: end;
  align-self: center;
  width: min(73%,820px);
  gap: clamp(4px,2cqw,26px);
}
.podium-place { display: grid; justify-items: center; min-width: 0; grid-row: 1; }
.podium-place img { width: min(100%,17.5cqw,18svh); aspect-ratio: 1; object-fit: contain; }
.podium-place strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(14px,2.6cqw,25px); }
.place-1 { grid-column: 2; padding-bottom: clamp(10px,4cqw,45px); position: relative; }
.place-1 img { width: min(100%,20cqw,21svh); }
.place-1::before { content: ""; position: absolute; top: 0; width: min(145%,29cqw,30svh); height: min(19cqw,22svh); background: url("/assets/sketch/podium-laurel-final.png") center / contain no-repeat; pointer-events: none; }
.place-1 > * { position: relative; }
.place-2 { grid-column: 1; }
.place-3 { grid-column: 3; padding-bottom: clamp(0px,.7cqw,7px); }
.podium-medal {
  display: grid;
  place-items: center;
  position: relative;
  width: clamp(23px,5.7cqw,54px);
  aspect-ratio: 1;
  margin-top: clamp(-23px,-2.3cqw,-8px);
  border: 2px solid #503b2a;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #fff7db, 0 2px #503b2a;
  background: #d9ab75;
  color: #3e2c19;
  font-size: clamp(13px,3cqw,27px);
  font-weight: 900;
}
.place-1 .podium-medal { width: clamp(28px,6.4cqw,62px); background: #ffd477; }
.place-2 .podium-medal { background: #d8dadd; }
@media (min-width: 721px) and (min-height: 690px) {
  .results-art { padding-top: clamp(12px,3.3svh,36px); }
  #podium { margin-top: clamp(8px,3svh,26px); }
  .podium-place img { width: min(100%,16.5cqw,20svh); }
  .place-1 img { width: min(100%,18.5cqw,22svh); }
  .podium-place strong { margin-top: 6px; }
}
.show-results .turn-progress { width: 92%; margin: 5px auto 12px; }
.show-results .board-panel { background: #fffdf7; }
.game-room .message-columns { overflow: visible; background: #fffdf7; }
.message-columns .chat-panel { position: relative; min-width: 0; padding-top: 16px; background: transparent; overflow: visible; }
.message-columns .chat-panel h2 {
  position: absolute;
  top: 0;
  right: clamp(8px,2vw,28px);
  transform: translateY(-50%);
  justify-content: center;
  min-width: clamp(88px,9.35vw,120px);
  padding: 4px 12px;
  border: 0;
  border-radius: 6px;
  color: #fff6df;
  background: #523825;
  font-size: clamp(12px,1.26vw,16px);
  font-weight: 900;
  text-transform: uppercase;
}
.show-results #guessForm button { display: none; }
.message-columns .chat-log { background: transparent; }
.show-results .chat-panel:last-child .chat-log { height: calc(clamp(78px,10vh,124px) + 36px); }
.show-results .chat-form { border-top: 0; }
@media (min-width: 721px) {
  .game-room .players-panel { contain: size; }
}
@media (max-width: 720px) {
  .show-results .chat-panel:last-child .chat-log { height: clamp(78px,10vh,124px); }
}
@media(max-width: 600px) {
  .show-results #board { min-height: 245px; }
  #podium { width: 90%; }
  .results-art h2 { -webkit-text-stroke-width: 3px; }
}
.header-right .room-control {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid #4b3422;
  border-radius: 8px;
  background: #fff7e5;
  box-shadow: 0 3px #4b3422;
  color: #4b3422;
  font-size: 0;
  text-decoration: none;
}
.room-control::before {
  content: "";
  width: 31px;
  aspect-ratio: 1;
  background: var(--control-art) center / contain no-repeat;
}
#roomSound { --control-art: url("/assets/sketch/control-sound.png"); }
#roomSound[aria-pressed=false] { --control-art: url("/assets/sketch/control-muted.png"); }
#openRules { --control-art: url("/assets/sketch/control-rules.png"); }
#leaveRoom { --control-art: url("/assets/sketch/control-leave.png"); }
.header-right .room-control:hover { background: #ffdf98; }
.header-right .room-control:focus-visible { outline: 2px solid #ffd477; outline-offset: 2px; }
.report-drawing {
  position: absolute;
  z-index: 1;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid #4b3422;
  border-radius: 8px;
  background: #fff8e9;
  box-shadow: 0 3px #4b3422;
}
.report-drawing::before {
  content: "";
  width: 23px;
  height: 22px;
  background: #eac16c;
  clip-path: polygon(50% 0,100% 100%,0 100%);
}
.report-drawing::after { content: "!"; position: absolute; top: 13px; font-size: 16px; line-height: 1; font-weight: 900; }
.report-drawing:hover:not(:disabled) { background: #f9e6b9; }
.report-drawing:disabled { opacity: 1; background: #dcece1; }
.report-drawing:disabled::before { visibility: hidden; }
.report-drawing:disabled::after {
  content: "";
  top: 10px;
  width: 8px;
  height: 13px;
  border: solid #36745a;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
#rulesDialog {
  width: min(500px,calc(100% - 24px));
  max-width: none;
  padding: 0;
  border: 2px solid #493521;
  border-radius: 14px;
  background: #fff8e9;
  box-shadow: 0 7px #493521, 0 18px 35px #07161765;
}
.rules-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid #cfae7b;
  background: #f6e4ba;
}
.rules-header .theme-art { width: 64px; flex: none; }
.rules-header p { margin: 0; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
#rulesTitle { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 900; }
.rules-body { padding: 18px 22px; }
.rules-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 0; }
.rules-facts > div { padding: 7px 8px; border: 1px solid #dbc29b; border-radius: 7px; background: #fffdf7; overflow-wrap: anywhere; }
.rules-facts dt { color: #6c5644; font-size: 12px; }
.rules-facts dd { margin: 1px 0 0; color: #295c69; font-weight: 800; }
#drawingRule { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid #548a76; border-radius: 0 6px 6px 0; background: #e1eee2; }
.rules-footer { display: flex; justify-content: end; padding: 0 22px 20px; }
#confirmRules { min-width: 140px; }
.round-bar button, .tools button, .chat-form button, #confirmRules {
  border: 2px solid #4b3422;
  border-radius: 8px;
  box-shadow: 0 3px #4b3422;
  font-weight: 800;
  transition: background-color .15s, box-shadow .15s, transform .15s;
}
.round-bar button { padding: 6px 10px; }
#giveHint { background: var(--mint); }
#finishPracticeTurn { background: var(--gold); }
:is(.round-bar button, .tools button, .chat-form button, #confirmRules):hover:not(:disabled) { filter: brightness(.97); }
:is(.round-bar button, .tools button, .chat-form button, #confirmRules):active:not(:disabled) {
  box-shadow: 0 1px #4b3422;
  transform: translateY(2px);
}
@media (prefers-reduced-motion: reduce) {
  .round-bar button, .tools button, .chat-form button, #confirmRules { transition: none; }
}
.player-gain { flex: none; align-self: center; padding: 3px 8px; border: 1px solid #88b29e; border-radius: 8px; background: #e0f0e5; color: #225c42; font-weight: 800; font-variant-numeric: tabular-nums; }
#roomSound[aria-pressed=true] { background: #cfe9d9; }
@media (max-width: 480px) {
  .in-room .site-header { flex-wrap: wrap; gap: 4px; padding-inline: 10px; }
  .in-room .header-right { width: 100%; justify-content: space-between; align-items: center; gap: 4px; }
}

@media (max-width: 900px) { .portal .site-header { height: 105px; } }
@media (max-width: 620px) {
  .portal .site-header { height: 83px; grid-template-columns: auto 1fr; gap: 8px; padding-inline: 13px; }
  .portal .brand { grid-column: 1; font-size: 27px; }
  .portal .brand img { width: 29px; height: 29px; }
  .portal .header-right { grid-column: 2; justify-self: end; }
  .portal .languageMenu { right: 0; left: auto; transform-origin: top right; }
  .portal main.siteWrap { padding-inline: 13px; }
  .portal #portalRefresh { font-size: 12px; }
  #entryDialog { padding: 16px; }
  #entryDialog #avatars { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 440px) { .message-columns .chat-panel + .chat-panel { margin-top: 8px; } }

#inviteBtn { --control-art: url("/assets/sketch/icon-invite.png?v=69"); }
.round-break {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(5px, 1vw, 14px);
  padding: 12px;
  background: #fffdf6;
  color: #4b3422;
  text-align: center;
}
.round-break h2 { margin: 0; font-size: clamp(20px, 3vw, 42px); line-height: 1; }
.round-break p { margin: 0; color: #6c5644; }
.round-break img { width: clamp(90px, 19vw, 220px); max-height: 24vh; object-fit: contain; }
#breakAnswer { font-weight: 750; }

.player-portrait { position: relative; display: block; flex: none; }
.player-portrait img { display: block; }
.player-portrait[data-place]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: clamp(10px, 1.2vw, 18px);
  aspect-ratio: 1;
  border: 2px solid #fff7e5;
  border-radius: 50%;
  background: var(--place-color);
}
.player-portrait[data-place="1"] { --place-color: #efba50; }
.player-portrait[data-place="2"] { --place-color: #aeb8ba; }
.player-portrait[data-place="3"] { --place-color: #b6784e; }

.game-room:not(.show-results) .players-panel {
  border: 2px solid #4b3422;
  border-radius: 12px;
  box-shadow: 0 4px #4b3422;
  background: #fff9ed;
}
.game-room:not(.show-results) #playersTitle {
  min-height: 56px;
  padding: 10px 14px;
  border-bottom: 2px solid #d7b985;
  background: #f5e4bf;
  font-weight: 900;
}
#playersTitle img { width: 29px; height: 29px; }
#footerCount {
  padding: 2px 9px;
  border: 1px solid #b59970;
  border-radius: 6px;
  background: #fff9ed;
  font-variant-numeric: tabular-nums;
}
.game-room:not(.show-results) .players-list { padding: 8px; }
.game-room:not(.show-results) .player {
  border: 1px solid #e1cfb2;
  border-radius: 8px;
  background: #fffdf7;
  padding-inline: 10px;
}
.game-room:not(.show-results) .player + .player { margin-top: 6px; }
.game-room:not(.show-results) .player.featured {
  border-color: #83a997;
  box-shadow: inset 3px 0 #568577;
  background: #e0efe5;
}
@media (max-width: 720px) {
  .game-room:not(.show-results) .players-list { gap: 6px; }
  .game-room:not(.show-results) .player + .player { margin-top: 0; }
}
@media (min-width: 1000px) {
  .board-panel:not(.guesser) {
    display: grid;
    grid-template-columns: 143px minmax(0,1fr);
    grid-template-areas: "round round" "toolbox canvas" "progress progress";
  }
  .board-panel:not(.guesser) .round-bar { grid-area: round; }
  .board-panel:not(.guesser) .canvas-wrap { grid-area: canvas; display: grid; align-items: center; }
  .board-panel:not(.guesser) .turn-progress { grid-area: progress; }
  .board-panel:not(.guesser) .drawing-controls {
    grid-area: toolbox;
    container-type: normal;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 9px;
    border-block: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: #f7ead2;
  }
  .drawing-controls .tools { display: contents; }
  .drawing-controls .tool-buttons { order: 0; }
  .drawing-controls .history-tools { order: 1; }
  .drawing-controls .palette-row { order: 2; margin: 0; }
  .drawing-controls .tool-buttons, .drawing-controls .history-tools { flex-wrap: wrap; margin-left: 0; gap: 5px; }
  .drawing-controls .tools button { width: 35px; height: 34px; }
  .drawing-controls .tools img { width: 26px; height: 26px; }
  .drawing-controls .brush-settings { display: grid; order: 3; }
  .drawing-controls .size-control { grid-template-columns: 1fr auto; }
  .drawing-controls .size-control input { grid-column: 1 / -1; grid-row: 2; }
  .drawing-controls .size-control output { grid-column: 2; grid-row: 1; padding-inline: 4px; }
  .game-room .drawing-controls .colors-all { grid-template-columns: repeat(6,minmax(0,1fr)); width: 100%; gap: 3px; }
  .drawing-controls .custom-color { margin-top: 3px; }
}

@media (max-width: 480px) {
  .drawing-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .drawing-controls .tools { display: contents; }
  .drawing-controls .tool-buttons { order: 0; }
  .drawing-controls .history-tools { order: 1; margin-left: 0; }
  .drawing-controls .palette-row { order: 2; margin: 0; }
  .drawing-controls .brush-settings { order: 3; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .drawing-controls .size-control { grid-template-columns: minmax(0,1fr) auto; }
  .drawing-controls .size-control input { grid-column: 1 / -1; grid-row: 2; }
  .drawing-controls .size-control output { grid-column: 2; grid-row: 1; padding-inline: 4px; }
}

.player-portrait[data-status]::before {
  content: "";
  position: absolute;
  left: -4px;
  bottom: 1px;
  width: clamp(17px,1.8vw,24px);
  aspect-ratio: 1;
  border: 2px solid #fff7e5;
  border-radius: 50%;
}
.player-portrait[data-status=drawing]::before {
  background: #fff7e5 url("/assets/sketch/icon-pencil-cozy.png?v=1") center / contain no-repeat;
}
.player-portrait[data-status=correct]::before {
  background: #36745a;
}
.player-portrait[data-status=correct] img {
  outline: 2px solid #5d9c7d;
  outline-offset: 1px;
  border-radius: 50%;
}

#guessForm #guessInput {
  min-width: 0;
  padding-inline-start: 36px;
  border-color: #927754;
  background: #fffdf8 url("/assets/sketch/icon-pencil-cozy.png?v=1") 8px center / 21px 21px no-repeat;
}
#guessForm #guessInput:disabled {
  border-color: #c6b79b;
  background-color: #f4efe3;
  color: #625d54;
}

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid #9bbaa7;
  border-radius: 8px;
  background: #e2eee4;
}
.avatar-preview img { width: 64px; height: 64px; object-fit: contain; }
#entryDialog #avatars {
  padding: 3px 3px 7px;
  max-height: min(420px, 50dvh);
  overflow-y: auto;
  scrollbar-width: thin;
}

body.portal, body.in-room { background: #d6bb95 url('/assets/sketch/cozy-doodles.png') repeat; background-size: 520px; }
#lobbyTrail { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.site-header { position: relative; z-index: 2; }
main.siteWrap { position: relative; z-index: 1; }
#entryDialog { width: min(600px,calc(100% - 28px)); }
#entryDialog .entry-layout { display: block; }
#sketchAccount { position: relative; }
.portal #sketchAccount { grid-column: 3; grid-row: 1; justify-self: end; }
#sketchAccount summary, #sketchAccount .signInButton { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 12px; color: #392c22; border: 2px solid #4b3422; border-radius: 8px; background: #fff2d8; box-shadow: 0 3px #4b3422; cursor: pointer; font-weight: 850; }
#sketchAccount summary img { width: 30px; height: 30px; object-fit: contain; }
#sketchAccount .accountMenu { right: 0; z-index: 5; width: min(280px,80vw); color: #392c22; }
.sketch-account-portrait { display: block; width: 70px; height: 70px; object-fit: contain; margin: 8px auto; }
#sketchSignIn { border: 2px solid #4b3422; border-radius: 12px; background: #fff8e9; }
.sketch-auth-options { display: grid; gap: 10px; margin: 15px 0; }
.sketch-auth-options a { display: flex; gap: 10px; align-items: center; padding: 10px; border: 2px solid #4b3422; border-radius: 8px; color: #392c22; text-decoration: none; font-weight: 800; }
.sketch-auth-options img { width: 20px; height: 20px; object-fit: contain; }
.sketch-more { margin-top: 22px; max-width: 520px; padding: 22px; border: 2px solid #4b3422; border-radius: 12px; background: #fff8e9; box-shadow: 0 5px #946f4c; }
.sketch-more > small { color: #955632; font-weight: 850; letter-spacing: .08em; }
.sketch-more h2 { margin: 4px 0; }
.sketch-more p { margin: 6px 0 14px; }
.sketch-more a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-top: 10px; border: 2px solid #674a30; border-radius: 8px; box-shadow: 0 3px #674a30; text-decoration: none; color: #392c22; background: #f8eacd; }
.sketch-more a:nth-of-type(2) { background: #e4eddc; }
.sketch-more a:nth-of-type(3) { background: #e9e8d8; }
.sketch-more a strong, .sketch-more a small { display: block; }
.sketch-more a b { border: 1px solid #927454; border-radius: 50%; padding: 3px 8px; background: #fff8e9; }
.sketch-reference-icon::before { content: ''; display: block; width: 26px; height: 26px; background: #58402e; mask: var(--sketch-icon) center / contain no-repeat; }
.sketch-reference-play { --sketch-icon: url('/assets/sketch/ref-play.svg'); }
.sketch-reference-rooms { --sketch-icon: url('/assets/sketch/ref-rooms.svg'); }
@media(max-width:620px) {
  .portal .site-header { grid-template-columns: minmax(0,1fr) auto auto; }
  .portal .brand { font-size: clamp(17px,5vw,26px); }
  .portal #sketchAccount { grid-column: 3; }
  #sketchAccount summary, #sketchAccount .signInButton { font-size: 12px; padding-inline: 6px; }
}

@font-face {
  font-family: Sketch tools;
  src: url('/assets/sketch/ref-tools.woff2') format('woff2');
  font-display: block;
}
#inviteBtn { --tool-glyph: "\e927"; }
#openRules { --tool-glyph: "\e92e"; }
#leaveRoom { --tool-glyph: "\e940"; }
[data-tool="pencil"] { --tool-glyph: "\e930"; }
[data-tool="eraser"] { --tool-glyph: "\e920"; }
[data-tool="fill"] { --tool-glyph: "\e91f"; }
[data-tool="eyedropper"] { --tool-glyph: "\e928"; }
#undoBtn { --tool-glyph: "\e93d"; }
#redoBtn { --tool-glyph: "\e939"; }
#clearBtn { --tool-glyph: "\e934"; }
:is(#inviteBtn,#openRules,#leaveRoom,[data-tool="pencil"],[data-tool="eraser"],[data-tool="fill"],[data-tool="eyedropper"],#undoBtn,#redoBtn,#clearBtn)::before {
  content: var(--tool-glyph) / "";
  display: grid;
  place-items: center;
  background: none;
  font: 22px/1 Sketch tools;
  color: #563d2b;
}
:is([data-tool="pencil"],[data-tool="eraser"],[data-tool="fill"],[data-tool="eyedropper"],#undoBtn,#redoBtn,#clearBtn) img { display: none; }
/* The source menu illustrations are opaque; use their outline glyphs at this size. */
.sketch-reference-icon::before {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: none;
  mask: none;
  color: #563d2b;
  font: 23px/1 Sketch tools;
}
.sketch-reference-play::before { content: "\e930"; }
.sketch-reference-rooms::before { content: "\e927"; }

.place-1::before {
  background: url('/assets/sketch/ref-laurel-left.svg') left center / auto 100% no-repeat,
              url('/assets/sketch/ref-laurel-right.svg') right center / auto 100% no-repeat;
}
#copyCodeBtn { --action-art: url('/assets/sketch/ref-copy-link.svg'); }
#ignorePlayer { --action-art: url('/assets/sketch/ref-ignore-player.svg'); }
#voteKick { --action-art: url('/assets/sketch/ref-vote-player.svg'); }
#themeDialog form button { font-size: 0; --action-art: url('/assets/sketch/ref-go-back.svg'); }
:is(#copyCodeBtn,#ignorePlayer,#voteKick,#themeDialog form button)::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1.15em;
  margin-inline-end: .45em;
  vertical-align: -.2em;
  background: var(--action-art) center / contain no-repeat;
}

#themeDialog form button::before {
  width: 18px;
  height: 18px;
  margin: 0;
}

#sketchAccount { display: flex; align-items: center; gap: 8px; }
#sketchAccount .notificationButton { position: relative; justify-content: center; width: 40px; padding: 5px; }
#sketchAccount .notificationButton img { width: 19px; height: 19px; }
#sketchAccount .notificationPanel { position: absolute; inset: calc(100% + 10px) 0 auto auto; width: min(320px,84vw); z-index: 5; color: #392c22; }
#sketchAccount .notificationItem { flex-wrap: wrap; }
#roomSound[aria-pressed=true]::before {
  content: "\e926" / "";
  display: grid;
  place-items: center;
  background: none;
  color: #563d2b;
  font: 22px/1 Sketch tools;
}

.sketch-waiting-doodle {
  width: 86px;
  height: 86px;
  background: url('/assets/sketch/ref-waiting.svg') 0 0 / 86px 344px no-repeat;
}


#sketchAccount .accountMenuAction {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
  padding: 9px;
  border: 1px solid #d8c3a4;
  border-radius: 4px;
  background: #fffdf6;
  color: #523a27;
  text-align: left;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 3px #3e2d20;
}
#sketchAccount .accountMenuAction:hover { background: #ffefd0; }
#sketchAccount .accountMenuAction img { width: 16px; height: 16px; }
@keyframes sketch-doodles-drift {
  from { background-position: 0 0; }
  to { background-position: 520px 0; }
}
body.portal:not(.hidden):not(.closing), body.in-room { animation: sketch-doodles-drift 48s linear infinite; }
@media(prefers-reduced-motion:reduce) { body.in-room { animation:none; } }
.portal .lobby { position:relative; }
.portal .sketch-more { align-self:start; width:100%; }
.sketch-more a { justify-content:initial; }
.sketch-more a > span { flex:1; }
#directoryJoinError:empty { display:none; }
#sketchAccount .sketch-account-portrait { padding:3px; }
@media(min-width:1120px) {
  .portal main.siteWrap { max-width:1954px; }
  .portal .lobby {
    --side-width: clamp(205px, calc((100% - 1236px) / 2), 335px);
    display:grid;
    grid-template-columns:var(--side-width) minmax(0,1fr) var(--side-width);
    column-gap:22px;
  }
  .portal .playPanel, .portal .tablesArea { grid-column:2; }
  .portal .sketch-more { grid-area:1 / 3 / span 2; margin-top:0; padding:clamp(12px,1.2vw,22px); }
}
@media(min-width:1120px) and (max-width:1550px) {
  .portal .sketch-more a { gap:7px; padding:9px; }
  .portal .sketch-more .moreGameArt { width:30px; height:30px; }
  .portal .sketch-more a b { padding:1px 5px; }
}

/* new close-up avatars fill their frame edge to edge (no padding ring) */
img[src*="/api/avatar/"] { padding: 0 !important; object-fit: cover !important; background: none !important; }
