/* Setup + Scout — play screens fit viewport */

.scout-lead {
  margin-bottom: 8px;
}

.counter-box {
  border: 2px solid var(--ink);
  background: var(--bone);
  padding: 8px 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-stamp);
}

.counter-box h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.counter-tips {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.counter-tips span {
  display: block;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}

.counter-tips span:last-child {
  border-bottom: none;
}

.scout-wave {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.hero-chip {
  flex: 0 0 auto;
  width: 120px;
  padding: 8px;
  border: 2px solid var(--ink);
  background: var(--bone);
  scroll-snap-align: start;
  box-shadow: var(--shadow-stamp);
  font-size: 0.8rem;
}

.hero-chip .cls {
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.hero-chip.MAGE .cls { color: var(--soul); }
.hero-chip.WARRIOR .cls { color: var(--seal); }
.hero-chip.ROGUE .cls { color: var(--moss); }

.room-strip {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 2px solid var(--ink);
  background: var(--bone);
  box-shadow: var(--shadow-stamp);
  margin-bottom: 10px;
  max-height: 28vh;
  overflow: auto;
}

.room-strip .room-row {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.room-strip .room-row:last-child {
  border-bottom: none;
}

/* ——— Setup fit-to-screen ——— */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.setup-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.setup-top h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.1;
}

.setup-top .section-label {
  margin: 0;
  font-size: 0.62rem;
}

.room-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 0 2px;
  flex-shrink: 0;
}

.room-tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 6px 10px;
  min-height: 34px;
  box-shadow: none;
}

.room-tabs button.active {
  background: var(--ink);
  color: var(--bone);
}

.room-board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  background: var(--bg-deep);
  padding: 6px 8px;
  box-shadow: var(--shadow-stamp);
  margin: 0;
  overflow: hidden;
}

.room-board .board-meta {
  flex-shrink: 0;
}

.room-board .board-meta strong {
  font-size: 0.85rem;
}

.cost-bar {
  height: 6px;
  background: var(--stone);
  border: 1.5px solid var(--ink);
  overflow: hidden;
  margin: 4px 0;
}

.cost-bar > span {
  display: block;
  height: 100%;
  background: var(--moss);
  transition: width 0.2s ease;
}

.cost-bar > span.hot {
  background: var(--seal);
}

.grid-board {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 3px;
  margin: 4px 0 0;
  width: 100%;
}

.grid-cell {
  min-height: 0;
  height: 100%;
  aspect-ratio: unset;
  background: rgba(247, 241, 230, 0.55);
  border: 1.5px dashed rgba(26, 22, 18, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.42rem, 1.5vw, 0.62rem);
  text-align: center;
  padding: 1px;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  line-height: 1.05;
  overflow: hidden;
}

.grid-cell:active {
  background: rgba(196, 60, 40, 0.12);
}

.grid-cell.filled {
  border-style: solid;
  border-color: var(--ink);
  background: var(--bone);
}

.setup-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.setup-bottom .section-label {
  margin: 0;
  font-size: 0.62rem;
}

.monster-tray {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 4px;
  -webkit-overflow-scrolling: touch;
  max-height: 88px;
}

.tray-item {
  flex: 0 0 auto;
  width: 72px;
  padding: 4px 4px 6px;
  border: 2px solid var(--ink);
  background: var(--bone);
  text-align: center;
  font-size: 0.58rem;
  cursor: pointer;
  min-height: 0;
  box-shadow: none;
  line-height: 1.15;
}

.tray-item.selected {
  background: var(--ink);
  color: var(--bone);
  transform: translateY(-2px);
}

.tray-item.selected .muted {
  color: rgba(247, 241, 230, 0.6);
}

.tray-item .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin: 0 auto 2px;
  border: 1.5px solid var(--ink);
}

.setup-footer {
  display: flex;
  gap: 6px;
  position: static;
  padding: 0;
  background: none;
}

.setup-footer button {
  flex: 1;
  min-height: 40px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

/* Body lock when playing — no page scroll */
body.play-fit {
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
}

body.play-fit .app {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}

body.play-fit .topbar {
  flex-shrink: 0;
  padding-top: 4px;
  padding-bottom: 0;
}

body.play-fit .topbar-row {
  gap: 6px;
}

body.play-fit .res-cell {
  padding: 3px 4px;
}

body.play-fit .res-cell .lbl {
  font-size: 0.55rem;
}

body.play-fit .res-cell .val {
  font-size: 0.9rem;
}

body.play-fit .account-btn {
  min-height: 38px;
  min-width: 72px;
  padding: 4px 8px;
  font-size: 0.62rem;
}

body.play-fit #tip-slot {
  display: none !important;
}

body.play-fit .screens {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 4px 10px 8px;
}

body.play-fit .screen.active {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.play-fit .screen.active > * {
  min-height: 0;
}

@media (min-width: 720px) {
  body.play-fit .screens {
    padding: 6px 20px 10px;
  }

  .tray-item {
    width: 84px;
    font-size: 0.62rem;
  }
}

@media (min-width: 1024px) {
  body.play-fit .app {
    max-width: 900px;
  }

  .grid-cell {
    font-size: clamp(0.5rem, 1vw, 0.75rem);
  }
}
