/* Fantasy Adventure — page-specific styles. Background comes from styles.css. */

:root {
  --fa-ink: #f4e6c8;
  --fa-muted: #c9b48a;
  --fa-deep: #1a120c;
  --fa-panel: rgba(22, 14, 10, 0.72);
  --fa-gold: #d4a017;
  --fa-gold-2: #8a5a12;
  --fa-hp: #b42318;
  --fa-hp-low: #7f1d1d;
}

html {
  height: 100%;
}

body {
  background: #000 !important;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* .bg-video-layer is the second playlist layer added by scripts/videos.js. */
#background-video,
.bg-video-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background-color: #000;
}

.page-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 230, 200, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(10, 6, 4, 0.3), rgba(10, 6, 4, 0.72));
}

#gameContainer {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(100%, 1400px);
  margin: 0 auto;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: clamp(0.4rem, 1.5vw, 1.25rem);
  background-color: var(--fa-panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--fa-ink);
}

.game-header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#gameContainer h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.15rem, 3.5vw, 2.1rem);
  color: var(--fa-ink);
  text-shadow: 0 1px 2px #000;
  line-height: 1.2;
}

.game-intro {
  flex: 0 0 auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 0.4rem;
  font-size: 0.85rem;
  color: var(--fa-ink);
}

.game-intro summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #3b2a10;
  background: rgba(244, 230, 200, 0.9);
  border: 1px solid var(--fa-gold);
  border-radius: 999px;
}

.game-intro summary::-webkit-details-marker { display: none; }

.game-intro[open] summary .intro-arrow { transform: rotate(180deg); }

.game-intro .intro-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.game-intro .intro-content {
  margin-top: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: rgba(244, 230, 200, 0.92);
  border: 1px solid rgba(212, 160, 23, 0.45);
  font-size: 0.85rem;
  line-height: 1.4;
  color: #3b2a10;
  text-align: left;
  max-height: 140px;
  overflow-y: auto;
}

#faHud {
  flex: 0 0 auto;
  margin: 0.25rem 0 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 160, 23, 0.35);
  text-align: left;
  font-size: 0.82rem;
}

.fa-hud-summary {
  display: none;
}

.fa-hud-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem 0.75rem;
}

.fa-hud-grid .fa-stat {
  min-width: 0;
}

.fa-hud-grid .fa-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fa-muted);
}

.fa-hud-grid .fa-value {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fa-ink);
}

.fa-hud-grid .fa-stat-wide { grid-column: span 2; }

.fa-hp-bar {
  margin-top: 0.2rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.fa-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #da3a2a, #f0c14b);
}

.fa-hp-fill.is-low { background: var(--fa-hp-low); }

#faPlay {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  border-radius: 16px;
  background: rgba(28, 18, 12, 0.82);
  border: 1px solid rgba(212, 160, 23, 0.28);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.fa-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  color: #fff8e7;
  background: linear-gradient(135deg, #5c3b12 0%, #8a5a12 55%, #d4a017 100%);
}

.fa-header .fa-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a120c;
  border: 2px solid rgba(255, 255, 255, 0.85);
  font-size: 1.2rem;
}

.fa-header .fa-name { font-weight: 700; font-size: 1.05rem; }
.fa-header .fa-tag { font-size: 0.8rem; opacity: 0.9; }

.fa-mute {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.15s, border-color 0.15s;
}

.fa-mute:hover { background: rgba(255, 255, 255, 0.3); }

.fa-mute.is-muted {
  background: rgba(180, 35, 24, 0.5);
  border-color: rgba(255, 120, 120, 0.7);
  color: #ffe0e0;
}

.fa-tts-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.fa-tts-controls[hidden] { display: none; }

.fa-tts-toggle,
.fa-tts-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.3rem 0.62rem;
  min-height: 30px;
  font: inherit;
  font-size: 0.78rem;
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.15s, border-color 0.15s;
}

.fa-tts-toggle:hover,
.fa-tts-settings:hover { background: rgba(255, 255, 255, 0.3); }

.fa-tts-toggle.is-on {
  background: rgba(42, 118, 70, 0.62);
  border-color: rgba(170, 240, 190, 0.8);
  color: #ecfff1;
}

.fa-tts-toggle.is-muted {
  background: rgba(180, 35, 24, 0.36);
  border-color: rgba(255, 165, 145, 0.7);
  color: #ffe0e0;
}

#faTtsIcon {
  position: relative;
  width: 0.92rem;
  height: 0.7rem;
  border: 1px solid currentColor;
  border-radius: 0.28rem;
}

#faTtsIcon::after {
  content: "";
  position: absolute;
  left: 0.12rem;
  bottom: -0.22rem;
  width: 0.26rem;
  height: 0.26rem;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  background: inherit;
  transform: skewY(-35deg);
}

.fa-tts-settings {
  width: 32px;
  padding-inline: 0.35rem;
  font-size: 0.66rem;
}

.fa-tts-settings::before {
  content: "\2699";
  font-size: 0.82rem;
  line-height: 1;
}

.fa-tts-panel[hidden] { display: none; }

.fa-tts-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.fa-tts-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}

.fa-tts-dialog {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 2rem));
  padding: 0.85rem;
  color: #2a1c10;
  background: #fff8e7;
  border: 1px solid #d4a017;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.fa-tts-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.fa-tts-dialog h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

#faTtsClose {
  width: 32px;
  height: 32px;
  color: #3b2a10;
  background: #f7ecd4;
  border: 1px solid #d4a017;
  border-radius: 999px;
  cursor: pointer;
}

.fa-tts-dialog label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.fa-tts-select-wrap {
  position: relative;
}

.fa-tts-select-wrap::after {
  content: "\25be";
  position: absolute;
  top: 50%;
  right: 0.7rem;
  color: #5c3b12;
  pointer-events: none;
  transform: translateY(-50%);
}

#faTtsVoice {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 38px;
  padding: 0.45rem 2rem 0.45rem 0.55rem;
  color: #2a1c10;
  background: #fffdf6;
  border: 1px solid #d4a017;
  border-radius: 7px;
}

.fa-tts-preview-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.7rem;
}

#faTtsPreview {
  flex: 0 0 auto;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-weight: 700;
  color: #fff8e7;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #8a5a12 0%, #d4a017 100%);
}

#faTtsPreview:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#faTtsStatus {
  min-width: 0;
  font-size: 0.78rem;
  color: #5c3b12;
}

.fa-reset {
  margin-left: 0.35rem;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.16);
}

.fa-reset:hover { background: rgba(255, 255, 255, 0.3); }

.fa-messages-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#faMessages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.9rem;
  background: rgba(42, 28, 16, 0.45);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.fa-scroll-bottom {
  position: absolute;
  bottom: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8a5a12 0%, #d4a017 100%);
  color: #fff8e7;
  border: 1px solid rgba(255, 235, 180, 0.75);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  padding: 0;
  margin: 0;
}

.fa-scroll-bottom.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fa-scroll-bottom:hover {
  background: linear-gradient(135deg, #a16b17 0%, #e5b026 100%);
  transform: translateY(-2px);
}

.fa-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.fa-row.user { flex-direction: row-reverse; }

.fa-row.system {
  justify-content: center;
}

.fa-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d4a017;
  background: #fff;
}

.fa-avatar-dm {
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: #1a120c;
  color: #f4e6c8;
}

.fa-bubble {
  max-width: min(78%, 60ch);
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
  color: #2a1c10;
  background: #f7ecd4;
  border: 1px solid #d4a017;
}

.fa-row.user .fa-bubble {
  color: #fff8e7;
  border-color: transparent;
  background: linear-gradient(135deg, #8a5a12 0%, #d4a017 100%);
}

.fa-row.system .fa-bubble {
  max-width: 90%;
  font-size: 0.9rem;
  color: #f4e6c8;
  background: rgba(0, 0, 0, 0.35);
  border-style: dashed;
}

#faCombat {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0.55rem 0.9rem;
  background: rgba(90, 18, 18, 0.55);
  border-top: 1px solid rgba(212, 160, 23, 0.3);
}

#faCombat[hidden] { display: none !important; }

#faMonster {
  flex: 1 1 100%;
  font-size: 0.9rem;
  color: #f4e6c8;
}

#faActions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem 0;
}

#faActions[hidden] { display: none !important; }

#faCombat button,
#faChoices button,
#faActions button,
#faSaveRow button,
#faSend {
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: #3b2a10;
  background: #f7ecd4;
  border: 1px solid #d4a017;
  border-radius: 999px;
}

#faCombat button:hover,
#faChoices button:hover,
#faSaveRow button:hover { background: #fff6e0; }

#faCombat button:disabled,
#faChoices button:disabled,
#faActions button:disabled,
#faSend:disabled,
#faInput:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#faSave {
  flex: 0 0 auto;
  padding: 0 0.9rem 0.6rem;
  font-size: 0.82rem;
  color: #f4e6c8;
}

#faSave > summary {
  cursor: pointer;
  padding: 0.35rem 0;
  color: #e8d49a;
  list-style: none;
}

#faSave > summary::-webkit-details-marker { display: none; }
#faSave > summary::before { content: "\25B8  "; }
#faSave[open] > summary::before { content: "\25BE  "; }
#faSave > summary:hover { color: #fff6e0; }

#faSaveNote {
  margin: 0.2rem 0 0.45rem;
  line-height: 1.45;
  color: #d9c7a0;
}

#faSaveCode {
  display: block;
  width: 100%;
  padding: 0.4rem 0.5rem;
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  word-break: break-all;
  color: #3b2a10;
  background: #fffdf6;
  border: 1px solid #d4a017;
  border-radius: 6px;
  resize: vertical;
}

#faSaveRow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.45rem;
}

#faSaveMsg {
  font-size: 0.78rem;
  color: #d9c7a0;
}

#faSaveMsg.is-bad { color: #ffb3a7; }
#faSaveMsg.is-good { color: #b6e3a0; }

.fa-savebox { max-width: 100%; }

.fa-savecode {
  display: block;
  width: 100%;
  margin: 0.45rem 0;
  padding: 0.4rem 0.5rem;
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  word-break: break-all;
  color: #3b2a10;
  background: #fffdf6;
  border: 1px solid #d4a017;
  border-radius: 6px;
  resize: vertical;
}

.fa-savecopy {
  padding: 0.3rem 0.8rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  color: #3b2a10;
  background: #f7ecd4;
  border: 1px solid #d4a017;
  border-radius: 999px;
}

.fa-savecopy:hover { background: #fff6e0; }

#faActions #faPotion,
#faActions #faPotion2 {
  border-color: #7bbf6a;
  background: #eaf7e4;
  color: #24401c;
}

#faActions #faPotion:hover,
#faActions #faPotion2:hover { background: #f5fff0; }

#faChoices {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0.9rem 0.6rem;
}

#faForm {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem 0.8rem;
  border-top: 1px solid rgba(212, 160, 23, 0.25);
  background: rgba(0, 0, 0, 0.25);
}

#faInput {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  font: inherit;
  border-radius: 999px;
  border: 1px solid #d4a017;
  background: #f7ecd4;
  color: #2a1c10;
}

#faInput:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.28);
}

#faSend {
  font-weight: 600;
  color: #fff8e7;
  border: 0;
  background: linear-gradient(135deg, #8a5a12 0%, #d4a017 100%);
}

.fa-typing {
  display: inline-flex;
  gap: 4px;
  padding: 2px 0;
}

.fa-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4a017;
  animation: faBlink 1.2s infinite ease-in-out;
}

.fa-typing span:nth-child(2) { animation-delay: 0.2s; }
.fa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes faBlink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .fa-typing span { animation: none; }
}

@media (max-width: 900px) {
  .fa-hud-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fa-hud-grid .fa-stat-wide { grid-column: span 2; }
}

@media (max-width: 767px) {
  body {
    padding: 0 !important;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    background-attachment: scroll;
  }

  #gameContainer {
    padding: 0.25rem 0.35rem 0.35rem;
    width: 100%;
    height: calc(100dvh - 76px);
    max-height: calc(100dvh - 76px);
    margin-bottom: 76px;
  }

  .game-header {
    margin-bottom: 0.1rem;
  }

  #gameContainer h1 {
    font-size: 0.95rem;
    margin: 0 0 0.1rem;
    line-height: 1.1;
  }

  .game-intro {
    margin: 0 auto 0.12rem;
    font-size: 0.72rem;
  }

  .game-intro summary {
    padding: 0.12rem 0.45rem;
    font-size: 0.68rem;
  }

  .game-intro .intro-content {
    max-height: 80px;
    font-size: 0.72rem;
    padding: 0.3rem 0.45rem;
  }

  /* Compact HUD on Mobile */
  #faHud {
    margin: 0.1rem 0 0.25rem;
    padding: 0.25rem 0.45rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(212, 160, 23, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .fa-hud-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    width: 100%;
    cursor: pointer;
    font-size: 0.75rem;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .fa-summary-item {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    min-width: 0;
  }

  .fa-summary-label {
    font-size: 0.62rem;
    color: var(--fa-muted);
    text-transform: uppercase;
    font-weight: 600;
  }

  .fa-summary-val {
    font-weight: 700;
    color: var(--fa-ink);
    font-size: 0.75rem;
  }

  .fa-summary-hp {
    flex: 0 0 auto;
  }

  .fa-hp-bar-sm {
    width: 34px;
    height: 6px;
    margin: 0 0 0 0.2rem;
    display: inline-block;
    vertical-align: middle;
  }

  .fa-summary-gear {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fa-summary-gear .fa-summary-val {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
  }

  .fa-summary-toggle {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: rgba(212, 160, 23, 0.25);
    border: 1px solid rgba(212, 160, 23, 0.4);
    color: var(--fa-ink);
    font-size: 0.65rem;
    flex: 0 0 auto;
  }

  .fa-toggle-arrow {
    transition: transform 0.2s ease;
    font-size: 0.6rem;
    display: inline-block;
  }

  .fa-hud-summary.is-expanded .fa-toggle-arrow {
    transform: rotate(180deg);
  }

  .fa-hud-grid {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.2rem 0.45rem;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(212, 160, 23, 0.25);
    font-size: 0.72rem;
  }

  .fa-hud-grid.is-expanded {
    display: grid;
  }

  .fa-hud-grid .fa-stat-wide {
    grid-column: span 2;
  }

  .fa-hud-grid .fa-label {
    font-size: 0.58rem;
  }

  .fa-hud-grid .fa-value {
    font-size: 0.7rem;
  }

  /* Play area takes max height */
  #faPlay {
    flex: 1 1 0;
    min-height: 0;
    border-radius: 10px;
  }

  .fa-header {
    padding: 0.3rem 0.5rem;
    gap: 0.35rem;
  }

  .fa-header .fa-mark {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    border-width: 1.5px;
  }

  .fa-header .fa-name {
    font-size: 0.85rem;
  }

  .fa-header .fa-tag {
    display: none;
  }

  .fa-mute,
  .fa-tts-toggle,
  .fa-tts-settings,
  .fa-reset {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    gap: 0.2rem;
  }

  .fa-tts-settings {
    width: 28px;
    padding-inline: 0.25rem;
  }

  .fa-mute-text,
  .fa-tts-text,
  .fa-tts-settings span {
    display: none;
  }

  .fa-tts-panel {
    align-items: end;
    justify-items: stretch;
    padding: 0;
  }

  .fa-tts-dialog {
    width: 100%;
    max-height: 45vh;
    overflow-y: auto;
    padding: 0.75rem;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 12px 12px 0 0;
  }

  .fa-tts-dialog h2 {
    font-size: 0.95rem;
  }

  .fa-tts-preview-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  #faMessages {
    flex: 1 1 0;
    min-height: 0;
    padding: 0.45rem 0.55rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .fa-row {
    margin-bottom: 0.4rem;
    gap: 0.3rem;
  }

  .fa-avatar {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
  }

  .fa-avatar-dm {
    font-size: 0.8rem;
  }

  .fa-bubble {
    max-width: 90%;
    padding: 0.4rem 0.55rem;
    font-size: 0.88rem;
    line-height: 1.35;
    border-radius: 10px;
  }

  .fa-row.system .fa-bubble {
    font-size: 0.8rem;
    padding: 0.3rem 0.45rem;
    max-width: 96%;
  }

  #faCombat {
    padding: 0.3rem 0.5rem;
    gap: 0.25rem;
  }

  #faMonster {
    font-size: 0.8rem;
  }

  #faCombat button,
  #faChoices button,
  #faActions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  #faActions {
    padding: 0.25rem 0.5rem 0;
  }

  #faChoices {
    padding: 0.25rem 0.5rem;
    gap: 0.3rem;
    max-height: 110px;
    overflow-y: auto;
  }

  #faForm {
    padding: 0.3rem 0.45rem 0.35rem;
    gap: 0.3rem;
  }

  #faInput {
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
  }

  #faSend {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
  }

  #faSave {
    padding: 0 0.5rem 0.25rem;
    font-size: 0.7rem;
  }

  #faSave > summary {
    padding: 0.15rem 0;
  }
}
