/* The voice page on top of the website's stylesheet (site/styles.css): the
   states the plugin's scripts switch with classes, and the few pieces the
   website has no style for. */

/* The plugin's scripts hide and show with these classes. */
.dev-hidden {
  display: none !important;
}

body.connected .hiddenWhenConnected,
body:not(.connected) .connectedSec,
body:not(.connected) .statusLabel:not(.disconnected) {
  display: none;
}

/* No sky until oasis.js has chosen the hour's, so the stylesheet's default
   isn't fetched and shown first. */
html:not([data-sky]) body::before {
  background-image: none;
}

/* Nothing past the edition question until it's answered, then that edition's
   steps. The form shows for either. Once joined, the form stays for its Leave
   button. */
body:not(.connected):not(:has([name="edition"]:checked)) .for-edition,
body:not(:has([name="edition"][value="java"]:checked)) [data-edition="java"],
body:not(:has([name="edition"][value="bedrock"]:checked)) [data-edition="bedrock"] {
  display: none;
}

.edition {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}

.edition .choices {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.edition legend {
  font-size: 1.35rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--gold-shadow);
  margin-bottom: 12px;
}

.voice h1 {
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--gold-shadow);
  text-align: center;
}

.voice .panel-section ol {
  padding-left: 1.4em;
}

.voice .panel-section .hint {
  display: block;
}

/* A command to type, on its own line. Plain monospace, like the Play page's
   addresses: the pixel font is hard to read character by character. */
.command {
  margin: 8px 0 6px;
  padding: 10px 14px;
  background: var(--input);
  border: 2px solid var(--input-edge);
  white-space: pre-wrap;
}

.command code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 1rem;
}

.voice-form {
  margin-top: 20px;
}

/* The password with its show/hide button at its end. */
.password {
  display: flex;
}

.password input {
  flex: 1;
  min-width: 0;
}

.reveal {
  flex: none;
  width: 48px;
  background: var(--tile);
  border: 2px solid var(--input-edge);
  border-left: 0;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.reveal:hover {
  color: var(--gold);
}

.reveal svg {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto;
  fill: currentColor;
}

.reveal[aria-pressed="false"] .slash {
  display: none;
}

.join {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 20px;
}

.statusLabel {
  flex: 1;
  margin: 0;
  font-family: var(--pixel);
}

.statusLabel.connected {
  color: var(--accent);
}

.statusLabel.disconnected {
  color: var(--error);
}

.connectedSec {
  margin-top: 24px;
}

.talk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* Lit while the microphone picks up sound. */
.micActivityIndicator {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  filter: brightness(0.4);
}

.micActivityIndicator.active {
  filter: none;
}

.mc-button.muted {
  --button: #8a3030;
  --button-light: #b85050;
  --button-dark: #5a1d1d;
}

.mc-button.muted,
.mc-button.active {
  background: var(--button);
  box-shadow:
    inset 3px 3px 0 var(--button-light),
    inset -3px -4px 0 var(--button-dark);
}

.mc-button.active {
  --button: var(--badge);
  --button-light: var(--accent);
  --button-dark: var(--accent-deep);
}

.voice summary {
  font-family: var(--pixel);
  cursor: pointer;
  margin-bottom: 12px;
}

/* Full-screen push to talk: one large button over the page. */
.ptt-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--veil);
  -webkit-backdrop-filter: var(--frost);
  backdrop-filter: var(--frost);
}

.ptt-overlay.visible {
  display: flex;
}

body.fullscreen-ptt-active {
  overflow: hidden;
}

.ptt-hold {
  width: min(82vw, 540px);
  height: min(58vh, 540px);
  font-size: clamp(1.5rem, 5vw, 2.6rem);
}

/* A message from the plugin, such as a refused password, along the top. */
.alert {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  -webkit-backdrop-filter: var(--frost);
  backdrop-filter: var(--frost);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 0 #000000;
  padding: 12px 16px;
}

.alert p {
  flex: 1;
  margin: 0;
}

.credit {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0 16px 32px;
}
