/* Hexagon, the player's phone: the stage heading with its ring clock, the hexagon pad, the progress dots and the
   status line. Built on the player shell (20_player_shell.css). The .gtf-hx / .gtf-hx__* hexagon drawing is shared
   with the big screen (35_screen_hexagon.css only changes its size). */

/* ---------- Stage heading and ring clock ---------- */

.gtf-hx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.gtf-hx-head__title {
  margin: 0;
  font-size: 34px;
}

.gtf-hx-clock__ring {
  --ring: var(--gtf-success);

  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--progress, 0) * 360deg), var(--gtf-surface-4) 0);

  &.is-urgent {
    --ring: var(--gtf-orange);
  }

  &::before {
    content: "";
    grid-area: 1 / 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gtf-ink);
  }
}

.gtf-hx-clock__value {
  grid-area: 1 / 1;
  z-index: 1;
  font-family: var(--gtf-mono);
  font-size: 26px;
  line-height: 1;
  color: var(--gtf-cream);
}

.gtf-hx-clock__ring.is-urgent .gtf-hx-clock__value {
  color: var(--gtf-orange);
}

/* ---------- The hexagon drawing (phone pad and big screen) ---------- */

.gtf-hx {
  display: block;
  width: 100%;
  overflow: visible;
}

.gtf-hx__seg {
  fill: var(--base);
  stroke: var(--gtf-cream);
  stroke-width: 5;
  stroke-linejoin: round;
  /* Grows outward from the middle of the hexagon (230, 200 in the drawing's units). */
  transform-box: view-box;
  transform-origin: 230px 200px;
  transition: fill 60ms linear, transform 90ms ease-out, filter 90ms ease-out;

  &.is-lit,
  &.is-down {
    fill: var(--lit);
    stroke: #fff;
    transform: scale(1.07);
    filter: brightness(1.25) drop-shadow(0 0 14px var(--lit));
  }
}

@media (prefers-reduced-motion: reduce) {
  .gtf-hx__seg {
    transition: fill 60ms linear;

    &.is-lit,
    &.is-down {
      transform: none;
    }
  }
}

.gtf-hx__hub {
  fill: var(--gtf-ink);
  stroke: var(--gtf-cream);
  stroke-width: 5;
  pointer-events: none;
}

.gtf-hx__symbol {
  pointer-events: none;
}

/* ---------- The pad ---------- */

.gtf-hx-pad {
  position: relative;
  container-type: inline-size;
  width: 100%;
  margin-top: 18px;
  opacity: 0.4;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: opacity 0.2s;

  &.is-active {
    opacity: 1;

    & .gtf-hx__seg {
      cursor: pointer;
    }
  }

  & .gtf-hx__seg:focus-visible {
    outline: none;
    stroke: var(--gtf-yellow);
  }
}

.gtf-hx-centre {
  position: absolute;
  top: 50%;
  left: 50%;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.gtf-hx-centre__big {
  font-size: 15cqw;
  font-weight: 900;
}

.gtf-hx-centre__small {
  margin-top: 1.5cqw;
  font-size: 4.6cqw;
  color: var(--gtf-text-2);
}

/* ---------- Progress dots and status line ---------- */

.gtf-hx-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 16px;
  margin-top: 22px;
}

.gtf-hx-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gtf-line);

  &.is-done {
    background: var(--gtf-success);
  }

  &.is-pending {
    background: var(--gtf-cream);
  }

  &.is-bad {
    background: var(--gtf-danger-red);
  }
}

.gtf-hx-line {
  min-height: 30px;
  margin-top: 16px;
  font-size: 24px;
  font-weight: 800;
  text-align: center;

  &.is-success {
    color: var(--gtf-success);
  }

  &.is-out {
    color: var(--gtf-orange);
  }
}
