.ctg-wrap {
  max-width: 720px;
  margin: 24px auto 48px;
  padding: 0 16px;
  font-family: 'Times New Roman', serif;
}

.ctg-wrap h2 {
  margin: 0 0 8px;
  color: #003253;
}

.ctg-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 16px;
  border-bottom: 2px solid #003253;
}

.ctg-tab {
  font-family: inherit;
  font-size: 1.15em;
  color: #003253;
  background: transparent;
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 8px 22px;
  cursor: pointer;
  margin-bottom: -2px;
}

.ctg-tab.is-on {
  background: #003253;
  color: #fff;
  border-color: #003253;
}

.ctg-board.n5 .ctg-cell {
  width: 68px;
  height: 68px;
  font-size: 26px;
}

.ctg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: baseline;
  margin-bottom: 16px;
  color: #203E5E;
}

.ctg-meta .seed {
  font-variant-numeric: tabular-nums;
}

.ctg-meta .timer {
  font-variant-numeric: tabular-nums;
  font-weight: bold;
}

.ctg-board-wrap {
  display: inline-block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  border: 3px solid #003253;
  border-radius: 6px;
  background: #f7f4ee;
  padding: 4px;
}

.ctg-board {
  display: grid;
  gap: 2px;
}

.ctg-cell {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  color: #003253;
  background: #fff;
  border: 1px solid #c5d0da;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.ctg-cell.trail {
  background: #cfe8ff;
  border-color: #3a7ab8;
}

.ctg-cell.found-0 { background: #f6c1c1; border-color: #c62828; color: #6a1b1b; }
.ctg-cell.found-1 { background: #bbdefb; border-color: #1565c0; color: #0d47a1; }
.ctg-cell.found-2 { background: #ffe082; border-color: #f9a825; color: #6d4c00; }
.ctg-cell.found-3 { background: #e1bee7; border-color: #7b1fa2; color: #4a148c; }
.ctg-cell.found-4 { background: #b2dfdb; border-color: #00695c; color: #004d40; }
.ctg-cell.found-5 { background: #ffccbc; border-color: #e64a19; color: #bf360c; }
.ctg-cell.found-6 { background: #c5cae9; border-color: #283593; color: #1a237e; }

.ctg-cell.start {
  background: #fff8e1;
  box-shadow: inset 0 0 0 3px #e6a817;
}

.ctg-cell.start.trail {
  background: #ffe08a;
}

.ctg-hint-btn {
  font-family: inherit;
  font-size: 1em;
  color: #003253;
  background: #fff;
  border: 2px solid #003253;
  border-radius: 6px;
  padding: 4px 14px;
  cursor: pointer;
}

.ctg-hint-btn:hover:not(:disabled) {
  background: #fff8e1;
}

.ctg-hint-btn:disabled {
  color: #8aa0b4;
  border-color: #c5d0da;
  cursor: default;
}

.ctg-found-list {
  margin-top: 20px;
  min-height: 2.5em;
}

.ctg-found-list h3 {
  margin: 0 0 8px;
  color: #003253;
  font-size: 1.1em;
}

.ctg-slot {
  font-size: 1.2em;
  margin: 6px 0;
  color: #003253;
}

a.ctg-slot-word {
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a.ctg-slot-word.found-0 { background: #f6c1c1; color: #6a1b1b; }
a.ctg-slot-word.found-1 { background: #bbdefb; color: #0d47a1; }
a.ctg-slot-word.found-2 { background: #ffe082; color: #6d4c00; }
a.ctg-slot-word.found-3 { background: #e1bee7; color: #4a148c; }
a.ctg-slot-word.found-4 { background: #b2dfdb; color: #004d40; }
a.ctg-slot-word.found-5 { background: #ffccbc; color: #bf360c; }
a.ctg-slot-word.found-6 { background: #c5cae9; color: #1a237e; }

#ctg-docs {
  max-width: 40em;
  font-size: 1.15em;
  line-height: 1.5;
  color: #003253;
}

#ctg-docs p {
  margin: 0 0 1em;
}

#ctg-docs img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.ctg-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 6px;
  background: #eef3f8;
  color: #003253;
  min-height: 1.4em;
}

.ctg-status.win {
  background: #e8f5e9;
  border: 1px solid #2e7d32;
  font-size: 1.15em;
}

.ctg-status.error {
  background: #fdecea;
  border: 1px solid #c62828;
  color: #b71c1c;
}

.ctg-hint {
  margin-top: 12px;
  color: #555;
  font-size: 0.95em;
}

@media (max-width: 520px) {
  .ctg-cell {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }
}
