/* ============================================================
   Ponovi melodijo
   ============================================================ */

#speeds .chip.on { background: var(--sky); box-shadow: 0 5px 0 var(--sky-d); }
#speeds .chip { font-size: 1.6rem; padding: 4px 22px; }

#game { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.board {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  gap: clamp(8px, 2vh, 18px);
}

/* Kvadratna plošča: širino omeji višina zaslona, višino pa dajo
   kvadratni otroci — isti vzorec kot pri tris/ in four/, ker
   WebKit pri inset:0 + auto ne upošteva aspect-ratio. */
.pads {
  --chrome: 190px;
  width: 100%;
  max-width: min(100%, calc(100vh  - var(--chrome)), 440px);
  max-width: min(100%, calc(100dvh - var(--chrome)), 440px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(8px, 2vh, 16px);
}

.pad {
  aspect-ratio: 1;
  border: 0;
  border-radius: 26px;
  cursor: pointer;
  opacity: .55;
  transition: opacity .12s ease, transform .12s ease, box-shadow .12s ease;
}
.pad.p0 { background: var(--sun);   box-shadow: 0 8px 0 var(--sun-d); }
.pad.p1 { background: var(--coral); box-shadow: 0 8px 0 var(--coral-d); }
.pad.p2 { background: var(--mint);  box-shadow: 0 8px 0 var(--mint-d); }
.pad.p3 { background: var(--grape); box-shadow: 0 8px 0 var(--grape-d); }

/* Zasveti, ko ga igra predvaja ali ko ga otrok pritisne. */
.pad.lit { opacity: 1; transform: translateY(-3px) scale(1.03); }
.pad:active { transform: translateY(4px); }
.pads.locked .pad { pointer-events: none; }

/* Pikice pokažejo, koliko tonov je otrok že ponovil — brez števil,
   ker jih štiriletnik še ne bere. */
.dots { display: flex; gap: 7px; min-height: 14px; flex-wrap: wrap; justify-content: center; }
.dots span {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(35,48,74,.15);
  transition: background .18s ease, transform .18s ease;
}
.dots span.done { background: var(--mint); transform: scale(1.15); }

.message {
  text-align: center;
  min-height: 1.8em;
  font-size: clamp(.95rem, 2.6vh, 1.3rem);
  font-weight: 600;
  color: var(--ink-soft);
}
.message.good { color: var(--mint-d); }
.message.bad  { color: var(--coral-d); }

.score-chip.current .val { color: var(--grape-d); }

@media (orientation: landscape) and (max-height: 560px) {
  .pads { --chrome: 130px; gap: 8px; }
  .pad { border-radius: 18px; }
}
@media (orientation: landscape) and (max-height: 430px) {
  /* Na boku telefona ni prostora za mrežo 2x2 — ploščice v eno vrsto. */
  .pads {
    --chrome: 60px;
    grid-template-columns: repeat(4, 1fr);
    max-width: min(100%, calc((100dvh - var(--chrome)) * 4), 560px);
    gap: 6px;
  }
  .pad { border-radius: 14px; box-shadow: 0 4px 0 rgba(35,48,74,.18); }
  .dots { min-height: 10px; }
  .dots span { width: 8px; height: 8px; }
  .board { gap: 6px; }
  .message { font-size: .82rem; min-height: 1.4em; }
}
