/* ─── Quordle ─────────────────────────────────────────────────────────── */

.quordle-game {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; width: 100%; padding: 8px; align-self: stretch;
}

/* 2x2 layout of mini-boards. On wide screens we let them sit side-by-side
   in a 4-wide row to use the available width. */
.quordle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: min(94vw, 720px);
}
@media (min-width: 1100px) {
  .quordle-grid {
    grid-template-columns: repeat(4, 1fr);
    width: min(96vw, 1080px);
  }
}

.quordle-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 6px;
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
}
.quordle-board.quordle-board-solved {
  border-color: #15803d;
  background: rgba(21, 128, 61, 0.08);
}

.quordle-row { display: contents; }
.quordle-cell {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(11px, 2.6vw, 17px);
  font-weight: 700;
  text-transform: uppercase;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: var(--ink, #111);
  user-select: none;
}
.quordle-cell.quordle-empty { color: transparent; }
.quordle-cell.quordle-typed {
  border-color: #94a3b8;
  transform: scale(1.04);
  transition: transform 0.05s;
}
.quordle-cell.quordle-cell-next { box-shadow: inset 0 -3px 0 #94a3b8; }
.quordle-cell.quordle-hit  { background: #15803d; border-color: #15803d; color: #fff; }
.quordle-cell.quordle-near { background: #d97706; border-color: #d97706; color: #fff; }
.quordle-cell.quordle-miss { background: #6b7280; border-color: #6b7280; color: #fff; }

.quordle-row-active .quordle-cell.quordle-empty { background: #f8fafc; }
.quordle-row.shake { animation: quordle-shake 0.45s ease-in-out; }
@keyframes quordle-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

.quordle-board-answer {
  position: absolute; left: 0; right: 0; bottom: -22px;
  text-align: center;
  font-size: 13px; font-weight: 700;
  color: #b91c1c;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Keyboard — same shape as wordle but each key shows 4 small dots
   (one per board) instead of a single colored background, since a
   letter can be different states across the four boards. */
.quordle-kb {
  display: flex; flex-direction: column; gap: 6px;
  width: min(96vw, 600px);
  margin-top: 12px;
}
.quordle-kb-row {
  display: flex; gap: 4px; justify-content: center;
}
.quordle-key {
  flex: 1 1 0; min-width: 0;
  height: 54px;
  border: 0; border-radius: 6px;
  background: #e2e8f0;
  font-size: 15px; font-weight: 700;
  color: var(--ink, #111);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 3px 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.quordle-key:active { background: #cbd5e1; }
.quordle-key-letter { font-size: 15px; line-height: 1; }
.quordle-key-pips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  width: 14px; height: 10px;
}
.quordle-key-pip {
  width: 5px; height: 4px;
  border-radius: 1px;
  background: rgba(0,0,0,0.18);
  align-self: center; justify-self: center;
}
.quordle-key-pip-hit  { background: #15803d; }
.quordle-key-pip-near { background: #d97706; }
.quordle-key-pip-miss { background: #3f3f46; }
.quordle-key-pip-none { background: rgba(0,0,0,0.14); }
.quordle-key-wide {
  flex: 0 0 auto;
  min-width: 58px; max-width: 80px;
  font-size: 12px;
  flex-direction: row;
  gap: 4px;
}
.quordle-key-wide .quordle-key-pips { display: none; }

@media (max-width: 480px) {
  .quordle-key { height: 48px; }
  .quordle-key-letter { font-size: 13px; }
  .quordle-key-pips { width: 12px; height: 8px; }
  .quordle-key-pip { width: 4px; height: 3px; }
  .quordle-key-wide { min-width: 50px; }
}

.quordle-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
