:root {
  color: #2b211e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #faf5ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(187, 247, 208, 0.35), transparent 30%),
    #fff8ec;
}

.hidden {
  display: none !important;
}

.home-screen,
.complete-screen {
  margin: 0 auto;
  max-width: 720px;
  padding: 26px 24px 48px;
  text-align: center;
}

.brand-mark,
.tiny-flame {
  align-items: center;
  background: #ff7a1a;
  border-radius: 22px;
  box-shadow: 0 14px 24px rgba(255, 122, 26, 0.25);
  color: #fff;
  display: inline-flex;
  font-size: 2.7rem;
  height: 80px;
  justify-content: center;
  margin-bottom: 18px;
  width: 80px;
}

.home-screen h1 {
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  line-height: 0.95;
  margin: 0;
}

.home-screen h1 span,
.complete-screen h2,
.stars,
.rule-card span {
  color: #ff7417;
}

.home-screen p {
  color: #7f6c5f;
  font-size: 1.15rem;
  margin: 14px 0 34px;
}

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

.level-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid #eee2d1;
  border-radius: 14px;
  color: #2b211e;
  display: grid;
  gap: 16px;
  grid-template-columns: 58px 1fr;
  padding: 22px;
  text-align: left;
}

.level-card.available:first-child,
.level-card.available:hover {
  background: linear-gradient(90deg, #fff2df, #fff9f1);
  border-color: #ffb073;
}

.level-card.locked {
  color: #b8aa9e;
  cursor: not-allowed;
  opacity: 0.75;
}

.level-icon {
  align-items: center;
  background: #fff5e8;
  border-radius: 16px;
  color: #ff7417;
  display: flex;
  font-size: 2rem;
  height: 58px;
  justify-content: center;
}

.level-card small {
  color: #8f7d71;
  display: block;
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.level-card strong {
  display: block;
  font-size: 1.1rem;
  margin: 4px 0;
}

.level-card em {
  color: inherit;
  display: block;
  font-style: normal;
}

.game-screen {
  margin: 0 auto;
  max-width: 760px;
  min-height: 100vh;
  padding-bottom: 34px;
}

.game-header {
  align-items: center;
  border-bottom: 1px solid #e5d8c7;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  min-height: 56px;
  padding: 8px 20px;
  text-align: center;
}

.game-header span {
  color: #8f7d71;
  display: block;
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.game-header strong {
  display: block;
  font-size: 0.9rem;
}

.tiny-flame {
  border-radius: 50%;
  box-shadow: none;
  font-size: 1.2rem;
  height: 34px;
  margin: 0;
  width: 34px;
}

.ghost-btn {
  background: transparent;
  border: 0;
  color: #5c4a40;
  font-size: 1.25rem;
  font-weight: 900;
}

.game-prompt {
  color: #7b6658;
  margin: 22px 24px;
  text-align: center;
}

.step-nav {
  align-items: center;
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-bottom: 14px;
}

.figure-card,
.pattern-table {
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid #dfd1bf;
  border-radius: 12px;
  margin: 0 auto;
  max-width: 620px;
}

.figure-card {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 172px;
  padding: 18px;
}

.figure-canvas {
  align-items: center;
  display: flex;
  justify-content: center;
  overflow: auto;
  width: 100%;
}

svg {
  max-height: 190px;
  max-width: 100%;
}

.match-shadow {
  stroke: #bf6509;
  stroke-linecap: round;
  stroke-width: 7;
}

.match {
  stroke: #d97809;
  stroke-linecap: round;
  stroke-width: 5;
}

.match.accent {
  stroke: #ff9f13;
}

.joint {
  fill: #e7354f;
}

.joint.end {
  fill: #ffc83d;
  stroke: #ff9f13;
  stroke-width: 3;
}

.step-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-top: 12px;
}

.step-dots span {
  background: #ddd3c7;
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.step-dots span.active {
  background: #ff7417;
}

.count-hint {
  color: #d85f13;
  font-size: 0.8rem;
  margin: 8px 0 20px;
  text-align: center;
}

.pattern-table {
  padding: 18px 16px;
}

.table-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 80px repeat(8, 1fr);
}

.header-row {
  border-bottom: 1px solid #dfd1bf;
  padding-bottom: 10px;
}

.match-row {
  padding-top: 10px;
}

.table-row span {
  color: #806c60;
  font-size: 0.8rem;
  font-weight: 950;
}

.table-row button {
  background: #f0ece6;
  border: 0;
  border-radius: 50%;
  color: #231917;
  font-weight: 950;
  height: 38px;
  min-width: 38px;
}

.table-row button.active {
  background: #ff7417;
  color: #fff;
}

.table-row button.done {
  background: #36b488;
  color: #fff;
}

.answer-zone {
  margin: 22px auto 0;
  max-width: 420px;
  text-align: center;
}

.answer-zone h2 {
  font-size: 0.95rem;
}

.answer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.answer-controls input {
  background: #fffaf2;
  border: 2px solid #ffb073;
  border-radius: 10px;
  font-weight: 950;
  min-height: 48px;
  padding: 10px 14px;
  text-align: center;
  width: 116px;
}

.primary-btn {
  background: #ff7417;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-weight: 950;
  min-height: 48px;
  padding: 10px 18px;
}

.feedback {
  color: #7b6658;
  font-weight: 850;
  min-height: 24px;
}

.feedback.ok {
  color: #249269;
}

.feedback.bad {
  color: #d8324a;
}

.complete-screen {
  padding-top: 70px;
}

.spark {
  color: #ff7417;
  font-size: 4rem;
}

.complete-screen h2 {
  color: #241915;
  font-size: 2rem;
  margin: 8px 0 6px;
}

.complete-screen > p {
  color: #8b776a;
}

.stars {
  font-size: 2.6rem;
  letter-spacing: 8px;
  margin: 18px 0;
}

.rule-card {
  background: rgba(255, 255, 255, 0.74);
  border: 1.5px solid #dfd1bf;
  border-radius: 12px;
  margin: 0 auto;
  max-width: 330px;
  padding: 20px;
}

.rule-card strong {
  color: #8a6c5c;
  font-size: 0.8rem;
}

.rule-card p {
  line-height: 1.55;
}

.rule-card span {
  background: #fff0e4;
  border-radius: 10px;
  display: inline-block;
  font-weight: 950;
  padding: 10px 14px;
}

.complete-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
}

.outline-btn {
  background: #fffaf2;
  border: 1.5px solid #dfd1bf;
  border-radius: 10px;
  color: #5c4a40;
  font-weight: 850;
  min-height: 42px;
  padding: 8px 14px;
}

@media (max-width: 640px) {
  .home-screen,
  .game-screen,
  .complete-screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .table-row {
    gap: 6px;
    grid-template-columns: 64px repeat(8, 1fr);
  }

  .table-row button {
    height: 32px;
    min-width: 32px;
  }
}
