.trio-screen {
  display: grid;
  align-content: safe center;
  justify-items: center;
  padding: 16px;
  overflow: auto;
  background: linear-gradient(90deg, transparent, #17102375 40% 60%, transparent);
}
.trio-cockpit {
  width: min(100%, 560px);
  color: var(--paper);
  border: 2px solid #937293;
  border-top-color: #ffe0a8;
  background: #191427f5;
  padding: clamp(12px, 3vw, 22px);
  box-shadow: 0 0 0 3px #271c36, 0 8px #100d1f, 0 22px 50px #120d1ccc;
  font-family: var(--readable);
}
.trio-kicker {
  margin: 0 0 3px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .14em;
  font: 700 .76rem/1.2 ui-monospace, monospace;
}
.trio-cockpit h2, .trio-feedback h2 {
  color: var(--paper);
  margin: 0;
  font: 700 clamp(1.8rem, 5vw, 2.45rem)/1 var(--pixel);
}
.trio-cockpit header > p:last-child {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: .89rem;
  line-height: 1.35;
}
.trio-cockpit header > p strong {
  display: block;
  margin-bottom: 3px;
  color: var(--paper);
  font-size: 1.1rem;
}
.trio-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 2px solid #806083;
  background: #20192e;
  box-shadow: inset 0 3px #141122, 0 3px #100d1f;
}
.trio-platform {
  min-width: 0;
  padding: 8px 4px 5px;
  display: grid;
  justify-items: center;
  gap: 4px;
  background: linear-gradient(#221b37, #3b2948);
  border-bottom: 3px solid #ae788e;
}
.trio-platform img, .trio-empty-slot {
  width: clamp(46px, 15vw, 72px);
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
}
.trio-platform img { transform-origin: center bottom; animation: trio-idle 3.8s ease-in-out infinite; }
.trio-platform:last-child img { animation-delay: -.9s; }
@keyframes trio-idle {
  50% { transform: translateY(-2px) scale(1.015, 1.035); }
}
.trio-platform strong { max-width: 100%; overflow-wrap: anywhere; font-family: var(--pixel); }
.trio-projection {
  color: #aff4df;
  background: repeating-linear-gradient(0deg, #aef2e40d 0 1px, transparent 1px 4px), linear-gradient(#172331, #294250);
  border-color: #82dfd3;
}
.trio-projection[data-live="true"] img { filter: drop-shadow(0 0 8px #8ffbdf88); }
.trio-empty-slot {
  display: grid;
  place-items: center;
  border: 1px dashed #82dfd397;
  font: 700 2rem/1 var(--pixel);
}
.trio-clock {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0 9px;
  min-height: 32px;
}
.trio-clock span { min-width: 2.7ch; }
.trio-clock progress { margin: 0; flex: 1; }
.trio-picker input, .trio-feedback select, .trio-feedback textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #9c779d;
  border-radius: 0;
  padding: 7px 10px;
  background: #100e20;
  color: var(--paper);
  font: 500 max(16px, .94rem)/1.25 var(--readable);
}
.trio-roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 4px;
  max-height: 130px;
  overflow: auto;
  padding: 5px;
  margin-top: 4px;
  background: #100e20;
  scrollbar-color: #946f91 #100e20;
}
.trio-pick {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 3px 1px;
  border: 1px solid #65506f;
  border-bottom-width: 2px;
  background: #292038;
  color: var(--paper);
  font: 650 .71rem/1.05 var(--readable);
  overflow-wrap: anywhere;
}
.trio-pick img { width: 28px; height: 28px; image-rendering: pixelated; }
.trio-pick:enabled:is(:hover, :focus-visible) { border-color: var(--gold); outline-offset: 0; }
.trio-pick[aria-pressed="true"] { color: #d4ffeb; border-color: #9bf0d9; background: #26414b; }
.trio-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.trio-status {
  color: var(--muted);
  font: .8rem/1.3 var(--readable);
  margin: 0;
}
.trio-actions .primary, .trio-feedback .primary {
  min-height: 44px;
  padding: 8px 12px;
  font: 700 1.05rem/1 var(--pixel);
}
.trio-actions .primary:disabled, .trio-feedback .primary:disabled { cursor: default; }
.trio-feedback {
  background: #1d172e;
  border: 2px solid #b993af;
  border-top: 3px solid var(--gold);
  color: var(--paper);
  width: min(calc(100% - 22px), 460px);
  max-height: calc(100dvh - 24px);
  padding: clamp(12px, 4vw, 22px);
  box-shadow: 6px 6px #110e1d;
  font: .89rem/1.35 var(--readable);
}
.trio-feedback::backdrop { background: #100b1bc9; }
.trio-feedback-pick { margin: 9px 0 2px; font-weight: 750; }
.trio-feedback-score { margin: 0 0 8px; color: var(--gold); font-weight: 750; }
.trio-feedback-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.trio-feedback-links > div { border-top: 2px solid #83cec3; padding: 5px 8px; background: #2a233b; }
.trio-link-title, .trio-match-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--paper);
}
.trio-link-title img, .trio-match-title img { width: 24px; height: 24px; image-rendering: pixelated; }
.trio-link-title b, .trio-match-title b {
  margin-left: auto;
  color: #b0f3de;
  white-space: nowrap;
  font: 700 .81rem/1 ui-monospace, monospace;
}
.trio-result-fold summary {
  cursor: pointer;
  min-height: 30px;
  padding: 6px 0;
  color: var(--paper);
  font: 700 .95rem/1.2 var(--pixel);
}
.trio-result-fold summary:hover { color: var(--gold); }
.trio-feedback-links ul { margin: 0 0 5px; padding-left: 1.05em; font-size: .78rem; }
.trio-feedback-links li + li { margin-top: 2px; }
#trio-top-matches {
  margin: 8px 0 11px;
  padding: 0 8px;
  border-block: 1px solid #967698;
  background: #251d35;
}
#trio-top-matches > summary { min-height: 38px; padding-block: 9px; color: var(--gold); }
.trio-match-list { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.trio-match { padding: 6px; background: #191426; border: 1px solid #775c7e; box-shadow: 2px 2px #100d1f; }
.trio-match-title { font: 700 1.05rem/1.1 var(--pixel); }
.trio-match-title img { width: 36px; height: 36px; border: 1px solid #ac859a; }
.trio-match-title b { color: var(--gold); }
.trio-match-connections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 5px; }
.trio-match-connections div { padding: 3px 5px; background: #252033; border-left: 2px solid #83cec3; }
.trio-match-connections b { color: #b0f3de; font-size: .77rem; }
.trio-match-connections span { display: block; color: var(--muted); font-size: .75rem; }
#trio-feedback-explanation { margin: 8px 0; color: var(--muted); font-size: .78rem; }
.trio-feedback form { display: grid; gap: 5px; }
.trio-feedback fieldset { border: 0; margin: 0; padding: 0; }
.trio-feedback label, .trio-feedback legend { font-weight: 650; padding: 0; }
.trio-feedback small { font-weight: 400; padding-left: 4px; color: var(--muted); }
.trio-stars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 5px 0 8px; }
.trio-stars label {
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 4px 2px;
  text-align: center;
  border: 1px solid #9c779d;
  color: #b5a0ba;
  background: #2c223d;
  font-size: 1.4rem;
  cursor: pointer;
}
.trio-star-icon { line-height: 1; }
.trio-star-caption { color: var(--paper); font-size: clamp(.65rem, 2.75vw, .75rem); line-height: 1.12; }
.trio-stars label:is(:has(:checked), :has(~ label :checked), :hover) { color: var(--gold); background: #503344; }
.trio-stars label:has(:focus-visible) { outline: 2px solid var(--paper); outline-offset: 1px; }
.trio-feedback .primary { margin-top: 5px; justify-self: stretch; }
@media (max-width: 480px) {
  .trio-screen { padding: 10px; }
  .trio-roster { grid-template-columns: repeat(5, minmax(0, 1fr)); max-height: 118px; }
}
@media (max-height: 660px) {
  .trio-screen { align-content: start; }
  .trio-cockpit { padding-block: 10px; }
  .trio-roster { max-height: 64px; }
}

.trio-boost-meter {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  scale: calc(1 + var(--charge, 0) * .42);
  text-align: center;
  animation: trio-score-rumble .17s linear infinite;
  display: grid;
  gap: 3px;
  min-width: clamp(108px, 17vw, 186px);
  padding: 8px 10px;
  border: 2px solid #a786ad;
  border-top-color: var(--gold);
  background: #1b1429ed;
  box-shadow: 3px 4px #100d1f, 0 0 calc(var(--charge, 0) * 52px) rgb(255 188 104 / calc(var(--charge, 0) * .8));
  pointer-events: none;
  color: var(--gold);
}
.trio-boost-meter span, .trio-boost-meter small {
  font: 700 clamp(.62rem, 1.25vw, .83rem)/1 ui-monospace, monospace;
  letter-spacing: .05em;
}
.trio-boost-meter strong {
  font: 800 clamp(1.35rem, 3.8vw, 3rem)/1 ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
  text-shadow: 0 0 calc(var(--charge, 0) * 19px) #ffcc78;
}
@keyframes trio-score-rumble {
  25% { transform: translate(calc(var(--charge, 0) * 3px), calc(var(--charge, 0) * -2px)) rotate(calc(var(--charge, 0) * 1.1deg)); }
  75% { transform: translate(calc(var(--charge, 0) * -3px), calc(var(--charge, 0) * 2px)) rotate(calc(var(--charge, 0) * -1.1deg)); }
}
.trio-boost-meter progress { width: 100%; height: 5px; accent-color: var(--gold); }
.trio-boost-meter[data-complete] { animation: trio-score-stamp .38s ease-out both; }
@keyframes trio-score-stamp {
  25% { transform: scale(1.09); box-shadow: 0 0 20px #ffcc7888; }
  100% { border-color: var(--gold); }
}
