
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
  --deep: #064c65;
  --teal: #087e96;
  --aqua: #18b9c9;
  --bright: #6ce4ea;
  --pale: #e5ffff;
  --white: #ffffff;
  --ink: #075577;
  --muted: #5d8298;
  --line: #8fe4f0;
  --pink: #ffb4e0;
  --gold: #ffcc50;
  --shadow: 0 8px 24px #006d8720;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Nunito', 'Trebuchet MS', sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 8% 15%, #9af7ff 0, transparent 28%),
    radial-gradient(ellipse at 88% 20%, #b0efff 0, transparent 29%),
    radial-gradient(ellipse at 50% 100%, #b9ffff 0, transparent 40%),
    linear-gradient(145deg, #d4fbff, #efffff 48%, #d4f7ff);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid #f4a4d2;
  outline-offset: 3px;
}
button:disabled { opacity: .65; cursor: not-allowed; }

.sky-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.sky-star {
  position: absolute;
  color: #ffffffd9;
  text-shadow: 0 0 15px #10bedb;
  animation: sparkle 2.5s ease-in-out infinite alternate;
}
.s1 { top: 16%; left: 23%; font-size: 30px; }
.s2 { top: 32%; right: 2%; font-size: 38px; animation-delay: .5s; }
.s3 { top: 64%; left: 2%; font-size: 25px; animation-delay: 1s; }
.s4 { top: 80%; right: 24%; font-size: 35px; animation-delay: .8s; }
.s5 { top: 7%; right: 40%; font-size: 20px; animation-delay: .3s; }

.cloud {
  position: absolute;
  width: 270px;
  height: 80px;
  opacity: .42;
  background: #fff;
  filter: blur(2px);
  border-radius: 50%;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud::before { width: 120px; height: 120px; left: 40px; bottom: 10px; }
.cloud::after { width: 160px; height: 145px; right: 20px; bottom: 0; }
.cloud-a { top: 27%; left: -180px; }
.cloud-b { bottom: 8%; right: -180px; transform: scale(.8); }

@keyframes sparkle {
  from { opacity: .45; transform: scale(.8) rotate(-8deg); }
  to { opacity: 1; transform: scale(1.15) rotate(8deg); }
}

.topbar {
  min-height: 74px;
  padding: 12px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 25;
  background: #ffffffed;
  backdrop-filter: blur(15px);
  border-bottom: 1px solid #9aeaf0;
  box-shadow: 0 4px 18px #00678112;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--deep);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  position: relative;
  width: 45px;
  height: 45px;
  font-size: 32px;
}
.brand-mark i {
  position: absolute;
  right: -3px;
  top: -3px;
  color: #f7be30;
  font-size: 19px;
  font-style: normal;
}
.brand strong { display: block; font-size: 23px; font-weight: 900; line-height: 1; }
.brand small { display: block; font-size: 10px; font-weight: 800; margin-top: 4px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 9px; }
.points-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 15px;
  border-radius: 30px;
  border: 1px solid #60e1e6;
  background: linear-gradient(115deg, #e1ffff, white);
  box-shadow: inset 0 1px white, 0 3px 10px #067f9510;
  font-size: 13px;
  color: var(--deep);
}
.points-pill b { font-size: 16px; }
.points-pill span { font-weight: 800; }
.round-action {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  font-size: 20px;
  box-shadow: 0 3px 9px #067f9510;
}
.round-action:hover { transform: translateY(-2px); background: #e4ffff; }

.app-layout {
  display: grid;
  grid-template-columns: 185px minmax(430px, 1fr) 294px;
  gap: 13px;
  max-width: 1800px;
  margin: 0 auto;
  padding: 15px;
  align-items: start;
}

.sidebar {
  min-height: calc(100vh - 103px);
  position: sticky;
  top: 89px;
  overflow: hidden;
  border-radius: 22px;
  padding: 14px 10px 22px;
  background: linear-gradient(180deg, #087d96, #07506c 80%, #073e5d);
  color: white;
  box-shadow: 0 12px 30px #043f5e30;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 10px 3px;
  font-size: 24px;
}
.sidebar-logo span { font-size: 10px; letter-spacing: 1.2px; font-weight: 900; color: #c5ffff; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  margin: 4px 0;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #edffff;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 900;
  transition: .2s;
}
.nav-link span { display: inline-grid; place-items: center; min-width: 23px; font-size: 19px; }
.nav-link:hover { background: #ffffff20; }
.nav-link.active {
  color: #064b62;
  border-color: #afffff;
  background: linear-gradient(115deg, #b5ffff, #48d6e0);
  box-shadow: 0 5px 13px #002d4c40, inset 0 1px white;
}
.sidebar-motto {
  text-align: center;
  padding: 28px 4px 8px;
  font-size: 13px;
  line-height: 1.55;
  color: #d3ffff;
}
.sidebar-motto strong { color: white; }
.sidebar-pet {
  text-align: center;
  font-size: 62px;
  margin-top: 12px;
  animation: petHover 3s ease-in-out infinite;
  filter: drop-shadow(0 9px 9px #003b5a55);
}

.main-column { min-width: 0; position: relative; }
.hero {
  min-height: 200px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  position: relative;
  overflow: hidden;
  padding: 20px 26px;
  align-items: center;
  color: white;
  border-radius: 22px;
  border: 1px solid #9df8ff;
  background:
    radial-gradient(circle at 78% 25%, #e0ffff75 0 2px, transparent 4px),
    radial-gradient(circle at 62% 70%, #ffffffa0 0 2px, transparent 4px),
    linear-gradient(120deg, #075b7b, #088db0 58%, #60e7e4);
  box-shadow: 0 14px 30px #047f9c26, inset 0 1px #ffffffa0;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: #aaffff22;
}
.hero::before { width: 300px; height: 300px; right: -60px; top: -170px; }
.hero::after { width: 220px; height: 220px; left: 35%; bottom: -170px; }
.hero-copy { position: relative; z-index: 3; }
.eyebrow { font-size: 9px; font-weight: 900; letter-spacing: 1.2px; color: var(--teal); }
.hero-eyebrow { color: #c7ffff; }
.hero h1 {
  margin: 8px 0;
  font-size: clamp(30px, 3vw, 43px);
  letter-spacing: -1.5px;
  font-weight: 900;
  line-height: .98;
  text-shadow: 0 3px 0 #074b76, 0 5px 12px #002d5045;
}
.hero h1 span { color: #b3ffff; }
.hero p { font-size: 13px; font-weight: 800; line-height: 1.5; }
.hero-button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: linear-gradient(110deg, #edffff, #9cffff);
  color: #075674;
  font-weight: 900;
  font-size: 12px;
  box-shadow: 0 5px 12px #003a5d40;
}
.hero-button span { font-size: 18px; margin-left: 10px; }

.hero-art { min-height: 160px; display: grid; place-items: center; position: relative; z-index: 2; }
.hero-dragon {
  font-size: clamp(80px, 9vw, 130px);
  line-height: 1;
  z-index: 2;
  filter: drop-shadow(0 12px 8px #003b5840);
  animation: petHover 3.4s ease-in-out infinite;
}
.castle { position: absolute; top: 2px; right: 0; font-size: clamp(45px, 5vw, 72px); opacity: .85; filter: drop-shadow(0 0 10px #b9ffff); }
.hero-orbit { position: absolute; border: 1px dashed #caffff9e; border-radius: 50%; }
.orbit-one { width: 155px; height: 155px; animation: rotate 24s linear infinite; }
.orbit-two { width: 195px; height: 85px; transform: rotate(40deg); }
.hero-spark { position: absolute; color: #fff3a6; font-size: 24px; animation: sparkle 2s ease-in-out infinite alternate; }
.hs-one { top: 5%; left: 9%; }
.hs-two { bottom: 8%; right: 10%; }
.hs-three { top: 40%; left: -1%; }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes petHover {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.quick-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 13px 9px;
  text-align: center;
  color: var(--ink);
  border: 1px solid #86e6f3;
  border-radius: 16px;
  background: linear-gradient(145deg, #fffffffa, #dbffff);
  box-shadow: 0 5px 13px #066a8910, inset 0 1px white;
  transition: .2s;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #22c4d6; }
.quick-art { display: block; font-size: 34px; height: 49px; filter: drop-shadow(0 4px 2px #0b7c941a); }
.quick-card strong { display: block; font-size: 13px; margin: 4px 0 5px; font-weight: 900; }
.quick-card small { display: block; font-size: 9px; line-height: 1.45; color: var(--muted); font-weight: 700; }
.card-arrow {
  position: absolute; right: 7px; top: 48%;
  width: 25px; height: 25px; display: grid; place-items: center;
  border-radius: 50%; background: linear-gradient(145deg, #26cbd3, #05809b);
  color: white; font-size: 23px; line-height: 1; box-shadow: 0 3px 6px #0062782b;
}

.daily-card {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 14px;
  align-items: center;
  margin: 13px 0;
  padding: 14px;
  border-radius: 17px;
  border: 1px solid #8ce8f0;
  background: linear-gradient(125deg, #d7ffff, #ffffff 85%);
  box-shadow: 0 6px 17px #056b8711, inset 0 1px white;
}
.daily-title { display: flex; align-items: center; gap: 10px; }
.daily-title > span { font-size: 33px; filter: drop-shadow(0 3px 3px #8b6a1120); }
.daily-title h2 { margin: 2px 0 0; font-size: 15px; color: var(--teal); }
.daily-copy h3 { font-size: 13px; margin: 10px 0 5px; }
.daily-copy p { margin: 0; font-size: 10px; line-height: 1.55; }
.daily-answer-area { min-width: 0; }
#dailyAnswers { display: grid; gap: 5px; }
.answer-option {
  width: 100%; padding: 7px 9px; border: 1px solid #9ee4f4;
  background: #ffffffd9; color: var(--ink); text-align: left;
  border-radius: 9px; font-weight: 800; font-size: 10px;
}
.answer-option:hover { background: #d7ffff; border-color: var(--aqua); }
.answer-option.correct { background: #d9ffeb; border-color: #4dc58d; }
.answer-option.wrong { background: #fff0f5; border-color: #f2a5c2; }
.answer-option:disabled { cursor: default; }
.feedback { color: var(--teal); font-size: 12px; font-weight: 900; }

.reading-preview, .progress-preview { margin: 17px 0; }
.section-heading {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 10px;
}
.section-heading h2 { margin: 3px 0 0; font-size: 18px; color: #096083; }
.topic-count {
  display: inline-block; font-size: 9px; padding: 4px 7px;
  color: white; vertical-align: middle; border-radius: 20px;
  background: linear-gradient(110deg, #14b6c7, #087b97);
}
.view-all {
  border: 0; color: #087e97; background: transparent;
  font-size: 10px; font-weight: 900; white-space: nowrap;
}
.view-all:hover { color: #03a9bb; text-decoration: underline; }

.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.topic-card {
  display: flex; align-items: center; gap: 6px;
  min-width: 0; min-height: 41px; padding: 6px;
  text-align: left; color: #075677;
  background: linear-gradient(120deg, #efffff, #d9fbff);
  border: 1px solid #83e2ef; border-radius: 10px;
  font-size: 9px; line-height: 1.2; font-weight: 900;
  box-shadow: inset 0 1px white;
  transition: .18s;
}
.topic-card:hover { background: white; border-color: #18bcca; transform: translateY(-2px); box-shadow: 0 4px 9px #076f8816; }
.topic-emoji {
  display: grid; place-items: center; flex: 0 0 27px;
  width: 27px; height: 27px; border: 1px solid #b9edf1;
  border-radius: 8px; background: linear-gradient(140deg, white, #d0ffff);
  font-size: 17px;
}
.topic-text { min-width: 0; }
.topic-text small { display: block; font-size: 8px; margin-top: 2px; color: var(--muted); font-weight: 700; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stat-card {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  padding: 10px 8px; border: 1px solid #95e7ef;
  border-radius: 12px; background: linear-gradient(130deg, white, #e5ffff);
}
.stat-icon { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; font-size: 17px; }
.stat-icon.gold { background: #fff2b5; }
.stat-icon.blue { background: #d6f3ff; }
.stat-icon.pink { background: #ffe0f3; }
.stat-icon.green { background: #d4fff0; }
.stat-card small { display: block; font-size: 8px; color: var(--muted); font-weight: 800; }
.stat-card strong { display: block; margin-top: 2px; font-size: 16px; overflow-wrap: anywhere; color: #087e99; }

.teacher-banner {
  display: flex; align-items: center; gap: 9px;
  padding: 12px; border: 1px solid #99e8f0;
  border-radius: 13px; background: linear-gradient(110deg, #e4ffff, white);
}
.teacher-icon { font-size: 28px; }
.teacher-banner strong { font-size: 11px; }
.teacher-banner p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.teacher-banner .view-all { margin-left: auto; }

.right-rail { min-width: 0; position: sticky; top: 89px; }
.rail-panel {
  border: 1px solid #6bdce8; border-radius: 19px; padding: 10px;
  background: linear-gradient(160deg, #ecffff, #c6faff 65%, #e8ffff);
  box-shadow: var(--shadow), inset 0 1px white;
}
.rail-title {
  display: flex; align-items: center; justify-content: space-between; gap: 7px;
  margin-bottom: 9px; padding: 3px 4px;
}
.rail-title h2 { margin: 0; font-size: 19px; color: #08708b; }
.rail-title h3 { margin: 0; font-size: 13px; color: #fff; }
.rail-title > button {
  padding: 5px 10px; border: 1px solid #a0eef2;
  border-radius: 18px; background: #ffffffa8; color: #08778f;
  font-size: 9px; font-weight: 900; white-space: nowrap;
}
.subrail-title {
  margin-top: 13px; border-radius: 20px; padding: 8px;
  color: white; background: linear-gradient(100deg, #07839a, #16b4c3);
  box-shadow: inset 0 1px #ffffff70;
}
.subrail-title > button { background: #ffffff22; color: white; border-color: #b1ffff70; }

.rail-balance {
  display: flex; align-items: center; gap: 7px; padding: 8px;
  background: #ffffffc9; border: 1px solid #b4edf1; border-radius: 12px;
}
.rail-balance > span { font-size: 23px; }
.rail-balance strong { font-size: 11px; white-space: nowrap; }
.rail-balance button, .featured-info button {
  margin-left: auto; padding: 7px 10px; border: 0; border-radius: 20px;
  background: linear-gradient(110deg, #16c0ca, #0786a0); color: white;
  font-size: 9px; font-weight: 900; box-shadow: 0 3px 8px #006c8418;
}
.featured-pet {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  padding: 10px 5px; margin-top: 8px;
  border-radius: 13px; background: linear-gradient(140deg, #fff, #d7ffff);
  border: 1px solid #a3e8ef;
}
.featured-art { font-size: 68px; line-height: 1.1; animation: petHover 3s ease-in-out infinite; }
.featured-info { min-width: 0; flex: 1; }
.featured-info strong, .featured-info small, .featured-info span { display: block; }
.featured-info strong { font-size: 14px; }
.featured-info small { margin: 3px 0 6px; font-size: 10px; color: var(--muted); }
.featured-info span { color: #a67a0b; font-size: 12px; font-weight: 900; }

.mini-pets { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.mini-pet {
  min-width: 0; padding: 7px 3px; border: 1px solid #9ce9ef;
  border-radius: 11px; background: #ffffffcf; text-align: center; color: var(--ink);
}
.mini-pet:hover { border-color: #06b7c8; background: white; }
.mini-pet-art { font-size: 33px; display: block; filter: drop-shadow(0 4px 3px #08798b16); }
.mini-pet strong { display: block; margin-top: 4px; font-size: 9px; overflow-wrap: anywhere; }
.mini-pet small { display: block; color: #b18513; font-size: 9px; margin-top: 3px; font-weight: 900; }

.featured-items { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.featured-item {
  min-width: 0; border: 1px solid #a5ebf0; border-radius: 11px;
  background: #ffffffc9; padding: 7px 3px; text-align: center;
}
.featured-item .item-art { display: block; font-size: 33px; }
.featured-item strong { display: block; font-size: 8px; line-height: 1.3; min-height: 22px; }
.featured-item small { display: block; margin-top: 4px; color: #9e760b; font-size: 9px; font-weight: 900; }

.shop-promo {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin-top: 10px; padding: 10px; border: 1px solid #5edce8;
  border-radius: 13px; text-align: left; color: white;
  background: linear-gradient(115deg, #087a98, #17bcc8);
  box-shadow: inset 0 1px #ffffff70;
}
.promo-pet { font-size: 41px; animation: petHover 3.5s ease-in-out infinite; }
.shop-promo strong { display: block; font-size: 10px; line-height: 1.45; }
.shop-promo small { display: block; margin-top: 5px; color: #d3ffff; font-weight: 900; font-size: 9px; }

.teacher-rail {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; background: linear-gradient(120deg, white, #d6ffff);
}
.teacher-rail .teacher-icon { font-size: 28px; }
.teacher-rail strong { font-size: 10px; }
.teacher-rail p { color: var(--muted); font-size: 9px; line-height: 1.5; }
.teacher-rail button { padding: 0; border: 0; background: none; color: var(--teal); font-size: 9px; font-weight: 900; }

.flying-layer { position: fixed; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; }
.flying-pet {
  position: absolute; left: var(--x); top: var(--y);
  font-size: var(--size); filter: drop-shadow(0 5px 6px #066b8525);
  animation: petFlight var(--speed) ease-in-out infinite alternate;
  opacity: .9;
}
@keyframes petFlight {
  0% { transform: translate(0,0) rotate(-7deg); }
  25% { transform: translate(28px,-25px) rotate(8deg); }
  55% { transform: translate(-12px,15px) rotate(-5deg); }
  100% { transform: translate(20px,-36px) rotate(6deg); }
}

.page { display: none; animation: pageReveal .3s ease; }
.page.visible { display: block; }
@keyframes pageReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { margin: 8px 0 18px; }
.page-heading h1 { margin: 6px 0; color: var(--deep); font-size: clamp(25px, 3vw, 36px); }
.page-heading p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.filter-row { display: grid; grid-template-columns: 1fr 190px; gap: 8px; margin-bottom: 13px; }

input, select, textarea {
  width: 100%; min-width: 0; border: 1px solid #91dfea;
  border-radius: 11px; padding: 11px 13px;
  color: var(--ink); background: #ffffffeb;
}
textarea { resize: vertical; }
label { display: block; margin: 12px 0 5px; font-size: 12px; font-weight: 900; }
.detail-panel {
  margin: 16px 0; padding: 20px; border: 1px solid #98e6ef;
  border-radius: 17px; background: linear-gradient(135deg, white, #e6ffff);
  box-shadow: var(--shadow), inset 0 1px white;
}
.detail-panel h2 { margin-top: 0; color: #08718b; }
.detail-panel p, .detail-panel li { line-height: 1.65; font-size: 13px; }
.big-emoji { font-size: 43px; }
.main-button {
  border: 0; border-radius: 12px; padding: 11px 16px;
  color: white; background: linear-gradient(110deg, #0c9bad, #22c7ca);
  box-shadow: 0 5px 13px #087c921f; font-weight: 900;
}
.main-button:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.soft-button { border: 1px solid #9ce8ee; border-radius: 11px; background: #e5ffff; padding: 10px 14px; color: var(--teal); font-weight: 900; }
.subject-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 13px; }
.subject-card {
  min-width: 0; padding: 13px; text-align: left; color: var(--ink);
  border: 1px solid #8ce1ed; border-radius: 15px; background: linear-gradient(135deg, white, #e0ffff);
  transition: .2s;
}
.subject-card:hover { transform: translateY(-3px); border-color: var(--aqua); box-shadow: var(--shadow); }
.subject-card .subject-icon { display: block; font-size: 31px; margin-bottom: 6px; }
.subject-card strong { display: block; font-size: 12px; }
.subject-card small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; font-size: 10px; }
.inline-topics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.inline-topics button { padding: 8px 12px; border: 1px solid #8fe3ed; border-radius: 24px; background: white; color: var(--teal); font-size: 11px; font-weight: 800; }
.inline-topics button:hover { background: #d9ffff; }

.quiz-panel { max-width: 700px; margin-inline: auto; }
.quiz-option {
  display: block; width: 100%; margin: 8px 0; padding: 12px;
  border: 1px solid #91e2ef; border-radius: 11px; background: white; color: var(--ink);
  text-align: left; font-weight: 800;
}
.quiz-option:hover { background: #e6ffff; }
.quiz-option.correct { background: #d9ffeb; border-color: #53c98c; }
.quiz-option.wrong { background: #fff0f5; border-color: #f4a1c0; }

.shop-page-balance { display: inline-block; margin-bottom: 13px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 25px; background: white; }
.shop-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 15px; }
.shop-tab { padding: 9px 13px; border-radius: 25px; border: 1px solid var(--line); background: white; color: var(--teal); font-size: 11px; font-weight: 900; }
.shop-tab.active, .shop-tab:hover { background: linear-gradient(100deg, #0b90a6, #27c8cb); color: white; border-color: transparent; }
.shop-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.shop-card, .pet-card {
  min-width: 0; padding: 11px; border: 1px solid #91e3ef;
  border-radius: 16px; background: linear-gradient(135deg, white, #e1ffff);
  text-align: center; box-shadow: 0 5px 14px #075b7810;
}
.shop-card:hover, .pet-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.shop-art, .pet-art {
  display: grid; place-items: center; min-height: 86px; margin-bottom: 8px;
  border-radius: 12px; font-size: 56px;
  background: radial-gradient(circle at 48% 35%, white, #c6fbff 80%);
  filter: drop-shadow(0 4px 4px #047c9810);
  animation: petHover 4s ease-in-out infinite;
}
.shop-card h3, .pet-card h3 { margin: 5px 0; font-size: 13px; color: #086b87; }
.shop-card p, .pet-card p { min-height: 31px; font-size: 10px; line-height: 1.4; color: var(--muted); }
.item-price { color: #a47a0e; font-size: 12px; font-weight: 900; margin: 9px 0; }
.shop-card .main-button, .pet-card .main-button { width: 100%; padding: 9px; font-size: 10px; }
.owned-label { display: inline-block; padding: 7px 10px; border-radius: 20px; background: #d9ffec; color: #17744b; font-size: 10px; font-weight: 900; }
.fine-print { color: var(--muted); font-size: 11px; }
.pet-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.pet-card.selected { border: 2px solid #19bcc9; background: #ddffff; }
.rename-row { display: flex; gap: 8px; }
.rename-row .main-button { flex: 0 0 auto; }
.big-stats { margin: 15px 0; }
#collection { display: flex; flex-wrap: wrap; gap: 6px; }

.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 22px;
  transform: translate(-50%, 25px); opacity: 0; pointer-events: none;
  padding: 13px 20px; border: 1px solid #93f2f3; border-radius: 30px;
  background: linear-gradient(100deg, #07576c, #098ba0); color: white;
  font-size: 12px; font-weight: 900; text-align: center;
  box-shadow: 0 8px 25px #00394e45; transition: .25s;
  max-width: calc(100vw - 28px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { padding: 22px 10px; text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); }
footer span { color: #05b8c7; padding: 0 6px; }

@media (min-width: 1550px) {
  .app-layout { grid-template-columns: 200px minmax(500px,1fr) 325px; gap: 16px; }
  .hero { min-height: 230px; }
  .topic-card { min-height: 45px; font-size: 10px; }
  .quick-card { padding: 17px 12px; }
}

@media (max-width: 1200px) {
  .app-layout { grid-template-columns: 155px minmax(0,1fr); }
  .right-rail { position: static; grid-column: 2; }
  .shop-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .shop-rail > .rail-title:first-child, .rail-balance, .featured-pet, .shop-promo { grid-column: 1 / -1; }
  .subrail-title { margin-top: 0; }
  .teacher-rail { grid-column: 2; }
}

@media (max-width: 760px) {
  .topbar { padding: 9px 11px; }
  .brand strong { font-size: 19px; }
  .brand-mark { font-size: 26px; width: 35px; }
  .brand small { font-size: 9px; }
  .points-pill { padding: 8px 10px; gap: 4px; font-size: 11px; }
  .points-pill b { font-size: 13px; }
  .round-action { width: 36px; height: 36px; font-size: 18px; }
  .app-layout { display: flex; flex-direction: column; padding: 10px; gap: 12px; }
  .sidebar { position: static; min-height: auto; width: 100%; display: flex; gap: 4px; overflow-x: auto; padding: 8px; border-radius: 14px; }
  .sidebar-logo, .sidebar-motto, .sidebar-pet { display: none; }
  .nav-link { width: auto; flex: 0 0 auto; white-space: nowrap; margin: 0; padding: 9px 11px; font-size: 11px; }
  .nav-link span { font-size: 16px; min-width: 18px; }
  .main-column, .right-rail { width: 100%; }
  .right-rail { order: 2; }
  .hero { min-height: 210px; padding: 20px; }
  .hero h1 { font-size: 35px; }
  .hero-art { min-height: 115px; }
  .hero-dragon { font-size: 85px; }
  .castle { font-size: 43px; }
  .orbit-one { width: 120px; height: 120px; }
  .orbit-two { width: 155px; }
  .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quick-card { padding: 14px 9px; }
  .quick-card small { font-size: 10px; }
  .daily-card { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shop-rail { display: block; }
  .shop-rail > .rail-title:first-child, .rail-balance, .featured-pet, .shop-promo { grid-column: auto; }
  .subrail-title { margin-top: 13px; }
  .subject-grid, .shop-grid, .pet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-row { grid-template-columns: 1fr; }
  .teacher-rail { width: 100%; }
}

@media (max-width: 390px) {
  .brand small { display: none; }
  .points-pill span { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 100px; }
  .topic-grid { grid-template-columns: 1fr; }
  .subject-grid, .shop-grid, .pet-grid { grid-template-columns: 1fr; }
  .section-heading h2 { font-size: 16px; }
}
