* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
  background: #fce7f3;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.game-page {
  min-height: 100vh;
  padding: 24px;
}

.game-layout {
  max-width: 1150px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.card {
  background: #fff;
  border: 4px solid #000;
  border-radius: 28px;
  box-shadow: 10px 10px 0 #000;
}

.card-inner {
  padding: 24px;
}

.sidebar {
  height: fit-content;
}

.sidebar-title {
  margin: 0 0 18px;
  font-size: 26px;
  font-weight: 900;
}

.progress-box,
.mission-box,
.code-box,
.choice-box,
.result-box,
.learn-box {
  border: 4px solid #000;
  border-radius: 18px;
  padding: 16px;
}

.progress-box {
  background: #fef3c7;
  margin-bottom: 18px;
}

.progress-box p,
.mission-box p,
.code-box p,
.choice-box p,
.result-box p,
.learn-box p {
  margin: 0;
}

.progress-label,
.eyebrow {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-number {
  margin-top: 4px !important;
  font-size: 28px;
  font-weight: 900;
}

.level-list {
  display: grid;
  gap: 14px;
}

.level-button,
.answer-button,
.btn {
  border: 4px solid #000;
  border-radius: 18px;
  box-shadow: 6px 6px 0 #000;
  background: #fff;
  color: #111827;
  font-weight: 900;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.level-button {
  width: 100%;
  text-align: left;
  padding: 14px;
}

.level-button:hover,
.answer-button:hover,
.btn:hover {
  transform: translateY(-2px);
}

.level-button.active {
  background: #bfdbfe;
}

.level-button-title {
  display: block;
  font-weight: 900;
}

.level-button-concept {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 700;
}

.level-done {
  margin-top: 8px;
  display: block;
  color: #15803d;
  font-size: 13px;
  font-weight: 900;
}

.level-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.level-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #bfdbfe;
  border: 4px solid #000;
  border-radius: 18px;
  font-size: 28px;
}

.level-concept {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.level-title {
  margin: 2px 0 0;
  font-size: 34px;
  font-weight: 900;
}

.main-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.stack {
  display: grid;
  gap: 16px;
}

.mission-box {
  background: #dcfce7;
}

.mission-title,
.choice-title,
.code-title {
  font-size: 18px;
  font-weight: 900;
}

.mission-text {
  margin-top: 6px !important;
  font-weight: 700;
}

.preview-box {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 4px solid #000;
  border-radius: 18px;
  box-shadow: 6px 6px 0 #000;
  padding: 24px;
}

.preview-box.full-width {
  display: block;
  width: 100%;
}

.preview-title {
  margin: 0;
  font-weight: 900;
  font-size: 36px;
}

.preview-text {
  width: 100%;
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

.preview-img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border: 4px solid #000;
  border-radius: 18px;
}

.preview-placeholder {
  font-size: 18px;
  font-weight: 800;
  color: #6b7280;
}

.code-box {
  background: #fef3c7;
  box-shadow: 6px 6px 0 #000;
}

.code-box pre {
  margin: 8px 0 0;
  overflow-x: auto;
  white-space: pre-wrap;
  font-size: 14px;
  font-family: Consolas, Monaco, monospace;
}

.choice-box {
  background: #f9fafb;
}

.answer-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.answer-button {
  width: 100%;
  padding: 16px;
  text-align: left;
}

.answer-button.active {
  background: #fef08a;
}

.answer-button.locked {
  opacity: 0.85;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 20px;
  text-decoration: none;
}

.btn-primary {
  background: #000;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: #111827;
}

.btn:disabled {
  opacity: 0.5;
  transform: none;
}

.result-box {
  box-shadow: 6px 6px 0 #000;
}

.result-box.good {
  background: #dcfce7;
}

.result-box.bad {
  background: #fee2e2;
}

.result-title {
  font-size: 20px;
  font-weight: 900;
}

.result-text {
  margin-top: 8px !important;
  font-weight: 700;
}

.finish-card {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.finish-title {
  margin: 0;
  font-size: 48px;
  font-weight: 900;
}

.finish-text {
  font-size: 20px;
  font-weight: 700;
}

.finish-score {
  font-size: 28px;
  font-weight: 900;
}

.finish-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
  text-align: left;
}

.learn-box.green {
  background: #dcfce7;
}

.learn-box.blue {
  background: #dbeafe;
}

.learn-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-weight: 700;
}

.home-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fce7f3;
}

.home-card {
  max-width: 720px;
  background: #fff;
  border: 4px solid #000;
  border-radius: 28px;
  box-shadow: 10px 10px 0 #000;
  padding: 32px;
}

.home-card h1 {
  margin: 8px 0;
  font-size: 42px;
  font-weight: 900;
}

.home-card p {
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .game-layout,
  .main-grid,
  .finish-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .game-page {
    padding: 12px;
  }

  .card-inner,
  .home-card {
    padding: 18px;
  }

  .level-title,
  .home-card h1 {
    font-size: 28px;
  }

  .finish-title {
    font-size: 34px;
  }

  .action-row {
    display: grid;
  }

  .btn {
    width: 100%;
  }
}
