/* BASE PAGE STYLE
   Sets the dark background, light text and main font used across the website. */
body {
  margin: 0;
  background: rgb(10, 15, 30);
  color: #f0f0f5;
  font-family: "Nunito", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

.skip-link {
  background: rgb(0, 220, 200);
  border-radius: 8px;
  color: rgb(10, 15, 30);
  font-weight: 700;
  left: 12px;
  padding: 8px 12px;
  position: absolute;
  text-decoration: none;
  top: -56px;
  transition: top 0.18s ease;
  z-index: 60;
}

.skip-link:focus {
  top: 10px;
}

.skip-link + .skip-link {
  left: 220px;
}

.landing-page {
  min-height: 100vh;
}

.landing-wrapper {
  margin: 0 auto;
  max-width: 1200px;
  padding: 30px;
}

.landing-header {
  margin-bottom: 16px;
}

/* WORKSPACE PAGE LAYOUT
   The main workspace uses a left creative area and a right code panel on large screens. */
.container {
  display: flex;
  min-height: 100vh;
}

/* LEFT CREATIVE AREA
   This section contains the logo, controls, drawing canvas and guided challenges. */

.visual-section {
  flex: 3;
  padding: 30px;
}

/* HEADER
   Logo, title and navigation icons at the top of the workspace. */

.title-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.logo-link {
  border-radius: 10px;
  display: inline-flex;
}

.logo-link:focus-visible {
  outline: 3px solid rgb(0, 220, 200);
  outline-offset: 4px;
}

.main-title {
  font-size: 42px;
  margin: 0;
  letter-spacing: 2px;
  font-weight: 800;
}

.code-text {
  color: rgb(0, 220, 200);
}

.kaleidoscope-text {
  color: rgb(140, 70, 255);
}

.subtitle {
  color: #aaa;
  margin-bottom: 20px;
  margin-top: 5px;
}

.header-links {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.workspace-teacher-link {
  align-items: center;
  background: rgba(22, 22, 38, 0.78);
  border: 1px solid rgb(70, 70, 105);
  border-radius: 10px;
  color: rgb(180, 235, 230);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  text-decoration: none;
  width: 42px;
}

.workspace-teacher-link:hover {
  border-color: rgb(0, 220, 200);
  color: rgb(0, 220, 200);
}

.workspace-teacher-link:focus-visible {
  outline: 3px solid rgb(0, 220, 200);
  outline-offset: 3px;
}

.teacher-nav-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  height: 20px;
  width: 20px;
}

.back-home-link {
  align-items: center;
  border: 1px solid rgb(70, 70, 105);
  border-radius: 10px;
  color: rgb(160, 150, 190);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  text-decoration: none;
  width: 42px;
}

.back-home-link:hover {
  background: rgba(22, 22, 38, 0.8);
  border-color: rgb(70, 70, 105);
  color: rgb(0, 220, 200);
}

.back-home-link:focus-visible {
  outline: 3px solid rgb(0, 220, 200);
  outline-offset: 3px;
}

.home-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  width: 22px;
  height: 22px;
}

/* LANDING PAGE
   Styles for the introductory page before the learner opens the workspace. */

.landing-hero {
  background:
    radial-gradient(circle at 10% 20%, rgba(0, 220, 200, 0.14), transparent 40%),
    radial-gradient(circle at 95% 10%, rgba(255, 90, 160, 0.18), transparent 34%),
    rgb(14, 16, 30);
  border: 1px solid rgb(35, 35, 55);
  border-radius: 10px;
  margin-bottom: 18px;
  padding: 18px;
}

.landing-kicker {
  color: rgb(180, 235, 230);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.landing-title {
  color: #fff;
  font-size: 34px;
  line-height: 1.1;
  margin: 0 0 10px;
}

.landing-copy {
  color: #d7d7e0;
  margin: 0 0 14px;
  max-width: 700px;
}

.landing-cta {
  background: rgb(0, 220, 200);
  border: 2px solid rgb(0, 220, 200);
  border-radius: 8px;
  color: rgb(10, 15, 30);
  display: inline-flex;
  font-weight: 800;
  padding: 10px 16px;
  text-decoration: none;
}

.landing-cta:hover {
  background: rgb(120, 240, 255);
}

.landing-cta-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-secondary-link {
  background: rgb(22, 22, 38);
  border: 2px solid rgb(70, 70, 105);
  border-radius: 8px;
  color: rgb(180, 235, 230);
  display: inline-flex;
  font-weight: 700;
  padding: 10px 14px;
  text-decoration: none;
}

.landing-secondary-link:hover {
  border-color: rgb(0, 220, 200);
  color: rgb(0, 220, 200);
}

.landing-steps {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.landing-step {
  background: rgba(12, 12, 24, 0.74);
  border: 1px solid rgb(48, 48, 74);
  border-radius: 8px;
  padding: 10px;
}

.step-number {
  background: rgb(255, 90, 160);
  border-radius: 50%;
  color: white;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  margin-bottom: 6px;
  width: 24px;
}

.landing-step p {
  color: #e8e8ef;
  margin: 0;
}

/* TEACHER RESOURCES
   Styles for the support page with lesson materials and downloadable resources. */

.teacher-page {
  min-height: 100vh;
}

.teacher-wrapper {
  margin: 0 auto;
  max-width: 1220px;
  padding: 30px;
}

.teacher-header {
  margin-bottom: 16px;
}

.teacher-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.teacher-workspace-icon-link {
  align-items: center;
  background: rgba(22, 22, 38, 0.8);
  border: 1px solid rgb(70, 70, 105);
  border-radius: 10px;
  color: rgb(180, 235, 230);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  text-decoration: none;
  width: 42px;
}

.teacher-workspace-icon-link:hover {
  border-color: rgb(0, 220, 200);
  color: rgb(0, 220, 200);
}

.teacher-workspace-icon-link:focus-visible {
  outline: 3px solid rgb(0, 220, 200);
  outline-offset: 3px;
}

.pencil-nav-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  height: 20px;
  width: 20px;
}

.teacher-hero {
  border-bottom: 1px solid rgb(35, 35, 55);
  margin-bottom: 20px;
  padding-bottom: 16px;
}

.teacher-kicker {
  color: rgb(180, 235, 230);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.teacher-title {
  color: #fff;
  font-size: 32px;
  line-height: 1.15;
  margin: 0 0 8px;
}

.teacher-copy {
  color: #d7d7e0;
  line-height: 1.5;
  margin: 0;
  max-width: 900px;
}

.teacher-band {
  margin-top: 20px;
}

.teacher-section-title {
  color: rgb(0, 220, 200);
  font-size: 24px;
  margin: 0 0 12px;
}

.teacher-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.teacher-card {
  background: rgba(18, 18, 32, 0.72);
  border: 1px solid rgb(35, 35, 55);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.teacher-card h3 {
  color: #fff;
  font-size: 18px;
  margin: 0;
}

.teacher-card p {
  color: #d9d9e4;
  line-height: 1.45;
  margin: 0;
}

.teacher-list {
  color: #e5e5ea;
  line-height: 1.5;
  margin: 0;
  padding-left: 20px;
}

.teacher-list li {
  margin-bottom: 6px;
}

.teacher-resource-link {
  background: rgb(22, 22, 38);
  border: 1px solid rgb(70, 70, 105);
  border-radius: 8px;
  color: rgb(200, 255, 250);
  display: inline-flex;
  font-weight: 700;
  padding: 8px 10px;
  text-decoration: none;
}

.teacher-resource-link:hover {
  border-color: rgb(0, 220, 200);
  color: rgb(0, 220, 200);
}

.teacher-note {
  background: rgba(12, 12, 24, 0.66);
  border-left: 4px solid rgb(255, 90, 160);
  border-radius: 8px;
  color: #ddd;
  margin-top: 14px;
  padding: 12px;
}

.prototype-feedback-card {
  border-color: rgb(0, 220, 200);
  margin-top: 14px;
  max-width: 520px;
}

/* PRINTABLE RESOURCE PAGES
   These pages use a lighter classroom-friendly style while keeping the same
   Code Kaleidoscope visual identity. */

.resource-page {
  background: #e9edf2;
  color: #182032;
  min-height: 100vh;
}

.resource-wrapper {
  margin: 0 auto;
  max-width: 980px;
  padding: 28px;
}

.resource-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.resource-title-block {
  align-items: center;
  display: flex;
  gap: 14px;
}

.resource-logo {
  flex: 0 0 auto;
  height: 64px;
  object-fit: contain;
  width: 64px;
}

.resource-kicker {
  color: #16645f;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.resource-header h1 {
  color: #101827;
  font-size: 34px;
  line-height: 1.12;
  margin: 0 0 8px;
}

.resource-subtitle {
  color: #4d5667;
  margin: 0;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.resource-action-link,
.resource-print-btn {
  align-items: center;
  background: #101827;
  border: 2px solid #101827;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  min-height: 42px;
  padding: 9px 13px;
  text-decoration: none;
}

.resource-print-btn {
  background: #00b8aa;
  border-color: #00b8aa;
  color: #101827;
}

.resource-action-link:hover,
.resource-print-btn:hover {
  transform: translateY(-2px);
}

.resource-sheet {
  background: #f7f8fa;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(16, 24, 39, 0.12);
  line-height: 1.55;
  padding: 30px;
}

.resource-sheet h2 {
  border-bottom: 2px solid #d9e0e8;
  color: #16645f;
  font-size: 22px;
  margin: 24px 0 10px;
  padding-bottom: 5px;
}

.resource-sheet h2:first-child {
  margin-top: 0;
}

.resource-sheet p,
.resource-sheet li {
  font-size: 16px;
}

.resource-sheet ul,
.resource-sheet ol {
  padding-left: 24px;
}

.resource-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
}

.resource-check-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0 18px;
}

.ethics-notice {
  background: #eef2f6;
  border: 2px solid #b9c4d0;
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 14px 16px;
}

.ethics-notice h2 {
  border-bottom: none;
  color: #182032;
  margin-top: 0;
  padding-bottom: 0;
}

.resource-consent-list {
  background: #fff;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 12px 0 20px;
  padding: 14px;
}

.resource-consent-list label {
  align-items: flex-start;
  display: inline-flex;
  gap: 9px;
}

.hidden-field {
  display: none;
}

.online-questionnaire input[type="text"],
.online-questionnaire input[type="date"],
.online-questionnaire textarea {
  background: #fff;
  border: 2px solid #b9c4d0;
  border-radius: 8px;
  box-sizing: border-box;
  color: #182032;
  display: block;
  font: inherit;
  margin-top: 6px;
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

.online-questionnaire textarea {
  min-height: 88px;
  resize: vertical;
}

.online-questionnaire input:focus,
.online-questionnaire textarea:focus {
  border-color: #00b8aa;
  outline: 3px solid rgba(0, 184, 170, 0.22);
}

.resource-name-row label {
  flex: 1 1 260px;
  font-weight: 700;
}

.form-question {
  border: 0;
  display: grid;
  gap: 8px;
  font-weight: 700;
  margin: 14px 0;
  padding: 0;
}

.form-question legend {
  font-weight: 800;
  margin-bottom: 8px;
}

.form-question label,
.rating-options label,
.resource-consent-list label {
  font-weight: 600;
}

.rating-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 150px;
}

.rating-options label {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.resource-table textarea {
  min-height: 64px;
}

.resource-submit-btn {
  background: #00b8aa;
  border: 2px solid #00b8aa;
  border-radius: 8px;
  color: #101827;
  font-weight: 900;
  margin-top: 18px;
  min-height: 46px;
  padding: 10px 16px;
}

.resource-submit-btn:hover {
  background: #25d8cc;
  transform: translateY(-2px);
}

.resource-check-grid label {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.print-checkbox {
  background: #fff;
  border: 2px solid #596273;
  border-radius: 3px;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.resource-table {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
}

.resource-table th,
.resource-table td {
  border: 1px solid #aeb8c5;
  min-height: 38px;
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

.resource-table th {
  background: #dfe5ec;
  color: #182032;
}

.resource-table td {
  height: 42px;
}

.resource-lines li {
  margin-bottom: 14px;
}

.resource-lines span {
  border-bottom: 1px solid #596273;
  display: inline-block;
  min-width: 190px;
}

.self-assessment-list {
  background: #eef2f6;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  padding: 12px 14px;
}

.self-assessment-list p {
  margin: 7px 0;
}

/* WORKSPACE CONTROLS
   Shared layout for Draw, Style and Action control groups. */

.controls-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}

.control-group {
  background: rgba(18, 18, 32, 0.72);
  border: 1px solid rgb(35, 35, 55);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
}

.drawing-controls {
  align-items: flex-end;
}

.style-controls,
.action-controls {
  align-content: flex-start;
}

.style-controls {
  gap: 18px;
}

.actions-access-row {
  align-items: flex-end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 10px;
  width: 100%;
}

.actions-row {
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 12px;
  width: fit-content;
}

.actions-row .group-title {
  flex-basis: 100%;
}

.group-title {
  color: rgb(0, 220, 200);
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.stepper-group {
  min-width: 150px;
}

.stepper-group label {
  display: flex;
  font-size: 14px;
  color: rgb(0, 220, 200);
  margin-bottom: 6px;
}

input,
select,
button {
  margin-top: 5px;
}

/* BUTTONS
   Base button styling plus variations for primary, secondary and danger actions. */

button {
  background: rgb(255, 90, 160);
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 600;
}

button:hover {
  transform: translateY(-2px);
}

button:focus-visible {
  outline: 3px solid rgb(0, 220, 200);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.action-btn {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  font-size: 15px;
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.primary-action {
  background: rgb(0, 220, 200);
  color: rgb(10, 15, 30);
}

.secondary-action {
  background: rgb(25, 25, 40);
  border-color: rgb(0, 220, 200);
  color: rgb(0, 220, 200);
}

.danger-action {
  background: rgb(25, 25, 40);
  border-color: rgb(255, 90, 160);
  color: rgb(255, 170, 205);
}

.secondary-action[aria-pressed="true"] {
  background: rgb(140, 70, 255);
  border-color: rgb(140, 70, 255);
  color: white;
}

.primary-action:hover {
  background: rgb(120, 240, 255);
}

.secondary-action:hover {
  background: rgb(40, 40, 65);
}

.danger-action:hover {
  background: rgb(255, 90, 160);
  color: white;
}

/* CANVAS
   Keeps the p5.js drawing canvas responsive inside its container. */

#canvas-container {
  overscroll-behavior: contain;
  touch-action: none;
  width: 100%;
}

#canvas-container canvas {
  max-width: 100%;
  width: 100% !important;
  height: auto !important;
  display: block;
  border: 2px solid rgb(35, 35, 55);
  border-radius: 8px;
  touch-action: none;
  user-select: none;
}

.workspace-layout {
  align-items: stretch;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
  width: 100%;
}

.canvas-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.challenge-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  max-width: none;
  min-width: 0;
  width: 100%;
}

/* PROMPT BOX
   Short challenge focus message shown below the challenge panel. */

.prompt-box {
  margin-top: 0;
  background: #121220;
  border-left: 4px solid rgb(255, 90, 160);
  padding: 12px;
  border-radius: 8px;
  color: #ddd;
}

.accessibility-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.actions-accessibility-row {
  align-self: stretch;
}

.access-link {
  background: transparent;
  border: none;
  box-shadow: none;
  color: rgb(160, 150, 190);
  font-size: 13px;
  min-height: auto;
  padding: 4px 0;
}

.access-link:hover {
  color: rgb(0, 220, 200);
  transform: none;
}

.access-link[aria-pressed="true"] {
  color: rgb(255, 220, 120);
}

/* RIGHT CODE PANEL
   The Live Python Model area that connects drawing actions to programming concepts. */

.code-panel {
  flex: 1;
  background: #121220;
  padding: 30px;
  border-left: 2px solid rgb(140, 70, 255);
}

.code-panel h2 {
  color: rgb(0, 220, 200);
}

/* CODE DISPLAY
   Styles the generated code-like text, line numbers and highlighted changed line. */

pre {
  color: #f0f0f5;
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.stepper-control {
  align-items: center;
  background: rgb(16, 16, 28);
  border: 1px solid rgb(45, 45, 70);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 36px minmax(52px, auto) 36px;
  overflow: hidden;
}

.stepper-control:focus-within {
  border-color: rgb(0, 220, 200);
  box-shadow: 0 0 0 2px rgba(0, 220, 200, 0.24);
}

.step-btn {
  background: rgb(25, 25, 40);
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 20px;
  font-weight: 700;
  height: 36px;
  margin: 0;
  padding: 0;
}

.step-btn:hover {
  background: rgb(140, 70, 255);
}

.step-value {
  color: rgb(240, 240, 250);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
}
.controls-text {
  color: rgb(0, 220, 200);
  line-height: 1.6;
  font-size: 15px;
  margin: 0;
  min-width: 150px;
}

.mouse-hint {
  align-items: center;
  display: flex;
  min-height: 58px;
  min-width: 56px;
}

.mouse-icon {
  border: 3px solid rgb(0, 220, 200);
  border-radius: 22px;
  display: block;
  height: 46px;
  position: relative;
  width: 30px;
}

.mouse-icon::before {
  background: rgb(255, 90, 160);
  border-radius: 6px;
  content: "";
  height: 10px;
  left: 50%;
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  width: 4px;
}

.mouse-icon::after {
  background: rgb(0, 220, 200);
  content: "";
  height: 12px;
  left: 50%;
  position: absolute;
  top: -14px;
  transform: translateX(-50%);
  width: 3px;
}

/* ICON CONTROL GROUPS
   Mode and shape controls use icons to reduce visual clutter while keeping
   accessible labels in the HTML. */
.theme-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shape-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.icon-control-row {
  display: grid;
  flex-basis: 100%;
  gap: 7px;
}

.icon-row-label {
  color: rgb(180, 235, 230);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.theme-btn,
.mode-btn,
.shape-btn {
  background: rgb(25, 25, 40);
  border: 1px solid rgb(92, 72, 150);
  border-radius: 14px;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.theme-btn {
  align-items: center;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  min-height: 42px;
  min-width: 62px;
  padding: 9px 14px;
}

.theme-swatch {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  box-shadow:
    8px 0 0 var(--swatch-two),
    16px 0 0 var(--swatch-three);
  display: inline-block;
  flex: 0 0 auto;
  height: 9px;
  margin-right: 16px;
  width: 9px;
}

.theme-swatch-logo {
  background: rgb(0, 220, 200);
  --swatch-two: rgb(255, 90, 160);
  --swatch-three: rgb(140, 70, 255);
}

.theme-swatch-ocean {
  background: rgb(0, 180, 255);
  --swatch-two: rgb(0, 220, 200);
  --swatch-three: rgb(120, 240, 255);
}

.theme-swatch-sunset {
  background: rgb(255, 90, 160);
  --swatch-two: rgb(255, 160, 80);
  --swatch-three: rgb(255, 220, 120);
}

.theme-swatch-mono {
  background: rgb(255, 255, 255);
  --swatch-two: rgb(180, 180, 180);
  --swatch-three: rgb(112, 112, 112);
}

.mode-btn,
.shape-btn {
  align-items: center;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  min-width: 54px;
  padding: 9px 13px;
}

.mode-icon {
  color: currentColor;
  display: block;
  height: 23px;
  position: relative;
  width: 23px;
}

.mode-icon-dots {
  background:
    radial-gradient(circle, currentColor 0 3px, transparent 4px) 2px 3px / 10px 10px,
    radial-gradient(circle, currentColor 0 3px, transparent 4px) 12px 11px / 10px 10px;
}

.mode-icon-pen::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 4px;
  left: 3px;
  position: absolute;
  top: 11px;
  transform: rotate(-32deg);
  width: 20px;
}

.mode-icon-pen::after {
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  content: "";
  position: absolute;
  right: 1px;
  top: 6px;
  transform: rotate(-32deg);
}

.mode-icon-dashes {
  background:
    linear-gradient(90deg, currentColor 0 8px, transparent 8px 13px, currentColor 13px 21px) 1px 5px / 22px 4px no-repeat,
    linear-gradient(90deg, currentColor 0 7px, transparent 7px 12px, currentColor 12px 22px) 1px 15px / 22px 4px no-repeat;
}

.mode-icon-ribbon::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 8px;
  left: 2px;
  opacity: 0.86;
  position: absolute;
  top: 8px;
  transform: rotate(-18deg);
  width: 22px;
}

.mode-icon-ribbon::after {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 5px;
  position: absolute;
  top: 11px;
  transform: rotate(-18deg);
  width: 16px;
}

.mode-icon-spray {
  background:
    radial-gradient(circle, currentColor 0 2px, transparent 3px) 10px 10px / 6px 6px no-repeat,
    radial-gradient(circle, currentColor 0 1.5px, transparent 2.5px) 2px 5px / 6px 6px no-repeat,
    radial-gradient(circle, currentColor 0 1.5px, transparent 2.5px) 17px 3px / 6px 6px no-repeat,
    radial-gradient(circle, currentColor 0 1.5px, transparent 2.5px) 4px 17px / 6px 6px no-repeat,
    radial-gradient(circle, currentColor 0 1.5px, transparent 2.5px) 18px 16px / 6px 6px no-repeat;
}

.shape-icon {
  display: block;
  height: 22px;
  width: 22px;
}

.shape-icon-circle {
  background: currentColor;
  border-radius: 50%;
}

.shape-icon-square {
  background: currentColor;
  border-radius: 3px;
}

.shape-icon-triangle {
  border-bottom: 23px solid currentColor;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  height: 0;
  width: 0;
}

.shape-icon-hexagon {
  background: currentColor;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.shape-icon-star {
  background: currentColor;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 69%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
}

.theme-btn:hover,
.mode-btn:hover,
.shape-btn:hover {
  background: rgb(35, 35, 56);
  border-color: rgb(0, 220, 200);
  transform: translateY(-2px);
}

.active-theme,
.active-mode,
.active-shape {
  background: rgb(0, 220, 200);
  border-color: rgb(0, 220, 200);
  color: rgb(10, 15, 30);
  box-shadow: 0 0 0 3px rgba(0, 220, 200, 0.14);
}

/* CHALLENGE PANEL
   Guided tasks, progress tracking and completion feedback for learners. */

.challenge-panel {
  background: rgb(18, 18, 32);
  border: 1px solid rgb(35, 35, 55);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  flex: 1;
  padding: 18px;
}

.challenge-meta {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.challenge-progress-block {
  display: grid;
  gap: 6px;
}

.challenge-progress-count {
  color: rgb(180, 235, 230);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.challenge-progress-track {
  background: rgb(20, 26, 42);
  border: 1px solid rgb(45, 55, 82);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.challenge-progress-fill {
  background: linear-gradient(90deg, rgb(0, 220, 200), rgb(140, 70, 255));
  border-radius: 999px;
  height: 100%;
  transition: width 0.2s ease;
  width: 0;
}

.challenge-progress {
  color: rgb(180, 235, 230);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.challenge-status {
  border: 1px solid;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  padding: 3px 9px;
}

.in-progress-status {
  border-color: rgb(95, 95, 125);
  color: rgb(190, 190, 215);
}

.done-status {
  border-color: rgb(0, 220, 200);
  color: rgb(0, 220, 200);
}

.challenge-title {
  color: rgb(0, 220, 200);
  font-size: 28px;
  font-weight: 800;
  margin: 0;
}

.challenge-goal,
.challenge-setup,
.challenge-check,
.challenge-reflect {
  color: #ddd;
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}

.challenge-goal {
  font-weight: 700;
}

.challenge-setup {
  color: rgb(180, 235, 230);
}

.challenge-steps {
  color: #e5e5ea;
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
  padding-left: 22px;
}

.challenge-steps li {
  margin-bottom: 4px;
}

.challenge-reflect {
  color: rgb(255, 205, 225);
}

.challenge-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.challenge-btn {
  height: 38px;
  min-width: 38px;
  padding: 0;
  border-radius: 8px;
  background: rgb(25, 25, 40);
  border: 2px solid rgb(140, 70, 255);
  position: relative;
}

.active-challenge {
  background: rgb(255, 90, 160);
  border-color: rgb(255, 90, 160);
}

.challenge-done:not(.active-challenge) {
  background: rgba(0, 220, 200, 0.1);
  border-color: rgb(0, 220, 200);
  color: rgb(200, 255, 250);
}

.challenge-done::after {
  align-items: center;
  background: rgb(0, 220, 200);
  border-radius: 999px;
  color: rgb(10, 15, 30);
  content: "\2713";
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  height: 14px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: -6px;
  top: -6px;
  width: 14px;
}

.challenge-done.active-challenge::after {
  background: rgb(255, 220, 120);
}

.challenge-done.active-challenge {
  background: linear-gradient(135deg, rgb(0, 220, 200), rgb(140, 70, 255));
  border-color: rgb(0, 220, 200);
  color: rgb(10, 15, 30);
}

.challenge-actions-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.challenge-nav-btn,
.complete-challenge-btn {
  background: rgb(25, 25, 40);
  border: 2px solid rgb(0, 220, 200);
  color: rgb(180, 235, 230);
  min-height: 38px;
  padding: 8px 12px;
}

.challenge-nav-btn:hover,
.complete-challenge-btn:hover {
  background: rgba(0, 220, 200, 0.2);
  color: white;
}

.challenge-nav-btn:disabled,
.complete-challenge-btn:disabled {
  border-color: rgb(75, 75, 110);
  color: rgb(150, 150, 180);
  opacity: 1;
}

.challenge-success {
  flex: 1 1 210px;
  color: rgb(120, 240, 255);
  font-size: 14px;
  margin: 0;
}

/* CONCEPT LABELS AND CODE HIGHLIGHTING
   Shows which programming concept is active in the Live Python Model. */

.concept-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.code-stage-hint {
  color: rgb(180, 235, 230);
  font-size: 14px;
  margin: 0 0 10px;
}

.code-coach-message {
  background: rgba(0, 220, 200, 0.08);
  border: 1px solid rgba(0, 220, 200, 0.28);
  border-radius: 8px;
  color: rgb(220, 255, 250);
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.code-next-hint {
  color: rgb(180, 235, 230);
  font-size: 13px;
  margin: 10px 0 0;
  opacity: 0.9;
}

.concept-pill {
  background: rgb(25, 25, 40);
  border: 1px solid rgb(70, 70, 95);
  border-radius: 20px;
  color: #ddd;
  cursor: help;
  font-size: 13px;
  padding: 6px 10px;
  position: relative;
  transition: 0.2s;
}

.active-concept {
  background: rgba(0, 220, 200, 0.2);
  border-color: rgb(0, 220, 200);
  color: rgb(210, 255, 250);
}

.concept-pill::after {
  background: rgb(12, 12, 24);
  border: 1px solid rgb(70, 70, 95);
  border-radius: 8px;
  bottom: calc(100% + 10px);
  color: rgb(230, 230, 240);
  content: attr(data-tip);
  font-size: 12px;
  left: 50%;
  line-height: 1.35;
  max-width: 220px;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  text-align: left;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  visibility: hidden;
  width: max-content;
  z-index: 20;
}

.concept-pill::before {
  border: 6px solid transparent;
  border-top-color: rgb(70, 70, 95);
  content: "";
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: -11px;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  visibility: hidden;
  z-index: 21;
}

.concept-pill:hover::after,
.concept-pill:hover::before,
.concept-pill:focus-visible::after,
.concept-pill:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  visibility: visible;
}

.concept-pill:focus-visible {
  outline: 2px solid rgb(0, 220, 200);
  outline-offset: 2px;
}

.code-line {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: start;
  min-height: 1.7em;
  padding: 1px 8px;
  border-radius: 6px;
}

.line-number {
  border-right: 1px solid rgba(120, 120, 160, 0.25);
  color: rgb(110, 120, 150);
  font-size: 12px;
  margin-right: 8px;
  padding-right: 7px;
  text-align: right;
  user-select: none;
}

.line-text {
  white-space: pre-wrap;
}

.changed-line {
  background: rgba(255, 90, 160, 0.22);
  color: white;
}

.section-line {
  color: rgb(180, 235, 230);
  font-weight: 700;
  margin-top: 8px;
}

.empty-line {
  min-height: 0.9em;
}

/* ACCESSIBILITY MODES
   High contrast mode improves visibility for learners who need stronger contrast. */

body.high-contrast {
  background: #000;
  color: #fff;
}

body.high-contrast .code-panel,
body.high-contrast .prompt-box,
body.high-contrast .code-coach-message,
body.high-contrast .challenge-panel {
  background: #050505;
  border-color: #fff;
}

body.high-contrast .challenge-progress-track {
  background: #111;
  border-color: #fff;
}

body.high-contrast .challenge-progress-fill {
  background: #ffff00;
}

body.high-contrast button,
body.high-contrast .active-theme,
body.high-contrast .active-challenge {
  background: #ffff00;
  border-color: #ffff00;
  color: #000;
}

/* TABLET LAYOUT
   Stacks the main workspace and code panel so tablets have more breathing room. */
@media (max-width: 1180px) {
  .container {
    flex-direction: column;
  }

  .visual-section,
  .code-panel {
    padding: 24px;
  }

  .code-panel {
    border-left: none;
    border-top: 2px solid rgb(140, 70, 255);
  }

  .controls-panel {
    gap: 14px;
  }

  .workspace-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  }

  .challenge-title {
    font-size: 24px;
  }

  .challenge-goal,
  .challenge-setup,
  .challenge-check,
  .challenge-reflect,
  .challenge-steps {
    font-size: 16px;
  }

  pre {
    font-size: 15px;
  }
}

/* SMALL TABLET LAYOUT
   Switches controls and canvas/challenge columns into a single column. */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }

  .controls-panel {
    grid-template-columns: 1fr;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .canvas-stage,
  .challenge-stage {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .actions-row {
    width: 100%;
  }

  .actions-access-row {
    align-items: stretch;
    flex-direction: column;
  }

  .actions-accessibility-row {
    width: 100%;
  }

  .visual-section,
  .code-panel {
    padding: 20px;
  }

  .main-title {
    font-size: 32px;
  }

  .landing-title {
    font-size: 29px;
  }

  .landing-steps {
    grid-template-columns: 1fr;
  }

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

  .concept-pill::after {
    font-size: 13px;
    line-height: 1.45;
    max-width: min(76vw, 260px);
    white-space: normal;
  }
}

/* PRINT RESOURCE LAYOUT
   Hides screen-only controls and prints worksheets as clean paper documents. */
@media print {
  body.resource-page {
    background: #fff;
    color: #000;
  }

  .resource-wrapper {
    max-width: none;
    padding: 0;
  }

  .resource-header {
    border-bottom: 2px solid #000;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .resource-actions,
  .resource-submit-btn,
  .hidden-field {
    display: none;
  }

  .resource-header h1 {
    color: #000;
    font-size: 25px;
  }

  .resource-logo {
    height: 48px;
    width: 48px;
  }

  .resource-kicker,
  .resource-subtitle,
  .resource-sheet h2 {
    color: #000;
  }

  .resource-sheet {
    background: #fff;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
    padding: 0;
    width: 100%;
  }

  .resource-sheet h2 {
    border-bottom-color: #999;
    break-after: avoid;
    font-size: 18px;
    margin-top: 16px;
  }

  .resource-table,
  .resource-check-grid,
  .self-assessment-list {
    break-inside: avoid;
  }

  .resource-table {
    font-size: 11px;
    table-layout: fixed;
    width: 100%;
  }

  .resource-table th:nth-child(1),
  .resource-table td:nth-child(1) {
    width: 42%;
  }

  .resource-table th:nth-child(2),
  .resource-table td:nth-child(2) {
    width: 23%;
  }

  .resource-table th:nth-child(3),
  .resource-table td:nth-child(3) {
    width: 35%;
  }

  .resource-table th {
    background: #e6e6e6;
  }

  .resource-table th,
  .resource-table td {
    border-color: #555;
    box-sizing: border-box;
    padding: 5px;
    vertical-align: top;
    word-break: break-word;
  }

  .online-questionnaire input[type="text"],
  .online-questionnaire input[type="date"],
  .online-questionnaire textarea {
    border-color: #777;
    border-radius: 3px;
    box-sizing: border-box;
    min-height: 28px;
    padding: 4px;
    width: 100%;
  }

  .online-questionnaire textarea {
    min-height: 46px;
  }

  .resource-table textarea {
    min-height: 38px;
  }

  .resource-name-row {
    gap: 10px;
  }

  .resource-name-row label {
    flex: 1 1 0;
    min-width: 0;
  }

  .form-question {
    margin: 9px 0;
  }

  .rating-options {
    gap: 4px;
    min-width: 0;
  }

  .rating-options label {
    gap: 2px;
  }

  .resource-consent-list {
    padding: 8px;
  }
}

/* MOBILE LAYOUT
   Tightens spacing and keeps icon controls compact on narrow screens. */
@media (max-width: 600px) {
  .title-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .logo {
    width: 62px;
    height: 62px;
  }

  .back-home-link {
    margin-left: auto;
    margin-top: 0;
  }

  .header-links,
  .teacher-links {
    justify-content: flex-end;
    margin-left: 0;
    width: 100%;
  }

  .controls-panel {
    gap: 14px;
  }

  .stepper-group {
    width: 100%;
  }

  .theme-buttons,
  .mode-buttons,
  .shape-buttons,
  .challenge-buttons {
    width: 100%;
  }

  .mode-btn,
  .shape-btn {
    flex: 0 1 54px;
  }

  .theme-btn,
  .challenge-btn {
    flex: 1;
  }

  .action-btn,
  .complete-challenge-btn,
  .challenge-nav-btn {
    width: 100%;
  }

  .challenge-btn {
    min-width: 22%;
  }

  .concept-pill::after {
    left: 0;
    transform: translateY(4px);
  }

  .concept-pill::before {
    left: 14px;
    transform: translateY(4px);
  }

  .concept-pill:hover::after,
  .concept-pill:focus-visible::after {
    transform: translateY(0);
  }

  .concept-pill:hover::before,
  .concept-pill:focus-visible::before {
    transform: translateY(0);
  }
}
