.tower-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at 28% top, #283d38, transparent 59%), #080f14ee;
}
.tower-screen.hidden { display: none; }
.tower-stage {
  width: min(900px, 96vw);
  padding: clamp(16px, 3vw, 30px);
  border: 1px solid #53706a;
  border-radius: 17px;
  background: linear-gradient(160deg, #1d2d2b, #10191e 78%);
  color: #eaf1ed;
  box-shadow: 0 22px 52px #0009;
}
.tower-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}
.tower-header p {
  color: #ebca8d;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.tower-header h1 { font-size: clamp(22px, 4vw, 36px); }
.tower-format {
  padding: 5px 10px;
  border: 1px solid #57746e;
  border-radius: 6px;
  color: #c3ddd5;
  white-space: nowrap;
  font-size: .8rem;
}
.tower-route {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(5, 1fr);
  gap: 6px 13px;
  list-style: none;
  counter-reset: stops;
}
.tower-stop {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  min-height: 45px;
  border: 1px solid #3b504f;
  border-radius: 7px;
  background: #111c21;
  animation: tower-stop-in 260ms ease-out both;
  animation-delay: calc(var(--i) * 42ms);
}
.tower-stop.is-current {
  background: #29483f;
  border-color: #a4d7c4;
}
.tower-stop.is-cleared { border-color: #8b7754; }
.tower-stop.is-locked .tower-face { filter: saturate(.55); opacity: .82; }
.tower-stop-step, .tower-stop-score {
  color: #e9cd96;
  font-size: .74rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.tower-stop-copy { display: grid; gap: 1px; min-width: 0; }
.tower-stop-copy strong, .tower-stop-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tower-stop-copy strong { font-size: .88rem; }
.tower-stop-copy small { font-size: .72rem; color: #aec4be; }
.tower-stop-faces, .tower-match > div > span { display: flex; gap: 3px; justify-content: center; }
.tower-face {
  display: inline-block;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid #779b90;
  border-radius: 50%;
  background: #213a37;
}
.tower-face.has-portrait { color: transparent; }
.tower-challenge {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #4a635e;
  border-radius: 10px;
  background: #132022;
  text-align: center;
}
.tower-challenge h2 { font-size: clamp(17px, 3vw, 24px); }
.tower-challenge p, .tower-challenge blockquote { color: #c0d3cd; font-size: .83rem; }
.tower-challenge blockquote { padding-top: 7px; }
.tower-challenge blockquote b { color: #efd39e; }
.tower-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  padding-top: 8px;
}
.tower-match .tower-face { width: 46px; height: 46px; }
.tower-match b { font-size: .8rem; }
.tower-match i { color: #f0c67b; font-style: normal; font-weight: 900; }
.tower-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tower-actions .btn { min-height: 39px; }
.tower-actions .btn:focus-visible { outline: 2px solid #e3f3e9; outline-offset: 2px; }
@keyframes tower-stop-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (max-width: 640px) {
  .tower-stage { padding: 12px; }
  .tower-route { gap: 4px 6px; }
  .tower-stop { grid-template-columns: 19px minmax(0, 1fr) auto; gap: 3px; padding: 5px; }
  .tower-stop .tower-face { width: 20px; height: 20px; }
  .tower-stop-score { display: none; }
  .tower-stop-copy strong { font-size: .72rem; }
  .tower-stop-copy small { font-size: .63rem; }
}
@media (max-height: 540px) {
  .tower-stage { padding-block: 10px; }
  .tower-header { margin-bottom: 8px; }
  .tower-stop { min-height: 31px; padding-block: 3px; }
  .tower-stop .tower-face { width: 22px; height: 22px; }
  .tower-challenge { margin-top: 7px; padding: 5px; }
  .tower-match .tower-face { width: 29px; height: 29px; }
  .tower-actions { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .tower-stop { animation: none; }
}

.tower-stop { grid-row: var(--r); grid-column: var(--c); }
.tower-encounter .tower-match { padding: clamp(8px, 2vw, 22px) 0; }
.tower-side {
  display: flex;
  align-self: start;
  justify-content: center;
  gap: clamp(6px, 2vw, 19px);
}
.tower-side--left { --slide: -20px; }
.tower-side--right { --slide: 20px; }
.tower-contender {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  text-align: center;
  animation: tower-contender-in 380ms ease-out both;
}
.tower-contender strong { font-size: clamp(.73rem, 2vw, 1rem); }
.tower-encounter .tower-face {
  width: clamp(42px, 13vw, 125px);
  height: clamp(42px, 13vw, 125px);
  border-radius: 16%;
  border: 2px solid #c8a87b;
  box-shadow: 0 7px 18px #0006;
  background-repeat: no-repeat;
}
.tower-encounter .tower-match i { font-size: clamp(1.1rem, 4vw, 2.5rem); }
.tower-lines { display: grid; gap: 6px; min-height: 58px; }
.tower-lines blockquote { padding: 2px; }
@keyframes tower-contender-in {
  from { transform: translateX(var(--slide)); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (max-width: 520px) {
  .tower-header { align-items: start; flex-direction: column; }
  .tower-format { white-space: normal; }
}
@media (max-height: 480px) {
  .tower-encounter .tower-face { width: clamp(45px, 17vh, 90px); height: clamp(45px, 17vh, 90px); }
}
@media (prefers-reduced-motion: reduce) {
  .tower-contender { animation: none; }
}

@media (min-width: 760px) {
  #home-rows:has([data-row="towerP2"]:not(.hidden)) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
  }
  #home-rows:has([data-row="towerP2"]:not(.hidden)) > * { grid-column: 1 / -1; }
  #home-rows:has([data-row="towerP2"]:not(.hidden)) > :is([data-row="towerP1"], [data-row="towerP2"]) { grid-column: auto; }
  #home-rows:has([data-row="towerP2"]:not(.hidden)) > :is([data-row="towerP1"], [data-row="towerP2"]) > .menu-choice {
    justify-content: flex-end;
    min-width: 0;
  }
}

/* How far you got (records.js) */
.tower-record {
  color: #fde68a;
  font-weight: 800;
}
