:root {
  --bg-1: #ecf5ef;
  --bg-2: #f8e6cf;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffdfa;
  --ink: #17222f;
  --muted: #5b6470;
  --line: rgba(23, 34, 47, 0.12);
  --accent: #197278;
  --accent-deep: #0d4f54;
  --warm: #d97b2d;
  --gold: #ebbb68;
  --blue-soft: rgba(34, 94, 149, 0.12);
  --teal-soft: rgba(25, 114, 120, 0.12);
  --shadow: 0 24px 54px rgba(34, 46, 58, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88), transparent 26%),
    radial-gradient(circle at bottom right, rgba(25, 114, 120, 0.16), transparent 25%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(16px);
}

body::before {
  width: 21rem;
  height: 21rem;
  top: -6rem;
  right: -3rem;
  background: rgba(217, 123, 45, 0.16);
}

body::after {
  width: 20rem;
  height: 20rem;
  bottom: -8rem;
  left: -6rem;
  background: rgba(25, 114, 120, 0.18);
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

img {
  max-width: 100%;
}

.page-shell {
  position: relative;
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 6.5rem;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: 36px;
  padding: 1.5rem;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.eyebrow span {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(25, 114, 120, 0.09);
}

.hero-grid,
.main-layout,
.concept-grid,
.scenario-grid,
.quad-grid,
.reflection-grid,
.section-heading,
.hero-actions,
.feedback-bar,
.flow-diagram,
.battleships-top {
  display: grid;
  gap: 1rem;
}

.drop-zone-head {
  display: flex;
  gap: 0.75rem;
}

.hero-grid {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: end;
  margin-top: 1rem;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  margin-bottom: 0;
}

.title-bar {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1.15rem;
  border-radius: 24px;
  background: rgba(255, 253, 250, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(23, 34, 47, 0.08);
}

.intro,
.activity-copy,
.progress-note,
.zone-copy,
.field-label,
select,
textarea {
  line-height: 1.55;
}

.intro,
.activity-copy,
.progress-note,
.zone-copy,
.field-label,
figcaption {
  color: var(--muted);
}

.intro {
  font-size: 0.98rem;
}

.intro-overview {
  margin-bottom: 0.7rem;
}

.intro-list {
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.intro-list li + li {
  margin-top: 0.35rem;
}

.hero-copy {
  align-self: start;
}

.intro-panel {
  position: sticky;
  top: 7.4rem;
  padding: 1rem 1.15rem 1rem 2.2rem;
  border-radius: 24px;
  background: rgba(255, 253, 250, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(23, 34, 47, 0.06);
}

.hero-intro-list {
  padding-left: 1.2rem;
}

.hero-actions,
.feedback-bar,
.drop-zone-head,
.section-heading,
.battleships-top {
  align-items: center;
  justify-content: space-between;
}

.hero-actions {
  margin-top: 1.25rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button:hover,
.chip-button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: white;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  border: 1px solid var(--line);
}

.hero-figure {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 247, 0.92));
  border: 1px solid var(--line);
}

.hero-figure img,
.scenario-figure img,
.concept-figure img {
  display: block;
  width: 100%;
  margin: 0 auto;
  border-radius: 22px;
}

.hero-figure img {
  max-width: 330px;
}

.hero-figure figcaption,
.scenario-figure figcaption,
.concept-figure figcaption {
  margin-top: 0.8rem;
}

.activity-title-figure {
  margin: 0;
  align-self: stretch;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.activity-title-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 205px;
  object-fit: cover;
  border-radius: 22px;
}

.activity-title-figure figcaption {
  margin-top: 0.65rem;
  color: var(--muted);
  line-height: 1.45;
}

.main-layout {
  margin-top: 1rem;
  align-items: start;
}

.panel-kicker {
  margin-bottom: 0.35rem;
  color: var(--accent-deep);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill,
.challenge-tag,
.zone-counter,
.flow-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill,
.zone-counter {
  width: fit-content;
  padding: 0.35rem 0.7rem;
  background: rgba(23, 34, 47, 0.07);
  color: var(--muted);
}

.status-pill.complete {
  background: rgba(25, 114, 120, 0.15);
  color: var(--accent);
}

.status-pill.partial {
  background: rgba(235, 187, 104, 0.24);
  color: #8d5d16;
}

.challenge-tag {
  padding: 0.5rem 0.8rem;
  background: var(--blue-soft);
  color: #1e4f87;
}

.content-stack {
  display: grid;
  gap: 1rem;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 1.25rem;
}

.card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.concept-grid,
.scenario-grid,
.reflection-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
}

.concept-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  align-items: stretch;
}

.activity-1-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.activity-1-copy {
  min-width: 0;
}

#activity-1 .scenario-grid,
#activity-2 .scenario-grid {
  grid-template-columns: 1fr;
}

#activity-3 .scenario-grid {
  grid-template-columns: 1fr;
}

.flow-diagram {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  margin: 1.2rem 0 1rem;
}

.flow-step {
  height: 11rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1rem;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(25, 114, 120, 0.1), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(25, 114, 120, 0.12);
}

.flow-step h3 {
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.flow-step p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
}

.flow-label {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.7rem;
  background: var(--accent);
  color: white;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--warm);
}

.concept-figure img {
  max-height: 300px;
  object-fit: cover;
}

.activity-shell,
.bank-grid,
.chip-zone {
  display: grid;
  gap: 0.9rem;
}

.activity-shell {
  width: 100%;
}

.bank-grid,
.chip-zone {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quad-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drop-zone {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px dashed rgba(23, 34, 47, 0.16);
  min-height: 12rem;
}

.chip-zone {
  margin-top: 0.8rem;
  min-height: 7.5rem;
  align-content: start;
  padding: 0.75rem;
  border-radius: 18px;
  border: 1px dashed rgba(23, 34, 47, 0.14);
  background: rgba(255, 255, 255, 0.6);
}

.chip-zone:empty::before {
  content: attr(data-empty-label);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.choice-chip {
  position: relative;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(241, 247, 246, 0.93));
}

.chip-text {
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.draggable-chip {
  cursor: grab;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease,
    border-color 140ms ease;
}

.draggable-chip:active {
  cursor: grabbing;
}

.draggable-chip.is-dragging {
  opacity: 0.5;
  transform: rotate(-1deg) scale(0.98);
}

.chip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.chip-remove-button {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.45rem;
  height: 1.45rem;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--warm);
  color: white;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(217, 123, 45, 0.18);
}

.choice-chip[data-state]:not([data-state="unassigned"]) {
  padding-top: 2.55rem;
  border-color: rgba(25, 114, 120, 0.22);
  background: linear-gradient(135deg, rgba(25, 114, 120, 0.11), rgba(255, 255, 255, 0.95));
}

.draggable-chip[data-state]:not([data-state="unassigned"]) {
  padding-top: 0.95rem;
}

.choice-chip[data-state]:not([data-state="unassigned"]) .chip-actions {
  display: none;
}

.choice-chip[data-state]:not([data-state="unassigned"]) .chip-remove-button {
  display: inline-flex;
}

.drop-target {
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.drop-target.drag-over {
  background: rgba(25, 114, 120, 0.08);
  border-color: rgba(25, 114, 120, 0.38);
  box-shadow: inset 0 0 0 2px rgba(25, 114, 120, 0.12);
}

.feedback-bar {
  margin-top: 1rem;
}

.feedback-text {
  margin: 0;
  font-weight: 700;
  color: var(--accent-deep);
}

.feedback-text.success {
  color: var(--accent);
}

.activity-image-note {
  margin: 0;
  color: var(--muted);
}

.instruction-list {
  padding-left: 1.2rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.instruction-list li + li {
  margin-top: 0.3rem;
}

.instruction-panel {
  position: sticky;
  top: 11.2rem;
  z-index: 8;
  padding: 1rem 1.15rem 1rem 2.1rem;
  border-radius: 20px;
  background: rgba(255, 253, 250, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(23, 34, 47, 0.06);
}

.activity-1-instructions {
  padding-left: 1.2rem;
}

.activity-2-instructions {
  padding-left: 1.2rem;
}

.battleships-card {
  background:
    radial-gradient(circle at top right, rgba(34, 94, 149, 0.15), transparent 26%),
    linear-gradient(165deg, rgba(17, 64, 108, 0.08), rgba(255, 255, 255, 0.9));
}

.battleships-top {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.battle-board {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 0.75rem;
}

.ship {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.ship-mirror {
  transform: scaleX(-1);
}

.grid-card {
  padding: 0.85rem;
  border-radius: 22px;
  border: 1px solid rgba(23, 34, 47, 0.12);
  background: rgba(249, 252, 255, 0.92);
}

.board-title {
  margin: 0 0 0.55rem;
  font-weight: 800;
  color: #1b4168;
}

.grid-labels,
.side-labels,
.battle-grid {
  display: grid;
}

.top-labels {
  grid-template-columns: repeat(10, 1fr);
  gap: 0.2rem;
  margin-bottom: 0.45rem;
  padding-left: 2rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #28507c;
}

.grid-shell {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.45rem;
}

.side-labels {
  grid-template-rows: repeat(10, 1fr);
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #28507c;
}

.battle-grid {
  grid-template-columns: repeat(10, 1fr);
  gap: 0.22rem;
}

.battle-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  color: #0f3557;
  background:
    linear-gradient(180deg, rgba(153, 210, 235, 0.95), rgba(113, 177, 215, 0.95));
  border: 1px solid rgba(34, 94, 149, 0.16);
}

.battle-cell-ship {
  background:
    linear-gradient(180deg, rgba(112, 139, 166, 0.95), rgba(82, 110, 141, 0.95));
}

.battle-cell-target {
  cursor: crosshair;
  transition:
    transform 120ms ease,
    filter 120ms ease,
    box-shadow 120ms ease;
}

.battle-cell-target:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 6px 12px rgba(34, 94, 149, 0.14);
}

.battle-cell-hit {
  background:
    linear-gradient(180deg, rgba(228, 103, 61, 0.96), rgba(195, 67, 35, 0.96));
  color: white;
}

.battle-cell-miss {
  background:
    linear-gradient(180deg, rgba(226, 235, 242, 0.96), rgba(202, 218, 230, 0.96));
  color: #4a6480;
}

.battle-cell:disabled {
  cursor: default;
}

.battle-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.battle-game-status {
  margin: 0;
  font-weight: 700;
  color: var(--accent-deep);
}

.battleships-caption {
  margin: 0.9rem 0 0;
  color: var(--muted);
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.reflection-feedback-card {
  grid-column: 1 / -1;
}

select,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(23, 34, 47, 0.14);
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  color: var(--ink);
  padding: 0.8rem 0.9rem;
}

textarea {
  resize: vertical;
  min-height: 3.6rem;
}

select:focus,
textarea:focus,
.button:focus,
.chip-button:focus {
  outline: 3px solid rgba(34, 94, 149, 0.18);
  outline-offset: 2px;
}

.floating-pdf-button {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 30;
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.6rem;
  min-width: min(20rem, calc(100% - 2rem));
  background: linear-gradient(135deg, var(--accent), #2f8a90);
  color: white;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow:
    0 18px 34px rgba(25, 114, 120, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.floating-pdf-button:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow:
    0 22px 40px rgba(25, 114, 120, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.05);
}

.floating-pdf-button:focus {
  outline: 3px solid rgba(34, 94, 149, 0.18);
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .hero-grid,
  .main-layout,
  .concept-grid,
  .scenario-grid,
  .reflection-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .flow-diagram,
  .quad-grid,
  .bank-grid,
  .chip-zone,
  .battleships-top,
  .battle-board {
    grid-template-columns: 1fr;
  }

  .flow-step {
    height: auto;
  }

  .flow-arrow,
  .ship {
    display: none;
  }

  .battle-status-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-labels {
    padding-left: 0;
  }

  .grid-shell {
    grid-template-columns: 1fr;
  }

  .side-labels {
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: none;
  }
}

#activity-1 .section-heading,
#activity-2 .section-heading {
  margin-bottom: 0.05rem;
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100%, calc(100% - 1rem));
    padding-top: 0.5rem;
    padding-bottom: 6rem;
  }

  .hero,
  .panel {
    border-radius: 24px;
    padding: 1rem;
  }

  h1 {
    line-height: 1;
  }

  .hero-actions,
  .section-heading,
  .feedback-bar,
  .drop-zone-head {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .activity-title-figure {
    max-width: 180px;
    justify-self: end;
  }

  .activity-1-top {
    grid-template-columns: 1fr;
  }
}

@media print {
  .floating-pdf-button {
    display: none;
  }
}
