/* The play screen is intentionally reduced to three primary surfaces:
   POV, active operator, and map. Labels and controls live on those
   surfaces instead of consuming a separate header row. */
.app {
  width: min(1700px, 100%);
  padding-inline: 18px;
}
.gamegrid {
  grid-template-columns: minmax(440px, .92fr) minmax(600px, 1.28fr);
  gap: 14px;
}
.audio-wrap,
.mapbody {
  padding: 10px;
}
.audio-cardhead {
  position: absolute;
  inset: 0;
  z-index: 3;
  height: auto;
  padding: 0;
  pointer-events: none;
}
.audio-cardhead h2,
.maptitle h2 {
  min-height: 30px;
  padding: 5px 10px 6px;
  box-shadow: 0 8px 22px #00000055;
}
.audio-cardhead h2 {
  position: absolute;
  top: 12px;
  left: 12px;
}
.map-cardhead {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  pointer-events: none;
}
.map-cardhead > * {
  pointer-events: auto;
}
.maptitle {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  max-width: calc(100% - 90px);
}
.maptitle h2 {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-cardhead .floor-tabs {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 2;
  width: auto;
  max-width: none;
  display: flex;
  flex-direction: column-reverse;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  overflow: visible;
  transform: translateY(-50%);
}
.map-cardhead .floor-tab {
  position: relative;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  backdrop-filter: none;
  font-size: 2.75rem;
  font-weight: 900;
}
.map-cardhead .floor-tab:hover {
  background: transparent;
  color: var(--yellow);
}
.map-cardhead .floor-tab.active {
  border-color: transparent;
  background: transparent;
  color: var(--yellow);
  box-shadow: none;
}
.map-cardhead .floor-tab-group .badges {
  position: absolute;
  top: 50%;
  right: calc(100% + 7px);
  align-items: center;
  justify-content: flex-end;
  transform: translateY(-50%);
  white-space: nowrap;
}
.guess-row {
  position: relative;
}
#guessHistoryRows .guess-row.selected {
  flex-grow: 1.45;
  min-height: 132px;
}
#guessHistoryRows .guess-row:not(.selected) {
  flex-grow: .78;
  min-height: 88px;
}
#guessHistoryRows .guess-row.selected .guess-detail {
  padding-top: 52px;
}
#headerPlayAudio {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-width: 188px;
  min-height: 46px;
  justify-content: flex-start;
  padding: 8px 12px;
  border: 1px solid var(--white-line-strong);
  border-radius: 3px;
  background: #0c1118d9;
  color: var(--text);
  box-shadow: 0 8px 24px #00000052;
  backdrop-filter: blur(8px);
  font-size: 1.08rem;
  font-weight: 850;
}
#headerPlayAudio:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}
#headerPlayAudio .audio-waveform {
  margin-left: auto;
}

@media (min-width: 901px) {
  body:has(#playView:not([hidden])) .app {
    padding-top: calc(var(--topbar-space) + 32px);
    padding-left: 36px;
    padding-right: 0;
  }
  #playView:not([hidden]) .gamegrid {
    gap: 4px;
  }
  #playView:not([hidden]) .mapbody {
    padding-left: 0;
  }
  #playView:not([hidden]) .mapviewport {
    justify-content: center;
  }
  #playView:not([hidden]) .mapactions {
    align-self: center;
  }
  #playView:not([hidden]) .mapbody {
    --map-shell-width: min(
      100%,
      calc(100dvh - var(--topbar-space) - 77px),
      900px
    );
  }
}
@media (max-width: 900px) {
  body:has(#playView:not([hidden])) .app {
    padding-top: calc(var(--topbar-space) + 32px);
  }
  .gamegrid {
    grid-template-columns: 1fr;
  }
  .map-cardhead {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
  }
}
@media (min-width: 601px) {
  .mapshell {
    overflow: visible;
  }
  .map-cardhead .floor-tabs {
    right: -60px;
  }
  .map-cardhead .floor-tab-group .badges {
    right: auto;
    left: calc(100% + 7px);
    justify-content: flex-start;
  }
}
@media (min-width: 601px) and (max-width: 1399px) {
  .map-cardhead .floor-tabs {
    right: 0;
  }
}
@media (max-width: 600px) {
  .app {
    padding-inline: 10px;
  }
  .guess-row b {
    font-size: 1.13rem;
  }
  #guessHistoryRows .guess-row.selected {
    grid-template-columns: minmax(0, 1fr) 118px;
  }
  #guessHistoryRows .guess-row.selected b {
    font-size: 1.25rem;
  }
  .map-cardhead .floor-tabs {
    right: 8px;
    width: auto;
    display: flex;
  }
  .map-cardhead .floor-tab {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
  #headerPlayAudio {
    top: 10px;
    right: 10px;
    width: 118px;
    min-width: 118px;
    min-height: 42px;
    padding-inline: 10px;
    font-size: .92rem;
  }
  #headerPlayAudio .audio-waveform {
    display: none;
  }
  #guessHistoryRows .guess-row.selected .guess-detail {
    padding-top: 48px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .topbar,
  .gamegrid > .card:first-child {
    transition: none;
  }
}

