/* ── BASE.CSS — Gemeinsame Styles für alle Amy-Lern-Seiten ── */

:root {
  --c1: #FF6B9D;
  --c2: #FF9A3C;
  --c3: #FFD93D;
  --c4: #6BCB77;
  --c5: #4D96FF;
  --c6: #9B5DE5;
  --c-cm1: #00c9a7;
  --c-cm2: #4D96FF;
  --dark: #1a1a2e;
  --card: #ffffffee;
  --shadow: 0 12px 40px rgba(0,0,0,0.12);
  --r: 22px;
  --nav-h: 64px;
  --subject-h: 52px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(135deg, #ffd6f0 0%, #ffe8c0 25%, #d6f5d6 50%, #d6e8ff 75%, #eed6ff 100%);
  background-size: 400% 400%;
  animation: bgShift 14s ease infinite;
  padding-bottom: 40px;
}
@keyframes bgShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* ── FLOATING BUBBLES ── */
.bubble {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  animation: floatUp linear infinite;
  opacity: 0.15;
  z-index: 0;
}
@keyframes floatUp {
  0%   { transform: translateY(100vh) scale(0.5); opacity: 0; }
  50%  { opacity: 0.2; }
  100% { transform: translateY(-120px) scale(1.2); opacity: 0; }
}

/* ── TOP SUBJECT NAV (Uhr / Längen / ...) ── */
.subject-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.subject-nav-inner {
  max-width: 940px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 12px;
  height: var(--subject-h);
  overflow-x: auto;
  scrollbar-width: none;
}
.subject-nav-inner::-webkit-scrollbar { display: none; }

.subject-logo {
  font-family: 'Fredoka One', cursive;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--c1), var(--c6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  margin-right: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.subject-logo:hover { opacity: 0.8; }

.subject-divider {
  width: 1px;
  height: 28px;
  background: #dde;
  margin: 0 10px;
  flex-shrink: 0;
}

.subject-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  padding: 8px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  color: #8899bb;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s;
}
.subject-btn:hover { background: rgba(0,0,0,0.05); color: var(--dark); }
.subject-btn.active,
.subject-btn.active-uhr {
  background: linear-gradient(135deg, var(--c5), var(--c6));
  color: white;
  box-shadow: 0 3px 12px rgba(77,150,255,0.35);
}
.subject-btn.active-cm {
  background: linear-gradient(135deg, var(--c-cm1), var(--c-cm2));
  color: white;
  box-shadow: 0 3px 12px rgba(0,201,167,0.35);
}
.subject-btn.active-einmaleins {
  background: linear-gradient(135deg, #FF9500, #FF5E00);
  color: white;
  box-shadow: 0 3px 12px rgba(255,149,0,0.35);
}
/* Neue Fächer: Farbe aus SUBJECTS.gradient per inline style, active-[id] als Hook */
.subject-btn .s-icon { font-size: 1.1rem; }

/* ── PAGE HEADER ── */
.page-header {
  text-align: center;
  padding: 20px 16px 10px;
}
.page-logo {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2rem, 6vw, 3.2rem);
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.1));
  animation: logoWobble 4s ease-in-out infinite;
  line-height: 1.1;
}
@keyframes logoWobble {
  0%, 100% { transform: rotate(-1deg); }
  50%       { transform: rotate(1deg); }
}
.page-sub {
  color: #7788aa;
  font-size: 0.95rem;
  margin-top: 4px;
  font-weight: 600;
}

/* ── TOP STATS BAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 940px;
  margin: 8px auto;
  padding: 0 16px;
  flex-wrap: wrap;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--dark);
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  border: 2px solid rgba(255,255,255,0.8);
}
.stat-pill .icon { font-size: 1.1rem; }
.streak-fire { animation: fireFlicker 0.5s ease infinite alternate; }
@keyframes fireFlicker {
  0%   { transform: scale(1) rotate(-5deg); }
  100% { transform: scale(1.15) rotate(5deg); }
}

/* ── MODULE NAV (tabs within a subject) ── */
.module-nav {
  max-width: 940px;
  margin: 6px auto 0;
  padding: 0 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.mod-btn {
  font-family: 'Fredoka One', cursive;
  font-size: 0.82rem;
  padding: 8px 15px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: var(--card);
  color: #8899bb;
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
  border: 2.5px solid transparent;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(.34,1.4,.64,1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mod-btn:hover { background: #f0f4ff; color: var(--dark); }
.mod-btn.active {
  color: white;
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 5px 18px rgba(0,0,0,0.18);
}

/* ── MAIN CONTENT ── */
.main {
  max-width: 940px;
  margin: 0 auto;
  padding: 10px 12px 40px;
}

/* ── SCREEN SWITCHING ── */
.screen { display: none; }
.screen.active {
  display: block;
  animation: fadeIn 0.28s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CARD ── */
.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 22px 18px;
  box-shadow: var(--shadow);
  border: 2px solid rgba(255,255,255,0.9);
  margin-bottom: 14px;
}
.card-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.35rem;
  margin-bottom: 14px;
  text-align: center;
}

/* ── LEVEL PILLS ── */
.levels {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.lvl-btn {
  font-family: 'Fredoka One', cursive;
  font-size: 0.78rem;
  padding: 6px 13px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: white;
  color: #9aabcc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s;
}
.lvl-btn.active {
  background: linear-gradient(135deg, var(--c5), var(--c6));
  color: white;
  transform: scale(1.07);
}

/* ── SCORE ROW ── */
.score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sc-pill {
  background: linear-gradient(135deg, var(--c3), var(--c2));
  color: var(--dark);
  font-weight: 900;
  font-size: 0.9rem;
  padding: 5px 16px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(255,179,71,0.35);
}

/* ── PROGRESS DOTS ── */
.prog-row {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pdot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #e0e8f5;
  transition: all 0.3s;
}
.pdot.ok  { background: var(--c4); transform: scale(1.2); }
.pdot.err { background: var(--c1); }
.pdot.cur { background: var(--c3); animation: dotPulse 0.8s ease infinite alternate; }
@keyframes dotPulse { 0% { transform: scale(1); } 100% { transform: scale(1.4); } }

/* ── CLOCK ── */
.clock-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.clock-outer > .q-text,
.clock-outer > .choices,
.clock-outer > .feedback,
.clock-outer > .tip,
.clock-outer > .btn {
  width: min(100%, 380px);
}
.clock-wrap {
  position: relative;
  width: min(260px, 70vw);
  height: min(260px, 70vw);
  filter: drop-shadow(0 10px 28px rgba(77,150,255,0.22));
  transition: transform 0.2s;
}
.clock-wrap.pulse { animation: clockPulse 0.4s ease; }
@keyframes clockPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.clock-wrap.shake { animation: clockShake 0.4s ease; }
@keyframes clockShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

svg.clk { width: 100%; height: 100%; touch-action: none; }
.cf   { fill: #fffef5; stroke: #ddd; stroke-width: 1.5; }
.cr   { fill: none; stroke-width: 6; }
.hh   { stroke: #1a1a2e; stroke-width: 7; stroke-linecap: round; }
.mh   { stroke: var(--c5); stroke-width: 4.5; stroke-linecap: round; }
.sh   { stroke: var(--c1); stroke-width: 2; stroke-linecap: round; opacity: 0.9; }
.cd   { fill: var(--c1); }
.cd2  { fill: white; }
.tmaj { stroke: #aaa; stroke-width: 2.5; }
.tmin { stroke: #ddd; stroke-width: 1; }
.cnum { font-family: 'Fredoka One', cursive; font-size: 13px; fill: #333; }
.mring { fill: none; stroke: var(--c4); stroke-width: 20; stroke-dasharray: 0 1000; stroke-linecap: round; opacity: 0.28; transition: stroke-dasharray 0.35s; }

/* ── Q-TEXT ── */
.q-text {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.05rem, 3.2vw, 1.45rem);
  color: var(--dark);
  text-align: center;
  margin-bottom: 12px;
  min-height: 2.5em;
  line-height: 1.3;
}

/* ── FEEDBACK ── */
.feedback {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  text-align: center;
  min-height: 2.1em;
  margin-top: 10px;
  transition: all 0.3s;
}
.feedback.good { color: var(--c4); animation: popIn 0.35s cubic-bezier(.34,1.6,.64,1); }
.feedback.bad  { color: var(--c1); }
@keyframes popIn { 0% { transform: scale(0.5); } 100% { transform: scale(1); } }

/* ── CHOICES ── */
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  width: min(100%, 380px);
  max-width: 380px;
  margin: 0 auto;
}
.ch-btn {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  padding: 12px 8px;
  border: 3px solid #e8eef8;
  border-radius: 16px;
  cursor: pointer;
  background: white;
  color: var(--dark);
  transition: all 0.18s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  width: 100%;
  min-width: 0;
}
.ch-btn:hover:not(:disabled) { border-color: var(--c5); background: #f0f7ff; transform: scale(1.04); }
.ch-btn.correct { background: linear-gradient(135deg,#d4f5dc,#c0f0cc); border-color: var(--c4); color: #0a6020; }
.ch-btn.wrong   { background: linear-gradient(135deg,#fde8e8,#fdd0d0); border-color: var(--c1); color: #900; }

/* ── BUTTONS ── */
.btn {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  padding: 11px 28px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(.34,1.3,.64,1);
  display: inline-block;
  margin: 6px 4px;
  text-decoration: none;
}
.btn:hover { transform: scale(1.07); }
.btn-next    { background: linear-gradient(135deg,var(--c1),var(--c2)); color: white; box-shadow: 0 4px 16px rgba(255,107,157,0.4); }
.btn-confirm { background: linear-gradient(135deg,var(--c5),var(--c6)); color: white; box-shadow: 0 4px 16px rgba(77,150,255,0.4); }
.btn-green   { background: linear-gradient(135deg,var(--c4),#3ab860); color: white; }
.btn-ghost   { background: white; color: var(--c5); border: 2.5px solid var(--c5); }
.btn-hide    { display: none !important; }
.btn-show    { display: inline-block !important; }

/* ── TIP ── */
.tip {
  background: linear-gradient(135deg,#fffbe0,#fff5cc);
  border-left: 5px solid var(--c3);
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 14px;
  font-size: 0.9rem;
  color: #6a5000;
  line-height: 1.6;
  display: none;
  text-align: left;
}
.tip.show { display: block; animation: fadeIn 0.3s ease; }

/* ── SET MODE CONTROLS ── */
.set-display {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: var(--c6);
  text-align: center;
  margin: 8px 0;
}
.adj-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}
.adj-btn {
  font-size: 1.2rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2.5px solid #dde6f5;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.adj-btn:hover { background: #f0f5ff; border-color: var(--c5); transform: scale(1.1); }
.adj-label { font-weight: 800; color: var(--dark); font-size: 0.9rem; }

/* ── MATCH CARDS ── */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(115px, 42vw), 1fr));
  gap: 10px;
  margin-top: 10px;
}
.match-card svg {
  width: min(68px, 18vw);
  height: min(68px, 18vw);
}
.match-card {
  background: white;
  border-radius: 16px;
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  border: 3px solid transparent;
  box-shadow: 0 3px 12px rgba(0,0,0,0.07);
  transition: all 0.2s;
  user-select: none;
  font-family: 'Fredoka One', cursive;
}
.match-card:hover:not(.matched):not(.disabled) { border-color: var(--c5); transform: scale(1.04); }
.match-card.selected  { border-color: var(--c6); background: #f0e8ff; transform: scale(1.04); }
.match-card.matched   { background: linear-gradient(135deg,#d4f5dc,#c0f0cc); border-color: var(--c4); color: #0a6020; }
.match-card.wrong-flash { animation: wrongFlash 0.4s ease; }
@keyframes wrongFlash { 0%,100% { background: white; } 50% { background: #fde8e8; } }

/* ── ACHIEVEMENTS ── */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px,1fr));
  gap: 10px;
}
.ach-section-title {
  grid-column: 1 / -1;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  color: #8899aa;
  margin-top: 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid #eef;
}
.ach-card {
  background: white;
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  border: 3px solid #eee;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.ach-card.unlocked {
  border-color: var(--c3);
  background: linear-gradient(135deg,#fffbe0,#fff8c0);
}
.ach-icon { font-size: 2.2rem; display: block; margin-bottom: 5px; filter: grayscale(1); }
.ach-card.unlocked .ach-icon { filter: none; animation: popIn 0.5s cubic-bezier(.34,1.6,.64,1); }
.ach-name { font-family: 'Fredoka One', cursive; font-size: 0.8rem; color: var(--dark); }
.ach-desc { font-size: 0.68rem; color: #8899aa; margin-top: 3px; line-height: 1.3; }
.ach-locked { opacity: 0.45; }

/* ── CELEBRATION ── */
.celebrate {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.celebrate.show { opacity: 1; pointer-events: all; }
.cel-emoji { font-size: 4.5rem; animation: floatStar 2s ease-in-out infinite; }
@keyframes floatStar { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-18px) rotate(5deg); } }
.cel-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.8rem, 7vw, 3.8rem);
  background: linear-gradient(135deg, var(--c1), var(--c6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: popIn 0.5s cubic-bezier(.34,1.6,.64,1);
  margin: 8px 0;
  text-align: center;
  padding: 0 16px;
}
.cel-score { font-size: 1rem; color: #7788aa; font-weight: 700; margin-bottom: 18px; text-align: center; }
.confetti-container { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.conf { position: absolute; width: 10px; height: 10px; border-radius: 2px; animation: confFall linear forwards; }
@keyframes confFall { 0% { opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: white;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: 999px;
  z-index: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: toastIn 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ── COOKIE BANNER ── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(26,26,46,0.97);
  backdrop-filter: blur(10px);
  color: white;
  padding: 16px 20px;
  z-index: 700;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  transform: translateY(0);
  transition: transform 0.4s ease;
}
.cookie-banner.hidden { transform: translateY(110%); }
.cookie-text {
  flex: 1;
  min-width: 220px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #ccd;
}
.cookie-text a { color: var(--c3); text-decoration: none; }
.cookie-text a:hover { text-decoration: underline; }
.cookie-btns { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.cookie-btn {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  padding: 9px 20px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.cookie-btn-accept { background: var(--c4); color: white; }
.cookie-btn-accept:hover { background: #4ab85a; transform: scale(1.04); }
.cookie-btn-reject { background: rgba(255,255,255,0.1); color: #aab; border: 1.5px solid rgba(255,255,255,0.2); }
.cookie-btn-reject:hover { background: rgba(255,255,255,0.18); }

/* ── CALC ── */
.calc-layout { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.calc-clocks { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; }
.calc-clock-box { text-align: center; }
.calc-clock-box .clk-label { font-family: 'Fredoka One', cursive; font-size: 0.85rem; color: #7788aa; margin-top: 6px; }
.arrow-box { font-size: 2.2rem; color: var(--c2); }
.calc-choices { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.calc-choice {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  padding: 9px 20px;
  border: 3px solid #e0e8f5;
  border-radius: 999px;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
}
.calc-choice:hover:not(:disabled) { border-color: var(--c5); background: #f0f7ff; transform: scale(1.05); }
.calc-choice.correct { background: linear-gradient(135deg,#d4f5dc,#c0f0cc); border-color: var(--c4); }
.calc-choice.wrong   { background: linear-gradient(135deg,#fde8e8,#fdd0d0); border-color: var(--c1); }

/* ── TIMELINE (Tagesplan) ── */
.tl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: white;
  border-radius: 14px;
  padding: 11px 14px;
  margin-bottom: 7px;
  border: 3px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.tl-item.done { background: linear-gradient(135deg,#d4f5dc,#e8ffee); border-color: var(--c4); }
.tl-item.err  { background: linear-gradient(135deg,#fde8e8,#ffeeee); border-color: var(--c1); }
.tl-emoji { font-size: 1.8rem; flex-shrink: 0; margin-top: 2px; }
.tl-text  { font-weight: 700; color: var(--dark); font-size: 0.95rem; }
.tl-choices-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tl-ch {
  font-family: 'Fredoka One', cursive;
  font-size: 0.82rem;
  padding: 5px 12px;
  border: 2px solid #dde;
  border-radius: 999px;
  cursor: pointer;
  background: white;
  transition: all 0.15s;
}
.tl-ch:hover { border-color: var(--c5); background: #f0f7ff; }

/* ── FREE CLOCK ── */
.free-layout { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.free-time { font-family: 'Fredoka One', cursive; font-size: 2.8rem; color: var(--dark); }
.free-spoken {
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem;
  color: var(--c6);
  text-align: center;
  background: white;
  padding: 10px 22px;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(155,93,229,0.15);
}

/* ── CM MODULE ── */
.ruler-wrap {
  position: relative;
  margin: 0 auto 14px;
  height: 64px;
  background: linear-gradient(180deg,#ffe082,#ffd54f);
  border-radius: 8px;
  border: 2px solid #f9a825;
  overflow: visible;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 16px rgba(249,168,37,0.3);
  touch-action: none;
}
.ruler-tick { position: absolute; bottom: 0; background: #5d4037; transform: translateX(-50%); }
.ruler-tick.major { width: 2.5px; }
.ruler-tick.minor { width: 1px; background: #8d6e63; }
.ruler-tick.half  { width: 1.5px; background: #795548; }
.ruler-num {
  position: absolute; bottom: 6px;
  font-family: 'Fredoka One', cursive; font-size: 10px; color: #4a3000;
  transform: translateX(-50%);
}
.ruler-arrow {
  position: absolute; top: -22px;
  font-size: 1.4rem; transform: translateX(-50%);
  transition: left 0.3s cubic-bezier(.34,1.3,.64,1);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.ruler-target-line {
  position: absolute; top: 0; bottom: 0; width: 3px; border-radius: 2px;
  background: var(--c1); opacity: 0.75; transform: translateX(-50%);
  pointer-events: none;
}
.cm-bar {
  height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--c-cm1), var(--c-cm2));
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 8px; color: white;
  font-family: 'Fredoka One', cursive; font-size: 0.9rem;
  transition: width 0.5s cubic-bezier(.34,1.3,.64,1);
  min-width: 28px; box-shadow: 0 3px 10px rgba(0,201,167,0.3);
}
.cm-input-field {
  font-family: 'Fredoka One', cursive; font-size: 1.4rem;
  width: 88px; padding: 7px 10px;
  border: 3px solid #dde; border-radius: 14px;
  text-align: center; color: var(--dark); outline: none;
  transition: border-color 0.2s;
}
.cm-input-field:focus   { border-color: var(--c-cm1); }
.cm-input-field.correct { border-color: var(--c4); background: #d4f5dc; }
.cm-input-field.wrong   { border-color: var(--c1); background: #fde8e8; }
.object-card {
  background: white; border-radius: 16px; padding: 12px 8px;
  text-align: center; border: 3px solid #eee;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  cursor: pointer; transition: all 0.2s;
}
.object-card:hover   { border-color: var(--c-cm1); transform: scale(1.04); }
.object-card.selected{ border-color: var(--c6); background: #f0e8ff; }
.object-card.correct { border-color: var(--c4); background: #d4f5dc; }
.object-card.wrong   { border-color: var(--c1); background: #fde8e8; }
.object-emoji { font-size: 2rem; display: block; margin-bottom: 4px; }
.object-label { font-family: 'Fredoka One', cursive; font-size: 0.78rem; color: var(--dark); }
.obj-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(92px,1fr)); gap: 9px; }
.convert-display {
  font-family: 'Fredoka One', cursive; font-size: 1.9rem;
  color: var(--c6); text-align: center;
  background: white; padding: 9px 20px; border-radius: 14px;
  box-shadow: 0 3px 12px rgba(155,93,229,0.15);
  margin: 10px 0;
}
.read-ruler-card {
  background: linear-gradient(135deg,#fffdf4,#fff7dd);
  border: 2px solid #ffe082;
  border-radius: 18px;
  padding: 14px 12px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 4px 14px rgba(240,180,41,0.12);
}
.read-ruler-hint,
.read-ruler-note {
  text-align: center;
  font-size: 0.88rem;
  color: #7a6400;
  line-height: 1.45;
}
.read-ruler-hint {
  margin-bottom: 10px;
  font-weight: 700;
}
.read-ruler-note {
  margin-top: 8px;
}
.read-ruler-stage {
  background: rgba(255,255,255,0.55);
  border-radius: 16px;
  padding: 10px 8px 6px;
}

/* ── ESTIMATE MODE (Slider) ── */
.estimate-ref-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg,#fffdf4,#eefcff);
  border: 2px solid #d9f4ef;
  border-radius: 18px;
  padding: 10px 14px;
  margin-bottom: 4px;
}
.estimate-ref-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.estimate-ref-label {
  font-size: 0.88rem;
  color: #4d6b66;
  line-height: 1.4;
}
.estimate-target-emoji {
  display: block;
  font-size: 3.5rem;
  line-height: 1.1;
  margin: 6px 0 2px;
}

/* ── TOUCH FEEDBACK ── */
.btn, .ch-btn, .match-card, .object-card, .diff-btn, .mode-opt {
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .ch-btn:active, .diff-btn:active, .mode-opt:active {
  transform: scale(0.96);
  transition: transform 0.08s;
}

/* ── MODE HUB (ARCH-03) ── */
.mode-hub {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 4px 0;
}
.mode-card {
  background: white;
  border-radius: 18px;
  padding: 18px 12px 14px;
  text-align: center;
  cursor: pointer;
  border: 2px solid #f0f0f0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  user-select: none;
}
.mode-card:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.mode-card:active { transform: scale(0.96); }
.mode-card-icon  { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.mode-card-name  { font-family: 'Fredoka One', cursive; font-size: 1rem; color: var(--dark); margin-bottom: 4px; }
.mode-card-desc  { font-size: 0.75rem; color: #8899aa; line-height: 1.3; }

/* ── BACK BUTTON (ARCH-03) ── */
.back-btn {
  display: none;
  align-items: center;
  gap: 5px;
  position: fixed;
  top: 72px;
  left: 10px;
  z-index: 200;
  background: white;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 7px 13px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  color: var(--dark);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.back-btn.show { display: flex; }
.back-btn:hover { transform: translateX(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.back-btn:active { transform: scale(0.96); }

/* ── PREVENT DOUBLE-TAP ZOOM ── */
* {
  touch-action: manipulation;
}
/* Set-Mode SVG needs explicit touch-action: none */
svg.clk { touch-action: none; }

/* ── LANDSCAPE MOBILE ── */
@media (max-height: 500px) and (orientation: landscape) {
  .clock-outer {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
  }
  .clock-wrap {
    width: min(180px, 40vh);
    height: min(180px, 40vh);
    flex-shrink: 0;
  }
}
@media (max-width: 480px) {
  .card { padding: 15px 12px; }
  .ach-grid { grid-template-columns: repeat(2, 1fr); }
  .match-grid { grid-template-columns: repeat(2,1fr); }
  .choices { max-width: 100%; }
  .cookie-banner { padding: 14px 14px; }
  .subject-btn { padding: 6px 12px; font-size: 0.82rem; }
  .mod-btn { font-size: 0.78rem; padding: 7px 12px; }
  .estimate-scale-mark span { font-size: 0.62rem; }
  .clock-outer > .q-text,
  .clock-outer > .choices,
  .clock-outer > .feedback,
  .clock-outer > .tip,
  .clock-outer > .btn {
    width: 100%;
  }
}
@media (min-width: 700px) {
  .card { padding: 26px 24px; }
  .clock-wrap { width: 280px; height: 280px; }
}
