/* Almir's Drawing Guide — kid-friendly, high contrast, big controls */
:root {
  --ink: #12203a;
  --ink-soft: #2a3a58;
  --paper: #fffdf7;
  --sky: #d9f0ff;
  --sun: #ffe9a8;
  --card: #ffffff;
  --line: #12203a;
  --easy: #0b7a3b;
  --medium: #9a6b00;
  --hard: #b42318;
  --next: #0b7a3b;
  --prev: #0b4fbf;
  --speak: #5b21b6;
  --home: #0b63c8;
  --shadow: 0 6px 0 #12203a;
  --radius: 22px;
  --btn-h: 64px;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 800;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #fff7c2 0 160px, transparent 161px),
    radial-gradient(circle at 92% 0%, #cdebff 0 200px, transparent 201px),
    linear-gradient(180deg, var(--sky) 0%, #fff6dc 55%, #ffe9b8 100%);
}

body {
  min-height: 100dvh;
}

#app {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1, h2, p, button { margin: 0; }

h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-align: center;
}

.welcome {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  text-align: center;
  margin-top: 8px;
  color: var(--ink);
}

.sub {
  text-align: center;
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-top: 8px;
}

.tip {
  display: block;
  margin: 16px auto 0;
  width: fit-content;
  max-width: 100%;
  background: #fff4c4;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 1.05rem;
  text-align: center;
  box-shadow: 0 3px 0 var(--ink);
}

.screen { animation: pop 0.25s ease; }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 28px;
}

.drawing-card,
.level-btn,
.action-btn,
.nav-btn,
.icon-btn {
  font-family: inherit;
  font-weight: 900;
  color: #fff;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  min-height: var(--btn-h);
  -webkit-tap-highlight-color: transparent;
}

.drawing-card,
.level-btn,
.action-btn,
.nav-btn,
.icon-btn {
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.drawing-card:hover,
.level-btn:hover,
.action-btn:hover,
.nav-btn:hover,
.icon-btn:hover {
  transform: translateY(-2px);
}

.drawing-card:active,
.level-btn:active,
.action-btn:active,
.nav-btn:active,
.icon-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.drawing-card:focus-visible,
.level-btn:focus-visible,
.action-btn:focus-visible,
.nav-btn:focus-visible,
.icon-btn:focus-visible,
.link-btn:focus-visible,
.toggle:focus-visible {
  outline: 4px solid #ffb703;
  outline-offset: 3px;
}

.drawing-card {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  text-align: left;
  background: var(--home);
  padding: 18px 20px;
  min-height: 110px;
}

.drawing-card .emoji {
  font-size: 3.2rem;
  line-height: 1;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.drawing-card .card-copy { display: flex; flex-direction: column; gap: 4px; }
.drawing-card .card-title { font-size: 1.6rem; line-height: 1.15; }
.drawing-card .card-meta { font-size: 1.05rem; opacity: 0.95; font-weight: 800; }

.level-row {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.level-btn { font-size: 1.6rem; padding: 8px 16px; }
.level-btn.easy { background: var(--easy); }
.level-btn.medium { background: var(--medium); }
.level-btn.hard { background: var(--hard); }
.level-btn small {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  opacity: 0.95;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.link-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 16px;
  min-height: 48px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.badge {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 1.05rem;
  font-weight: 900;
}

.step-count {
  text-align: center;
  font-size: 1.2rem;
  margin: 4px 0 10px;
}

.progress {
  height: 18px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0b7a3b, #22c55e);
  width: 0%;
  transition: width 0.25s ease;
}

.step-panel {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 28px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow);
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.icon-btn {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--speak);
  font-size: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
}

.icon-btn[aria-pressed="true"] { background: #7c3aed; }

.step-text {
  flex: 1;
  font-size: clamp(1.55rem, 3.6vw, 2.15rem); /* 32px+ on desktop */
  line-height: 1.25;
  letter-spacing: -0.02em;
  min-height: 2.6em;
}

.hint-wrap {
  margin: 16px auto 6px;
  width: min(280px, 100%);
  background: #f3fbff;
  border: 3px dashed var(--ink);
  border-radius: 24px;
  padding: 8px;
}

.hint-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.shape-new {
  stroke: #0b4fbf !important;
  filter: drop-shadow(0 0 3px #7dd3fc);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.7; }
}

.auto-read {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
}

.auto-read input {
  appearance: none;
  width: 56px;
  height: 32px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #e7eaf0;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.auto-read input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.auto-read input:checked { background: var(--easy); }
.auto-read input:checked::after { transform: translateX(24px); }

.nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.nav-btn, .action-btn {
  font-size: 1.35rem;
  padding: 8px 14px;
}

.nav-btn.prev, .action-btn.secondary { background: var(--prev); }
.nav-btn.next, .action-btn.primary { background: var(--next); }
.nav-btn:disabled {
  background: #9aa6b8;
  box-shadow: 0 3px 0 #5c6778;
  cursor: not-allowed;
  transform: none;
}

.done-wrap { text-align: center; padding: 12px 6px 6px; }
.done-emoji { font-size: 4.2rem; line-height: 1; }
.done-wrap h1 { margin-top: 8px; }
.done-wrap .sub { font-size: 1.35rem; margin-top: 10px; }
.done-actions {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.hidden { display: none !important; }

@media (max-width: 520px) {
  .step-head { flex-direction: column; align-items: center; text-align: center; }
  .step-text { font-size: 1.5rem; }
  .nav-btn, .action-btn, .level-btn { font-size: 1.25rem; }
  .drawing-card { min-height: 96px; }
}
