/* ===== Cryptic Conclave — shared "How to Play" widget =====
   Paired with /js/cc-how-to-play.js. Converts each standard minigame's
   `.game-info` panel into a button and a modal, so instructions stop eating
   the top of every play area.

   CURSORS: never write a bare `cursor: pointer` in this file. It would override
   the site's skeleton-hand cursor, which is set on `button` in cryptic.css for
   standard pages. Always use the full url() stack below. */

.cc-htp-bar {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

.cc-htp-trigger,
.cc-htp-done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  border: 1px solid #00cccc;
  border-radius: 999px;
  background: rgba(10, 22, 26, 0.92);
  color: #9fdede;
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor:
    url('/images/cursors/hover.cur') 11 0,
    url('/images/cursors/hover.png') 11 0,
    pointer;
}

.cc-htp-trigger::before {
  content: '?';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 700;
}

.cc-htp-trigger:hover,
.cc-htp-done:hover {
  color: #00ffff;
  border-color: #00ffff;
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.28);
}

.cc-htp-trigger:focus-visible,
.cc-htp-done:focus-visible,
.cc-htp-x:focus-visible {
  outline: 2px solid #00ffff;
  outline-offset: 3px;
}

/* --- Modal -------------------------------------------------------------- */

.cc-htp-overlay {
  position: fixed;
  inset: 0;
  /* Above the bug reporter's floating trigger (9998), below its own modal
     (9999), so a bug report opened afterwards still lands on top. In practice
     the floating trigger only appears on standalone pages, which do not load
     this widget at all — this ordering is belt and braces. */
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 8, 10, 0.82);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.cc-htp-overlay.is-open { opacity: 1; }

.cc-htp-overlay[hidden] { display: none; }

.cc-htp-dialog {
  width: min(620px, 100%);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid #00cccc;
  border-radius: 14px;
  background: linear-gradient(180deg, #0b171b 0%, #060d0f 100%);
  box-shadow: 0 0 46px rgba(0, 255, 255, 0.22);
  transform: translateY(10px);
  transition: transform 0.18s ease;
}

.cc-htp-overlay.is-open .cc-htp-dialog { transform: translateY(0); }

.cc-htp-dialog:focus { outline: none; }

.cc-htp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #1d4147;
}

.cc-htp-title {
  margin: 0;
  color: #00dddd;
  font-size: 1.24rem;
  text-align: left;
}

.cc-htp-x {
  border: 0;
  background: none;
  color: #6fb7b7;
  font-size: 1.7rem;
  line-height: 1;
  padding: 0 4px;
  font-family: inherit;
  transition: color 0.15s ease;
  cursor:
    url('/images/cursors/hover.cur') 11 0,
    url('/images/cursors/hover.png') 11 0,
    pointer;
}

.cc-htp-x:hover { color: #00ffff; }

.cc-htp-body {
  padding: 16px 20px;
  overflow-y: auto;
  text-align: left;
  color: #cfeaea;
  scrollbar-width: thin;
  scrollbar-color: #00807f rgba(10, 22, 26, 0.6);
}

.cc-htp-body::-webkit-scrollbar { width: 9px; }
.cc-htp-body::-webkit-scrollbar-track { background: rgba(10, 22, 26, 0.6); border-radius: 999px; }
.cc-htp-body::-webkit-scrollbar-thumb { background: #00807f; border-radius: 999px; }
.cc-htp-body::-webkit-scrollbar-thumb:hover { background: #00cccc; }

.cc-htp-body ul,
.cc-htp-body ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.cc-htp-body li { margin-bottom: 7px; }

.cc-htp-body p { margin: 0 0 12px; }

.cc-htp-body > :last-child { margin-bottom: 0; }

.cc-htp-body h2,
.cc-htp-body h3,
.cc-htp-body h4 {
  margin: 16px 0 8px;
  color: #00dddd;
  font-size: 1rem;
}

.cc-htp-body img { max-width: 100%; height: auto; }

.cc-htp-foot {
  padding: 12px 20px 16px;
  border-top: 1px solid #1d4147;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 520px) {
  .cc-htp-dialog { max-height: 86vh; }
  .cc-htp-foot { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-htp-overlay,
  .cc-htp-dialog { transition: none; }
}
