/* Anchor the corner controls to the artwork, including letterboxed windows. */
#tts-shell {
  --home-table-width: max(1280px, min(100vw, 177.7778svh));
  --home-table-height: max(720px, min(100svh, 56.25vw));
}
.tts-home-corner {
  position: absolute; z-index: 2;
  top: max(6px, calc((100svh - var(--home-table-height)) / 2 + var(--home-table-height) * .007));
  right: max(18px, calc((100vw - var(--home-table-width)) / 2 + var(--home-table-width) * .02));
  width: min(380px, calc(100vw - 36px));
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
#tts-shell:not([data-view="home"]) .tts-home-corner { display: none; }
#tts-home-audio {
  position: static; width: 100%; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(0, 1fr);
  align-items: center; gap: 12px; padding: 10px 12px;
  background: linear-gradient(180deg, #102e47f7, #061728f7);
  border: 1px solid #ba9655; border-radius: 8px;
  box-shadow: inset 0 0 0 2px #243746, 0 3px 10px #0006;
}
#tts-shell:not([data-view="home"]) #tts-home-audio { display: none; }
#tts-home-audio .tts-home-audio-channel {
  display: grid; grid-template-columns: 54px 96px minmax(0, 1fr);
  align-items: center; column-gap: 8px; min-width: 0;
}
#tts-home-audio .tts-home-audio-channel + .tts-home-audio-channel {
  position: relative;
}
#tts-home-audio .tts-home-audio-channel + .tts-home-audio-channel::before {
  content: ''; position: absolute; left: 0; right: 0; top: -7px;
  height: 1px; background: #b590504d;
}
#tts-home-audio label {
  color: #f5ddb0; font: bold 15px/1 Georgia, 'Times New Roman', serif;
  text-transform: uppercase; letter-spacing: .015em;
}
#tts-home-audio output {
  display: block; margin-top: 5px; color: #d2e4ef;
  font: 12px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
#tts-home-audio input[type="range"] {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 32px; margin: 0; padding: 0;
  min-width: 0; background: transparent; border: 0; border-radius: 0;
  box-shadow: none; cursor: pointer;
}
#tts-home-audio input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border: 1px solid #a68145; border-radius: 5px;
  background: linear-gradient(to right, #c9a464 0 var(--volume-percent, 65%), #10283e var(--volume-percent, 65%) 100%);
  box-shadow: inset 0 1px 3px #0007;
}
#tts-home-audio input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  height: 22px; width: 14px; margin-top: -8px;
  border: 1px solid #edcf8b; border-radius: 3px;
  background: linear-gradient(90deg, #886b38, #f6dc9f 48%, #b89556);
  box-shadow: 0 1px 4px #000b;
}
#tts-home-audio input[type="range"]::-moz-range-track {
  height: 6px; border: 1px solid #a68145; border-radius: 5px; background: #10283e;
}
#tts-home-audio input[type="range"]::-moz-range-progress { height: 6px; border-radius: 5px; background: #c9a464; }
#tts-home-audio input[type="range"]::-moz-range-thumb {
  height: 20px; width: 12px; border: 1px solid #edcf8b; border-radius: 3px;
  background: linear-gradient(90deg, #886b38, #f6dc9f 48%, #b89556);
}
#tts-home-audio input[type="range"]:focus-visible {
  outline: 2px solid #fff0ad; outline-offset: 2px; border-radius: 4px;
}
@layer tts-controls {
  body.tts-edition #tts-home-audio .tts-plaque-button {
    --plaque-height: 36px; --plaque-type-ratio: .5;
    min-width: 0 !important; width: 96px; padding-inline: 9px !important;
  }
  body.tts-edition .tts-home-actions > .tts-plaque-button {
    --plaque-height: max(64px, min(4.65vw, 8.2667svh)); --plaque-type-ratio: .4;
    position: absolute; width: 27.7%; left: 69%; padding-inline: 20px !important;
  }
  body.tts-edition #tts-begin { --plaque-height: clamp(88px, 10vw, 112px); --plaque-type-ratio: .5; width: min(480px, calc(100vw - 64px)); }
  body.tts-edition #tts-begin:focus-visible { outline: none !important; filter: drop-shadow(0 3px 4px #0009) drop-shadow(0 0 9px #efc66480) !important; }
}
.tts-home-actions > .tts-plaque-button { width: 27.7%; left: 69%; }
.tts-home-actions .tts-solo { top: 26.6%; }
.tts-home-actions .tts-pvp { top: 37.3%; }
.tts-home-actions .tts-inspect { top: 48%; }
.tts-home-cgh { position: static; width: max(124px, min(9.6875vw, 17.2222svh)); display: block; }
.tts-home-cgh img { display: block; width: 100%; height: auto; }
.tts-home-cgh:focus-visible { outline: 3px solid #fff0ad; outline-offset: 3px; border-radius: 5px; }
#tts-shell:not([data-view="home"]) .tts-home-cgh { display: none; }
.tts-home-cleanup { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
/* Only expose bare wood beneath the live navigation, logo and audio panel. */
.tts-home-cleanup-nav { clip-path: inset(0 0 41.5% 67.5%); mask-image: linear-gradient(to right, transparent 67.5%, #000 68.7%), linear-gradient(to bottom, #000 57%, transparent 58.5%); mask-composite: intersect; }
.tts-begin-dialog { padding: 12px; border: 0; background: transparent; color: #f5ebd5; text-align: center; overflow: visible; }
.tts-begin-dialog::backdrop { background: transparent; backdrop-filter: none; }
.tts-begin-dialog:focus-visible { outline: none; }
.tts-begin-dialog[open] #tts-begin { animation: tts-begin-pulse 2.8s ease-in-out infinite; transform-origin: center; }
@keyframes tts-begin-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .tts-begin-dialog[open] #tts-begin { animation: none; transform: none; }
}
@media (max-width: 700px) {
  .tts-home-corner { width: min(360px, calc(100vw - 36px)); }
  #tts-home-audio .tts-home-audio-channel + .tts-home-audio-channel::before {
    left: 0; right: 0; top: -7px; bottom: auto; height: 1px; width: auto;
  }
}
