@import url("../shared/multiplayer.css");

.match-stage {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.arena {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  container-type: size;
}

.draw-play {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  gap: .65rem;
  justify-items: center;
}

.preview-countdown {
  position: absolute;
  right: .8rem;
  top: .8rem;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: #17324d;
  color: #fff;
  font-size: 1.65rem;
  font-weight: 950;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9);
}

.draw-play {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.draw-canvas-wrap {
  position: relative;
  width: auto;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 4 / 3;
}

.draw-play .draw-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.draw-play:not(.previewing) .preview-countdown {
  display: none;
}

.draw-tools .ink {
  width: auto;
  min-width: 4rem;
  height: 2.5rem;
  padding: .25rem .55rem;
  border: 2px solid #fff;
  outline: 2px solid #263253;
  border-radius: .65rem;
  color: #fff;
  font-size: .72rem;
  font-weight: 950;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.draw-tools .ink.selected {
  outline: 4px solid var(--accent);
  outline-offset: 1px;
  transform: none;
}

.draw-review-tabs {
  width: min(100%, 22rem);
  display: flex;
  justify-content: center;
  gap: .5rem;
}

.draw-review-tabs button {
  min-height: 2.65rem;
  flex: 1 1 0;
  border: 2px solid #263253;
  border-radius: .65rem;
  background: #fffdf8;
  color: #263253;
  font-weight: 900;
}

.draw-review-tabs button[aria-pressed="true"] {
  background: #263253;
  color: #fff;
  box-shadow: 0 0 0 3px var(--accent);
}

/* Mobile Safari can collapse an auto-width, percentage-height aspect-ratio
   item inside a minmax grid row. Give phones a definite inline size instead. */
@media (max-width: 600px) and (orientation: portrait) {
  .draw-play {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
  }

  .draw-canvas-wrap {
    flex: 0 0 auto;
    width: min(100%, 22rem);
    height: auto;
    max-height: none;
    aspect-ratio: 4 / 3;
  }

  .draw-play .draw-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .draw-tools {
    width: 100%;
    gap: .35rem;
  }

  .draw-tools .ink {
    min-width: 0;
    flex: 1 1 0;
    padding-inline: .3rem;
  }

  .draw-play > .prompt,
  .draw-tools,
  .draw-review-tabs,
  .draw-score-breakdown {
    flex: 0 0 auto;
  }
}

@media (max-width: 600px) and (max-height: 600px) and (orientation: portrait) {
  .draw-canvas-wrap {
    width: min(100%, 16rem);
  }
}

.draw-canvas.is-locked {
  cursor: default;
  pointer-events: none;
}

.draw-score-breakdown {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
}

@media (max-height: 620px) and (orientation: landscape) {
  .draw-play { gap: .3rem; }
}
