/* Gagaboll – the HUD, the menus and the touch controls over the 3D picture. The box, the corner buttons and the
   start screen's frame come from css/game-stage.css; everything HTML grows with the box (--ui, .ui-grows). */

.gb-stage {
  cursor: default;
}

.gb-stage.is-playing canvas {
  cursor: crosshair;
}

/* ---------- The HUD: the round top left, the players' list under it ---------- */

.gb-hud {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.3rem;
  right: auto;
  pointer-events: none;
}

.gb-round {
  color: var(--cyan);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.gb-players {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.12rem;
  font-size: 0.78rem;
  text-transform: none;
  font-style: normal;
  font-weight: 700;
}

.gb-players li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  transition: opacity 0.3s;
}

.gb-players li.is-out {
  opacity: 0.4;
  text-decoration: line-through;
}

.gb-players li.is-you {
  color: var(--yellow);
}

.gb-players .gb-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 6px currentColor;
}

.gb-players .gb-stars {
  color: var(--yellow);
  letter-spacing: -0.05em;
  min-width: 2.4em;
  font-variant-numeric: tabular-nums;
}

/* the big texts in the middle ("GAA… GAA… BOLL!", "TVÅ KVAR!", the winner) */
.gb-big {
  position: absolute;
  left: 0;
  right: 0;
  top: 30%;
  margin: 0;
  text-align: center;
  font-style: italic;
  font-weight: 900;
  font-size: calc(2.8rem * var(--ui, 1));
  text-transform: uppercase;
  color: var(--yellow);
  text-shadow: 0 0 18px rgba(255, 233, 77, 0.7), 0 2px 0 rgba(14, 10, 36, 0.8);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s, transform 0.15s;
}

.gb-big.is-shown {
  opacity: 1;
  transform: scale(1);
}

.gb-big.is-blue {
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(94, 240, 255, 0.8), 0 2px 0 rgba(14, 10, 36, 0.8);
}

.gb-big.is-red {
  color: var(--magenta);
  text-shadow: 0 0 18px rgba(255, 63, 180, 0.8), 0 2px 0 rgba(14, 10, 36, 0.8);
}

/* the edge of the box glows magenta when YOU are knocked out, yellow when you won the round */
.gb-edge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 0 transparent;
  transition: opacity 0.4s;
  z-index: 1;
}

.gb-edge.is-out {
  opacity: 1;
  box-shadow: inset 0 0 calc(3rem * var(--ui, 1)) rgba(255, 63, 180, 0.7);
}

.gb-edge.is-won {
  opacity: 1;
  box-shadow: inset 0 0 calc(3rem * var(--ui, 1)) rgba(255, 233, 77, 0.7);
}

/* ---------- The menus ---------- */

.gb-overlay {
  z-index: 3;
}

.gb-stage .icon-button {
  z-index: 4;
}

.gb-overlay h2 {
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(94, 240, 255, 0.6);
}

.gb-overlay p {
  margin-bottom: 1rem;
}

.gb-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 30rem);
}

.gb-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.gb-label {
  margin: 0;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.gb-choice {
  font: inherit;
  font-weight: 800;
  padding: 0.35rem 0.8rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(94, 240, 255, 0.4);
  cursor: pointer;
}

.gb-choice.is-chosen {
  color: var(--yellow);
  border-color: var(--yellow);
  box-shadow: 0 0 10px rgba(255, 233, 77, 0.35);
}

/* the result's list: a dot in each robot's colour, the stars won */
.gb-result {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 22rem;
}

.gb-result li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(94, 240, 255, 0.2);
  text-align: left;
}

.gb-result li.is-you {
  color: var(--yellow);
}

.gb-result .gb-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  flex: none;
}

.gb-result .gb-name {
  flex: 1;
  font-weight: 800;
}

.gb-result .gb-stars {
  font-weight: 900;
  color: var(--yellow);
}

/* the keys on the help under the game (kbd) */
.gb-key {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.1em 0.4em;
  border: 1px solid rgba(94, 240, 255, 0.5);
  border-radius: 0.3em;
  background: rgba(94, 240, 255, 0.1);
  font: inherit;
  font-weight: 800;
  text-align: center;
}

/* ---------- The touch controls (touch.js) ---------- */

.gb-stage canvas {
  touch-action: none;
}

.gb-touch {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.gb-touch[hidden] {
  display: none;
}

.gb-stick {
  position: absolute;
  left: calc(1.2rem + 56px + var(--safe-left));
  top: calc(100% - 2.8rem - 56px - var(--safe-bottom));
  width: 112px;
  height: 112px;
  border: 2px solid rgba(94, 240, 255, 0.5);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 240, 255, 0.04) 40%, rgba(94, 240, 255, 0.14));
  transform: translate(-50%, -50%);
  opacity: 0.4;
  transition: opacity 0.15s;
}

.gb-stick.is-held {
  opacity: 0.95;
  transition: none;
}

.gb-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(94, 240, 255, 0.35);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 12px rgba(94, 240, 255, 0.6);
  transform: translate(-50%, -50%);
}

.gb-touch-hit,
.gb-touch-dash {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: rgba(94, 240, 255, 0.16);
  color: var(--cyan);
  font: inherit;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  opacity: 0.8;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.gb-touch-hit {
  right: calc(6.6rem + var(--safe-right));
  bottom: calc(2.2rem + var(--safe-bottom));
  width: 5.8rem;
  height: 5.8rem;
  border-color: var(--yellow);
  color: var(--yellow);
  background: rgba(255, 233, 77, 0.16);
  font-size: 1.05rem;
}

.gb-touch-hit::before {
  content: "Slå";
}

.gb-touch-hit::after {
  content: "";
  position: absolute;
  inset: 0.45rem;
  border: 1px dashed rgba(255, 233, 77, 0.45);
  border-radius: 50%;
}

.gb-touch-dash {
  right: calc(2.3rem + var(--safe-right));
  bottom: calc(1.4rem + var(--safe-bottom));
  width: 3.6rem;
  height: 3.6rem;
  font-size: 0.65rem;
}

.gb-touch-dash::before {
  content: "Sido-steg";
}

.gb-touch-hit.is-held,
.gb-touch-dash.is-held {
  opacity: 1;
  transform: scale(0.94);
}

/* a phone held upright: a taller box (the pit fills the width, the buttons under it) */
@media (max-width: 700px) and (orientation: portrait) {
  .gb-stage {
    --aspect: 3 / 4;
  }

  .gb-players {
    font-size: 0.68rem;
  }
}
