.room-heading,
.room-tools,
.lobby-bar,
.toolbar,
.turn-meta,
.team-panel header,
.bench,
.launch,
.turn-actions,
.side-title,
.file-row,
.role-buttons,
.score,
.member,
.side-tools,
.spectators,
.voice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-heading,
.lobby-bar,
.bench,
.launch,
.turn-meta,
.side-title {
  justify-content: space-between;
}
.room-heading {
  margin: 0 0 16px;
  align-items: flex-end;
}
.room-kicker,
.room-code small,
.role-label small,
.member small,
.spectators,
.team-panel header > span:last-child {
  font-size: 13px;
  color: var(--sub);
}
.room-kicker {
  display: none;
}
.disconnected .room-kicker {
  display: block;
  color: #a14d00;
}
.disconnected .turn-actions,
.disconnected .board {
  pointer-events: none;
  opacity: 0.65;
}
.room-code {
  display: grid;
  padding: 0 8px;
  line-height: 1.2;
}
.room-code strong {
  font-size: 16px;
  letter-spacing: 0.07em;
  color: var(--text);
  font-weight: 550;
  user-select: all;
}
.lobby-bar {
  margin-bottom: 12px;
}
.toolbar,
.role-buttons,
.turn-actions,
.side-tools,
.spectators,
.dialog-actions {
  flex-wrap: wrap;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.team-grid.n3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.red {
  --team: #d94553;
  --tint: #fff1f1;
}
.blue {
  --team: #4b88dc;
  --tint: #edf4fd;
}
.green {
  --team: #368e61;
  --tint: #eaf5ed;
}
.neutral {
  --team: #c0a785;
  --tint: #faf6ed;
}
.black {
  --team: #26272c;
  --tint: #e9e9eb;
}
.team-panel,
.bench,
.launch,
.side-panel,
.turn-banner {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.team-panel {
  min-width: 0;
  padding: 16px;
}
.team-panel header > span:last-child {
  margin-left: auto;
}
.team-symbol {
  color: var(--team, var(--sub));
  font-weight: 600;
  font-size: 0.83em;
}
.team-panel ul,
.side-panel ul,
.history ol {
  padding: 0;
  margin: 0;
  list-style: none;
}
.empty-team {
  color: var(--sub);
  font-size: 14px;
  margin-top: 14px;
}
.member {
  margin-top: 10px;
  min-width: 0;
}
.member > span:nth-child(2) {
  display: grid;
  min-width: 0;
}
.member b {
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.member b small {
  font-size: 12px;
  font-weight: 400;
}
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid var(--team, #ddd);
  border-radius: 50%;
  background: var(--tint, var(--weak));
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}
.offline {
  opacity: 0.65;
}
.member-more {
  margin-left: auto;
  min-width: 32px;
  min-height: 32px;
  border: 0;
  background: none;
  color: var(--sub);
  font-weight: 600;
}
.role-buttons:not(:empty) {
  margin-top: 12px;
}
.bench,
.launch {
  margin-top: 12px;
  padding: 14px 16px;
}
.spectators {
  margin-top: 4px;
}
.launch > span,
.voice-bar,
.guidance {
  color: var(--sub);
  font-size: 14px;
}
.launch i {
  font-style: normal;
}
.guidance {
  margin-top: 8px;
}
.voice-bar {
  justify-content: flex-end;
  margin-top: 12px;
}
.desk {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 2.05fr);
  grid-template-areas: "seats game";
  gap: 16px;
  align-items: start;
}
.play-area {
  grid-area: game;
  min-width: 0;
}
.turn-banner {
  padding: 16px;
}
.turn-meta {
  font-size: 14px;
  color: var(--sub);
  margin-bottom: 4px;
}
.turn-banner h2 {
  font-size: 24px;
  line-height: 32px;
}
.turn-banner p {
  margin-top: 3px;
  font-size: 14px;
  line-height: 21px;
}
.turn-actions:not(:empty) {
  margin-top: 12px;
}
#clock {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
#clue-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
#clue-form input {
  flex: 1 1 120px;
  min-width: 0;
}
#clue-form select {
  width: 64px;
}
.clue-number {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--sub);
}
.score-row,
.solo-score {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.score,
.solo-score > span {
  flex: 1;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--weak);
  font-size: 14px;
}
.score.current {
  background: var(--tint);
}
.score b,
.solo-score b {
  margin-left: auto;
  color: var(--text);
  font-weight: 550;
}
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  background: #fff;
}
.board.size-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.word {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: clamp(60px, 6.1vw, 90px);
  padding: 11px 4px;
  border: 1px solid var(--team, #dedede);
  border-radius: 10px;
  background: var(--tint, #f7f7f7);
  color: #26272c;
  text-align: center;
  font-family: inherit;
  transition:
    background-color 0.12s,
    transform 0.12s;
}
.word:disabled {
  color: #26272c;
  opacity: 1;
}
.word:not(:disabled):hover {
  background: #f2f3f4;
  transform: translateY(-1px);
}
.word:not(:disabled):active {
  transform: translateY(1px);
}
.word.opened {
  background: var(--team);
  border-color: transparent;
  color: white;
}
.word.opened.neutral {
  color: #26272c;
}
.word.black.opened {
  outline: 1px solid #707074;
  outline-offset: -1px;
}
.word-text {
  font-size: clamp(0.8rem, 1.35vw, 1.13rem);
  font-weight: 550;
  line-height: 1.2;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.word-type {
  position: absolute;
  top: 4px;
  left: 6px;
  line-height: 1;
  font-size: 10px;
  color: var(--team);
}
.opened .word-type {
  color: inherit;
}
.mark-count {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 11px;
  line-height: 1.1;
  color: #414248;
}
.word.fresh {
  animation: flip 0.23s ease-out;
}
@keyframes flip {
  from {
    transform: scaleX(0.91);
    opacity: 0.7;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}
.side-panel {
  grid-area: seats;
  min-width: 0;
  padding: 16px;
}
.role-label {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.role-label > div {
  display: grid;
}
.role-label strong {
  font-size: 15px;
  font-weight: 550;
  color: var(--text);
}
.side-title {
  margin: 12px 0 8px;
}
.side-title > span {
  color: var(--sub);
  font-size: 14px;
}
.side-panel .team-panel {
  border: 0;
  border-radius: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.side-panel .team-panel h3 {
  font-size: 14px;
}
.side-panel .member {
  margin-top: 8px;
}
.side-details,
.side-tools {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 8px;
}
summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.history ol {
  max-height: 235px;
  overflow: auto;
  margin-top: 8px;
}
.history li {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
#settings {
  width: min(520px, calc(100% - 24px));
}
#settings form,
#settings fieldset {
  display: grid;
  gap: 12px;
}
#settings form {
  gap: 18px;
}
#settings fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
#settings legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 550;
  color: var(--text);
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.opt-field input,
.opt-field textarea,
.opt-field select {
  width: 100%;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.check input {
  accent-color: #779400;
  width: 16px;
  height: 16px;
}
.opt-detail {
  border-block: 1px solid var(--line);
  padding: 12px 0;
}
.opt-detail fieldset {
  margin: 14px 0 !important;
}
.opt-note,
.file-row small {
  color: var(--sub);
  font-size: 13px;
}
.file-label {
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
}
.file-label input {
  position: absolute;
  width: 1px;
  opacity: 0;
}
.file-label:focus-within {
  outline: 2px solid #335cff;
}
.dialog-actions {
  justify-content: flex-end;
  margin-top: 12px;
}
#choice p {
  margin-block: 12px;
  font-size: 14px;
}
@media (max-width: 820px) {
  .desk {
    grid-template-columns: 1fr;
    grid-template-areas: "game" "seats";
  }
  .side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .role-label,
  .side-title,
  .side-details,
  .side-tools {
    grid-column: 1/-1;
  }
  .side-title {
    margin: 0;
  }
}
@media (max-width: 620px) {
  .room-heading {
    align-items: center;
    gap: 5px;
  }
  .room-heading h1 {
    font-size: 22px;
    line-height: 28px;
  }
  .room-code {
    padding: 0;
  }
  .room-code small {
    font-size: 11px;
  }
  .room-code strong {
    font-size: 14px;
  }
  .room-tools > .btn {
    min-height: 32px;
    padding: 0 8px;
  }
  .team-grid,
  .team-grid.n3 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .lobby-bar {
    align-items: center;
    gap: 5px;
  }
  .toolbar {
    justify-content: flex-end;
    gap: 5px;
  }
  .toolbar .btn {
    font-size: 12px;
    min-height: 32px;
    padding: 0 7px;
  }
  .team-panel,
  .side-panel,
  .turn-banner {
    padding: 12px;
  }
  .bench,
  .launch {
    padding: 10px 12px;
  }
  .launch > span {
    font-size: 12px;
  }
  .score-row {
    gap: 4px;
    margin: 7px 0;
  }
  .score {
    padding: 5px 6px;
    font-size: 12px;
    gap: 4px;
  }
  .board {
    padding: 0;
    gap: 4px;
  }
  .word {
    min-height: 60px;
    border-radius: 7px;
    padding: 10px 2px;
  }
  .word-text {
    font-size: clamp(0.7rem, 2.8vw, 0.95rem);
  }
  .size-6 .word-text {
    font-size: clamp(0.65rem, 2.4vw, 0.85rem);
  }
  #clue-form {
    gap: 4px;
  }
  #clue-form input {
    flex-basis: 80px;
  }
  #clue-form select {
    width: 52px;
  }
  #clue-form .btn {
    padding: 0 8px;
  }
  .options-grid {
    gap: 8px;
  }
}
