/* Where Are Hue?: the grid of squares and the 3x3 logo. Loaded after style.css (the look shared with the other games). */

:root { --odd: #2fae9a; --odd-edge: #1f8a79; }

/* ---- the logo: nine squares that look the same, one that doesn't ---- */
.glogo { display: grid; grid-template-columns: repeat(3, auto); gap: 4px; justify-content: center; }
.glogo i {
  width: clamp(16px, 3vh, 24px); height: clamp(16px, 3vh, 24px); border-radius: 6px;
  background: hsl(212 62% 54%);
}
.glogo i.odd { background: hsl(212 62% 64%); }
.glogo-spin i.odd { animation: glow 1.1s ease-in-out infinite alternate; }
@keyframes glow { from { background: hsl(212 62% 54%); } to { background: hsl(212 62% 70%); } }

/* ---- the progress bars: six rounds ---- */
.bars { grid-template-columns: repeat(6, 1fr); }

/* ---- the grid ---- */
/* it is as big as the screen allows and always square, so every level fits without scrolling */
.game { justify-content: flex-start; }
.grid-wrap {
  flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center;
  container-type: size;
}
.grid {
  --cols: 4; --rows: 4; --gap: 6px;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr);
  gap: var(--gap);
  width: min(100cqw, 100cqh, 440px); aspect-ratio: var(--cols) / var(--rows);
  height: auto;
}
@supports not (width: 1cqw) { .grid { width: min(100%, 56vh, 440px); } }
.grid.dense { --gap: 4px; }
.sq {
  appearance: none; border: 0; padding: 0; margin: 0; min-width: 0; min-height: 0;
  border-radius: clamp(5px, 14%, 14px);
  background: var(--c, #888);
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.sq { touch-action: manipulation; -webkit-touch-callout: none; }
/* pressed: dim it, never shrink it (a shrinking square can slide out from under the finger and lose the tap) */
.sq:active:not(:disabled) { filter: brightness(0.9); }
.sq:disabled { cursor: default; }
/* no letters, no symbols: a wrong square shrinks and vanishes (its place stays empty), the right one lifts */
.sq.wrong { opacity: 0; transform: scale(0.4); visibility: hidden; pointer-events: none; transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s 0.18s; }
.sq.right { transform: scale(1.12); box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px #fff; z-index: 1; position: relative; }
.grid.fresh .sq { animation: pop 0.22s ease-out both; }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
.grid.shake { animation: shake 0.3s; }

/* a small demo grid in the tutorial */
.tut-stage .grid-wrap { flex: 1 1 auto; }
.tut-stage .grid { width: min(100cqw, 100cqh, 340px); }

/* the sample result in the tutorial */
.tut-pills { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ---- the results list: six rounds, each a row (number on the left, time on the right) ---- */
.review { grid-template-rows: repeat(6, minmax(0, 1fr)); max-height: 360px; }
.review .row-in {
  width: 100%; height: 100%; min-height: 0; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--surface); border: 1.5px solid var(--surface-edge); border-radius: 14px;
  font-weight: 800; font-size: clamp(0.85rem, 2.2vh, 1rem);
}
.review .row-in .num { color: var(--muted); flex: none; min-width: 1.2em; }
.review .row-in .time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; white-space: nowrap; }
.review .row-in .time .x { color: var(--wrong); }
.review .row-in .time .tag { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--surface-edge); color: var(--muted); font-size: 0.7rem; font-weight: 900; }
.tut-review { grid-template-rows: none; }
.tut-review .row-in { background: var(--bg); border: 0; border-radius: 12px; padding: 7px 12px; height: auto; }
