:root {
  --color-background: #fefaf5;
  --color-surface: #ffffff;
  --color-border: #f1e3d3;
  --color-primary: #ff7f50;
  --color-primary-dark: #f45e2f;
  --color-accent: #4ecdc4;
  --color-text: #333333;
  --color-muted: #737373;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.08);
  --max-width: 960px;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Nunito', 'Trebuchet MS', 'Segoe UI', sans-serif;
  color: var(--color-text);
  background: radial-gradient(circle at top left, #fff6e8 0%, var(--color-background) 45%);
  min-height: 100vh;
}

.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  background: var(--color-surface);
  box-shadow: 0 6px 20px rgba(255, 184, 116, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.site-title {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.site-title a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.site-main {
  padding: 2rem 0 4rem;
}

.site-footer {
  margin-top: 3rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--color-muted);
  text-align: center;
}

.hero {
  background: linear-gradient(120deg, #ffe8d6, #ffe6f7);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
  margin-bottom: 2.5rem;
}

.hero h2 {
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary-dark);
}

.hero__tagline {
  margin: 0 auto 1.5rem;
  max-width: 480px;
  font-size: 1.1rem;
  color: var(--color-text);
}

.section {
  margin-bottom: 2.5rem;
}

.section__header h3 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--color-primary-dark);
}

.section__header p {
  margin-top: 0.4rem;
  color: var(--color-muted);
}

.tracing-lab-grid {
  display: grid;
  gap: 2rem;
}

.card-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.2rem;
}

.card-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(255, 155, 102, 0.25);
}

.card__body h4,
.card__body h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.card__body p {
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.card__actions {
  display: flex;
  justify-content: flex-start;
}

.card--video {
  border-left: 6px solid rgba(78, 205, 196, 0.8);
}

.card--compact {
  padding: 1rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip {
  background: rgba(255, 145, 77, 0.15);
  color: var(--color-primary-dark);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.button {
  display: inline-block;
  border: 2px solid var(--color-primary);
  color: var(--color-primary-dark);
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 127, 80, 0.1);
  transition: background 0.2s ease, transform 0.2s ease;
}

.button:hover,
.button:focus-visible {
  background: rgba(255, 127, 80, 0.25);
  transform: translateY(-1px);
}

.button--primary {
  background: var(--color-primary);
  color: #fff;
}

.button--accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

.button--small {
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  margin-bottom: 0.5rem;
}

.detail-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

.detail-card__header {
  margin-bottom: 1.5rem;
}

.detail-card__section {
  margin-top: 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-muted);
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--color-primary);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  box-shadow: var(--shadow-soft);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}

.game-embed {
  margin-top: 1.5rem;
}

[data-game-card] {
  --game-accent: var(--color-primary);
  --game-accent-strong: var(--color-primary-dark);
  --game-secondary: var(--color-accent);
  --game-muted: var(--color-muted);
  --game-border: var(--color-border);
  --game-success: #2bb574;
  --game-danger: #ef476f;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2vw, 1.8rem);
  box-shadow: var(--shadow-soft);
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  color: var(--color-text);
}

[data-game-card] h3,
[data-game-card] h4 {
  margin-top: 0;
  color: var(--color-primary-dark);
}

[data-game-card] p {
  color: var(--color-text);
}

[data-game-card] .score-label,
[data-game-card] small {
  color: var(--color-muted);
}

[data-game-card] button {
  font-family: inherit;
}

.tracing-game {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-soft);
}

.tracing-game__board {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  flex-wrap: nowrap;
}

.tracing-game__canvas-panel {
  flex: 1 1 55%;
  min-width: 0;
}

.tracing-game__control-panel {
  flex: 0 0 320px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tracing-game__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tracing-game__round {
  font-weight: 600;
  color: var(--color-muted);
  margin: 0 0 0.35rem;
}

.tracing-game__title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-primary-dark);
}

.tracing-game__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(78, 205, 196, 0.15);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--color-accent);
}

.tracing-game__score .label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tracing-game__score .value {
  font-size: 1.4rem;
  line-height: 1.2;
}

.tracing-game canvas {
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(0, 0, 0, 0.05);
  display: block;
  margin: 0 0 1.2rem;
  background: #fff;
}

.tracing-game__details {
  background: rgba(255, 184, 116, 0.12);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.2rem;
}

.tracing-game__meta {
  display: flex;
  gap: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tracing-game__explanation {
  margin: 0.2rem 0 0.6rem;
}

.tracing-game__commands {
  background: rgba(46, 213, 197, 0.12);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  font-size: 0.9rem;
}

.tracing-game__commands h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--color-primary-dark);
}

.tracing-game__commands ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

.tracing-game__commands li {
  list-style: disc;
  color: var(--color-muted);
}

.tracing-game__commands code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.tracing-game__control-panel label {
  font-weight: 700;
  display: block;
  margin-bottom: 0.35rem;
}

.tracing-game__control-panel textarea {
  width: 100%;
  min-height: 260px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(0, 0, 0, 0.08);
  padding: 0.75rem;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
  flex: 1 1 auto;
}

.tracing-game__buttons {
  display: flex;
  gap: 0.75rem;
  margin: 0.4rem 0 0.2rem;
  flex-wrap: wrap;
}


@media (max-width: 720px) {
  .tracing-game {
    padding: 1.2rem;
  }

  .tracing-game__board {
    flex-direction: column;
  }

  .tracing-game__control-panel {
    max-width: 100%;
  }

  .tracing-game__meta {
    flex-wrap: wrap;
  }

  .tracing-game__control-panel textarea {
    min-height: 200px;
  }
}

.bubble-pop-game {
  margin-top: 2rem;
  background: linear-gradient(135deg, rgba(173, 216, 230, 0.15), rgba(255, 192, 203, 0.2));
  border-radius: var(--radius-lg, 18px);
  padding: 1.5rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bubble-pop-game__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.bubble-pop-game__header h2 {
  margin: 0;
  color: var(--color-primary-dark, #ff7f50);
}

.bubble-pop-game__hud {
  min-width: 220px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md, 12px);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.bubble-pop-game__layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.bubble-pop-game__controls {
  flex: 0 0 280px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md, 14px);
  padding: 1rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.bubble-pop-game__form {
  display: grid;
  gap: 1rem;
  font-size: 0.95rem;
}

.bubble-pop-game__form fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.bubble-pop-game__form legend {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.bubble-pop-game__form label {
  display: grid;
  grid-template-columns: 1.2rem 1fr;
  gap: 0.4rem;
  align-items: center;
}

.bubble-pop-game__inline-input {
  margin-left: 1.2rem;
  margin-top: 0.35rem;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0.35rem 0.5rem;
  width: 100%;
  font-size: 0.95rem;
}

.bubble-pop-game__note {
  margin: 0.2rem 0 0 1.6rem;
  font-size: 0.85rem;
  color: var(--color-muted, #7a7a7a);
}

.bubble-pop-game__actions {
  display: flex;
  gap: 0.6rem;
}

.bubble-pop-game__status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--color-muted, #666);
}

.bubble-pop-game__board {
  position: relative;
  flex: 1 1 360px;
  min-height: 360px;
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(173, 216, 230, 0.4));
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.08);
}

.bubble-pop-game__board::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.6) 0, transparent 45%),
    radial-gradient(circle at 70% 35%, rgba(255, 255, 255, 0.35) 0, transparent 50%),
    radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.25) 0, transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

.bubble-pop-game__bubble {
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: var(--bubble-size, 64px);
  height: var(--bubble-size, 64px);
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(135, 206, 250, 0.85));
  box-shadow: 0 12px 24px rgba(70, 130, 180, 0.25);
  font-family: 'Baloo 2', 'Segoe UI', sans-serif;
  font-size: calc(var(--bubble-size, 64px) / 2.4);
  font-weight: 700;
  color: #1f3a93;
  cursor: pointer;
  animation: bubble-pop-rise var(--bubble-float-duration, 5200ms) ease-in forwards;
  display: grid;
  place-items: center;
}

.bubble-pop-game__bubble:focus-visible {
  outline: 3px solid rgba(255, 140, 0, 0.7);
  outline-offset: 3px;
}

.bubble-pop-game__bubble:active {
  transform: translate(-50%, -2%) scale(0.96);
}

@keyframes bubble-pop-rise {
  0% {
    bottom: -25%;
    transform: translateX(-50%) scale(0.9);
    opacity: 0;
  }
  5% {
    opacity: 0.95;
    transform: translateX(-50%) scale(0.93);
  }
  60% {
    bottom: 55%;
    opacity: 1;
    transform: translateX(-50%) scale(1.02);
  }
  90% {
    bottom: 95%;
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    bottom: 110%;
    transform: translateX(-50%) scale(1.08);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .bubble-pop-game__layout {
    flex-direction: column;
  }

  .bubble-pop-game__controls {
    flex-basis: auto;
  }
}

.polyomino-game {
  margin-top: 2rem;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 18px);
  padding: 1.5rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.polyomino-game__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.2rem;
}

.polyomino-game__header h2 {
  margin: 0;
  color: var(--color-primary-dark, #ff7f50);
}

.polyomino-game__scoreboard {
  display: grid;
  grid-auto-flow: column;
  gap: 1.2rem;
  margin: 0;
}

.polyomino-game__scoreboard dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--color-muted, #7a7a7a);
}

.polyomino-game__scoreboard dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.polyomino-game__controls {
  background: rgba(248, 249, 252, 0.9);
  border-radius: var(--radius-md, 12px);
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
}

.polyomino-game__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.polyomino-game__form label {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.polyomino-game__form select {
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0.45rem 0.6rem;
  min-width: 180px;
}

.polyomino-game__buttons {
  display: flex;
  gap: 0.6rem;
}

.polyomino-game__status {
  margin: 0;
  color: var(--color-muted, #666);
  min-height: 1.2rem;
}

.polyomino-game__layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.polyomino-panel {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md, 12px);
  padding: 1rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.polyomino-panel h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  color: var(--color-text, #333);
}

.poly-grid {
  --cell-size: 34px;
  display: grid;
  grid-template-columns: repeat(10, var(--cell-size));
  grid-template-rows: repeat(10, var(--cell-size));
  gap: 4px;
  justify-content: center;
}

.poly-grid--preview {
  --cell-size: 20px;
  gap: 3px;
  justify-content: flex-start;
}

.poly-grid--main {
  margin: 0 auto;
}

.poly-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background: rgba(240, 244, 248, 0.95);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.1s ease, background 0.1s ease;
}

.poly-cell:hover:not(:disabled) {
  transform: scale(1.04);
  background: rgba(214, 234, 248, 0.95);
}

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

.poly-cell--target {
  background: linear-gradient(135deg, #ffe082, #ffca28);
  border-color: rgba(255, 193, 7, 0.6);
}

.poly-cell--active {
  background: linear-gradient(135deg, #4db6ac, #00897b);
  border-color: rgba(0, 121, 107, 0.6);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.poly-preview {
  --preview-cell-size: 22px;
  display: grid;
  grid-template-columns: repeat(var(--preview-columns, 1), var(--preview-cell-size));
  grid-template-rows: repeat(var(--preview-rows, 1), var(--preview-cell-size));
  gap: 4px;
  justify-content: flex-start;
  padding: 0.4rem 0.2rem;
}

.poly-preview-cell {
  width: var(--preview-cell-size);
  height: var(--preview-cell-size);
  border-radius: 6px;
  background: linear-gradient(135deg, #ffe082, #ffca28);
  border: 1px solid rgba(255, 193, 7, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

@media (max-width: 640px) {
  .polyomino-game__form {
    flex-direction: column;
    align-items: stretch;
  }

  .polyomino-game__buttons {
    justify-content: stretch;
  }

  .polyomino-game__buttons .button {
    flex: 1 1 auto;
  }
}

.feedback-form {
  background: var(--color-surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  max-width: 520px;
}

.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.1rem;
}

.form-field label {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.form-field input,
.form-field textarea,
.form-field select {
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
}

.form-field input:focus-visible,
.form-field textarea:focus-visible,
.form-field select:focus-visible {
  border-color: var(--color-primary);
  outline: none;
}

.form-field__error {
  color: #d9534f;
  font-size: 0.85rem;
  min-height: 1.1rem;
  margin: 0.35rem 0 0;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-status {
  margin: 0;
  min-height: 1.2rem;
  color: var(--color-muted);
}

@media (max-width: 720px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero {
    padding: 2rem 1.5rem;
  }

  .site-main {
    padding: 1.5rem 0 3rem;
  }

  .detail-card {
    padding: 1.5rem;
  }
}


.turtle-shapes-game {
  margin-top: 2rem;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 18px);
  padding: 1.5rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.turtle-shapes-game__header h2 {
  margin: 0;
  color: var(--color-primary-dark, #ff7f50);
}

.turtle-shapes-game__header p {
  margin: 0.3rem 0 1.2rem;
  color: var(--color-muted, #7a7a7a);
}

.turtle-shapes-game__layout {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.turtle-shapes-game__canvas-panel {
  flex: 1 1 360px;
  min-width: 320px;
}

.turtle-shapes-game__canvas-panel canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md, 12px);
  border: 2px solid rgba(0, 0, 0, 0.04);
  background: #fff;
}

.turtle-shapes-game__control-panel {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.turtle-shapes-game__presets h3 {
  margin: 0 0 0.5rem;
  color: var(--color-primary-dark, #ff7f50);
}

.turtle-shapes-game__selector {
  margin-top: 1rem;
  display: grid;
  gap: 0.4rem;
}

.turtle-shapes-game__selector label {
  font-weight: 700;
  color: var(--color-text, #333);
}

.turtle-shapes-game__selector select {
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
}

.turtle-shapes-description {
  margin: 0.2rem 0 0;
  color: var(--color-muted, #7a7a7a);
  font-size: 0.85rem;
  min-height: 2.4rem;
}

.turtle-shapes-game__label {
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
}

.turtle-shapes-game__editor textarea {
  width: 100%;
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.8rem;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
}

.turtle-shapes-game__buttons {
  display: flex;
  gap: 0.6rem;
}

.turtle-shapes-game__commands {
  margin-top: 0.8rem;
}

.turtle-shapes-game__feedback {
  min-height: 2.4rem;
  margin: 0;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md, 12px);
  color: var(--color-muted, #7a7a7a);
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .turtle-shapes-game__layout {
    flex-direction: column;
  }

  .turtle-shapes-game__control-panel {
    flex-basis: auto;
  }
}

.section--highlight {
  background: linear-gradient(135deg, rgba(255, 231, 186, 0.3), rgba(173, 216, 230, 0.25));
  border-radius: var(--radius-lg, 18px);
  padding: 2rem;
  margin-top: 2rem;
}

.section--highlight .section__header {
  margin-bottom: 1.5rem;
}

.section--highlight .card {
  max-width: 480px;
  margin: 0 auto;
  border: 0;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.simple-shapes-game {
  margin-top: 2rem;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 18px);
  padding: 1.5rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.05);
}

.simple-shapes-game__header h2 {
  margin: 0;
  color: var(--color-primary-dark, #ff7f50);
}

.simple-shapes-game__header p {
  margin: 0.3rem 0 1.2rem;
  color: var(--color-muted, #7a7a7a);
}

.simple-shapes-game__layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.simple-shapes-game__canvas-panel {
  flex: 1 1 360px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.simple-shapes-game__canvas-panel canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md, 12px);
  border: 2px solid rgba(0, 0, 0, 0.04);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.simple-shapes-game__palette {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md, 12px);
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

.simple-palette {
  display: grid;
  gap: 0.6rem;
}

.simple-palette__item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 16px;
  padding: 0.6rem 0.9rem;
  font-weight: 700;
  color: #fff;
  cursor: grab;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.simple-palette__item:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.simple-palette__item[data-command="forward"] {
  background: linear-gradient(135deg, #5cb85c, #4caf50);
  box-shadow: 0 6px 16px rgba(92, 184, 92, 0.35);
}

.simple-palette__item[data-command="left"],
.simple-palette__item[data-command="right"] {
  background: linear-gradient(135deg, #5bc0de, #428bca);
  box-shadow: 0 6px 16px rgba(66, 139, 202, 0.35);
}

.simple-palette__item[data-command="repeat"] {
  background: linear-gradient(135deg, #f0ad4e, #ff9800);
  box-shadow: 0 6px 16px rgba(240, 173, 78, 0.35);
}

.simple-shapes-game__examples {
  display: grid;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md, 12px);
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.simple-shapes-game__examples select {
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
}

.simple-shapes-description {
  margin: 0;
  color: var(--color-muted, #7a7a7a);
  font-size: 0.85rem;
  min-height: 2.4rem;
}

.simple-shapes-game__program-panel {
  flex: 0 0 320px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.simple-program {
  min-height: 280px;
  padding: 1rem;
  border-radius: var(--radius-md, 12px);
  background: rgba(248, 249, 252, 0.9);
  border: 2px dashed rgba(66, 139, 202, 0.25);
  display: grid;
  gap: 0.75rem;
}

.simple-program__empty {
  margin: 0;
  color: var(--color-muted, #7a7a7a);
  font-style: italic;
}

.simple-command {
  border-radius: 18px;
  padding: 0.6rem 0.8rem;
  color: #fff;
  box-shadow: 0 8px 18px rgba(66, 139, 202, 0.25);
  cursor: grab;
}

.simple-command__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.simple-command__title {
  font-weight: 700;
  text-transform: capitalize;
}

.simple-command select {
  border-radius: 12px;
  border: none;
  padding: 0.3rem 0.6rem;
  font-weight: 700;
}

.simple-command__remove {
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
  cursor: pointer;
}

.simple-command__body {
  margin-top: 0.6rem;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 0.6rem;
  display: grid;
  gap: 0.5rem;
}

.simple-command--forward {
  background: linear-gradient(135deg, #5cb85c, #4caf50);
}

.simple-command--left,
.simple-command--right {
  background: linear-gradient(135deg, #5bc0de, #428bca);
}

.simple-command--repeat {
  background: linear-gradient(135deg, #f0ad4e, #ff9800);
}

.simple-command--repeat .simple-command__body {
  border: 2px dashed rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.1);
}

.simple-shapes-game__buttons {
  display: flex;
  gap: 0.6rem;
}

.simple-shapes-game__commands ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-muted, #7a7a7a);
  font-size: 0.9rem;
}

.simple-shapes-feedback {
  min-height: 2.4rem;
  margin: 0;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md, 12px);
  color: var(--color-muted, #7a7a7a);
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85rem;
}

@media (max-width: 960px) {
  .simple-shapes-game__program-panel {
    flex: 1 1 100%;
  }
}

@media (max-width: 720px) {
  .section--highlight {
    padding: 1.5rem;
  }

  .simple-shapes-game__layout {
    flex-direction: column;
  }

  .simple-shapes-game__program-panel {
    min-width: unset;
  }
}
