/* Fog Patrol — styles. The kit (../kit/game-kit.css) gives the paper, the type, the bar, the cover
   and the buttons. Here: the sea seen towards the horizon, the harbour with its lighthouse, pier and
   cannon, the outcomes drifting on three rows, the notes that say what was wrong, and the review. */

.fp-stage { cursor: crosshair; }

/* fog along the horizon; thicker for every vague outcome that gets in */
.fp-fog {
  position: absolute;
  left: 0; right: 0;
  z-index: 2;
  height: 220px;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(ellipse 40% 50% at 20% 50%, rgba(201, 193, 171, 0.55), transparent 70%),
    radial-gradient(ellipse 35% 45% at 60% 40%, rgba(201, 193, 171, 0.45), transparent 70%),
    radial-gradient(ellipse 30% 50% at 90% 60%, rgba(201, 193, 171, 0.4), transparent 70%);
  background-size: 140% 100%;
  animation: fp-fog 26s linear infinite alternate;
  transition: opacity 1.5s;
}
@keyframes fp-fog { to { background-position: -40% 0; } }

/* ---------- the harbour ---------- */

.fp-harbour { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.fp-pier { fill: var(--card); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.fp-post { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.fp-tower { fill: var(--card); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.fp-band { fill: var(--danger); }
.fp-lamp { fill: #f4e6b8; stroke: var(--ink); stroke-width: 1.4; }
.fp-roof { fill: var(--ink); }
.fp-beam { fill: rgba(244, 230, 184, 0.45); transform-origin: 0 -68px; }
.fp-barrel { fill: var(--ink); }
.fp-mount { fill: var(--ink); }
.fp-cannon .fp-mount { transform: translateY(4px); }

.fp-sign {
  position: absolute;
  z-index: 5;
  right: 14px;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  pointer-events: none;
}
.fp-sign b { color: var(--ink); font-size: 12.5px; }
body:not(.g-playing) .fp-sign, body:not(.g-playing) .fp-cannon { opacity: 0; }
.fp-sign, .fp-cannon { transition: opacity 0.6s; }

/* ---------- the bar ---------- */

.fp-hud { opacity: 0; transition: opacity 0.5s; }
body.g-playing .fp-hud { opacity: 1; }
.fp-round { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-count b { font-weight: 600; color: var(--ink); font-size: 14px; }
.fp-buoys { display: inline-flex; gap: 6px; }
.fp-buoy { width: 18px; height: 18px; transition: opacity 0.4s, transform 0.5s var(--ease-back); }
.fp-buoy circle { fill: none; stroke-width: 4.2; }
.fp-buoy .ring { stroke: var(--card); }
.fp-buoy .bands { stroke: var(--danger); stroke-dasharray: 5.5 5.5; }
.fp-buoy .edge { stroke: var(--ink); stroke-width: 1; }
.fp-buoy.is-lost { opacity: 0.22; transform: translateY(4px) scale(0.85); }
.fp-buoy.is-lost .bands { stroke: var(--muted); }

/* ---------- the outcomes on the water ---------- */

.fp-play { position: absolute; inset: 0; z-index: 6; }
.fp-slip {
  appearance: none;
  position: absolute;
  left: 0; top: 0;
  max-width: 400px;
  padding: 0;
  border: 0;
  background: none;
  cursor: crosshair;
  transform-origin: 0 100%;
  will-change: transform;
}
.fp-slip.is-long { max-width: 560px; }   /* the 40-word outcome: wider, so it stays within its row */
.fp-slip-card {
  display: block;
  padding: 11px 16px 12px;
  border: 1px solid var(--ink);
  border-radius: 6px 6px 10px 10px;
  background: var(--card);
  box-shadow: 0 6px 0 -3px var(--hair-strong), 0 10px 22px rgba(35, 38, 31, 0.12);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.25;
  color: var(--ink);
  text-align: left;
  animation: fp-bob 3.2s ease-in-out infinite;
  animation-delay: var(--bob, 0s);
  transition: border-color 0.15s, box-shadow 0.2s;
}
.fp-slip:hover .fp-slip-card, .fp-slip:focus-visible .fp-slip-card { box-shadow: 0 6px 0 -3px var(--ink), 0 12px 26px rgba(35, 38, 31, 0.18); }
.fp-slip:focus-visible { outline: none; }
.fp-slip:focus-visible .fp-slip-card { outline: 2px solid var(--c-ilo); outline-offset: 3px; }
.fp-slip.is-hit .fp-slip-card { animation: fp-hit 0.25s ease; }
@keyframes fp-bob { 0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); } 50% { transform: translateY(-4px) rotate(calc(var(--tilt, 0deg) * -1)); } }
@keyframes fp-hit { 30% { transform: translateX(-6px) rotate(-3deg); } 70% { transform: translateX(5px) rotate(2deg); } }

.fp-ball { position: absolute; left: 0; top: 0; z-index: 7; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--ink); pointer-events: none; }

/* what was wrong (or right), where it happened */
.fp-note {
  position: absolute;
  z-index: 8;
  width: min(330px, calc(100vw - 28px));
  padding: 10px 14px 12px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 10px 26px rgba(35, 38, 31, 0.16);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.35s var(--ease-back);
}
.fp-note.is-on { opacity: 1; transform: none; }
.fp-note-kind { display: block; margin-bottom: 3px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-ilo); }
.fp-note.is-bad .fp-note-kind { color: var(--danger); }
.fp-note-why { display: block; font-family: var(--font-display); font-style: italic; font-size: 16.5px; line-height: 1.3; color: var(--ink); }

.fp-pop {
  position: absolute;
  z-index: 8;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 28px;
  color: var(--ink);
  pointer-events: none;
  transform: translate(-50%, 0);
  animation: fp-pop 1.1s var(--ease-out) forwards;
}
@keyframes fp-pop { from { opacity: 0; transform: translate(-50%, 8px); } 20% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -50px); } }

/* ---------- the cover ---------- */

.fp-cover .seaeu-statement { background: var(--paper); }
.fp-cover-body { justify-content: flex-start; padding-top: 44px; }
.fp-cover .g-title { font-size: clamp(64px, 10vw, 150px); }
.fp-cover .g-steps { margin-top: 64px; }
.fp-cover .g-steps li { padding: 12px 16px 14px; border: 1px solid var(--hair-strong); border-radius: 10px; background: var(--card); animation: fp-bob 3.6s ease-in-out infinite; }
.fp-cover .g-steps li:nth-child(2) { animation-delay: -1.2s; }
.fp-cover .g-steps li:nth-child(3) { animation-delay: -2.4s; }

/* ---------- the end ---------- */

.fp-end { background: rgba(245, 242, 234, 0.92); }
.fp-end-body { justify-content: flex-start; padding-top: 60px; }
.fp-end-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(48px, 7vw, 96px); line-height: 0.98; letter-spacing: -0.02em; }
.fp-end-title em { color: var(--c-ilo); }
.fp-stats { display: flex; flex-wrap: wrap; gap: 10px 34px; margin: 24px 0 0 0; padding: 0; list-style: none; }
.fp-stats li { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.fp-stats b { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 30px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); }
.fp-end-line { margin: 26px 0 0 0; max-width: 36em; font-family: var(--font-display); font-style: italic; font-size: 22px; line-height: 1.4; color: var(--ink-soft); }
.fp-end-actions { margin-top: 30px; }
.fp-review-head { margin: 56px 0 14px 0; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.fp-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.fp-review li { padding: 16px 18px; border: 1px solid var(--hair-strong); border-radius: 12px; background: var(--card); }
.fp-review-tag { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.fp-review-tag::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--hair-strong); }
.fp-review li.is-right .fp-review-tag::before { background: var(--ink); }   /* status in ink: colour is for the model */
.fp-review li.is-wrong .fp-review-tag::before { background: var(--danger); }
.fp-review-vague { margin: 0; font-family: var(--font-display); font-size: 19px; line-height: 1.3; color: var(--muted); text-decoration: underline wavy var(--danger); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.fp-review-why { margin: 8px 0 0 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.fp-review-fix { margin: 10px 0 0 0; padding-left: 12px; border-left: 3px solid var(--c-ilo); font-family: var(--font-display); font-size: 19px; line-height: 1.3; color: var(--ink); }
.fp-review-fix small { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-ilo); }
.fp-review-clear { margin: 0; font-family: var(--font-display); font-size: 19px; line-height: 1.3; color: var(--ink); }

/* ---------- phones ---------- */

@media (max-width: 720px) {
  .fp-slip { max-width: 232px; }
  .fp-slip.is-long { max-width: 290px; }
  .fp-slip.is-long .fp-slip-card { font-size: 14.5px; }
  .fp-slip-card { font-size: 16px; padding: 9px 12px 10px; }
  .fp-round { visibility: hidden; }
  .fp-buoys { gap: 3px; }
  .fp-sign { font-size: 9.5px; padding: 4px 7px; }
  .fp-review { grid-template-columns: 1fr; }
  .fp-end-body { padding-top: 40px; }
}

/* ---------- reduced motion: the outcomes still drift (that is the game), but nothing bobs ---------- */

@media (prefers-reduced-motion: reduce) {
  .fp-fog, .fp-slip-card, .fp-slip.is-hit .fp-slip-card { animation: none; }
}
