/* ==========================================================================
   HOST — teams, the tap battle, showdown betting and the drawing gallery.
   Loaded after host-rounds.css.
   ========================================================================== */

/* ---- team rosters (round intro) ----------------------------------------- */

.team-rosters {
  display: flex;
  align-items: center;
  gap: 2vw;
  flex-wrap: wrap;
  justify-content: center;
}
.roster {
  background: var(--surface);
  border: 3px solid var(--team, var(--line));
  border-radius: 22px;
  padding: 1em 1.8em;
  min-width: 22vw;
}
.roster-name {
  font-size: clamp(1.2rem, 2.8vw, 2.6rem);
  font-weight: 900;
  color: var(--team, var(--text));
  letter-spacing: .05em;
}
.roster-members {
  color: var(--muted);
  font-size: clamp(.8rem, 1.4vw, 1.3rem);
  font-weight: 700;
  margin-top: .3em;
}
.roster-vs {
  font-size: clamp(1rem, 2vw, 1.8rem);
  font-weight: 900;
  color: var(--gold);
}

/* ---- tap battle (tug of war) -------------------------------------------- */

.battle-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vh;
  background: var(--bg);
}
.battle-word {
  font-size: clamp(2.5rem, 9vw, 9rem);
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--muted);
}
.battle-stage.go .battle-word {
  color: var(--gold);
  animation: slam .15s ease;
}

.tug {
  display: flex;
  width: 84vw;
  height: clamp(90px, 18vh, 200px);
  border-radius: 22px;
  overflow: hidden;
  border: 4px solid var(--line);
}
.tug-side {
  background: var(--team, var(--line));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #0b0b12;
  transition: flex-grow .18s var(--ease);
  min-width: 0;
  overflow: hidden;
}
.tug-name {
  font-size: clamp(.9rem, 2vw, 2rem);
  font-weight: 900;
  letter-spacing: .1em;
  white-space: nowrap;
}
.tug-count { font-size: clamp(1.2rem, 3vw, 3rem); font-weight: 900; }

/* ---- showdown betting --------------------------------------------------- */

.bet-strip {
  position: absolute;
  bottom: 6vh;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6vh;
}
.bet-label {
  color: var(--muted);
  font-size: clamp(.9rem, 1.6vw, 1.5rem);
  font-weight: 700;
}
.bet-count {
  background: var(--surface);
  border: 2px solid var(--blue);
  color: var(--blue);
  border-radius: 999px;
  padding: .4em 1.4em;
  font-weight: 900;
  font-size: clamp(.85rem, 1.4vw, 1.3rem);
}
.tap-stage.go .bet-strip { display: none; }

.bet-results {
  display: flex;
  flex-wrap: wrap;
  gap: .6vh .8vw;
  justify-content: center;
  margin-bottom: 1.5vh;
  max-width: 80%;
}
.bet-chip {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: .35em 1em;
  font-size: clamp(.75rem, 1.2vw, 1.1rem);
  font-weight: 700;
}
.bet-chip.won  { border-color: var(--green); color: var(--green); }
.bet-chip.lost { border-color: var(--pink);  color: var(--pink); }

/* ---- team results (reveal) ---------------------------------------------- */

.team-results {
  display: flex;
  gap: 2vw;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5vh;
}
.team-card {
  background: var(--surface);
  border: 3px solid var(--team, var(--line));
  border-radius: 22px;
  padding: .9em 1.6em;
  text-align: center;
  min-width: 20vw;
  opacity: .55;
}
.team-card.won { opacity: 1; box-shadow: 0 0 40px color-mix(in srgb, var(--team) 30%, transparent); }
.tc-name {
  font-size: clamp(1rem, 2.2vw, 2rem);
  font-weight: 900;
  color: var(--team, var(--text));
}
.tc-score { font-size: clamp(1.6rem, 4vw, 3.4rem); font-weight: 900; }
.tc-answer {
  font-size: clamp(.9rem, 1.6vw, 1.5rem);
  font-weight: 800;
  margin: .2em 0;
}
.tc-members {
  color: var(--muted);
  font-size: clamp(.7rem, 1.1vw, 1rem);
  font-weight: 700;
  margin-top: .3em;
}

/* ---- drawing gallery ---------------------------------------------------- */

/* Everything must fit on screen: a TV cannot be scrolled from across a room.
   Tiles are square, so their size is bounded by BOTH the available width and
   the available height. Sizing off width alone overflows the moment there is
   more than one row. --cols and --rows come from JS. */
.vote-grid.gallery {
  --tile: min(
    calc((84vw - (var(--cols, 3) - 1) * 1.2vw) / var(--cols, 3)),
    calc((56vh - (var(--rows, 1) - 1) * 1.2vh) / var(--rows, 1))
  );
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), var(--tile));
  grid-auto-rows: var(--tile);
  gap: 1.2vh 1.2vw;
  width: auto;
  justify-content: center;
  align-content: center;
}
.vote-card.art {
  padding: .4em;
  background: #fff;
  border-color: var(--purple);
  aspect-ratio: 1;
  display: flex;
}
.vote-card.art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.art-results {
  /* Same two-axis fit as the gallery, in the tighter reveal budget. The
     caption adds height, hence the 1.22 factor on the row bound. */
  --tile: min(
    calc((80vw - (var(--cols, 4) - 1) * .8vw) / var(--cols, 4)),
    calc((36vh - (var(--rows, 1) - 1) * .8vh) / var(--rows, 1) / 1.22)
  );
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), var(--tile));
  gap: .8vh .8vw;
  width: auto;
  margin-bottom: 1.2vh;
  justify-content: center;
  align-content: center;
}
.art-card {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: .3em;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.art-card.best { border-color: var(--gold); box-shadow: 0 0 30px rgba(235,201,90,.35); }
.art-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
}
.art-card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5em;
  padding: .3em .4em 0;
  color: #0b0b12;
  font-size: clamp(.65rem, 1vw, .95rem);
  font-weight: 800;
}
.art-card figcaption b {
  background: var(--gold);
  color: #3a2c00;
  border-radius: 999px;
  padding: .1em .6em;
}

@media (max-height: 820px) {
  .vote-grid.gallery { max-height: 46vh; }
  .art-results { max-height: 34vh; }
  .tug { height: clamp(70px, 14vh, 150px); }
}