/* Times Tables — page-specific styles */

.question {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 11vw, 3.6rem);
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.entry {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 10vw, 3rem);
  line-height: 1;
  color: #c4b8a2;
  min-height: 1.1em;
  transition: color 0.15s, transform 0.15s;
}

.entry.has-answer { color: var(--color-orange); }
.entry.is-right { color: #2f9e78; transform: scale(1.12); }
.entry.is-wrong { color: var(--color-coral); }

/* A keypad, because most of this will be done on a phone with one thumb. */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  max-width: 17rem;
  margin: 0.9rem auto 0.2rem;
}

.key {
  padding: 0.7rem 0;
  border: 2px solid #e8e2d8;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}

.key:hover, .key:focus-visible { border-color: var(--color-orange); outline: none; }
.key:active { transform: translateY(2px); }
.key--go { background: #e8f8f0; border-color: #bfe6d6; color: #2f9e78; }
.key--rub { color: var(--color-text-muted); }

.choose-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0.7rem 0 0.35rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 2px solid #e8e2d8;
  background: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.chip:hover, .chip:focus-visible { border-color: var(--color-orange); outline: none; }
.chip.is-on { background: var(--color-orange); border-color: var(--color-orange); color: #fff; }

/* The grid: thirteen columns, the first one being the row labels. */
.tt-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 2px;
  margin-top: 0.6rem;
}

.gcell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.42rem, 1.55vw, 0.72rem);
  background: #f4eee1;
  color: #b6a68c;
}

.gcell--head { background: transparent; color: var(--color-text-muted); font-weight: 700; }

/* Nothing to full, in five steps you can see from across the room. */
.strength-0 { background: #f4eee1; color: #c3b69c; }
.strength-1 { background: #ffe6cc; color: #9a6b33; }
.strength-2 { background: #ffd4a8; color: #8a5a20; }
.strength-3 { background: #ffbe7a; color: #6f4512; }
.strength-4 { background: #8fd9b6; color: #14503a; }
.strength-5 { background: #4fc08d; color: #08341f; }

.gcell.is-off { opacity: 0.42; }

.tricky-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 1rem 0 0.4rem;
  color: var(--color-text-muted);
}

.tricky { display: flex; flex-wrap: wrap; gap: 0.35rem; color: var(--color-text-muted); }

.tricky-chip {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: #ffe3e3;
  color: #d64545;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
  .entry, .key { transition: none; }
}

/* Phones: the thirteen-by-thirteen grid's numbers fell to 6.7px. "144" still fits a cell at 9px. */
@media (max-width: 640px) {
  .gcell { font-size: clamp(0.58rem, 2.5vw, 0.72rem); }
}
