.code-input {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.room-top h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.connection {
  padding: 7px 12px;
  border-radius: 999px;
  color: #9ee8cc;
  background: rgba(69, 211, 154, 0.12);
  font-size: 0.8rem;
  font-weight: 800;
}

.host-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.score-settings {
  display: flex;
  align-items: end;
  gap: 10px;
}

.score-settings .tool-field {
  max-width: 130px;
}

.buzz-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.buzz-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--tool-line);
  border-radius: 12px;
  background: var(--tool-panel-2);
}

.buzz-order {
  font-size: 1.2rem;
  font-weight: 900;
}

.buzz-meta {
  color: var(--tool-muted);
  font-size: 0.8rem;
}

.judge-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 6px;
}

.judge-actions .tool-button {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 0.78rem;
}

.judge-score {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--tool-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.judge-score .tool-input {
  width: 110px;
  min-height: 38px;
  padding: 6px 9px;
}

.judged {
  opacity: 0.68;
}

.score-row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--tool-line);
}

.score-row:last-child {
  border-bottom: 0;
}

.score-number {
  font-size: 1.25rem;
  font-weight: 900;
}

.score-controls {
  display: flex;
  gap: 4px;
}

.score-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--tool-line);
  border-radius: 8px;
  color: var(--tool-text);
  background: transparent;
  cursor: pointer;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
  gap: 18px;
}

.buzzer-button {
  min-height: 520px;
  border: 10px solid rgba(255, 255, 255, 0.08);
  border-radius: 48px;
  color: #fff;
  background: radial-gradient(circle at 50% 35%, #ff7a88, #d62d49 58%, #71172b);
  box-shadow:
    inset 0 -24px 0 rgba(0, 0, 0, 0.18),
    0 30px 80px rgba(214, 45, 73, 0.28);
  cursor: pointer;
  touch-action: manipulation;
}

.buzzer-button:active:not(:disabled) {
  transform: translateY(10px);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.18);
}

.buzzer-button:disabled {
  opacity: 0.68;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

.buzzer-button span {
  display: block;
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.buzzer-button small {
  font-size: 1rem;
  font-weight: 800;
}

.buzzer-button.buzzed {
  background: radial-gradient(circle at 50% 35%, #7f8cff, #4754d8 58%, #222b77);
}

.player-score-panel {
  display: flex;
  flex-direction: column;
}

.player-score-panel #player-scoreboard {
  flex: 1;
}

.player-score-panel #leave-room {
  margin-top: 20px;
}

.room-identity {
  display: flex;
  align-items: center;
  gap: 28px;
}

.room-code-box {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  min-width: 300px;
  padding: 16px 20px;
  border: 1px solid rgba(116, 130, 255, 0.45);
  border-radius: 16px;
  background: rgba(116, 130, 255, 0.11);
  column-gap: 14px;
}

.room-code-box span {
  grid-column: 1 / -1;
  color: var(--tool-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.room-code-box strong {
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: 0.16em;
}

.room-code-box button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--tool-line);
  border-radius: 9px;
  color: var(--tool-text);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

#message {
  min-height: 28px;
  margin: 18px 0;
  color: #ffc1c8;
  font-weight: 700;
}

/* ライトテーマ時の部品表示を調整 */
body[data-theme="light"] .connection {
  color: #116b4d;
  background: rgba(22, 132, 94, 0.1);
}

body[data-theme="light"] .score-controls button,
body[data-theme="light"] .room-code-box button {
  color: var(--tool-text);
  background: #fff;
}

body[data-theme="light"] .room-code-box {
  background: rgba(88, 101, 242, 0.08);
}

@media (max-width: 760px) {
  .host-actions,
  .score-settings {
    align-items: stretch;
    flex-direction: column;
  }

  .score-settings .tool-field {
    max-width: none;
  }

  .player-layout {
    grid-template-columns: 1fr;
  }

  .buzzer-button {
    min-height: 58vh;
    border-radius: 34px;
  }

  .score-row {
    grid-template-columns: 32px 1fr auto;
  }

  .score-controls {
    grid-column: 2 / -1;
  }

  .judge-actions {
    flex-wrap: wrap;
  }

  .room-top {
    align-items: stretch;
    flex-direction: column;
  }

  .room-identity {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .room-code-box {
    width: 100%;
    min-width: 0;
  }

  .room-code-box strong {
    font-size: 2.4rem;
  }
}
