/*
  NavyTime Crossword page CSS.
  Header/nav/banner come from the real homepage structure and styles.css.
  This file only controls the crossword area.
*/

.cw-page {
  min-height: 100vh;
}

.cw-wrap {
  width: min(1500px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.cw-titlebar,
.cw-status,
.cw-grid-wrap,
.cw-clue-column,
.cw-share {
  border: 1px solid rgba(135, 180, 255, 0.22);
  border-radius: 12px;
  background: rgba(8, 20, 38, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.cw-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.25rem;
}

.cw-kicker {
  margin: 0 0 0.25rem;
  color: #8ec5ff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cw-titlebar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.cw-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.55rem 0 0;
  color: #bfd5f5;
}

.cw-controls {
  display: grid;
  justify-items: end;
  gap: 0.65rem;
}

.cw-difficulty-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #dbeaff;
  font-weight: 700;
}

.cw-difficulty-label select {
  border: 1px solid rgba(150, 190, 255, 0.35);
  border-radius: 999px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  color: #ffffff;
  background: rgba(10, 25, 48, 0.95);
  font-weight: 700;
}

.cw-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.cw-actions button,
.cw-share button {
  border: 1px solid rgba(150, 190, 255, 0.35);
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(45, 105, 190, 0.95), rgba(20, 65, 130, 0.95));
  cursor: pointer;
  font-weight: 700;
}

.cw-actions button:hover,
.cw-share button:hover {
  filter: brightness(1.12);
}

.cw-status {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  color: #dbeaff;
}

.cw-status-error {
  border-color: rgba(255, 120, 120, 0.55);
  color: #ffd6d6;
}

/* Main crossword layout */
.cw-game {
  display: grid !important;
  grid-template-columns:
    minmax(220px, 300px)
    minmax(460px, 680px)
    minmax(220px, 300px);
  grid-template-areas: "across puzzle down";
  justify-content: center;
  align-items: start;
  gap: 1rem;
  width: 100%;
}

.cw-across-panel {
  grid-area: across;
}

.cw-puzzle-panel {
  grid-area: puzzle;
  display: flex;
  justify-content: center;
  width: 100%;
}

.cw-down-panel {
  grid-area: down;
}

.cw-grid-wrap {
  width: 100%;
  max-width: 680px;
  padding: clamp(0.5rem, 1.5vw, 1rem);
}

.cw-grid {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 3px solid #06101f;
  background: #06101f;
  gap: 1px;
}

.cw-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #f8fbff;
  color: #07111f;
}

.cw-cell-black {
  background: #050914;
}

.cw-cell-active {
  background: #dcecff;
}

.cw-cell-number {
  position: absolute;
  top: 2px;
  left: 3px;
  z-index: 2;
  color: #233450;
  font-size: clamp(0.45rem, 1vw, 0.7rem);
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.cw-cell input {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: #07111f;
  text-align: center;
  text-transform: uppercase;
  font-size: clamp(1rem, 2.4vw, 2rem);
  font-weight: 800;
  outline: none;
}

.cw-cell input:focus {
  background: #fff3a6;
}

.cw-cell input.cw-good {
  color: #0a7a39;
}

.cw-cell input.cw-bad {
  color: #b00020;
  background: #ffd9df;
}

.cw-clue-column {
  overflow: hidden;
}

.cw-clue-column h2 {
  margin: 0;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.1rem;
}

.cw-clue-list {
  display: grid;
  gap: 0.25rem;
  max-height: 680px;
  margin: 0;
  padding: 0.75rem;
  overflow: auto;
  list-style: none;
}

.cw-clue-list li button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  color: #dceaff;
  background: transparent;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}

.cw-clue-list li button:hover,
.cw-clue-active button {
  background: rgba(115, 170, 255, 0.18);
  color: #ffffff;
}

.cw-share {
  margin-top: 1.25rem;
  padding: 1rem;
}

.cw-share h2 {
  margin: 0 0 0.5rem;
}

.cw-share p {
  margin: 0 0 0.75rem;
  color: #cfe0f8;
}

@media (max-width: 980px) {
  .cw-titlebar {
    align-items: stretch;
    flex-direction: column;
  }

  .cw-controls {
    justify-items: stretch;
  }

  .cw-actions {
    justify-content: flex-start;
  }

  .cw-game {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "puzzle puzzle"
      "across down";
  }

  .cw-grid-wrap {
    max-width: 680px;
  }

  .cw-clue-list {
    max-height: none;
  }
}

@media (max-width: 650px) {
  .cw-wrap {
    width: min(100% - 0.75rem, 1500px);
  }

  .cw-game {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "puzzle"
      "across"
      "down";
  }

  .cw-actions button,
  .cw-share button {
    flex: 1 1 auto;
  }

  .cw-cell-number {
    font-size: 0.45rem;
  }
}

@media print {
  .cw-actions,
  .cw-share,
  .cw-difficulty-label {
    display: none;
  }

  .cw-wrap {
    width: 100%;
  }

  .cw-titlebar,
  .cw-grid-wrap,
  .cw-clue-column {
    border-color: #000000;
    background: #ffffff;
    color: #000000;
    box-shadow: none;
  }

  .cw-game {
    grid-template-columns: 1fr 1.4fr 1fr !important;
    grid-template-areas: "across puzzle down";
  }

  .cw-clue-list li button {
    color: #000000;
  }
}

/* Wider centered crossword layout refinement */
.cw-game {
  width: 100%;
  grid-template-columns:
    minmax(260px, 1fr)
    minmax(560px, 820px)
    minmax(260px, 1fr) !important;
  grid-template-areas: "across puzzle down";
  justify-content: stretch;
}

.cw-grid-wrap {
  max-width: 820px;
}

@media (max-width: 1120px) {
  .cw-game {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "puzzle puzzle"
      "across down";
  }

  .cw-puzzle-panel {
    justify-content: center;
  }

  .cw-grid-wrap {
    max-width: 780px;
  }
}

@media (max-width: 650px) {
  .cw-game {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "puzzle"
      "across"
      "down";
  }

  .cw-grid-wrap {
    max-width: 100%;
  }
}

/* Match NavyTime homepage panel colors */
.cw-titlebar,
.cw-status,
.cw-grid-wrap,
.cw-clue-column,
.cw-share {
  background: linear-gradient(180deg,var(--panelTop),var(--panelBot));
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

/* Match homepage panel title feel */
.cw-clue-column h2 {
  color: var(--text);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}


/* Small crawlable SEO strip at bottom of crossword page */
.crossword-seo-strip {
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 7px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: rgba(203, 213, 225, 0.72);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

.crossword-seo-strip strong {
  color: rgba(241, 245, 249, 0.86);
  font-weight: 700;
}
