@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&family=Baloo+2:wght@500;700;800&display=swap');

:root {
  --mk-red: #e52521;
  --mk-red-dark: #b91c18;
  --mk-blue: #049cd8;
  --mk-blue-dark: #0378a6;
  --mk-yellow: #fbd000;
  --mk-yellow-dark: #e0ac00;
  --mk-green: #43b047;
  --mk-green-dark: #2f8a33;
  --mk-cream: #fff8e7;
  --mk-dark: #1a1a2e;
  --mk-grey: #4a4a58;
  --radius: 18px;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

/* PAW Patrol theme: same components, remapped palette */
:root.theme-paw {
  --mk-red: #e63946;
  --mk-red-dark: #b32835;
  --mk-blue: #2196f3;
  --mk-blue-dark: #1769aa;
  --mk-yellow: #ffc107;
  --mk-yellow-dark: #d39e00;
  --mk-green: #4caf50;
  --mk-green-dark: #357a38;
  --mk-cream: #eef6ff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Baloo 2', system-ui, sans-serif;
  background: linear-gradient(180deg, #7ec8f0 0%, #bfe8ff 45%, var(--mk-cream) 45%, var(--mk-cream) 100%);
  min-height: 100vh;
  color: var(--mk-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 40px;
}

/* Checkered road strip along the top, purely decorative */
.file-warning {
  display: none;
  width: 100%;
  background: var(--mk-yellow);
  color: var(--mk-dark);
  font-weight: 800;
  font-size: 0.9rem;
  text-align: center;
  padding: 12px 16px;
  border-bottom: 3px solid var(--mk-dark);
  box-sizing: border-box;
}
html.proto-file .file-warning {
  display: block;
}

.road-strip {
  width: 100%;
  height: 14px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--mk-dark) 0 20px,
    #fff 20px 40px
  );
  flex-shrink: 0;
}

.wrap {
  width: 100%;
  max-width: 560px;
  padding: 24px 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1, h2, h3 {
  font-family: 'Luckiest Guy', cursive;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
  text-align: center;
  -webkit-text-stroke: 1.5px var(--mk-dark);
  color: var(--mk-yellow);
  text-shadow: 3px 3px 0 var(--mk-dark);
}

h1 {
  font-size: 2.4rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.7rem;
}

p.subtitle {
  text-align: center;
  font-weight: 700;
  color: var(--mk-grey);
  margin-top: 0;
}

/* Buttons */
.btn {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  border: none;
  border-radius: 999px;
  padding: 16px 28px;
  cursor: pointer;
  color: #fff;
  background: var(--mk-blue);
  box-shadow: 0 6px 0 var(--mk-blue-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  width: 100%;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--mk-blue-dark);
}

.btn-red {
  background: var(--mk-red);
  box-shadow: 0 6px 0 var(--mk-red-dark);
}
.btn-green {
  background: var(--mk-green);
  box-shadow: 0 6px 0 var(--mk-green-dark);
}
.btn-yellow {
  background: var(--mk-yellow-dark);
  box-shadow: 0 6px 0 #a67900;
}
.btn-outline {
  background: #fff;
  color: var(--mk-dark);
  box-shadow: 0 6px 0 #ccc;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-sm {
  padding: 10px 16px;
  font-size: 0.95rem;
  width: auto;
}
.btn-round {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.row {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* Cards */
.card {
  background: #fff;
  border: 3px solid var(--mk-dark);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

/* Home page theme switcher */
.theme-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  width: 100%;
}
.theme-btn {
  flex: 1;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  border: 3px solid var(--mk-dark);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  background: #fff;
  color: var(--mk-dark);
}
.theme-btn.active {
  background: var(--mk-yellow);
}

/* Home page kart choice buttons */
.choice-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  margin-top: 20px;
}

.choice-card {
  background: #fff;
  border: 4px solid var(--mk-dark);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  text-decoration: none;
  color: var(--mk-dark);
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  cursor: pointer;
  display: block;
}
.choice-card:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 rgba(0,0,0,0.25);
}
.choice-card .emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 6px;
}
.choice-card h2 {
  color: var(--mk-dark);
  -webkit-text-stroke: 0;
  text-shadow: none;
  margin-bottom: 4px;
}
.choice-card p {
  margin: 0;
  color: var(--mk-grey);
  font-weight: 700;
}
.choice-card.parent { border-color: var(--mk-blue); }
.choice-card.kid { border-color: var(--mk-red); }

/* Parent: word inputs */
.word-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.word-input-row input[type="text"] {
  flex: 1;
}
.remove-btn {
  background: var(--mk-red);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 0 var(--mk-red-dark);
}
.remove-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

input[type="text"] {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 14px;
  border: 3px solid var(--mk-dark);
  border-radius: 12px;
  width: 100%;
  background: #fffdf5;
}
input[type="text"]:focus {
  outline: 3px solid var(--mk-blue);
}

.flash {
  text-align: center;
  font-weight: 800;
  padding: 10px;
  border-radius: 12px;
  margin-top: 8px;
}
.flash.ok {
  background: #e2f7e3;
  color: var(--mk-green-dark);
  border: 2px solid var(--mk-green);
}

/* Race track progress bar */
.track {
  position: relative;
  width: 100%;
  height: 46px;
  background: repeating-linear-gradient(
    90deg,
    #6b6b78 0 24px,
    #59596a 24px 48px
  );
  border: 3px solid var(--mk-dark);
  border-radius: 999px;
  margin-bottom: 22px;
  overflow: visible;
}
.track::before,
.track::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 6px;
  background-image: repeating-linear-gradient(180deg, #fff 0 8px, transparent 8px 16px);
}
.track::before { left: 14px; }
.track::after { right: 14px; }
.track-fill {
  position: absolute;
  top: 3px;
  left: 3px;
  bottom: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--mk-yellow), var(--mk-green));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.track-kart {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  font-size: 1.7rem;
  transition: left 0.4s ease;
  filter: drop-shadow(1px 2px 0 rgba(0,0,0,0.4));
}
.track-flag {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
}

/* Voice picker */
.voice-picker {
  width: 100%;
  margin-bottom: 8px;
}
.voice-picker-label {
  font-weight: 800;
  color: var(--mk-grey);
  text-align: center;
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.voice-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.voice-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 3px solid #ccc;
  border-radius: 14px;
  padding: 8px 10px;
  cursor: pointer;
}
.voice-option.selected {
  border-color: var(--mk-blue);
  box-shadow: 0 0 0 3px rgba(4, 156, 216, 0.25);
}
.voice-option .name {
  flex: 1;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
}
.voice-option .badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--mk-green);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.voice-option .preview-btn {
  background: var(--mk-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Quiz word line */
.word-line {
  background: #fff;
  border: 3px solid var(--mk-dark);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.word-line .num {
  font-family: 'Luckiest Guy', cursive;
  color: var(--mk-blue);
  font-size: 1.1rem;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}
.word-line input[type="text"] {
  flex: 1;
}
.word-line.correct {
  border-color: var(--mk-green);
  background: #f0fbf0;
}
.word-line.incorrect {
  border-color: var(--mk-red);
  background: #fdf0f0;
}
.feedback-badge {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.correct-hint {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--mk-red-dark);
  width: 100%;
  margin-top: -6px;
  margin-bottom: 10px;
  padding-left: 44px;
}

/* Mode select */
.mode-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 16px 0;
}
.mode-card {
  background: #fff;
  border: 3px solid #ccc;
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}
.mode-card .emoji {
  font-size: 2.2rem;
}
.mode-card h3 {
  margin: 0 0 2px;
  text-align: left;
  color: var(--mk-dark);
  -webkit-text-stroke: 0;
  text-shadow: none;
  font-size: 1.1rem;
}
.mode-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--mk-grey);
  font-weight: 700;
}
.mode-card.selected {
  border-color: var(--mk-green);
  box-shadow: 0 0 0 3px rgba(67,176,71,0.3);
}

/* Results page */
.score-banner {
  text-align: center;
  padding: 26px 16px;
  border-radius: var(--radius);
  border: 4px solid var(--mk-dark);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.score-banner .trophy {
  font-size: 3.4rem;
  display: block;
}
.score-banner .score-text {
  font-family: 'Luckiest Guy', cursive;
  font-size: 2.2rem;
  color: var(--mk-dark);
  -webkit-text-stroke: 0;
  text-shadow: none;
  margin: 6px 0;
}
.score-banner .msg {
  font-weight: 800;
  color: var(--mk-grey);
}
.tier-gold { background: linear-gradient(180deg,#fff8d8,#ffe98a); }
.tier-silver { background: linear-gradient(180deg,#f4f6ff,#dfe6f5); }
.tier-bronze { background: linear-gradient(180deg,#ffe9d8,#f3caa0); }
.tier-try { background: linear-gradient(180deg,#ffe3e0,#ffc9c3); }

.card h3 {
  color: var(--mk-dark);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.review-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 2px dashed #e0dcc8;
}
.review-item:last-child { border-bottom: none; }
.review-item .icon { font-size: 1.3rem; width: 28px; text-align: center; }
.review-item .words { flex: 1; }
.review-item .your-answer { font-weight: 700; }
.review-item.wrong .your-answer { color: var(--mk-red); text-decoration: line-through; }
.review-item .correct-word { color: var(--mk-green-dark); font-weight: 800; }

.empty-state {
  text-align: center;
  padding: 30px 10px;
}
.empty-state .emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}

.center-text { text-align: center; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }

a.link {
  color: var(--mk-blue-dark);
  font-weight: 800;
  text-decoration: none;
}
