/* ============================================================================
   Mini Crossword player styles
   Uses the OTP brand color (#c8102e) and Lato/Merriweather fonts from site.
   ============================================================================ */
.crossword-page {
  background: #f3f3f3;
  margin: 0;
  font-family: 'Lato', sans-serif;
  color: #1b1b1b;
  -webkit-text-size-adjust: 100%;
}

/* ---- Header / footer ---- */
.game-header {
  background: #1b1b1b;
  border-bottom: 1px solid #1b1b1b;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.game-logo img {
  height: 32px;
  display: block;
}
.game-back {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.game-back:hover { color: #c8102e; }
.game-footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 12px;
  color: #888;
}
.game-footer a {
  color: #c8102e;
  text-decoration: none;
}

/* ---- Layout ---- */
.game-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.game-container { width: 100%; }

.game-titlebar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.game-title {
  font-family: 'Merriweather', serif;
  font-size: 28px;
  font-weight: 900;
  margin: 0;
}
.game-meta {
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.puzzle-date {
  font-size: 13px;
  color: #666;
}
.puzzle-timer {
  font-size: 15px;
  font-weight: 700;
  color: #1b1b1b;
  font-variant-numeric: tabular-nums;
}

.loading-message {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

/* ---- Grid ---- */
.grid-wrap {
  position: relative;
  margin: 0 auto 16px;
  max-width: 500px;
}
.active-clue {
  background: #fff7d6;
  border: 1px solid #e8c700;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  min-height: 22px;
}
.active-clue .clue-direction {
  font-weight: 900;
  color: #c8102e;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 8px;
}
.grid-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #1b1b1b;
  border: 2px solid #1b1b1b;
  aspect-ratio: 1 / 1;
  user-select: none;
  -webkit-user-select: none;
  margin: 0 auto;
  max-width: 100%;
}
.cell {
  position: relative;
  background: #fff;
  border-right: 1px solid #1b1b1b;
  border-bottom: 1px solid #1b1b1b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lato', sans-serif;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}
.cell:nth-child(7n) { border-right: none; }
.cell:nth-child(n+43) { border-bottom: none; }  /* 7x7: last 7 cells skip bottom border */
.cell.black {
  background: #1b1b1b;
  cursor: default;
}
.cell-number {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #555;
}
.cell.in-slot {
  background: #d6eafd;
}
.cell.active {
  background: #fdd96e;
}
.cell.wrong {
  background: #fde0e0;
}
.cell.wrong .cell-letter {
  color: #c8102e !important;
  text-decoration: line-through;
}
.cell.revealed .cell-letter {
  color: #1b6fc4 !important;
}
.cell-letter {
  color: #1b1b1b;
  line-height: 1;
}

/* ---- Action buttons ---- */
.game-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0 24px;
  flex-wrap: wrap;
}
.game-btn {
  background: #fff;
  border: 1.5px solid #1b1b1b;
  color: #1b1b1b;
  padding: 8px 18px;
  border-radius: 4px;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.game-btn:hover { background: #f3f3f3; }
.game-btn.primary {
  background: #c8102e;
  color: #fff;
  border-color: #c8102e;
}
.game-btn.primary:hover { background: #a30d24; }

/* ---- Action menu (Reveal/Check dropdowns) ---- */
.action-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #1b1b1b;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  overflow: hidden;
}
.action-menu button {
  display: block;
  width: 100%;
  background: #fff;
  border: none;
  border-bottom: 1px solid #eee;
  padding: 10px 16px;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: left;
}
.action-menu button:last-child { border-bottom: none; }
.action-menu button:hover { background: #f3f3f3; }

/* ---- Clue lists ---- */
.clues-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}
.clues-column h3 {
  font-family: 'Merriweather', serif;
  font-size: 16px;
  font-weight: 900;
  border-bottom: 2px solid #c8102e;
  padding-bottom: 6px;
  margin: 0 0 8px;
}
.clue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}
.clue-list li {
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 3px;
}
.clue-list li:hover {
  background: #f3f3f3;
}
.clue-list li.active {
  background: #fff7d6;
  font-weight: 700;
}
.clue-number {
  font-weight: 700;
  margin-right: 6px;
  color: #c8102e;
}

/* ---- Hidden input ---- */
/* Use position:fixed with opacity 0 so the input has no physical
   space and the browser won't scroll-to-view when it takes focus.
   Avoid top: -9999px (the classic anti-pattern that triggers scroll
   on iOS Safari). */
.hidden-input {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  font-size: 16px;  /* prevents iOS zoom-on-focus */
}

/* ---- Win modal ---- */
.win-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.win-modal-inner {
  background: #fff;
  border-radius: 8px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.win-modal-inner h2 {
  font-family: 'Merriweather', serif;
  font-size: 28px;
  font-weight: 900;
  color: #c8102e;
  margin: 0 0 12px;
}
.win-modal-inner p { margin: 8px 0; font-size: 15px; }
.win-modal-inner .win-sub { color: #666; font-size: 13px; }
.win-modal-inner .game-btn { margin-top: 16px; }
.win-result-summary {
  font-weight: 700;
  color: #1b6fc4;
  font-size: 14px !important;
}
.win-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.win-actions .game-btn {
  margin-top: 0;
  width: 100%;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .game-main { padding: 16px 12px 40px; }
  .game-title { font-size: 24px; }
  .clues-wrap {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cell { font-size: 22px; }
  .cell-number { font-size: 9px; }
}
