/* Odd One — a quiet field of look-alike characters in the bottom of the screen (no grid lines: the field is the
   stimulus), a 1 px clock line above it. After a round the odd one and the rest stand side by side up top. */

.od-stim { min-height: 0; }
.od-status { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.od-meta { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--stage-dim); }
.od-big { margin: 0; min-height: 46px; font-size: 40px; font-weight: 200; letter-spacing: -0.5px; line-height: 46px; color: var(--stage-ink); }

.od-pair { display: flex; gap: 22px; min-height: 96px; align-items: flex-start; justify-content: center; }
.od-pair figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.od-pair b {
  width: 72px; height: 72px; border: 1px solid var(--stage-line); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 50px; font-weight: 400; line-height: 1; color: var(--stage-dim);
}
.od-pair .odd b { border-color: var(--stage-ink); color: var(--stage-ink); }
.od-pair small { font-size: 12px; color: var(--stage-dim); }

.od-controls { align-items: center; }
.od-board {
  --cols: 8;
  --cell: 44px;
  --fs: 28px;
  /* may be a little wider than the play area (into the side gutters); the flex column keeps it centred */
  width: calc(var(--cols) * var(--cell));
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.od-clock { height: 1px; margin: 0 4px; background: var(--stage-line); overflow: hidden; }
.od-clock i { display: block; height: 100%; background: var(--stage-dim); transform-origin: left center; }
.od-clock.off { visibility: hidden; }

.od-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-auto-rows: var(--cell);
  font-size: var(--fs);
  line-height: 1;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.od-grid.latin, .od-pair.latin { font-family: var(--sans); font-variant-numeric: lining-nums; font-feature-settings: 'zero' 0; }
.od-grid.hanzi, .od-pair.hanzi { font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Microsoft YaHei', var(--sans); }

.od-cell {
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--stage-ink);
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.od-cell:active { background: #1A1918; }
.od-cell.wrong { color: var(--stage-faint); }
.od-cell.hint { box-shadow: inset 0 0 0 1px var(--stage-dim); }

/* the round is over: everything else steps back, the odd one stands out */
.od-grid.over .od-cell { color: var(--stage-faint); }
.od-grid.over .od-cell.found { background: var(--stage-ink); color: var(--stage); }
.od-grid.over .od-cell.shown { color: var(--stage-ink); box-shadow: inset 0 0 0 1.5px var(--stage-ink); }

/* short phones (iPhone SE): a more compact result area so the 10-row field still fits */
@media (max-height: 720px) {
  .od-status { gap: 6px; }
  .od-big { min-height: 38px; font-size: 32px; line-height: 38px; }
  .od-pair { min-height: 78px; }
  .od-pair b { width: 56px; height: 56px; border-radius: 14px; font-size: 38px; }
}

/* very short phones (360 × 600): the odd one and the rest stand beside the time instead of under it,
   so the 10-row field and its clock still fit above the bottom edge */
@media (max-height: 640px) {
  .od-status { display: grid; grid-template-columns: auto auto; grid-template-areas: 'meta pair' 'big pair'; align-items: center; column-gap: 0; row-gap: 2px; }
  .od-meta { grid-area: meta; align-self: end; text-align: center; }
  .od-big { grid-area: big; align-self: start; text-align: center; min-height: 34px; font-size: 28px; line-height: 34px; }
  .od-pair { grid-area: pair; min-height: 0; gap: 12px; margin-left: 18px; }
  .od-pair:empty { display: none; }
  .od-pair b { width: 50px; height: 50px; border-radius: 12px; font-size: 34px; }
}
