/* ==========================================================================
   DryScout.org — Hurricane Prep (V1)
   Builds on ../styles.css (tokens, header, buttons, type). Game-only rules here.
   Three screens: start / game / results. Subtle storm atmosphere via CSS only.
   ========================================================================== */

.hp-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Soft sky wash at the top of the page. Pale, restrained; gameplay stays the focus. */
.hp-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 42% at 12% 6%, rgba(23, 163, 218, 0.10), transparent 70%),
    radial-gradient(ellipse 52% 36% at 88% 10%, rgba(15, 27, 61, 0.09), transparent 70%),
    linear-gradient(180deg, #EEF5FC 0%, #FFFFFF 460px);
}
.hp-body .site-header { background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(6px); }

.hp-back { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--navy); min-height: 44px; white-space: nowrap; flex: none; }
.hp-back:hover { color: var(--blue); }
.hp-back .arrow { font-weight: 600; }

.hp-main { padding: 0 0 56px; }
.hp-screen[hidden] { display: none; }

/* Shared focus state (keyboard) */
.hp-body button:focus-visible, .hp-body a:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: 3px;
}
.hp-body button, .hp-body a { -webkit-tap-highlight-color: transparent; }

/* ---------- SCREEN 1: START ---------- */
.hp-start-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; column-gap: 40px;
  min-height: calc(100vh - 76px - 56px);
  padding-top: 24px; padding-bottom: 24px;
}
.hp-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 4.6vw, 64px); line-height: 1.08; letter-spacing: -0.02em;
  color: var(--navy); margin-top: 22px; max-width: 12ch;
}
.hp-lede { font-size: 22px; color: var(--text-soft); margin-top: 14px; }
.hp-btn-start { font-size: 20px; padding: 18px 30px; margin-top: 34px; border-radius: 14px; min-height: 56px; }

.hp-start-jax { position: relative; width: clamp(220px, 26vw, 400px); margin-right: clamp(0px, 6vw, 80px); pointer-events: none; }
.hp-start-jax img { width: 100%; height: auto; position: relative; z-index: 1; }
.hp-jax-shadow {
  position: absolute; left: 14%; right: 12%; bottom: 1%; height: 9%;
  background: radial-gradient(ellipse at center, rgba(15, 27, 61, 0.20) 0%, rgba(15, 27, 61, 0) 70%);
}

/* ---------- SCREEN 2: GAME ---------- */
.hp-game .container { padding-top: 22px; }
.hp-panel {
  background: var(--surface);
  border: 1px solid rgba(15, 27, 61, 0.08);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(15, 27, 61, 0.07);
  overflow: hidden;
}

/* Navy strip: title on the left, TIME / SCORE on the right. Text only, no icons. */
.hp-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px 26px;
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff;
}
.hp-game-title { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.01em; line-height: 1.1; }
.hp-game-sub { font-size: 15px; color: rgba(255, 255, 255, 0.78); margin-top: 4px; }
.hp-stats { display: flex; gap: 8px; flex: none; }
.hp-stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 92px; padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.hp-stat-label { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.72); }
.hp-stat-value { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hp-stat-value.is-low { color: #FFD166; }

/* Item grid */
.hp-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
  padding: 18px 22px 12px;
}
.hp-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 116px; padding: 12px 8px 10px;
  background: #fff; color: var(--navy);
  border: 2px solid var(--line); border-radius: 14px;
  text-align: center;
  transition: border-color .12s ease, background-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
@media (hover: hover) {
  .hp-tile:hover { border-color: #B7C6DD; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15, 27, 61, 0.06); }
}
.hp-tile:active { transform: translateY(0); }
.hp-tile-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--pale-blue); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
}
.hp-tile-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hp-tile-name { font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 1.2; }

/* Selected: border + tint + checkmark badge (not colour alone) */
.hp-tile-check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue); color: #fff; opacity: 0; transform: scale(.6);
  transition: opacity .12s ease, transform .12s ease;
}
.hp-tile-check::after {
  content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg);
}
.hp-tile[aria-pressed="true"] { border-color: var(--blue); background: var(--pale-blue); box-shadow: 0 0 0 3px rgba(30, 111, 230, 0.14); }
.hp-tile[aria-pressed="true"] .hp-tile-icon { background: #fff; color: var(--blue); }
.hp-tile[aria-pressed="true"] .hp-tile-check { opacity: 1; transform: scale(1); }

/* Your kit */
.hp-kit {
  display: flex; align-items: center; gap: 22px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line-soft);
  background: #F7FAFE;
}
.hp-kit-label { display: flex; flex-direction: column; flex: none; min-width: 92px; }
.hp-kit-title { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--navy); }
.hp-kit-count { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.hp-slots { display: flex; gap: 10px; flex: 1 1 auto; min-width: 0; }
.hp-slot {
  flex: 1 1 0; min-width: 0; height: 60px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 8px;
  border: 2px dashed #C5D0E2; border-radius: 12px; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--navy); text-align: center; line-height: 1.15;
}
.hp-slot.is-filled { border-style: solid; border-color: var(--blue); background: var(--pale-blue); }
.hp-slot svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hp-slot span { overflow: hidden; text-overflow: ellipsis; }
.hp-btn-done { flex: none; font-size: 18px; padding: 0 34px; min-height: 56px; border-radius: 14px; }
.hp-btn-done:disabled { background: #D6DEEB; color: #8B95AB; cursor: not-allowed; }

/* Feedback toast: one line, sits in the navy band, disappears on its own */
.hp-panel { position: relative; }
.hp-toast {
  position: absolute; left: 50%; top: 26px; z-index: 5;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100% - 32px);
  padding: 11px 20px;
  background: #fff; color: var(--navy);
  border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  font-size: 15px; font-weight: 600; white-space: nowrap;
  pointer-events: none;
  animation: hp-toast-in .18s ease-out;
}
.hp-toast[hidden] { display: none; }
.hp-toast .hp-toast-mark { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.hp-toast .hp-toast-note { color: var(--text-soft); font-weight: 500; }
.hp-toast.is-full { white-space: normal; text-align: center; }
@keyframes hp-toast-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- SCREEN 3: RESULTS ---------- */
.hp-results-inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  min-height: calc(100vh - 76px - 56px);
  justify-content: center;
  padding-top: 24px; padding-bottom: 24px;
}
.hp-results-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(38px, 4.2vw, 56px); line-height: 1.1; letter-spacing: -0.02em; color: var(--navy); }
.hp-results-label { font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-soft); margin-top: 22px; }
.hp-results-score { font-family: var(--font-display); font-weight: 800; font-size: clamp(36px, 4vw, 52px); color: var(--blue); line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hp-results-jax { width: clamp(200px, 22vw, 300px); margin-top: 18px; }
.hp-results-jax img { width: 100%; height: auto; }
.hp-btn-again { font-size: 20px; padding: 18px 34px; margin-top: 22px; border-radius: 14px; min-height: 56px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1180px) {
  .hp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .hp-tile-name { font-size: 13px; }
}

@media (max-width: 980px) {
  .hp-start-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; min-height: 0; padding-top: 28px; }
  .hp-title { max-width: none; }
  .hp-start-jax { width: min(44vw, 260px); margin: 24px 0 0; }
  .eyebrow-bar { justify-content: center; }

  .hp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hp-kit { flex-wrap: wrap; }
  .hp-btn-done { flex: 1 1 100%; }
}

@media (max-width: 640px) {
  .hp-main { padding-bottom: 32px; }
  .hp-back { font-size: 14px; }
  .hp-back-long { display: none; }
  .hp-start-inner { padding-top: 20px; }
  .hp-title { font-size: 38px; }
  .hp-lede { font-size: 18px; }
  .hp-btn-start { width: 100%; max-width: 360px; }
  .hp-start-jax { width: min(52vw, 220px); margin-top: 20px; }

  .hp-game .container { padding: 14px 12px 0; }
  .hp-panel { border-radius: 16px; }
  .hp-panel-head { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 16px 14px; }
  .hp-game-title { font-size: 21px; }
  .hp-game-sub { font-size: 14px; }
  .hp-stats { justify-content: space-between; }
  .hp-stat { flex: 1 1 0; min-width: 0; padding: 6px 10px; }
  .hp-stat-value { font-size: 22px; }

  .hp-grid { gap: 8px; padding: 12px 12px 8px; }
  .hp-tile { min-height: 104px; padding: 10px 6px 8px; gap: 6px; border-radius: 12px; }
  .hp-tile-icon { width: 44px; height: 44px; border-radius: 12px; }
  .hp-tile-icon svg { width: 28px; height: 28px; }
  .hp-tile-name { font-size: 12.5px; }
  .hp-tile-check { width: 20px; height: 20px; top: 6px; right: 6px; }
  .hp-tile-check::after { left: 6px; top: 3px; }

  .hp-kit { gap: 12px; padding: 12px 12px 14px; }
  .hp-kit-label { flex-direction: row; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 100%; }
  .hp-kit-count { font-size: 22px; }
  .hp-slots { flex: 1 1 100%; gap: 6px; }
  .hp-slot { height: 52px; padding: 0 4px; font-size: 0; gap: 0; border-radius: 10px; }
  .hp-slot svg { width: 26px; height: 26px; }
  .hp-btn-done { min-height: 54px; font-size: 18px; }

  .hp-toast { position: fixed; top: auto; bottom: 18px; font-size: 14px; padding: 10px 16px; background: var(--navy); color: #fff; }
  .hp-toast .hp-toast-note { color: rgba(255, 255, 255, 0.78); }

  .hp-results-inner { min-height: 0; padding-top: 32px; }
  .hp-results-jax { width: min(58vw, 230px); }
  .hp-btn-again { width: 100%; max-width: 360px; }
}
