/* Layout: en smal spelkolumn mot en ljus himmel. Kamrat A är alltid blå, kamrat B alltid korall. */
:root {
  --sky: #BFE6FF;
  --sky-2: #E8F7FF;
  --ink: #1B2547;
  --ink-soft: #4A5677;
  --blue: #2F6BFF;
  --blue-deep: #1D4FD6;
  --coral: #FF6B3D;
  --coral-deep: #E04E20;
  --sun: #FFC83D;
  --leaf: #1FA866;
  --berry: #E23D7A;
  --grape: #7A5CFF;
  --card: #FFFFFF;
  --line: #9CCBEA;
  --shadow: rgba(27, 37, 71, 0.18);
  --display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 30% at 15% 8%, var(--sky-2) 0 40%, transparent 41%),
    radial-gradient(ellipse 45% 22% at 90% 20%, var(--sky-2) 0 40%, transparent 41%),
    var(--sky);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; text-wrap: balance; }

.app { max-width: 780px; margin: 0 auto; padding-inline: 16px; padding-block: 12px 48px; }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 6px 14px; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.01em; }
.logo { display: flex; align-items: flex-end; }
.logo span { width: 26px; height: 26px; border-radius: 50% 50% 46% 46%; position: relative; }
.logo span:first-child { background: var(--blue); }
.logo span:last-child { background: var(--coral); margin-left: -6px; height: 22px; width: 22px; }
.logo span::after { content: ""; position: absolute; top: 8px; left: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--card); box-shadow: 7px 0 0 var(--card); }
.logo span:last-child::after { top: 6px; left: 5px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 800; box-shadow: 0 3px 0 var(--shadow); font-variant-numeric: tabular-nums; }
.pill .star { color: var(--sun); font-size: 1.2rem; -webkit-text-stroke: 1px #D99A00; }
.icon-btn { width: 40px; height: 40px; justify-content: center; padding: 0; font-size: 1.15rem; }
.icon-btn[aria-pressed="false"] { opacity: 0.45; }
@media (max-width: 400px) {
  .brand-name { font-size: 1.25rem; }
  .logo span:first-child { width: 22px; height: 22px; }
  .logo span:last-child { width: 18px; height: 18px; }
  .top-actions { gap: 5px; }
  .pill { padding: 5px 9px; }
  .icon-btn { width: 36px; height: 36px; padding: 0; font-size: 1rem; }
}
@media (max-width: 345px) { .brand-name { font-size: 1.05rem; } .app { padding-inline: 12px; } }

.screen { animation: enter 0.35s ease both; }
@keyframes enter { from { opacity: 0.4; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Start */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; margin-block: 10px 20px; }
/* Talkamraterna (eller avataren) får en egen ruta, så att lilla kompisen aldrig nuddar badgen */
.hero-face { display: grid; place-items: center; width: 96px; min-height: 80px; }
.hero-face .mascot { margin-right: 18px; }
.hero-txt { display: grid; gap: 10px; justify-items: start; min-width: 0; }
@media (max-width: 380px) {
  .hero { column-gap: 8px; }
  .hero-face { width: 78px; }
  .hero-face .mascot { transform: scale(0.82); transform-origin: center; margin-right: 14px; }
  .rank { gap: 8px; padding-right: 10px; }
  .rank-txt > b { font-size: 0.98rem; }
}
/* Allra smalast: talkamraterna får vika undan så att titeln får plats */
@media (max-width: 340px) { .hero { grid-template-columns: minmax(0, 1fr); } .hero-face { display: none; } }
.hero h1 { font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 800; line-height: 1; overflow-wrap: anywhere; }
.hero p { margin: 4px 0 0; color: var(--ink-soft); font-weight: 700; }
/* Titeln: en liten rad under hälsningen (stjärnan med antal, titel och mätare) */
.rank { --tier: #8FA3C7; display: inline-flex; align-items: center; gap: 10px; margin: 0; min-height: 58px; max-width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer;
  background: linear-gradient(160deg, #26336060, transparent 60%), var(--ink); color: var(--card); border-radius: 18px; padding: 6px 14px 6px 7px;
  box-shadow: inset 0 0 0 2px var(--tier), 0 4px 0 var(--shadow); }
.rank[data-tier="1"] { --tier: #D9A06A; } .rank[data-tier="2"] { --tier: #C9D3E0; } .rank[data-tier="3"] { --tier: var(--sun); } .rank[data-tier="4"] { --tier: #4BD58F; }
.rank[data-tier="5"] { --tier: #7FA6FF; } .rank[data-tier="6"] { --tier: #FF7FAE; } .rank[data-tier="7"] { --tier: #B7A4FF; } .rank[data-tier="8"] { --tier: #FFD54A; }
.rank-star { flex: none; width: 52px; height: 52px; display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #FFF1B8, var(--sun) 45%, #E9A800);
  clip-path: polygon(50% 0, 61.8% 35.4%, 100% 38.2%, 69.1% 61.8%, 80.9% 100%, 50% 76.4%, 19.1% 100%, 30.9% 61.8%, 0 38.2%, 38.2% 35.4%);
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.3)); }
.rank-star b { margin-top: 6px; font-family: var(--display); font-weight: 800; color: var(--ink); font-size: 1.15rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
/* Fler siffror, mindre text: 2000 och mer får plats i stjärnan */
.rank-star[data-len="3"] b { font-size: 0.78rem; }
.rank-star[data-len="4"] b { font-size: 0.66rem; margin-top: 5px; }
.rank-star[data-len="5"] b { font-size: 0.54rem; margin-top: 5px; }
.rank-txt { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 3px; min-width: 0; }
.rank-txt > b { font-family: var(--display); font-size: 1.1rem; line-height: 1.1; color: var(--tier); }
.rank-txt small { grid-column: 1 / -1; font-weight: 800; font-size: 0.72rem; color: #C9D3F2; white-space: nowrap; }
.rank-txt .rank-lv { grid-column: 1 / -1; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tier); opacity: 0.9; }
.rank-txt .rank-lv::after { content: " ›"; }
.rank-meter { width: 100%; min-width: 110px; height: 7px; background: rgba(255, 255, 255, 0.18); border-radius: 999px; overflow: hidden; }
.rank-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sun), #FFE58A); border-radius: 999px; transition: width 0.6s ease; }
.rank.up { animation: bump 0.6s ease; }
.titles { display: grid; gap: 6px; text-align: left; margin: 10px 0; }
/* Resan genom nivåerna: en slingrande stig med ett märke per nivå */
.journey { position: relative; margin: 14px 0 6px; }
.jr-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.jr-path path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.jr-road { stroke: #F1E3C2; stroke-width: 22px; }
.jr-road-done { stroke: #FFD86B; stroke-width: 22px; }
.jr-dash { stroke: #fff; stroke-width: 3px; stroke-dasharray: 2 12; opacity: 0.9; }
.journey ol { list-style: none; margin: 0; padding: 0; position: relative; }
.jr { display: flex; align-items: center; gap: 12px; text-align: left; }
.jr-left { padding-left: calc(20% - 28px); }
.jr-right { flex-direction: row-reverse; padding-right: calc(20% - 28px); text-align: right; }
.jr-badge { position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: var(--card); box-shadow: inset 0 0 0 3px var(--line), 0 3px 0 rgba(0,0,0,0.08); }
.jr-badge i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 0.85rem; background: var(--card); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.jr.jr-next .jr-badge > :not(i), .jr.jr-next .jr-badge { filter: grayscale(1); }
.jr.jr-next .jr-badge { opacity: 0.75; }
.jr.jr-done .jr-badge { background: #FFF6D6; box-shadow: inset 0 0 0 3px var(--sun), 0 3px 0 rgba(0,0,0,0.08); }
.jr.jr-here .jr-badge { background: var(--ink); box-shadow: 0 0 0 4px var(--sun), 0 4px 12px rgba(0,0,0,0.25); width: 64px; height: 64px; font-size: 2rem; animation: pop-in 0.4s ease; }
.jr-txt { display: grid; gap: 1px; min-width: 0; background: rgba(255, 255, 255, 0.85); border-radius: 14px; padding: 4px 10px; }
.jr-txt small { font-weight: 800; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.jr-txt b { font-family: var(--display); font-size: 1.15rem; line-height: 1.1; }
.jr-txt em { font-style: normal; font-weight: 700; font-size: 0.82rem; color: var(--ink-soft); }
.jr.jr-here .jr-txt { background: #FFF6D6; box-shadow: inset 0 0 0 2px var(--sun); }
.jr.jr-here em { color: var(--ink); }
.jr.jr-next b { color: var(--ink-soft); }
.jr-meter { display: block; height: 8px; margin-top: 4px; background: var(--card); border-radius: 999px; overflow: hidden; min-width: 120px; }
.jr-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), #FFB400); border-radius: 999px; }
.jr-note { font-size: 0.9rem; }
.titles div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--sky-2); font-weight: 800; }
.titles .got { background: #E3FFF0; } .titles .cur { box-shadow: inset 0 0 0 3px var(--sun); }

.panel { background: var(--card); border-radius: 26px; padding: 18px; box-shadow: 0 6px 0 var(--shadow); }
.panel + .panel { margin-top: 16px; }
.label { font-family: var(--display); font-weight: 800; font-size: 1.35rem; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.label small { font-family: var(--body); font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }

.numgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (min-width: 640px) { .numgrid { grid-template-columns: repeat(10, 1fr); } }
.num {
  aspect-ratio: 1 / 1.1; max-width: 100%; border: 0; border-radius: 18px;
  background: var(--sky-2); box-shadow: inset 0 -5px 0 var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 1.9rem); line-height: 1;
  transition: transform 0.12s ease;
}
.num:hover { transform: translateY(-3px) rotate(-2deg); }
.num:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--line); }
.num.big { background: #FFF1C9; box-shadow: inset 0 -5px 0 #F2C65A; }
.num .s { font-size: 0.7rem; letter-spacing: 1px; color: var(--line); margin-top: 4px; font-family: var(--body); }
.num .s .on { color: var(--sun); -webkit-text-stroke: 0.6px #D99A00; }

.mixrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mixrow .chunky { white-space: nowrap; font-size: clamp(1rem, 4.4vw, 1.2rem); padding-inline: 8px; }
.chunky {
  border: 0; border-radius: 18px; padding: 14px 16px; font-family: var(--display); font-weight: 800; font-size: 1.2rem;
  background: var(--blue); color: var(--card); box-shadow: 0 5px 0 var(--blue-deep); transition: transform 0.1s;
}
.chunky:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-deep); }
.chunky.coral { background: var(--coral); box-shadow: 0 5px 0 var(--coral-deep); }
.chunky.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink), 0 5px 0 var(--ink); }
.chunky.ghost:active { box-shadow: inset 0 0 0 3px var(--ink), 0 2px 0 var(--ink); }
.chunky.sun { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 #D99A00; }

.foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 16px; }
.namefield { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.namefield input { width: 9.5em; border: 3px solid var(--line); border-radius: 12px; padding: 6px 10px; font: inherit; color: var(--ink); background: var(--card); }
.textbtn { background: none; border: 0; text-decoration: underline; color: var(--ink-soft); font-weight: 700; padding: 6px; }

/* Mascot */
.buddy-row { display: flex; align-items: flex-end; gap: 12px; }
.mascot { width: 74px; height: 66px; flex: none; position: relative; border-radius: 50% 50% 44% 44%; background: var(--blue); box-shadow: inset -8px -8px 0 rgba(0,0,0,0.12); transition: transform 0.2s; }
/* Den lilla kompisen bredvid: glada stängda ögon, rosa kinder och en liten mun med tunga */
.mascot .pal { position: absolute; right: -18px; bottom: 0; width: 40px; height: 36px; border-radius: 50% 50% 44% 44%; background: var(--coral); box-shadow: inset -5px -5px 0 rgba(0,0,0,0.12); }
.mascot .pal::before { content: ""; position: absolute; left: 8px; top: 10px; width: 22px; height: 12px;
  background:
    radial-gradient(circle at 4px 6px, transparent 0 2.4px, var(--ink) 2.6px 4.2px, transparent 4.4px) 0 0 / 9px 6px no-repeat,
    radial-gradient(circle at 4px 6px, transparent 0 2.4px, var(--ink) 2.6px 4.2px, transparent 4.4px) 13px 0 / 9px 6px no-repeat,
    radial-gradient(circle, #FFB3C8 0 2.6px, transparent 2.8px) 0 7px / 6px 5px no-repeat,
    radial-gradient(circle, #FFB3C8 0 2.6px, transparent 2.8px) 16px 7px / 6px 5px no-repeat; }
.mascot .pal::after { content: ""; position: absolute; left: 15px; top: 20px; width: 9px; height: 6px; background: var(--ink); border-radius: 0 0 6px 6px; box-shadow: inset 0 -2px 0 #FF8FB0; }
.mascot.oops .pal::after { height: 3px; border-radius: 3px; box-shadow: none; top: 22px; }
.mascot .eyes { position: absolute; top: 20px; left: 16px; display: flex; gap: 14px; }
.mascot .eyes i { width: 10px; height: 13px; background: var(--card); border-radius: 50%; position: relative; }
.mascot .eyes i::after { content: ""; position: absolute; width: 5px; height: 6px; background: var(--ink); border-radius: 50%; left: 3px; top: 4px; }
.mascot .mouth { position: absolute; left: 25px; top: 38px; width: 22px; height: 11px; border-radius: 0 0 14px 14px; background: var(--ink); }
.mascot.happy { animation: hop 0.6s ease 2; }
.mascot.happy .mouth { height: 15px; }
.mascot.oops { animation: tilt 0.5s ease; }
.mascot.oops .mouth { height: 5px; border-radius: 6px; top: 42px; }
@keyframes hop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-16px) rotate(-6deg); } }
@keyframes tilt { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-10deg); } 70% { transform: rotate(8deg); } }
.speech { position: relative; background: var(--card); border-radius: 18px; padding: 10px 14px; font-weight: 800; box-shadow: 0 4px 0 var(--shadow); margin: 0 0 18px 14px; min-width: 0; flex: 1; }
.speech::before { content: ""; position: absolute; left: -10px; bottom: 12px; border: 10px solid transparent; border-right-color: var(--card); border-left: 0; }

/* Mode */
.back { margin-bottom: 10px; }
.mode-title { font-size: clamp(2rem, 8vw, 3rem); font-weight: 800; margin-block: 4px 14px; }
.mode-title em { font-style: normal; color: var(--coral); }
.modes { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .modes { grid-template-columns: 1fr 1fr; } }
.mode-card { text-align: left; border: 0; border-radius: 26px; padding: 18px; background: var(--card); box-shadow: 0 6px 0 var(--shadow); display: grid; gap: 6px; transition: transform 0.12s; }
.mode-card:hover { transform: translateY(-3px); }
.mode-card h3 { font-size: 1.6rem; font-weight: 800; }
.mode-card p { margin: 0; color: var(--ink-soft); font-weight: 700; }
.mode-card .demo { font-family: var(--display); font-size: 2rem; font-weight: 800; }
.mode-card .best { font-size: 0.9rem; font-weight: 800; color: var(--ink-soft); }
.a { color: var(--blue); }
.b { color: var(--coral); }

details.friends { margin-top: 16px; }
details.friends summary { font-family: var(--display); font-weight: 800; font-size: 1.2rem; cursor: pointer; }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.domino { display: inline-flex; border-radius: 12px; overflow: hidden; font-family: var(--display); font-weight: 800; font-size: 1.25rem; box-shadow: 0 3px 0 var(--shadow); font-variant-numeric: tabular-nums; }
.domino span { padding: 4px 12px; color: var(--card); min-width: 2.2em; text-align: center; }
.domino span:first-child { background: var(--blue); }
.domino span:last-child { background: var(--coral); }

/* Play common */
.playhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.progress { display: flex; gap: 6px; flex-wrap: wrap; }
.progress i { width: 16px; height: 16px; border-radius: 50%; background: var(--card); box-shadow: inset 0 -3px 0 var(--line); }
.progress i.done { background: var(--leaf); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); }
#findProgress, #bubProgress { justify-content: center; margin-bottom: 12px; }
.progress i.miss { background: var(--coral); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); }
.progress i.now { background: var(--sun); transform: scale(1.25); }
.streak { font-family: var(--display); font-weight: 800; background: var(--ink); color: var(--sun); border-radius: 999px; padding: 2px 12px; transition: transform 0.2s; }
.streak.bump { animation: bump 0.4s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }

.stage { background: var(--card); border-radius: 30px; padding: 20px 16px 22px; box-shadow: 0 6px 0 var(--shadow); text-align: center; }
.equation { display: flex; justify-content: center; align-items: center; gap: 0.25em; flex-wrap: wrap; font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 12vw, 4.4rem); line-height: 1; margin-block: 4px 16px; font-variant-numeric: tabular-nums; }
.equation .op { color: var(--ink-soft); }
.equation .gap { min-width: 1.4em; padding: 0.08em 0.2em 0; border: 4px dashed var(--coral); border-radius: 18px; color: var(--coral); background: #FFF0EA; }
.equation .gap.filled { border-style: solid; background: var(--coral); color: var(--card); animation: bump 0.4s ease; }
.equation .total { background: var(--sun); border-radius: 18px; padding: 0.08em 0.25em 0; }

.beads { display: grid; gap: 8px; justify-content: center; margin-bottom: 18px; }
.beadrow { display: flex; gap: 14px; justify-content: center; }
.five { display: flex; gap: 5px; }
.bead { width: clamp(22px, 6.4vw, 32px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 800; color: var(--card); }
.bead.ka { background: var(--blue); box-shadow: inset -3px -3px 0 rgba(0,0,0,0.18); }
.bead.kb { background: var(--coral); box-shadow: inset -3px -3px 0 rgba(0,0,0,0.18); animation: popin 0.35s ease both; }
.bead.empty { border: 3px dashed var(--coral); color: var(--coral); }
.bead.hint { animation: pulse 0.9s ease infinite; }
@keyframes popin { from { transform: scale(0); } 70% { transform: scale(1.25); } to { transform: scale(1); } }
@keyframes pulse { 50% { transform: scale(1.18); background: #FFE2D7; } }

.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .answers { grid-template-columns: repeat(4, 1fr); } }
.answers.two { grid-template-columns: repeat(2, 1fr); }
.ans {
  border: 0; border-radius: 22px; min-height: 84px; font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: 1;
  background: var(--sky-2); box-shadow: inset 0 -6px 0 var(--line); transition: transform 0.1s;
}
.ans:hover:not(:disabled) { transform: translateY(-3px); }
.ans:active:not(:disabled) { transform: translateY(2px); }
.ans.right { background: var(--leaf); color: var(--card); box-shadow: inset 0 -6px 0 rgba(0,0,0,0.2); animation: bump 0.4s ease; }
.ans.wrong { background: #ECEFF5; color: #A3ACC2; box-shadow: none; animation: shake 0.4s ease; cursor: not-allowed; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.explain { min-height: 1.6em; margin: 14px 0 0; font-weight: 800; color: var(--ink-soft); }

/* Bubbles */
.bubble-goal { font-family: var(--display); font-weight: 800; font-size: 1.5rem; margin-bottom: 10px; }
.bubble-goal b { background: var(--sun); border-radius: 12px; padding: 0 10px; }
.pond { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding-block: 8px; }
.bubble {
  --c: var(--blue);
  width: clamp(64px, 19vw, 84px); aspect-ratio: 1; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.85) 0 12%, transparent 13%), var(--c);
  box-shadow: inset -6px -8px 0 rgba(0,0,0,0.15), 0 5px 0 var(--shadow);
  color: var(--card); font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1;
  animation: float 3s ease-in-out infinite; animation-delay: var(--d, 0s);
  transition: transform 0.15s;
}
.bubble.sel { outline: 5px solid var(--sun); outline-offset: 3px; transform: scale(1.12); animation: none; }
.bubble.wobble { animation: shake 0.45s ease; }
.bubble.popped { animation: popout 0.4s ease forwards; pointer-events: none; }
.bubble.tip { animation: pulse 0.8s ease 3; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes popout { 40% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(0.2); opacity: 0; } }
.found { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 40px; margin-top: 14px; }
.tiprow { display: flex; justify-content: center; margin-top: 12px; }

/* Done */
.done { text-align: center; }
.done h2 { font-size: clamp(2.6rem, 11vw, 4.2rem); font-weight: 800; color: var(--coral); }
.bigstars { display: flex; justify-content: center; gap: 10px; margin-block: 12px; }
.bigstars span { font-size: clamp(3rem, 14vw, 4.5rem); color: #DDE3EE; line-height: 1; }
.bigstars span.on { color: var(--sun); -webkit-text-stroke: 2px #D99A00; animation: starin 0.5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes starin { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
.stats { font-weight: 800; color: var(--ink-soft); margin: 0 0 14px; }
.reward { display: grid; justify-items: center; gap: 4px; background: var(--sky-2); border-radius: 22px; padding: 14px; margin-block: 14px; }
.reward .em { font-size: 4.5rem; line-height: 1.1; animation: spinin 0.8s cubic-bezier(.3,1.5,.5,1) 0.6s both; }
@keyframes spinin { from { transform: scale(0) rotate(-200deg); } to { transform: scale(1) rotate(0); } }
.reward p { margin: 0; font-weight: 800; }
/* Sammanfattningen efter en runda: en rad per sak */
.done-list { display: grid; gap: 8px; text-align: left; margin: 4px 0 18px; }
.done-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--sky-2); border-radius: 16px; padding: 8px 12px; animation: pop-in 0.3s ease both; }
.done-row:nth-child(2) { animation-delay: 0.08s; } .done-row:nth-child(3) { animation-delay: 0.16s; } .done-row:nth-child(n+4) { animation-delay: 0.24s; }
.dr-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--card); font-size: 1.5rem; line-height: 1; }
.dr-txt b { display: block; font-family: var(--display); font-size: 1.1rem; line-height: 1.15; }
.dr-txt b b { display: inline; color: var(--blue-deep); font-size: inherit; }
.dr-txt small { display: block; color: var(--ink-soft); font-weight: 700; font-size: 0.88rem; }
.done-row.dr-big { background: var(--ink); color: var(--card); }
.done-row.dr-big small { color: #C9D3F2; }
.done-row.dr-big .dr-ic { background: rgba(255, 255, 255, 0.14); }
.done-row.dr-pet { background: #EFE9FF; }
.done-row.dr-class { background: #E3F7EC; }
.done-row.dr-sticker { background: #FFF6D6; }
.done-row.dr-legend { background: linear-gradient(135deg, #FFE68A, #FFC83D); }
.done-actions .textbtn { justify-self: center; }
.done-actions.retry-first #againBtn { order: -1; }
.done-actions { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .done-actions { grid-template-columns: 1fr 1fr 1fr; } }

/* Stickers */
.book { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.slot { aspect-ratio: 1; max-width: 100%; border-radius: 18px; background: var(--sky-2); display: grid; place-items: center; text-align: center; padding: 6px; }
.slot .em { font-size: 2.4rem; line-height: 1; }
.slot small { font-size: 0.7rem; font-weight: 800; color: var(--ink-soft); }
.slot.missing { border: 3px dashed var(--line); background: transparent; color: var(--line); font-family: var(--display); font-weight: 800; font-size: 1.8rem; }
.slot .x { font-size: 0.7rem; background: var(--berry); color: var(--card); border-radius: 999px; padding: 0 6px; }

/* Hemskärmens kort */
.cardrow { display: grid; gap: 12px; margin-top: 16px; }
.cardrow .panel { margin: 0; display: grid; gap: 10px; align-content: space-between; }
.cardrow .panel + .panel { margin-top: 0; }
.cardrow .chunky { width: 100%; }
.cardrow p { margin: 0; color: var(--ink-soft); font-weight: 700; font-size: 0.95rem; }
.wide { width: 100%; }
.road-cta { background: var(--ink); color: var(--card); display: grid; gap: 12px; }
.road-cta .label small { color: #B9C3E0; }
.road-world { justify-self: start; background: var(--sun); color: var(--ink); border-radius: 999px; padding: 4px 14px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.road-cta[data-world="minus"] .road-world { background: #7FD6FF; }
.road-cta[data-world="dubbel"] .road-world { background: #C7B6FF; }
.road-cta[data-world="ganger"] .road-world { background: #9BE3B5; }
.road-cta .next { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1.1; }
.road-cta .next span { color: var(--sun); }
.meter { height: 16px; border-radius: 999px; background: rgba(255,255,255,0.18); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sun), var(--coral)); transition: width 0.6s ease; }
.panel .meter { background: var(--sky-2); }
.tricky-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tricky-panel p { margin: 0; font-weight: 700; color: var(--ink-soft); min-width: 0; flex: 1 1 14em; }
.who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; color: var(--ink-soft); }
.avatar-big { width: 74px; height: 74px; flex: none; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 2.8rem; box-shadow: 0 5px 0 var(--shadow); }
.playlabel { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--ink-soft); }
.progress.many i { width: 11px; height: 11px; }

/* Vägen till expert */
.zone { position: relative; padding: 18px 16px 22px; overflow: hidden; }
.zone + .zone { margin-top: 16px; }
.zone-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; margin-bottom: 8px; }
.zone-head h3 { font-size: 1.6rem; font-weight: 800; }
.zone-head small { display: block; font-weight: 800; color: var(--ink-soft); font-family: var(--body); font-size: 0.9rem; }
.medal { font-size: 2.4rem; line-height: 1; filter: grayscale(1); opacity: 0.35; }
.medal.on { filter: none; opacity: 1; animation: bump 0.5s ease; }
.road { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.road .bed { fill: none; stroke: #F3DDA4; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.road .dash { fill: none; stroke: var(--card); stroke-width: 3; stroke-dasharray: 8 10; stroke-linecap: round; }
.stops { position: relative; z-index: 1; display: grid; gap: 14px; padding-top: 22px; }
.stop { display: flex; align-items: center; gap: 12px; margin-left: var(--x, 0%); max-width: calc(100% - var(--x, 0%)); background: none; border: 0; padding: 0; text-align: left; }
.stop .node {
  width: 62px; height: 62px; flex: none; border-radius: 50%; display: grid; place-items: center; position: relative;
  font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1;
  background: #DCE3EE; color: #8792AA; box-shadow: inset 0 -5px 0 rgba(0,0,0,0.12);
}
.stop .node.kind-test, .stop .node.kind-final { border-radius: 18px; }
.stop .node.kind-challenge { border-radius: 50% 50% 50% 12px; }
.stop.done .node { background: var(--leaf); color: var(--card); }
.stop.open .node { background: var(--sun); color: var(--ink); animation: ring 1.6s ease infinite; }
.stop.open .node::after { content: attr(data-me); position: absolute; top: -20px; left: -18px; font-size: 1.7rem; animation: hop 1.2s ease infinite; }
@keyframes ring { 0%, 100% { box-shadow: inset 0 -5px 0 rgba(0,0,0,0.12), 0 0 0 0 rgba(255,200,61,0.7); } 50% { box-shadow: inset 0 -5px 0 rgba(0,0,0,0.12), 0 0 0 12px rgba(255,200,61,0); } }
.stop .txt { min-width: 0; background: var(--card); border-radius: 14px; padding: 6px 10px; box-shadow: 0 3px 0 var(--shadow); }
.stop .txt b { display: block; font-family: var(--display); font-size: 1.1rem; line-height: 1.1; }
.stop .txt small { display: block; font-weight: 700; color: var(--ink-soft); font-size: 0.82rem; }
.stop .txt .on { color: var(--sun); -webkit-text-stroke: 0.6px #D99A00; }
.stop:disabled { cursor: default; }
.stop:disabled .txt { opacity: 0.6; }
.stop:not(:disabled):hover .node { transform: scale(1.06); }
.goal-card { text-align: center; display: grid; gap: 6px; justify-items: center; }
.goal-card .em { font-size: 3rem; line-height: 1; }

/* Prov / utmaning – intro */
.intro { text-align: center; display: grid; gap: 12px; justify-items: center; }
.intro h2 { font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 800; }
.intro ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-weight: 800; color: var(--ink-soft); }
.intro .chunky { min-width: 12em; }

/* Utmaning på tid */
.timer { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-bottom: 12px; }
.timebar { height: 18px; border-radius: 999px; background: var(--sky-2); overflow: hidden; box-shadow: inset 0 2px 0 rgba(0,0,0,0.06); }
.timebar i { display: block; height: 100%; background: var(--leaf); border-radius: inherit; transition: width 0.1s linear, background 0.3s; }
.timebar i.low { background: var(--coral); }
.secs { font-family: var(--display); font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; min-width: 2.4em; text-align: right; }
.scorebox { font-family: var(--display); font-weight: 800; font-size: 1.3rem; }
.scorebox b { font-size: 2rem; color: var(--leaf); }
.countdown { font-family: var(--display); font-weight: 800; font-size: clamp(5rem, 30vw, 9rem); color: var(--coral); line-height: 1; animation: bump 0.5s ease; }
.ans.correct-was { outline: 4px solid var(--leaf); outline-offset: 2px; }

/* Klass-inloggning */
.join h2 { font-size: clamp(1.8rem, 7vw, 2.4rem); font-weight: 800; margin-bottom: 6px; }
.join p.lead { margin: 0 0 14px; font-weight: 700; color: var(--ink-soft); }
.codefield { width: 100%; font-family: var(--display); font-weight: 800; font-size: 2rem; text-align: center; letter-spacing: 0.08em; text-transform: uppercase; border: 4px solid var(--line); border-radius: 18px; padding: 8px; color: var(--ink); background: var(--card); }
.textfield { width: 100%; font: inherit; font-weight: 800; font-size: 1.3rem; border: 4px solid var(--line); border-radius: 16px; padding: 10px 12px; color: var(--ink); background: var(--card); }
.formstack { display: grid; gap: 14px; }
.error { color: var(--berry); font-weight: 800; min-height: 1.4em; margin: 0; }
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.kid { border: 0; border-radius: 18px; background: var(--sky-2); box-shadow: inset 0 -5px 0 var(--line); padding: 10px 6px; display: grid; justify-items: center; gap: 2px; font-weight: 800; min-width: 0; }
.kid .em { font-size: 2.2rem; line-height: 1.1; }
.kid span:last-child { max-width: 100%; overflow-wrap: anywhere; }
.kid.new { background: #FFF1C9; box-shadow: inset 0 -5px 0 #F2C65A; }
.pickrow { display: flex; flex-wrap: wrap; gap: 8px; }
.pickrow button { width: 54px; height: 54px; border-radius: 16px; border: 0; background: var(--sky-2); font-size: 1.9rem; box-shadow: inset 0 -4px 0 var(--line); }
.pickrow button[aria-pressed="true"] { background: var(--sun); box-shadow: inset 0 -4px 0 #D99A00; transform: scale(1.08); }
.pinslots { display: flex; justify-content: center; gap: 12px; margin-bottom: 14px; }
.pinslots span { width: 64px; height: 64px; border-radius: 18px; border: 4px dashed var(--line); display: grid; place-items: center; font-size: 2.2rem; }
.pinslots span.full { border-style: solid; border-color: var(--blue); background: var(--sky-2); animation: bump 0.25s ease; }
.pinpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 360px; margin: 0 auto; }
.pinpad button { aspect-ratio: 1; max-width: 100%; border: 0; border-radius: 18px; background: var(--sky-2); box-shadow: inset 0 -5px 0 var(--line); font-size: 2.1rem; }
.pinpad button:active { transform: translateY(2px); }
.pinactions { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }

/* Klassen */
.jar { display: grid; gap: 8px; }
.jar .big { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.jar .big span { color: var(--sun); -webkit-text-stroke: 1px #D99A00; }
.mates { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mate { background: var(--sky-2); border-radius: 18px; padding: 10px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; min-width: 0; }
.mate.me { background: #FFF1C9; outline: 3px solid var(--sun); }
.mate .em { font-size: 2rem; grid-row: span 2; }
.mate b { font-family: var(--display); font-size: 1.1rem; overflow-wrap: anywhere; line-height: 1.1; }
.mate > * { min-width: 0; }
.mate small { overflow-wrap: anywhere; font-size: 0.8rem; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mate .medals { grid-column: 1 / -1; font-size: 1.1rem; min-height: 1.3em; letter-spacing: 2px; }

/* Diplom */
.diploma { grid-template-columns: minmax(0, 1fr); background: var(--card); border-radius: 12px; padding: 28px 16px; text-align: center; box-shadow: 0 8px 0 var(--shadow); border: 10px double var(--sun); display: grid; gap: 8px; justify-items: center; }
.diploma .kicker { letter-spacing: 0.3em; font-weight: 800; color: var(--ink-soft); font-size: 0.85rem; text-transform: uppercase; }
.diploma h2 { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(1.7rem, 8.4vw, 3.6rem); font-weight: 800; color: var(--blue); }
.diploma .name { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 9vw, 3rem); color: var(--coral); border-bottom: 3px solid var(--line); padding: 0 16px; }
.diploma p { margin: 0; font-weight: 700; max-width: 30em; }
.seal { font-size: 3.6rem; line-height: 1; animation: spinin 0.9s cubic-bezier(.3,1.5,.5,1) 0.3s both; }
.diploma .date { font-weight: 800; color: var(--ink-soft); }
@media print {
  .topbar, .no-print, #fx { display: none !important; }
  body { background: #fff; }
}

/* Medaljer i klistermärkesboken */
.medal-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.medal-row .slot { background: #FFF1C9; }
.medal-row .slot { border: 0; font: inherit; color: inherit; cursor: pointer; width: 100%; min-width: 0; overflow: hidden; }
.medal-row .slot { aspect-ratio: auto; min-height: 70px; padding: 6px 2px; align-content: start; }
.medal-row .slot > div { width: 100%; min-width: 0; }
.medal-row .slot small { display: block; overflow-wrap: break-word; line-height: 1.1; margin-top: 3px; }
.medal-row .slot.missing { background: transparent; }
.medal-row .slot.missing .em { filter: grayscale(1); opacity: 0.3; font-size: 2rem; }
.medal-row .slot.missing small { color: var(--line); font-family: var(--display); font-size: 1rem; }
.sh-big.dim { filter: grayscale(1); opacity: 0.4; }

/* Världsflikar */
.worldtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--card); border-radius: 18px; padding: 6px; box-shadow: 0 4px 0 var(--shadow); margin-block: 16px; }
.worldtabs button { border: 0; border-radius: 13px; padding: 10px 6px; background: transparent; font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--ink-soft); }
.worldtabs button[aria-pressed="true"] { background: var(--ink); color: var(--sun); }
.worldtabs button { white-space: nowrap; }
@media (max-width: 420px) {
  .worldtabs button { font-size: 0.95rem; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.1; }
  .worldtabs .wi { font-size: 1.1rem; }
}
#road .worldtabs { margin-top: 0; }

/* Dagens utmaning */
.daily { background: linear-gradient(135deg, var(--coral), var(--berry)); color: var(--card); display: grid; gap: 10px; }
.daily-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.daily .kicker { font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; opacity: 0.9; }
.daily h2 { font-size: clamp(1.6rem, 7vw, 2.1rem); font-weight: 800; }
.daily p { margin: 0; font-weight: 700; }
.daily .flame { background: rgba(0,0,0,0.22); border-radius: 999px; padding: 4px 12px; font-weight: 800; white-space: nowrap; }
.daily .chunky.coral { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 #D99A00; }
.daily.is-done { background: linear-gradient(135deg, var(--leaf), #138A52); }
.daily.is-done .chunky.coral { background: rgba(255,255,255,0.2); color: var(--card); box-shadow: 0 5px 0 rgba(0,0,0,0.2); }

/* Husdjuret */
.petpanel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.petstage { width: 112px; height: 112px; border: 0; border-radius: 26px; background: radial-gradient(circle at 50% 85%, #E3DAFF 0 38%, var(--sky-2) 39%); display: grid; place-items: end center; padding: 0 0 12px; }
.petinfo { display: grid; gap: 6px; min-width: 0; }
.petinfo .label { margin: 0; }
.petinfo p { margin: 0; font-weight: 700; color: var(--ink-soft); }
.petinfo .meter { background: var(--sky-2); height: 12px; }
.petinfo .meter i { background: linear-gradient(90deg, var(--grape), var(--berry)); }
.petnext { font-weight: 700; color: var(--ink-soft); }
.petinfo .textbtn { justify-self: start; padding: 0; font-size: 0.9rem; }
.pet-name-input { font: inherit; font-family: var(--display); font-weight: 800; width: 8em; border: 3px solid var(--line); border-radius: 10px; padding: 0 6px; }
.pet { --s: 1; position: relative; width: calc(46px * var(--s)); height: calc(42px * var(--s)); border-radius: 50% 50% 42% 42%; animation: petbob 2.4s ease-in-out infinite; }
/* Kroppen är ett eget lager, så att mantel och vingar (z-index -2) hamnar bakom den */
.pet::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--grape); box-shadow: inset -6px -6px 0 rgba(0,0,0,0.14); z-index: -1; }
.pet.egg::before { display: none; }
/* Tio steg: husdjuret växer lite för varje steg */
.pet.stage-1 { --s: 0.78; } .pet.stage-2 { --s: 0.88; } .pet.stage-3 { --s: 0.98; } .pet.stage-4 { --s: 1.06; } .pet.stage-5 { --s: 1.14; }
.pet.stage-6 { --s: 1.22; } .pet.stage-7 { --s: 1.3; } .pet.stage-8 { --s: 1.36; } .pet.stage-9 { --s: 1.42; }
.pet.stage-1 .eye { width: 22%; height: 26%; }
.pet .tear { top: 50%; width: 8%; height: 11%; background: #7CC8FF; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%; opacity: 0; }
.pet .t1 { left: 20%; } .pet .t2 { right: 20%; }
.pet.stage-1.mood-hungry .tear, .pet.stage-1.mood-ok .tear, .pet.crying .tear { animation: tear 1.4s ease-in infinite; }
.pet .t2 { animation-delay: 0.7s !important; }
@keyframes tear { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(calc(18px * var(--s))); } }
.pet .tuft { top: -16%; left: 44%; width: 12%; height: 22%; background: var(--grape); border-radius: 50% 50% 0 50%; transform: rotate(20deg); }
.pet .specs { --b: calc(2.5px * var(--s)); top: 22%; left: 15%; width: 28%; height: 30%; border: var(--b) solid var(--ink); border-radius: 50%; z-index: 2; background: rgba(255,255,255,0.25); }
.pet .specs::after { content: ""; position: absolute; top: calc(-1 * var(--b)); left: calc(150% - var(--b)); width: 100%; height: 100%; border: var(--b) solid var(--ink); border-radius: 50%; background: rgba(255,255,255,0.25); }
.pet .specs::before { content: ""; position: absolute; top: 35%; left: 100%; width: 50%; height: var(--b); background: var(--ink); }
.pet .cape { left: -14%; right: -14%; top: 20%; bottom: -10%; border-radius: 30% 30% 10% 10%; z-index: -2; clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%); }
.pet .cape.red { background: linear-gradient(#E23D3D, #A81E3A); }
.pet .cape.gold { background: linear-gradient(#FFE58A, #E9A800); }
.pet .cape.rainbow { background: linear-gradient(90deg, #FF5C5C, #FFB13D, #FFE14D, #4DD28A, #4DA6FF, #9A6BFF); }
.pet .acc { position: absolute; line-height: 1; left: 50%; transform: translateX(-50%); pointer-events: none; }
.pet .acc.head { top: -34%; font-size: calc(22px * var(--s)); z-index: 3; }
.pet .acc.face { top: 14%; font-size: calc(22px * var(--s)); z-index: 2; }
.pet .acc.neck { bottom: -8%; font-size: calc(16px * var(--s)); z-index: 2; }
/* Saker att hålla i, stå på eller ha med sig */
.pet .acc.hand { left: auto; right: -34%; top: 34%; transform: rotate(12deg); font-size: calc(20px * var(--s)); z-index: 3; }
.pet .acc.hand.balloon { top: -60%; right: -30%; transform: none; animation: balloon 3s ease-in-out infinite; }
.pet .acc.hand.balloon::after { content: ""; position: absolute; left: 50%; top: 92%; width: 1px; height: calc(30px * var(--s)); background: #555; transform: rotate(-18deg); transform-origin: top; }
.pet .acc.feet { top: auto; bottom: -34%; font-size: calc(32px * var(--s)); z-index: 0; }
.pet .acc.side { left: auto; right: -58%; top: auto; bottom: -6%; transform: none; font-size: calc(18px * var(--s)); animation: petbob 1.8s ease-in-out infinite; }
.pet .acc.above { top: -80%; font-size: calc(26px * var(--s)); z-index: 1; animation: balloon 4s ease-in-out infinite; }
.pet .acc.jet { left: -36%; top: 18%; transform: rotate(-30deg); font-size: calc(20px * var(--s)); z-index: -2; }
@keyframes balloon { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
/* Guldkedjan: en guldbåge med en medaljong */
.pet .chain { position: absolute; left: 22%; right: 22%; bottom: 4%; height: 26%; border: calc(2.5px * var(--s)) dotted #E9A800; border-top: 0; border-radius: 0 0 50% 50%; z-index: 2; }
.pet .chain b { position: absolute; left: 50%; bottom: calc(-6px * var(--s)); width: calc(9px * var(--s)); height: calc(9px * var(--s)); transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFF1B8, #FFC83D 50%, #C98A00); box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.pet.legend { box-shadow: 0 0 0 4px rgba(255, 216, 77, 0.6), 0 0 22px 6px rgba(255, 200, 61, 0.7); }
.pet .sparkle { font-style: normal; font-size: calc(10px * var(--s)); animation: sparkle 1.8s ease-in-out infinite; }
.pet .k1 { left: -22%; top: -10%; } .pet .k2 { right: -24%; top: 30%; animation-delay: 0.9s; }
@keyframes sparkle { 0%, 100% { opacity: 0.2; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.1); } }
.pet i { position: absolute; display: block; }
.pet .belly { left: 22%; right: 22%; bottom: 8%; height: 40%; border-radius: 50%; background: #CBBDFF; }
.pet .eye { top: 26%; width: 18%; height: 22%; background: var(--card); border-radius: 50%; }
.pet .eye::after { content: ""; position: absolute; width: 50%; height: 55%; left: 30%; top: 30%; background: var(--ink); border-radius: 50%; }
.pet .e1 { left: 22%; } .pet .e2 { right: 22%; }
.pet .mouth { left: 40%; width: 20%; top: 54%; height: 12%; border-radius: 0 0 10px 10px; background: var(--ink); }
.pet .cheek { top: 48%; width: 14%; height: 9%; border-radius: 50%; background: #FF9EC0; }
.pet .c1 { left: 9%; } .pet .c2 { right: 9%; }
.pet .horn { top: -14%; width: 0; height: 0; border-left: calc(5px * var(--s)) solid transparent; border-right: calc(5px * var(--s)) solid transparent; border-bottom: calc(10px * var(--s)) solid var(--sun); }
.pet .h1 { left: 22%; } .pet .h2 { right: 22%; }
.pet .wing { top: 22%; width: 30%; height: 40%; background: #E3DAFF; border-radius: 50% 10% 50% 50%; z-index: -2; }
.pet .w1 { left: -18%; transform: rotate(-20deg); } .pet .w2 { right: -18%; transform: scaleX(-1) rotate(-20deg); }
.pet .crown { position: absolute; top: -48%; left: 50%; transform: translateX(-50%); font-size: calc(18px * var(--s)); line-height: 1; }
.pet.mood-hungry { filter: saturate(0.6); animation: petsad 3s ease-in-out infinite; }
.pet.mood-hungry .mouth { height: 5%; border-radius: 4px; top: 60%; }
.pet.mood-hungry .eye { height: 14%; top: 32%; }
.pet.egg { width: 50px; height: 62px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: #FFF6E0; box-shadow: inset -6px -6px 0 rgba(0,0,0,0.08); animation: wobble 2.2s ease-in-out infinite; }
.pet.egg .spot { width: 12px; height: 10px; border-radius: 50%; background: var(--grape); opacity: 0.7; }
.pet.egg .s1 { left: 10px; top: 14px; } .pet.egg .s2 { right: 9px; top: 26px; width: 9px; height: 8px; } .pet.egg .s3 { left: 18px; bottom: 12px; width: 14px; }
.pet.jump { animation: petjump 0.6s ease; }
@keyframes petbob { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-4px) scaleY(1.03); } }
@keyframes petsad { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes wobble { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-9deg); } 86% { transform: rotate(8deg); } 94% { transform: rotate(-4deg); } }
@keyframes petjump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-26px) scale(1.08, 0.94); } 70% { transform: translateY(0) scale(1.1, 0.9); } }

/* Frisk-träningens rutnät */
.num .pre { font-size: 0.55em; margin-right: 1px; vertical-align: 0.3em; color: var(--ink-soft); }
.equation .word { font-family: var(--body); font-size: 0.42em; font-weight: 800; color: var(--ink-soft); align-self: center; }
.bead.gone { background: #E6EAF1; position: relative; }
.bead.gone::before, .bead.gone::after { content: ""; position: absolute; left: 15%; right: 15%; top: 50%; height: 3px; margin-top: -1.5px; background: #9AA4BB; border-radius: 2px; transform: rotate(45deg); }
.bead.gone::after { transform: rotate(-45deg); }

/* Kort på startsidan */
.cardrow { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.badge { justify-self: start; background: var(--berry); color: var(--card); border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 0.9rem; animation: bump 0.6s ease 2; }

/* Val-chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 800; background: var(--sky-2); box-shadow: inset 0 -3px 0 var(--line); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--sun); box-shadow: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; color: var(--ink-soft); }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.duel-names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel-names label { display: grid; gap: 6px; font-weight: 800; min-width: 0; }
@media (max-width: 420px) { .duel-names { grid-template-columns: 1fr; } }

/* Kompisduell */
.duel-mode .topbar { display: none; }
.duelplay { position: relative; display: grid; grid-template-rows: 1fr auto 1fr; gap: 8px; min-height: calc(100dvh - 24px); }
.half { background: var(--card); border-radius: 24px; padding: 12px; display: grid; align-content: center; gap: 10px; box-shadow: 0 5px 0 var(--shadow); transition: background 0.2s; }
#half1 { background: #FFF1EA; }
.duelplay.flip #half1 { transform: rotate(180deg); }
.half .dhead { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-weight: 800; font-size: 1.3rem; }
.half .dscore { background: var(--ink); color: var(--sun); border-radius: 12px; min-width: 2em; text-align: center; padding: 0 8px; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.half .equation { font-size: clamp(2rem, 9vw, 3.2rem); margin: 0; }
.half .ans { min-height: 64px; font-size: 2.1rem; }
.half .dmsg { margin: 0; min-height: 1.4em; text-align: center; font-weight: 800; color: var(--ink-soft); }
.half.won { background: #D9F7E7 !important; }
.half.locked .ans { opacity: 0.4; }
.duel-mid { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; }
.duel-mid .chunky { padding: 6px 14px; font-size: 1rem; }
.duelwin { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(27, 37, 71, 0.55); border-radius: 24px; padding: 16px; z-index: 5; }
.duelwin .stage { display: grid; gap: 8px; justify-items: center; width: min(100%, 420px); }
.duelwin h2 { font-size: clamp(2rem, 9vw, 3rem); font-weight: 800; color: var(--coral); }
.winscore { font-family: var(--display); font-weight: 800; font-size: 2.6rem; font-variant-numeric: tabular-nums; }
.done-actions.two { grid-template-columns: 1fr 1fr; width: 100%; }
.done-actions.spaced { margin-top: 16px; }

/* Klassen: uppdrag och flöde */
.cheer-news { background: var(--berry); color: var(--card); font-weight: 800; border-radius: 16px; padding: 10px 14px; margin: 0 0 14px; animation: bump 0.6s ease 2; }
.mission { background: var(--grape); color: var(--card); }
.mission .label small, .mission .stats { color: #E6DFFF; }
.mission .meter { background: rgba(255,255,255,0.2); }
.mission .meter i { background: linear-gradient(90deg, var(--sun), #FFE58A); }
.mission-title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1.15; margin-bottom: 10px; }
.mission .stats { margin: 8px 0 0; }
.panel.mission + .panel, .panel + .panel.mission { margin-top: 16px; }
.feed { display: grid; gap: 8px; }
.event { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--sky-2); border-radius: 16px; padding: 8px 10px; }
.event.mine { background: #FFF1C9; }
.event .em { font-size: 1.8rem; }
.event p { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.event small { color: var(--ink-soft); font-weight: 700; }
.heja { border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 800; background: var(--sun); box-shadow: inset 0 -3px 0 #D99A00; white-space: nowrap; }
.heja:disabled { background: transparent; box-shadow: none; cursor: default; }
.error.center { text-align: center; }

/* Välkomstskärmen */
.welcome { display: grid; gap: 16px; }
.welcome-hero { display: grid; justify-items: center; text-align: center; gap: 8px; padding-block: 12px 4px; }
.welcome-hero h1 { font-size: clamp(2rem, 8vw, 3rem); font-weight: 800; }
.welcome-hero p { margin: 0; font-weight: 700; color: var(--ink-soft); max-width: 30em; }
.welcome-class { background: var(--ink); color: var(--card); display: grid; gap: 10px; }
.welcome-class p { margin: 0; font-weight: 700; color: #DCE3F5; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-weight: 800; }
.or::before, .or::after { content: ""; flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.welcome .panel + .panel { margin-top: 0; }

/* Klassen överst på startsidan */
.classtop { background: var(--grape); color: var(--card); display: grid; gap: 10px; margin-bottom: 16px; }
.classtop.is-done { background: linear-gradient(135deg, var(--grape), var(--berry)); }
.ct-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.classtop .kicker { font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.78rem; color: #E6DFFF; }
.ct-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 6vw, 1.8rem); line-height: 1.1; }
.classtop .meter { background: rgba(255,255,255,0.2); }
.classtop .meter i { background: linear-gradient(90deg, var(--sun), #FFE58A); }
.ct-row { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; font-weight: 700; color: #F1EDFF; }
.ct-row b { color: var(--card); }
.ct-event { margin: 0; background: rgba(255,255,255,0.14); border-radius: 12px; padding: 8px 10px; font-weight: 700; overflow-wrap: anywhere; }
.joincard { background: var(--ink); color: var(--card); display: grid; gap: 10px; margin-bottom: 16px; }
.joincard p { margin: 0; font-weight: 700; color: #DCE3F5; }
#classTop + .panel, #joinCard + .panel { margin-top: 0; }

/* Husdjurets önskan */
.wish { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; background: #FFF6DA; border-radius: 18px; padding: 10px 12px; }
.wish-icon { font-size: 2.4rem; line-height: 1; animation: wobble 2.6s ease-in-out infinite; }
.wish-body { display: grid; gap: 6px; min-width: 0; }
.wish-body b { font-weight: 800; line-height: 1.25; }
.wish-body .meter { background: var(--card); height: 10px; }
.wish-body .meter i { background: linear-gradient(90deg, var(--sun), var(--coral)); }
.wish-body small { font-weight: 800; color: var(--ink-soft); }
.wish .chunky { grid-column: 1 / -1; }

/* Installera som app */
.installcard { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; margin-top: 16px; }
.installcard p { margin: 2px 0 0; font-weight: 700; color: var(--ink-soft); }
.install-icon img { border-radius: 12px; display: block; }
.install-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Lärarens fokus och svaga pärlor */
.ct-focus { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,0.16); border-radius: 14px; padding: 8px 10px; font-weight: 800; }
.ct-focus .chunky { padding: 8px 14px; font-size: 1rem; }
.beads.faint .bead { opacity: 0.35; }
.beads.faint .bead.empty { border-style: dotted; }

/* Effects */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.cheer {
  position: fixed; left: 50%; top: 38%; z-index: 60; pointer-events: none;
  width: min(92vw, 720px); text-align: center; line-height: 1; text-wrap: balance;
  font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 13vw, 5rem); color: var(--sun);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink);
  animation: cheer 1.25s ease forwards;
}
.cheer.mega { color: var(--coral); font-size: clamp(3rem, 15vw, 6rem); }
@keyframes cheer {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-12deg); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.15) rotate(4deg); opacity: 1; }
  35% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
  75% { opacity: 1; }
  100% { transform: translate(-50%, -110%) scale(1); opacity: 0; }
}

/* Steg på vägen: Lära, Öva, Kunna */
.step { display: grid; gap: 12px; }
.step h2 { font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 800; text-align: center; }
.step > .stats { text-align: center; margin: 0; }
.moments { display: grid; gap: 10px; }
.moment { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; text-align: left; border: 0; border-radius: 20px; padding: 12px 14px; background: var(--card); box-shadow: 0 5px 0 var(--shadow); }
.moment .mi { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: var(--sky-2); font-family: var(--display); font-weight: 800; }
.moment .mt b { display: block; font-family: var(--display); font-size: 1.25rem; line-height: 1.1; }
.moment .mt small { display: block; font-weight: 700; color: var(--ink-soft); }
.moment .ms { color: var(--line); font-size: 1.1rem; white-space: nowrap; display: grid; justify-items: center; }
.moment .ms small { font-size: 0.65rem; font-weight: 800; color: var(--coral-deep); }
.moment .ms .on { color: var(--sun); -webkit-text-stroke: 0.6px #D99A00; }
.moment.open:not(.done) { outline: 4px solid var(--sun); }
.moment.open:not(.done) .mi { background: var(--sun); animation: ring 1.6s ease infinite; }
.moment.done .mi { background: var(--leaf); color: var(--card); }
.moment:disabled { opacity: 0.55; cursor: default; }
.stop .txt .dots { letter-spacing: 0.08em; color: var(--leaf); }
.recall-btn { position: relative; z-index: 2; margin-top: 8px; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 800; background: #FFF1C9; box-shadow: inset 0 -3px 0 #F2C55C; }
.recall-note { color: var(--grape); font-weight: 800; }
.medal.shine, .slot.shine .em { filter: drop-shadow(0 0 6px #FFD84D) drop-shadow(0 0 2px #fff); animation: shine 2.4s ease-in-out infinite; }
@keyframes shine { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08) rotate(-4deg); } }

/* Klassen: alla med, klassplutten och kunskapsväggen */
.ct-all { margin: 0; font-weight: 800; color: #F1ECFF; }
.allin { margin: 8px 0 0; background: #FFF6DA; color: var(--ink); border-radius: 12px; padding: 8px 10px; font-weight: 700; }
.cp-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; align-items: center; }
.cp-view { display: grid; place-items: center; min-height: 90px; }
.cp-text { display: grid; gap: 6px; min-width: 0; }
.cp-text b { font-family: var(--display); font-size: 1.25rem; }
.cp-text p { margin: 0; font-weight: 700; }
.cp-text small { color: var(--ink-soft); font-weight: 700; }
.wall .worldtabs { margin-block: 8px 12px; box-shadow: none; background: var(--sky-2); }
.wallgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wtile { border-radius: 14px; padding: 6px 4px; text-align: center; display: grid; gap: 0; color: var(--ink);
  background: color-mix(in srgb, var(--leaf) calc(var(--share) * 85%), var(--sky-2)); }
.wtile b { font-family: var(--display); font-size: 1.3rem; line-height: 1.1; }
.wtile small { font-weight: 800; font-size: 0.8rem; }
.wtile.mine { box-shadow: inset 0 0 0 3px var(--sun); }
.wtile.mine small::after { content: " ⭐"; }

/* Spela två: duell eller lagkamp */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg .chip { padding: 12px; font-size: 1.05rem; }
.half.waiting { background: var(--sky-2); }
.half.waiting .dmsg { color: var(--grape); font-size: 1.2rem; }

.sound-status { white-space: pre-line; margin: 10px 0 0; background: var(--card); border-radius: 14px; padding: 10px 12px; font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); overflow-wrap: anywhere; }

.joincard-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.welcome-class .textbtn { margin-top: 6px; color: #E6ECFF; }
.codecard { text-align: center; display: grid; gap: 12px; justify-items: center; }
.codecard .bigcode { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 9vw, 3rem); letter-spacing: 0.04em; white-space: nowrap; background: var(--sun); border-radius: 16px; padding: 4px 16px; user-select: all; }

/* Klasskamp: bergen */
.mountains { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px 8px; margin: 10px 0 6px; align-items: end; }
.mtn { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; }
.mtn .peak { position: relative; width: 100%; max-width: 110px; aspect-ratio: 1.15; clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(to top, var(--blue) 0 var(--fill), var(--sky-2) var(--fill) 100%); }
.mtn.mine .peak { background: linear-gradient(to top, var(--coral) 0 var(--fill), #FFE3D6 var(--fill) 100%); }
.mtn .flag { height: 1.3em; font-size: 1.1rem; line-height: 1; }
.mtn b { font-family: var(--display); font-size: 1.1rem; line-height: 1.1; overflow-wrap: anywhere; }
.mtn small { font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mtn.mine b::after { content: " (vi)"; font-size: 0.8rem; color: var(--coral-deep); }
.contest-cheer { margin: 6px 0 0; font-weight: 800; font-size: 1.1rem; }
.ct-contest { margin: 0; font-weight: 800; color: #F1ECFF; }

.voicepick { margin-top: 12px; display: grid; gap: 6px; justify-items: center; text-align: center; }
.voicepick .lead { font-weight: 800; }

/* Fler utmaningar */
.extras { margin-top: 16px; }
.extra-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.extra-btn { border: 0; border-radius: 20px; padding: 12px 8px; background: var(--sky-2); box-shadow: inset 0 -4px 0 var(--line); display: grid; gap: 2px; justify-items: center; text-align: center; min-width: 0; }
.extra-btn .ex-ic { font-size: 2rem; line-height: 1.1; }
.extra-btn b { font-family: var(--display); font-size: 1.1rem; line-height: 1.1; }
.extra-btn small { font-weight: 700; color: var(--ink-soft); font-size: 0.8rem; }
.extra-btn .ex-lv { margin-top: 4px; font-size: 0.75rem; font-weight: 800; background: var(--card); border-radius: 999px; padding: 2px 8px; }
@media (max-width: 380px) { .extra-row { grid-template-columns: 1fr; } .extra-btn { grid-template-columns: auto 1fr auto; justify-items: start; text-align: left; align-items: center; column-gap: 10px; } .extra-btn .ex-ic { grid-row: span 2; } }
.levels { display: grid; gap: 10px; margin-top: 4px; }
.level { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 0; border-radius: 20px; padding: 12px 14px; background: var(--card); box-shadow: 0 5px 0 var(--shadow); text-align: left; }
.level .lv-n { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); font-family: var(--display); font-weight: 800; font-size: 1.4rem; }
.level.done .lv-n { background: var(--leaf); color: var(--card); }
.level.locked { opacity: 0.55; } .level.locked .lv-n { background: var(--sky-2); font-size: 1.1rem; }
.level .lv-t b { display: block; font-family: var(--display); font-size: 1.2rem; line-height: 1.1; }
.level .lv-t small { color: var(--ink-soft); font-weight: 700; }
.level .lv-s { color: var(--line); white-space: nowrap; } .level .lv-s .on { color: var(--sun); -webkit-text-stroke: 0.6px #D99A00; }

/* Tallinjen */
.line-q { margin: 0 0 6px; font-weight: 800; font-size: 1.2rem; }
.numline svg { width: 100%; height: auto; display: block; overflow: visible; margin-bottom: 10px; }
.numline .axis { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }
.numline .tick line { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.numline .tick .hit { fill: transparent; }
.numline .tappable .tick { cursor: pointer; }
.numline .tappable .tick:hover .hit { fill: var(--sky-2); }
.numline .tick.right .hit { fill: #D9F7E7; }
.numline .tick.wrong .hit { fill: #FFE0EA; }
.numline .lbl { font-family: var(--display); font-weight: 800; font-size: 38px; text-anchor: middle; fill: var(--ink); }
.numline .tick:not(.given) .lbl { fill: var(--blue); }
.numline .lbl.hidden { display: none; }
.numline .lbl.good { fill: var(--leaf); }
.numline .lbl.bad { fill: var(--berry); }
.numline .marker path { fill: var(--coral); }
.numline .marker text { font-family: var(--display); font-weight: 800; font-size: 44px; text-anchor: middle; fill: var(--coral-deep); }
.numline .flag line { stroke: var(--ink-soft); stroke-width: 4; }
.numline .flag path { fill: var(--line); }
.numline .flag.won path { fill: var(--leaf); }
.numline .jb { fill: var(--grape); }
.numline .jbelly { fill: #CBBDFF; }
.numline .je { fill: #fff; } .numline .jp { fill: var(--ink); }
.numline .jcount { font-family: var(--display); font-weight: 800; font-size: 36px; text-anchor: middle; fill: var(--grape); }
.ans.picked { outline: 4px solid var(--sun); }
.numline .jhelp { font-family: var(--display); font-weight: 800; font-size: 44px; text-anchor: middle; fill: var(--berry); stroke: var(--card); stroke-width: 8px; paint-order: stroke; opacity: 0; }
.numline .jhelp.show { animation: help 1.1s ease forwards; }
@keyframes help { 0% { opacity: 0; transform: translateY(10px); } 20%, 80% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
.numline .flag { display: none; }
#line[data-game="jump"] .numline .flag { display: inline; }

/* Hemliga ordet */
.wordslots { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.slot-l { width: 48px; height: 58px; border-radius: 12px; display: grid; place-items: center; background: var(--sky-2); font-family: var(--display); font-weight: 800; font-size: 2rem; color: var(--line); box-shadow: inset 0 -4px 0 var(--line); }
.slot-l.now { outline: 4px solid var(--sun); }
.slot-l.got { background: var(--leaf); color: var(--card); box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2); animation: bump 0.4s ease; }
#wordEq { margin-bottom: 12px; }
.word-reveal { font-size: 1.3em; letter-spacing: 0.08em; color: var(--leaf); }
.codekey-wrap { margin-top: 14px; display: grid; gap: 6px; }
.codekey-title { font-weight: 800; color: var(--ink-soft); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.codekey { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.keytile { border: 0; border-radius: 12px; padding: 6px 2px; background: #FFF6DA; box-shadow: inset 0 -3px 0 #F2C55C; display: grid; line-height: 1.1; }
.keytile .kn { font-weight: 800; color: var(--ink-soft); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.keytile .kl { font-family: var(--display); font-weight: 800; font-size: 1.5rem; }
.codekey.active .keytile { cursor: pointer; }
.codekey.active { animation: keyglow 1.6s ease infinite; border-radius: 14px; }
@keyframes keyglow { 50% { box-shadow: 0 0 0 6px rgba(255, 200, 61, 0.5); } }
.keytile.hit { background: var(--leaf); color: var(--card); box-shadow: none; }
.keytile.hit .kn { color: var(--card); }
.keytile.wrong { animation: wobble 0.4s ease; background: #FFE0EA; }

/* Nyheter */
.news { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: center; margin-bottom: 16px;
  background: linear-gradient(135deg, #FFF6DA, #FFE7B0); box-shadow: inset 0 0 0 3px var(--sun), 0 6px 0 var(--shadow); }
.news-ic { font-size: 2.4rem; line-height: 1; }
.news-txt { display: grid; gap: 2px; min-width: 0; }
.news-tag { justify-self: start; background: var(--berry); color: var(--card); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; }
.news-txt b { font-family: var(--display); font-size: 1.25rem; line-height: 1.1; }
.news-txt p { margin: 0; font-weight: 700; color: var(--ink-soft); }
.news-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }

/* Kompisutmaning */
.buddycard { margin-bottom: 16px; display: grid; gap: 10px; }
.buddycard p { margin: 0; font-weight: 700; }
.bd-mates { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.bd-mates .em { font-size: 1.8rem; }
.bd-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.bd-split { display: flex; justify-content: space-between; font-weight: 800; color: var(--ink-soft); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.buddycard .meter i { background: linear-gradient(90deg, var(--leaf), #7BE0A6); }
.buddycard.done { background: linear-gradient(135deg, #E3FFF0, #FFF6DA); box-shadow: inset 0 0 0 3px var(--leaf), 0 6px 0 var(--shadow); }
.matelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.mate-pick { border: 0; border-radius: 16px; padding: 10px; background: var(--sky-2); box-shadow: inset 0 -3px 0 var(--line); display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; }
.mate-pick .em { font-size: 1.8rem; }
.mate-pick b { overflow-wrap: anywhere; }
.mate-pick small { color: var(--ink-soft); font-weight: 700; }
.mate-pick[aria-pressed="true"] { background: var(--ink); color: var(--sun); box-shadow: none; }
.mate-pick[aria-pressed="true"] small { color: #C9D3F2; }
.mate-pick:disabled { opacity: 0.45; }
.matelist .grp { grid-column: 1 / -1; font-weight: 800; color: var(--ink-soft); font-size: 0.85rem; margin-top: 4px; }

/* Klistermärken: sällsynthet och byten */
.tradebox { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: #FFE9EF; border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; font-weight: 700; }
.tradebox span:nth-child(2) { flex: 1 1 14em; min-width: 0; }
.tradebox .tb-ic { font-size: 1.8rem; }
.ex-ic .tb-plutt, .news-ic .tb-plutt, #extraTitle .tb-plutt { transform: scale(1.35); margin: 4px 6px; }
.raritykey { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rk { border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; font-weight: 800; border: 3px solid var(--r); background: var(--card); }
.r0 { --r: var(--line); } .r1 { --r: var(--leaf); } .r2 { --r: var(--blue); } .r3 { --r: var(--sun); }
.book .slot { position: relative; box-shadow: inset 0 0 0 3px var(--r, transparent); }
.book .slot.r0 { box-shadow: none; }
.book .slot.missing { border-color: var(--r); }
.book .slot.r3:not(.missing) { background: linear-gradient(135deg, #FFF6DA, #FFE58A); animation: legend 2.6s ease-in-out infinite; }
.book .slot.r2:not(.missing) { background: #E3EBFF; }
@keyframes legend { 50% { box-shadow: inset 0 0 0 3px var(--sun), 0 0 14px 2px rgba(255, 200, 61, 0.8); } }
.slot .swap { display: block; margin: 4px auto 0; border: 0; border-radius: 999px; padding: 2px 8px; font-weight: 800; font-size: 0.72rem; background: var(--coral); color: var(--card); box-shadow: 0 2px 0 var(--coral-deep); }
#reward.legend { background: linear-gradient(135deg, #FFF6DA, #FFE58A); box-shadow: 0 0 0 4px var(--sun), 0 0 22px rgba(255, 200, 61, 0.9); }

/* Garderoben */
.petbtns { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.wd-top { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: center; }
.wd-pet { height: 150px; border-radius: 26px; display: grid; place-items: end center; padding-bottom: 18px; background: radial-gradient(circle at 50% 85%, #E3DAFF 0 38%, var(--sky-2) 39%); }
.wd-info { display: grid; gap: 4px; min-width: 0; }
.wd-info b { font-family: var(--display); font-size: 1.3rem; }
.wd-info p { margin: 0; font-weight: 700; color: var(--ink-soft); }
.wd-info .textbtn { justify-self: start; padding: 0; }
.wd-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 4px; }
.wd-actions .chunky { padding: 8px 14px; font-size: 1rem; }
.berries { color: var(--berry); font-size: 1.2em; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.wd-item { background: var(--card); border-radius: 20px; padding: 12px; box-shadow: 0 5px 0 var(--shadow); display: grid; gap: 4px; justify-items: center; text-align: center; }
.wd-item .wi { font-size: 2.4rem; line-height: 1.1; }
.wd-item b { font-family: var(--display); font-size: 1.1rem; }
.wd-item small { color: var(--ink-soft); font-weight: 700; font-size: 0.8rem; }
.wd-item.locked { opacity: 0.55; }
.wd-item.on { box-shadow: inset 0 0 0 3px var(--leaf), 0 5px 0 var(--shadow); }
.wd-item .chunky { padding: 8px 14px; font-size: 1rem; margin-top: 4px; }
/* Glänsande klistermärken */
.slot .shiny { display: inline-block; margin-top: 2px; font-size: 0.7rem; font-weight: 800; background: linear-gradient(90deg, #FFE58A, #FFF6DA, #FFD24D); border-radius: 999px; padding: 1px 6px; }
.book .slot.has-shiny .em { filter: drop-shadow(0 0 4px #FFD84D) drop-shadow(0 0 1px #fff); animation: shine 2.4s ease-in-out infinite; }
.slot .share { display: block; margin: 3px auto 0; border: 0; border-radius: 999px; padding: 2px 8px; font-weight: 800; font-size: 0.72rem; background: var(--leaf); color: var(--card); box-shadow: 0 2px 0 #157a4a; }

/* Klistermärkesboken: flöde, rubriker per nivå och närbild */
.tradebox { display: grid; gap: 8px; }
.tradebox p { margin: 0; }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; font-weight: 800; font-size: 0.85rem; text-align: center; }
.flow span { position: relative; background: var(--card); border-radius: 14px; padding: 6px 4px; display: grid; gap: 2px; }
.flow span i { font-style: normal; font-size: 1.5rem; }
.flow span + span::before { content: "➜"; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); color: var(--coral-deep); font-size: 1rem; }
.flow-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.flow-actions .chunky { padding: 10px 14px; font-size: 1rem; }
.rar-head { margin: 16px 0 8px; font-size: 1.25rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rar-head::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--r); align-self: center; }
.rar-head small { font-family: var(--body); font-weight: 700; font-size: 0.8rem; color: var(--ink-soft); }
button.slot { border: 0; font: inherit; color: inherit; cursor: pointer; }
.book .slot.dup { box-shadow: inset 0 0 0 3px var(--r, transparent), 0 0 0 3px var(--coral); }
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(27, 37, 71, 0.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.sheet.open { opacity: 1; }
.sheet-card { width: min(100%, 520px); background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); text-align: center; transform: translateY(40px); transition: transform 0.2s; max-height: 90vh; overflow: auto; }
.sheet.open .sheet-card { transform: none; }
.sheet-card h3 { font-size: 1.6rem; margin-top: 6px; }
.sheet-card p { font-weight: 700; color: var(--ink-soft); }
.sh-big { font-size: 4.5rem; line-height: 1.1; width: 120px; height: 120px; margin: 0 auto; border-radius: 26px; display: grid; place-items: center; background: var(--sky-2); box-shadow: inset 0 0 0 4px var(--r); font-family: var(--display); color: var(--line); }
.sh-big.has-shiny { filter: drop-shadow(0 0 8px #FFD84D); }
.sh-rar { display: inline-block; margin: 4px 0 0; border-radius: 999px; padding: 2px 12px; border: 3px solid var(--r); color: var(--ink) !important; }
.sh-actions { display: grid; gap: 10px; margin-top: 8px; }
.sh-actions .chunky { width: 100%; }
.sh-note { font-size: 0.85rem; margin-top: 10px; }

/* Flikar och menyn längst ner */
body.on-start .app { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }
.tabbar { display: none; }
body.on-start .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--card); box-shadow: 0 -4px 0 var(--shadow); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabbar button { position: relative; border: 0; background: none; border-radius: 14px; padding: 6px 2px; display: grid; justify-items: center; gap: 2px;
  font-family: var(--display); font-weight: 800; font-size: 0.95rem; color: var(--ink-soft); }
.tabbar .tb-ic { font-size: 1.5rem; line-height: 1.1; }
.tabbar button[aria-current="page"] { background: var(--ink); color: var(--sun); }
.tabbar .dot { position: absolute; top: 4px; right: calc(50% - 22px); width: 12px; height: 12px; border-radius: 50%; background: var(--berry); box-shadow: 0 0 0 2px var(--card); }
.tabpane > * + * { margin-top: 16px; }
.tabpane .panel + .panel { margin-top: 16px; }
/* Idag-listan: en solig morgonruta med vita kort */
.panel.today { position: relative; overflow: hidden; background: linear-gradient(160deg, #FFE68A 0%, #FFC59E 55%, #FFAFC4 100%); }
.panel.today::before { content: ""; position: absolute; top: -60px; right: -50px; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.75), rgba(255,255,255,0) 70%); pointer-events: none; }
.panel.today .label { position: relative; font-size: 1.45rem; }
.panel.today .label small { color: #7A4A2A; }
.today-sun { display: inline-block; animation: sunspin 12s linear infinite; }
@keyframes sunspin { to { transform: rotate(360deg); } }
.todo { position: relative; display: grid; gap: 8px; }
.todo-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 0; text-align: left; width: 100%;
  background: var(--card); border-radius: 16px; padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; box-shadow: 0 3px 0 rgba(122, 74, 42, 0.18); }
.todo-row:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(122, 74, 42, 0.18); }
.todo-row .ti { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: #FFF3D1; font-size: 1.5rem; line-height: 1; }
.todo-row:nth-child(3n+2) .ti { background: #E8F7FF; }
.todo-row:nth-child(3n+3) .ti { background: #FFE6EE; }
.todo-row.main .ti { background: rgba(255, 255, 255, 0.14); }
.panel.today .stats { color: #7A4A2A; font-weight: 800; }
.todo-row.focus { box-shadow: inset 0 0 0 3px var(--grape), 0 3px 0 rgba(122, 74, 42, 0.18); }
.todo-row.focus .ti { background: #EFE9FF; }
.todo-row.tip { background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9); }
.todo-row.tip b::before { content: "Tips: "; color: var(--grape); }
.todo-row.tip small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.todo-row b { display: block; font-family: var(--display); font-size: 1.1rem; line-height: 1.15; }
.todo-row small { display: block; color: var(--ink-soft); font-weight: 700; }
.todo-row .tg { background: var(--sun); border-radius: 999px; padding: 6px 12px; font-family: var(--display); font-weight: 800; box-shadow: 0 3px 0 #D99A00; white-space: nowrap; }
.todo-row.main { background: var(--ink); color: var(--card); }
.todo-row.main small { color: #C9D3F2; }
/* Plutt i litet format på Hem */
.homepet { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; }
/* Husdjuret går att klappa; resten av kortet leder till Plutt-fliken */
.hp-view { height: 72px; width: 72px; border: 0; padding: 0 0 6px; cursor: pointer; border-radius: 18px; display: grid; place-items: end center; background: radial-gradient(circle at 50% 85%, #E3DAFF 0 38%, var(--sky-2) 39%); }
.hp-view:active { transform: scale(0.96); }
.hp-open { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.hp-txt small.saying { display: inline-block; margin-top: 2px; background: var(--sky-2); color: var(--ink); border-radius: 12px 12px 12px 4px; padding: 4px 10px; animation: pop-in 0.25s ease; }
@keyframes pop-in { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
/* Petar man för mycket: husdjuret skakar på sig, och till slut somnar det */
.pet.grumpy { animation: petshake 0.45s ease; }
.pet:not(.egg).grumpy::before { background: #9A6BFF; }
.pet.sleepy { animation: petsleep 2.4s ease-in-out infinite; filter: saturate(0.6) brightness(0.92); }
@keyframes petshake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px) rotate(-6deg); } 40% { transform: translateX(6px) rotate(6deg); } 60% { transform: translateX(-4px) rotate(-3deg); } 80% { transform: translateX(3px); } }
@keyframes petsleep { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, 0.96) translateY(2px); } }
.hp-view .pet { --s: 0.8 !important; }
.hp-txt b { display: block; font-family: var(--display); font-size: 1.2rem; }
.hp-txt small { display: block; color: var(--ink-soft); font-weight: 700; }
.hp-lv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.hp-lvtag { background: var(--grape); color: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 0.8rem; white-space: nowrap; }
.hp-meter { flex: 1 1 50px; min-width: 50px; height: 8px; background: var(--sky-2); border-radius: 999px; overflow: hidden; }
.hp-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--berry), var(--grape)); border-radius: 999px; }
.hp-go { font-size: 2rem; color: var(--line); font-weight: 800; }
/* Inställningar: en ruta från kugghjulet i sidhuvudet */
.settingsbox { display: grid; gap: 14px; text-align: left; }
.settingsbox h2 { font-size: 1.6rem; text-align: center; }
.toggles { display: grid; gap: 10px; }
.toggle { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-radius: 18px; padding: 12px 14px; background: var(--sky-2); font: inherit; color: var(--ink); cursor: pointer; }
.toggle .tg-ic { grid-row: span 2; font-size: 1.7rem; text-align: center; }
.toggle b { font-family: var(--display); font-size: 1.2rem; line-height: 1.1; }
.toggle small { grid-column: 2; color: var(--ink-soft); font-weight: 700; }
.tg-sw { grid-column: 3; grid-row: 1 / span 2; width: 54px; height: 32px; border-radius: 999px; background: var(--leaf); position: relative; transition: background 0.15s; }
.tg-sw::after { content: ""; position: absolute; top: 4px; left: 26px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); transition: left 0.15s; }
.toggle[aria-pressed="false"] .tg-sw { background: #B7C2D9; }
.toggle[aria-pressed="false"] .tg-sw::after { left: 4px; }
.settingsbox .voicepick { margin-top: 0; }
.set-account { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--sky-2); border-radius: 18px; padding: 12px 14px; }
.settingsbox .danger { justify-self: center; color: var(--coral-deep); }
.icon-btn.muted { opacity: 0.6; }
/* Profilbilden: elevens figur med ett litet kugghjul */
#settingsBtn.profile { position: relative; width: 44px; height: 44px; padding: 0; overflow: visible; }
#settingsBtn.profile .pf-av { font-size: 1.6rem; line-height: 1; }
#settingsBtn.profile .pf-gear { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,0.25); display: grid; place-items: center; font-size: 0.7rem; }
@media (max-width: 420px) { #settingsBtn.profile { width: 40px; height: 40px; } }
.set-about { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; border-top: 2px dashed var(--line); padding-top: 10px; }
.set-about a { font-size: 0.95rem; }
/* Ändringsloggen */
.changelog { display: grid; gap: 10px; text-align: left; margin: 10px 0 14px; }
.cl-ver { background: var(--sky-2); border-radius: 16px; padding: 10px 14px; }
.cl-ver.now { background: #FFF6D6; box-shadow: inset 0 0 0 2px var(--sun); }
.cl-ver header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cl-ver header b { font-family: var(--display); font-size: 1.15rem; }
.cl-ver header small { color: var(--ink-soft); font-weight: 700; }
.cl-ver ul { margin: 6px 0 0; padding-left: 20px; font-weight: 700; color: var(--ink-soft); }
.cl-ver li + li { margin-top: 3px; }
/* Testläget: en randig rad överst så att man aldrig tror att det är på riktigt */
.demobar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 0; padding: 8px 8px 8px 14px; border-radius: 16px; font-weight: 700;
  background: repeating-linear-gradient(-45deg, #FFE68A 0 14px, #FFD84D 14px 28px); color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,0.12); }
.demobar button { border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-weight: 800; padding: 6px 14px; cursor: pointer; }
.demo-group { display: grid; gap: 8px; text-align: left; margin: 12px 0; }
.demo-group b { font-family: var(--display); font-size: 1.1rem; }
.demo-group .chunky { text-align: left; }
/* Fri träning */
.free-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.free-head h2 { font-size: 1.3rem; }
.free-head small { color: var(--ink-soft); font-weight: 700; }
.free-stars { margin-left: auto; background: var(--sky-2); border-radius: 999px; padding: 4px 12px; font-weight: 800; white-space: nowrap; }
.free-stars .star { color: var(--sun); -webkit-text-stroke: 1px #D99A00; }
.basketcard p, .stickercard p, .wardcard p, .duelcard p { margin: 0 0 10px; font-weight: 700; color: var(--ink-soft); }
/* Plutt-fliken: korgen, garderoben och klistermärkena */
.basketcard { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; background: linear-gradient(135deg, #FFF0F4, var(--card) 70%); }
.basketcard .chunky { grid-column: 1 / -1; }
.bk-big { font-size: 3rem; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,0.12)); }
.bk-txt .label { margin: 0; }
.bk-count { display: block; font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--berry); }
.bk-count small { font-size: 1rem; color: var(--ink-soft); }
.basketcard p { margin: 4px 0 6px; font-size: 0.92rem; }
.ward-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-bottom: 12px; cursor: pointer; }
.ward-it { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 14px; background: var(--sky-2); font-size: 1.5rem; line-height: 1; }
.ward-it small { font-size: 0.72rem; font-weight: 800; color: var(--ink-soft); }
.ward-it.own { background: #E3F7EC; box-shadow: inset 0 0 0 2px var(--leaf); }
.ward-it.own small { color: var(--leaf); }
.ward-it.buy { background: #FFF6D6; box-shadow: inset 0 0 0 2px var(--sun); }
.ward-it.lock > span { filter: grayscale(1); opacity: 0.4; }
.st-tiers { display: grid; gap: 6px; margin: 4px 0 12px; }
.st-tier { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 3em; gap: 10px; align-items: center; font-weight: 800; font-size: 0.9rem; }
.st-tier b { text-align: right; font-variant-numeric: tabular-nums; }
.st-bar { height: 10px; background: var(--sky-2); border-radius: 999px; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--r); border-radius: 999px; }
.st-tier.r0 { --r: #6FB4E0; }
/* Mini-Plutt i menyn */
.tb-plutt { position: relative; display: inline-block; width: 26px; height: 22px; margin-top: 2px; border-radius: 50% 50% 42% 42%; background: radial-gradient(circle at 35% 30%, #B7A4FF, var(--grape) 70%); box-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.tb-plutt i { position: absolute; top: 34%; width: 6px; height: 7px; border-radius: 50%; background: #fff; }
.tb-plutt i::after { content: ""; position: absolute; left: 1.5px; top: 2px; width: 3px; height: 3px; border-radius: 50%; background: var(--ink); }
.tb-plutt i:first-child { left: 22%; } .tb-plutt i:last-child { right: 22%; }
.noclass { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .cheer { animation: none; transform: translate(-50%, -50%); opacity: 1; }
}

/* Mata en i taget: ett litet +1 som flyger upp från knappen */
#basketFeed, #wdFeed { position: relative; overflow: visible; }
.plus-one { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font-weight: 800; color: var(--berry); pointer-events: none; animation: plusone 0.7s ease-out forwards; }
@keyframes plusone { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -34px); } }
/* Klassen-fliken: klassidan direkt i fliken */
.classarea { display: grid; gap: 16px; }
.classarea > * + * { margin-top: 0 !important; }
.class-title { margin: 4px 0 0; }
.foldpanel > summary { cursor: pointer; list-style: none; font-family: var(--display); font-weight: 800; font-size: 1.2rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.foldpanel > summary::-webkit-details-marker { display: none; }
.foldpanel > summary::after { content: "▾"; margin-left: auto; color: var(--ink-soft); }
.foldpanel[open] > summary::after { content: "▴"; }
.foldpanel > summary small { font-family: var(--body); font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }
.foldpanel[open] > summary { margin-bottom: 12px; }
/* Räknesagor, saknas-talet och pengar */
.quiz-q { font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.25; margin: 0 0 10px; text-align: center; }
.quiz-q .textbtn { text-decoration: none; font-size: 1.2rem; padding: 0 4px; }
.quiz-scene { display: grid; justify-items: center; margin-bottom: 14px; }
.quiz-pic { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; min-height: 70px; background: var(--sky-2); border-radius: 20px; padding: 12px; width: 100%; }
.quiz-gap .quiz-pic { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 9vw, 3rem); gap: 10px; background: transparent; }
.quiz-pic .op { font-family: var(--display); font-weight: 800; font-size: 1.8rem; color: var(--ink-soft); }
.quiz-pic .gap { display: inline-grid; place-items: center; min-width: 1.6em; border-radius: 14px; border: 4px dashed var(--coral); color: var(--coral); }
.pics { font-size: 1.7rem; letter-spacing: 2px; max-width: 12em; line-height: 1.25; text-align: center; }
.pics.new { filter: drop-shadow(0 0 4px #FFD84D); }
.pics-n { font-family: var(--display); font-weight: 800; font-size: 1.8rem; }
.coins { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.coin { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: #4A4030;
  background: radial-gradient(circle at 35% 30%, #FFFFFF, #CFD4DC 55%, #9AA2AE); box-shadow: inset 0 0 0 3px rgba(0,0,0,0.12), 0 2px 0 rgba(0,0,0,0.15); }
.coin.c2 { width: 50px; height: 50px; }
.coin.c5, .coin.c10 { background: radial-gradient(circle at 35% 30%, #FFF5C8, #F2C94C 55%, #C9962C); }
.coin.c10 { width: 56px; height: 56px; font-size: 1.3rem; }
.note, .price { display: inline-grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.4rem; }
.note { width: 96px; height: 52px; border-radius: 8px; background: linear-gradient(135deg, #B7E4C7, #74C69D); box-shadow: inset 0 0 0 3px rgba(0,0,0,0.1); color: #14532D; }
.note::after { content: " kr"; font-size: 0.9rem; }
.price { grid-auto-flow: column; gap: 8px; background: var(--card); border-radius: 14px; padding: 6px 12px; }
/* Spelen med Plutt */
.gamescard .game-btn.locked { opacity: 0.85; }
.gamescard .game-btn.locked .ex-ic { filter: grayscale(1); }
.g-lock { display: grid; gap: 2px; width: 100%; justify-items: center; }
.g-lockbar { width: 80%; height: 8px; background: var(--card); border-radius: 999px; overflow: hidden; }
.g-lockbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), #FFB400); }
.quiz-game .stage { overflow: hidden; }
.g-eq { margin-bottom: 10px; }
.gscene { position: relative; width: 100%; height: 300px; border-radius: 22px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.gscene > * { position: absolute; left: 0; top: 0; }
.gscene.fly { background: linear-gradient(#8FD3FF, #DDF3FF 75%, #9BE3A8 75%); }
.gscene.catch { background: linear-gradient(#C9F0FF, #E9F9FF 82%, #9BE3A8 82%); }
.gscene.throw { background: linear-gradient(#FFF1D6, #FFE2B3); }
.g-actor { z-index: 3; width: 70px; height: 70px; display: grid; place-items: end center; }
.g-actor .pet { --s: 1.1 !important; animation: none; }
.tb-plutt.big { transform: scale(2); margin-bottom: 14px; }
.g-hint { margin: 10px 0 0; text-align: center; font-weight: 800; font-size: 0.92rem; color: var(--ink-soft); }
.g-path { width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.g-path path { fill: none; stroke: #fff; stroke-width: 4; stroke-dasharray: 2 9; stroke-linecap: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25)); }
.g-path circle { fill: none; stroke: var(--coral); stroke-width: 4; opacity: 0; }
.g-target.fall.waiting { animation: dangle 0.9s ease-in-out infinite; }
@keyframes dangle { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
.pyr { width: 84px; height: 104px; z-index: 1; }
.pyr .mini-can { position: absolute; width: 36px; height: 38px; border-radius: 6px 6px 8px 8px; background: linear-gradient(90deg, #E23D3D, #FF7A7A 45%, #B92B2B); box-shadow: inset 0 4px 0 rgba(255,255,255,0.35), inset 0 -4px 0 rgba(0,0,0,0.2); }
.pyr .g-tag { position: absolute; left: 50%; top: -6px; translate: -50% -50%; min-width: 44px; padding: 2px 10px; border-radius: 12px; background: var(--card); font-family: var(--display); font-weight: 800; font-size: 1.5rem; text-align: center; box-shadow: 0 3px 0 rgba(0,0,0,0.12); }
.pyr.wrong { filter: grayscale(0.7); }
.pyr.wobble { animation: wobble 0.5s ease 2; }
@keyframes wobble { 25% { rotate: -6deg; } 75% { rotate: 6deg; } }
.pyr.correct-was .g-tag { box-shadow: 0 0 0 5px var(--sun); }
.pyr .g-tag.pop { animation: tagpop 0.6s ease forwards; }
@keyframes tagpop { 40% { scale: 1.5; } 100% { scale: 1.2; background: var(--sun); } }
.g-target { display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.8rem; color: var(--ink); }
.g-target.cloud { width: 80px; height: 52px; border-radius: 40px; background: #fff; box-shadow: 0 6px 0 rgba(0,0,0,0.08); }
.g-target.cloud::before, .g-target.cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; z-index: -1; }
.g-target.cloud::before { width: 40px; height: 40px; top: -18px; left: 10px; }
.g-target.cloud::after { width: 32px; height: 32px; top: -10px; right: 10px; }
.sling { left: 22px !important; top: auto !important; bottom: 34px; width: 46px; height: 60px; border: 6px solid #8B5A2B; border-top: 0; border-radius: 0 0 24px 24px; }
.g-power { left: 14px !important; top: 12px !important; width: 120px; height: 12px; background: rgba(255,255,255,0.7); border-radius: 999px; overflow: hidden; }
.g-power i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--leaf), var(--sun), var(--coral)); }
.g-target.fall { width: 52px; height: 52px; border-radius: 50%; background: var(--card); box-shadow: 0 4px 0 rgba(0,0,0,0.12), inset 0 0 0 3px var(--sun); font-size: 1.5rem; }
.catcher .basket { position: absolute; bottom: -6px; font-size: 2.2rem; }
.g-target.can { width: 60px; height: 80px; border-radius: 10px 10px 14px 14px; background: linear-gradient(90deg, #E23D3D, #FF7A7A 45%, #B92B2B); color: #fff; box-shadow: inset 0 6px 0 rgba(255,255,255,0.35), inset 0 -6px 0 rgba(0,0,0,0.2); }
.shelf { left: 4% !important; width: 92%; height: 12px; border-radius: 6px; background: #A0522D; }
.g-ball { width: 40px; height: 40px; font-size: 2.3rem; line-height: 40px; text-align: center; z-index: 3; }
.g-aim { height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--coral) 0 8px, transparent 8px 14px); transform-origin: 0 50%; opacity: 0; z-index: 2; }
.g-target.right.pop { animation: gpop 0.5s ease forwards; }
@keyframes gpop { 50% { scale: 1.3; } 100% { scale: 0; opacity: 0; } }
.g-target.right.hit { animation: canfall 0.7s ease-in forwards; }
@keyframes canfall { 30% { rotate: -25deg; translate: 0 -12px; } 100% { rotate: 80deg; translate: 40px 160px; opacity: 0; } }
.g-target.wrong { filter: grayscale(0.7); }
.g-target.correct-was { box-shadow: 0 0 0 5px var(--sun), 0 6px 0 rgba(0,0,0,0.08); }
.jr-game { display: block; color: var(--grape) !important; font-weight: 800; }
@media (max-width: 380px) { .g-target.cloud { width: 92px; } .g-target.can { width: 60px; } .g-target.plat { width: 78px; } }

/* Plutts önskan på Hem: Plutt, en pratbubbla och godsaken som väntar */
.homewish { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: linear-gradient(135deg, #F3EDFF, #FFF0F6); overflow: visible; }
.hw-pet { height: 84px; display: grid; place-items: end center; padding-bottom: 6px; }
.hw-pet .pet { --s: 1 !important; animation: petbeg 1.4s ease-in-out infinite; }
@keyframes petbeg { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-6px) rotate(-4deg); } 75% { transform: translateY(-6px) rotate(4deg); } }
.hw-bubble { position: relative; display: grid; gap: 4px; background: var(--card); border-radius: 18px; padding: 10px 14px 12px; box-shadow: 0 3px 0 rgba(122, 92, 255, 0.18); min-width: 0; }
.hw-bubble::before { content: ""; position: absolute; left: -9px; top: 26px; border: 9px solid transparent; border-left: 0; border-right-color: var(--card); }
.hw-kicker { font-weight: 800; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--grape); }
.hw-bubble b { font-family: var(--display); font-size: 1.1rem; line-height: 1.2; }
.hw-task { font-weight: 700; color: var(--ink-soft); }
.hw-meter { height: 8px; background: var(--sky-2); border-radius: 999px; overflow: hidden; }
.hw-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--berry), var(--grape)); }
.hw-go { justify-self: start; margin-top: 2px; background: var(--sun); border-radius: 999px; padding: 4px 12px; font-family: var(--display); font-weight: 800; box-shadow: 0 3px 0 #D99A00; }
.hw-treat { position: absolute; right: -6px; top: -14px; font-size: 2.4rem; filter: drop-shadow(0 3px 2px rgba(0,0,0,0.15)); animation: treatbob 2s ease-in-out infinite; }
@keyframes treatbob { 0%, 100% { transform: rotate(-10deg) translateY(0); } 50% { transform: rotate(10deg) translateY(-6px); } }

/* ================= Gånger ================= */
/* Pärlgrupper: en rad per grupp, lite mindre pärlor så att tio grupper får plats */
.beads.groups { gap: 5px; }
.beads.groups .bead { width: clamp(18px, 5.2vw, 26px); }
.beads.groups.dense { gap: 3px; }
.beads.groups.dense .bead { width: clamp(15px, 4.4vw, 22px); }
.beads.groups .five { gap: 4px; }
.beads.groups .beadrow { gap: 9px; justify-content: flex-start; padding-left: 4px; }
.beadrow .rowsum { min-width: 2.2em; padding: 1px 7px; border-radius: 999px; background: var(--sun); font-family: var(--display); font-size: 0.85rem; line-height: 1.5; text-align: center; animation: popin 0.35s ease both; }
/* Hoppa i tabellen: "3, 6, ?, 12" */
.equation .seq { display: inline-flex; align-items: center; gap: 0.15em; font-size: 0.72em; flex-wrap: wrap; justify-content: center; }
.equation .seq .op { margin-right: 0.15em; }

/* Tabellrutan */
.tgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; max-width: 360px; margin: 6px auto 8px; }
.tgrid i { aspect-ratio: 1; border-radius: 6px; background: #E9EEF7; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: clamp(0.55rem, 2.6vw, 0.8rem); color: var(--card); font-variant-numeric: tabular-nums; }
.tgrid i.on { background: var(--grape); }
.tgrid i.on.sq { background: var(--coral); }
.tgrid i.mark { box-shadow: inset 0 0 0 2px var(--sun); }
.tgrid i.mark:not(.on) { background: #FFF3CF; }
.tgrid-panel .stats { text-align: center; }
.flipnote { margin-top: 12px; padding: 14px 16px; border-radius: 20px; background: #F1ECFF; text-align: left; }
.flipnote p { margin: 0 0 8px; line-height: 1.4; }
.flipnote b { display: block; font-family: var(--display); }
.flipnote .tgrid { max-width: 260px; }
