/* Schack page – the game box itself is in css/game-stage.css, the look shared with the other robot games
   (names at the top, bubbles, menus, big text, back button) in css/holo-games.css. The board is drawn on the canvas. */

/* White and black (like Vändbricka's discs): white = solid white, black = a white ring with a dark inside. White
   starts, so it is the FIRST colour here (side 1 unless you choose black against a robot). The variables are
   explained at the top of css/holo-games.css. */
.holo-stage {
  --colour-a: #ffffff;
  --colour-a-dot: radial-gradient(circle, rgba(255, 255, 255, 0.7), #fff 70%);
  --colour-a-fill: #ffffff;
  --colour-a-ink: #0e0a24;
  --colour-b: #ffffff;
  --colour-b-dot: radial-gradient(circle, #030208 50%, #fff 58%);
  --colour-b-fill: #05040f;
  --colour-b-ink: #fff;
}


/* Phones held upright: a taller box, so the board can be bigger */
@media (max-aspect-ratio: 1/1) {
  .stage {
    --aspect: 4 / 5;
  }
}

/* The pieces a side has taken, small and overlapping, under its name (who is ahead shows without numbers) */
.sk-taken {
  display: flex;
  align-items: center;
  min-height: 1.4rem;
  padding: 0 0.3rem;
}

.holo-col-2 .sk-taken {
  justify-content: flex-end;
}

.sk-taken img {
  width: 1.4rem;
  height: 1.4rem;
  margin-right: -0.55rem;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.45));
}

/* A piece just taken pops into the row */
.sk-taken img.is-new {
  animation: sk-pop 0.35s ease-out;
}

@keyframes sk-pop {
  from { transform: scale(1.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 560px) {
  .sk-taken {
    min-height: 1.05rem;
  }
  .sk-taken img {
    width: 1.05rem;
    height: 1.05rem;
    margin-right: -0.42rem;
  }
}

/* "Tips" (only against Plåt-Pipen): bottom middle, in the highlight yellow; it pulses while the tip is worked out.
   It grows with the picture in fullscreen (its sizes are in em of a font size that follows --ui), unlike the corner
   buttons. */
.sk-tips {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(0.6rem + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 0.4em;
  height: 2.6em;
  padding: 0 0.8em 0 0.6em;
  color: var(--yellow);
  font: inherit;
  font-size: calc(1rem * var(--ui, 1));
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  background: rgba(14, 10, 36, 0.75);
  border: 2px solid var(--yellow);
  transform: translateX(-50%);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.sk-tips[hidden] {
  display: none;
}

.sk-tips svg {
  width: 1.4em;
  height: 1.4em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sk-tips:hover,
.sk-tips:focus-visible {
  opacity: 1;
  box-shadow: 0 0 12px rgba(255, 233, 77, 0.6);
}

/* Not your turn: still there (nothing jumps), just dim */
.sk-tips:disabled {
  cursor: default;
  opacity: 0.3;
  box-shadow: none;
}

.sk-tips.is-thinking {
  animation: sk-thinking 0.5s ease-in-out infinite alternate;
}

@keyframes sk-thinking {
  from { box-shadow: 0 0 4px rgba(255, 233, 77, 0.3); }
  to { box-shadow: 0 0 18px rgba(255, 233, 77, 0.9); }
}

/* The tall layout (wide boxes, css/holo-games.css): the taken pieces wrap in the name's narrow zone, and "Tips" sits
   above the back button in your zone – the board fills the bottom middle */
.holo-stage.is-tall .sk-taken {
  flex-wrap: wrap;
  row-gap: 0.15rem;
}

.holo-stage.is-tall .sk-tips {
  left: calc(0.6rem + var(--safe-left));
  bottom: calc(3.7rem + var(--safe-bottom));
  transform: none;
}
