/* 01: voice dialogs, dictionary, and mic button UI; managed only in 01/. */
:root {
  --game-title-height: calc(clamp(10px, 1.2dvmax, 16px) * 1.5 + clamp(6px, 1.2dvmin, 14px) + clamp(6px, 1.2dvmin, 14px));
}

#voskDownloadConsent {
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  margin: auto;
  padding: 22px;
  border: 1px solid #697174;
  border-radius: 8px;
  background: #24282a;
  color: #fff;
  font: 16px/1.6 system-ui, sans-serif;
  text-align: left;
}

#voskDownloadConsent::backdrop {
  background: #000b;
}

#voskDownloadConsent h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.35;
}

#voskDownloadConsent p {
  margin: 0 0 14px;
}

#voskDownloadConsent .voskConsentCheck {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
}

#voskDownloadConsent input {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 4px;
  accent-color: #c3d825;
}

#voskDownloadConsent .voskConsentActions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

#voskDownloadConsent button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #697174;
  border-radius: 4px;
  font: 700 15px/1.4 system-ui, sans-serif;
  background: #41484b;
  color: #fff;
  cursor: pointer;
}

#voskDownloadConsent #voskDownloadStart {
  flex: 1;
  background: #c3d825;
  color: #17252c;
}

#voskDownloadConsent button:disabled {
  opacity: 0.45;
  cursor: default;
}

.voice-log-dialog {
  box-sizing: border-box;
  width: min(720px, 96vw);
  max-height: 94dvh;
  margin: auto;
  padding: 14px;
  border: 1px solid #777;
  border-radius: 8px;
  background: #191b1d;
  color: #fff;
  font-family: Meiryo, sans-serif;
  overflow: auto;
}

.voice-log-dialog::backdrop {
  background: #000a;
}

.voice-log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.voice-log-heading h2 {
  font-size: 18px;
  margin: 0;
}

.voice-log-dialog button,
.voice-log-dialog input,
.voice-log-dialog select {
  font: inherit;
  box-sizing: border-box;
  min-width: 0;
}

.voice-log-dialog button,
.dictionary-file-label {
  padding: 6px 10px;
  border: 1px solid #666;
  border-radius: 4px;
  background: #303437;
  color: #fff;
  cursor: pointer;
}

#voiceLogClose {
  font-size: 20px;
  line-height: 1;
}

#hybridLog {
  height: min(24dvh, 160px);
  margin: 0 0 8px;
  padding: 8px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #080909;
  font: 11px/1.35 monospace;
}

.voice-log-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.voice-log-fields label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.voice-log-fields input,
.voice-log-fields select {
  width: 100%;
  padding: 5px;
  border: 1px solid #777;
  border-radius: 3px;
  background: #fff;
  color: #111;
  height: 33px;
}

.voice-log-submit {
  margin-top: 8px;
}

#registerReading {
  display: block;
  width: 100%;
  background: #d86700;
  border-color: #ff9b3b;
  min-height: 36px;
}

#dictionaryStatus {
  margin: 6px 0;
  font-size: 12px;
  min-height: 1.4em;
}

.dictionary-sharing {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}

.dictionary-management-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

#deleteDictionaryEntry {
  background: #1761a5;
  border-color: #5795cf;
}

#resetDictionary {
  background: #b72d2d;
  border-color: #ed7272;
}

.dictionary-manage-dialog {
  width: min(600px, 96vw);
}

#dictionaryEntries {
  max-height: 66dvh;
  overflow: auto;
}

.dictionary-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #454748;
}

.dictionary-entry span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.dictionary-entry button {
  flex-shrink: 0;
  background: #1761a5;
  border-color: #5795cf;
}

.dictionary-confirm-dialog {
  width: min(440px, 94vw);
  text-align: center;
}

#dictionaryConfirmMessage {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 10px 0 18px;
}

#dictionaryConfirmActions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

#dictionaryConfirmActions[hidden] {
  display: none;
}

#dictionaryConfirmActions button {
  min-width: 90px;
}

.dictionary-file-label {
  position: relative;
}

#importDictionary {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}

.dictionary-hint {
  font-size: 11px;
  color: #bbb;
  margin: 7px 0 0;
}

#voiceLogBtn {
  font: inherit;
  min-height: 28px;
}

body .game-info,
body .score-menu .game-title {
  box-sizing: border-box;
  height: var(--game-title-height);
  min-height: var(--game-title-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-block: 0;
}

body .game-info {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

body .game-info h1 {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body button[data-mic-active] {
  color: #fff;
}

body button[data-mic-active="true"] {
  background: #c3d825;
  border-color: #c3d825;
  color: #17252c;
  box-shadow: 0 0 12px #c3d82580;
}

body button[data-mic-active="true"] * {
  color: #17252c;
}

@media (max-height: 550px), (pointer: coarse) {
  :root {
    --game-title-height: calc(clamp(9px, 1.15dvmax, 12px) * 1.5 + 6px);
  }
}
