:root {
  --ink: #25234a;
  --muted: #767692;
  --primary: #5c5ce6;
  --primary-dark: #4848bf;
  --lavender: #eeeefe;
  --peach: #fff1df;
  --mint: #e4faf2;
  --yellow: #fff4ba;
  --line: #e8e7f6;
  --panel: rgba(255,255,255,.93);
  --shadow: 0 18px 45px rgba(72, 66, 145, .13);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #f7f6ff;
}

/* mc-web powered "我的家". The iframe isolates the upstream WebGL runtime from
   the learning app while the same-origin bridge syncs account entitlements. */
.among-world-stage.mc-home-stage {
  width: min(1120px,100%);
  max-width: 1120px;
  height: min(76dvh,720px);
  aspect-ratio: 16 / 9;
  touch-action: none;
  border-color: rgba(255,255,255,.92);
  background: #05080d;
}
.mc-home-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: #05080d;
}
.mc-home-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  padding: 24px;
  color: #f7fff3;
  background: radial-gradient(circle at 50% 36%,#547d49 0,#243a2b 42%,#101a17 100%);
  text-align: center;
  transition: opacity .35s ease,visibility .35s ease;
  pointer-events: none;
}
.mc-home-loading strong { font-size: clamp(17px,3vw,25px); }
.mc-home-loading small { max-width: 480px; color: #d5e8d0; font-weight: 750; line-height: 1.6; }
.mc-home-loading-cube {
  width: 52px;
  height: 52px;
  border: 5px solid #9e7542;
  background: linear-gradient(#65a253 0 28%,#73522e 28%);
  box-shadow: inset -8px -8px 0 rgba(0,0,0,.12),0 10px 24px rgba(0,0,0,.3);
  animation: mc-home-cube 1.2s ease-in-out infinite;
}
.mc-home-stage.mc-home-ready .mc-home-loading { opacity: 0; visibility: hidden; }
.mc-home-stage .among-world-home-button { z-index: 4; }
.mc-home-stage > .among-world-home-button { display: none !important; }
@keyframes mc-home-cube {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}
body.among-world-fullscreen-mode .among-world-stage.mc-home-stage,
.among-world-stage.mc-home-stage:fullscreen {
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  aspect-ratio: auto;
  background: #05080d;
}
@media (max-width:620px) {
  .among-world-stage.mc-home-stage { width: 100%; height: min(80dvh,720px); aspect-ratio: 9 / 16; }
}
@media (prefers-reduced-motion:reduce) {
  .mc-home-loading,.mc-home-loading-cube { transition:none; animation:none; }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f7f6ff; }
#background-music { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; clip-path: inset(50%); }
.app-background { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(145deg, #f4f2ff 0%, #fffaf6 48%, #edfafa 100%); }
.app-background::before, .app-background::after { content: ""; position: absolute; border-radius: 999px; filter: blur(2px); opacity: .52; }
.app-background::before { width: 42vw; height: 42vw; left: -13vw; top: 12vh; background: #dcdcff; }
.app-background::after { width: 36vw; height: 36vw; right: -11vw; bottom: 4vh; background: #d5f5e9; }
.screen { min-height: 100vh; }
.login-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center start;
  overflow: hidden;
  padding: clamp(28px, 6vw, 82px);
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url('assets/backgrounds/login-characters-wallpaper.png');
  background-size: cover;
  background-position: center;
}
.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(15, 22, 58, .54) 0%, rgba(30, 30, 76, .3) 34%, rgba(12, 13, 34, .08) 68%, rgba(12, 13, 34, .18) 100%);
}
.login-card { position: relative; z-index: 1; width: min(100%, 480px); padding: 42px 38px 34px; text-align: center; background: rgba(255, 255, 255, .74); border: 1px solid rgba(255,255,255,.9); border-radius: 30px; box-shadow: 0 22px 60px rgba(17, 18, 52, .24); backdrop-filter: blur(18px) saturate(1.14); }
.center-logo { position: absolute; z-index: 2; top: clamp(18px, 3vw, 36px); right: clamp(18px, 4vw, 58px); width: clamp(150px, 17vw, 260px); height: auto; padding: 9px 13px; border-radius: 16px; background: rgba(255,255,255,.78); box-shadow: 0 14px 34px rgba(15, 20, 55, .16); backdrop-filter: blur(10px); }
.app-screen {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background: transparent;
  --panel: rgba(255,255,255,.84);
  --shadow: 0 18px 48px rgba(31, 35, 78, .18);
}
.app-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: url('assets/backgrounds/login-characters-wallpaper.png');
  background-size: cover;
  background-position: center;
}
.app-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(247,246,255,.84) 0%, rgba(247,246,255,.7) 42%, rgba(255,250,246,.82) 100%);
}
.app-screen .topbar,
.app-screen .main-nav,
.app-screen .panel-card,
.app-screen .pet-skills-panel,
.app-screen .pet-stats-under-card,
.app-screen .owned-equipment-panel,
.app-screen .pet-collection-panel,
.app-screen .message-wall-composer,
.app-screen .wall-post-card,
.app-screen .shop-item,
.app-screen .subject-card,
.app-screen .checkin-card,
.app-screen .question-card,
.app-screen .history-row {
  background: rgba(255, 255, 255, .84);
  border-color: rgba(255,255,255,.72);
  box-shadow: 0 18px 46px rgba(31, 35, 78, .16);
  backdrop-filter: blur(18px) saturate(1.1);
}
.app-screen .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-screen .nav-button.active,
.app-screen .student-chip {
  background: rgba(255,255,255,.9);
}
.brand-mark { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 24px; background: linear-gradient(145deg, #7979ee, #5252cc); color: white; font-size: 38px; box-shadow: 0 12px 24px rgba(92,92,230,.26); transform: rotate(-4deg); }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(30px, 6vw, 42px); letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: clamp(25px, 4vw, 35px); letter-spacing: -.035em; }
h3 { margin-bottom: 0; font-size: 20px; letter-spacing: -.025em; }
.hero-copy { margin: 0 auto 30px; color: var(--muted); line-height: 1.7; }
.login-form { display: grid; gap: 10px; text-align: left; }
.login-form label { font-weight: 750; font-size: 14px; }
.login-form input { width: 100%; padding: 15px 16px; border: 2px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: #fff; transition: .2s ease; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(92,92,230,.12); }
.register-id-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; overflow: hidden; border: 2px solid var(--line); border-radius: 14px; background: #fff; transition: .2s ease; }
.register-id-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(92,92,230,.12); }
.register-id-prefix { display: grid; place-items: center; min-width: 62px; align-self: stretch; color: #4d49bb; background: linear-gradient(135deg, #f0efff, #fff7cf); font-weight: 1000; letter-spacing: 0; }
.login-form .register-id-field input { border: 0; border-radius: 0; box-shadow: none; }
.login-form .register-id-field input:focus { border-color: transparent; box-shadow: none; }
.login-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; padding: 5px; border: 1px solid rgba(96,91,198,.16); border-radius: 16px; background: rgba(255,255,255,.68); }
.login-mode-button { min-height: 42px; border: 0; border-radius: 12px; color: #5d5a90; background: transparent; font-weight: 950; cursor: pointer; }
.login-mode-button.active { color: white; background: linear-gradient(135deg, var(--primary), #49bea7); box-shadow: 0 10px 22px rgba(85,82,220,.18); }
.register-form { margin-top: 0; }
.primary-button, .secondary-button, .icon-button { border: 0; border-radius: 13px; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary-button { padding: 14px 18px; color: white; background: linear-gradient(135deg, var(--primary), #8181f5); box-shadow: 0 9px 20px rgba(92,92,230,.22); }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.primary-button:active, .secondary-button:active { transform: translateY(0); }
.secondary-button { padding: 13px 16px; color: var(--primary-dark); background: var(--lavender); }
button.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: wait; pointer-events: none; }
.button-spinner { flex: 0 0 auto; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: button-spin .7s linear infinite; }
.primary-button .button-spinner { border-color: rgba(255,255,255,.62); border-right-color: transparent; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.full-width { width: 100%; }
.demo-login { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.text-button { padding: 4px 7px; border: 0; color: var(--primary); background: transparent; font-weight: 800; }
.text-button:hover { text-decoration: underline; }
.text-button.subtle { color: #9695ae; font-weight: 600; }
.form-error { min-height: 20px; margin: 12px 0 0; color: #d84b69; font-size: 13px; font-weight: 700; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px max(24px, calc((100vw - 1180px)/2)); background: rgba(255,255,255,.72); border-bottom: 1px solid rgba(232,231,246,.8); backdrop-filter: blur(14px); }
.brand-lockup, .topbar-actions, .student-chip, .welcome-row, .section-title-row, .panel-heading, .pet-progress-row, .streak-pill, .date-card, .wallet-card { display: flex; align-items: center; }
.panel-heading > div { display: block; }
.brand-lockup { gap: 11px; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 15px; }
.brand-lockup span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: var(--primary); font-size: 21px; }
.app-logo-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 12px; border: 1px solid rgba(255,255,255,.78); border-radius: 17px; background: rgba(255,255,255,.66); box-shadow: 0 10px 28px rgba(31,35,78,.1); backdrop-filter: blur(12px); }
.app-header-logo { display: block; width: clamp(168px, 18vw, 260px); height: auto; max-height: 64px; object-fit: contain; }
.app-logo-lockup #holiday-status { min-width: max-content; margin: 0; color: #605f86; font-size: 13px; font-weight: 900; }
.topbar-actions { gap: 12px; }
.student-chip { gap: 8px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 13px; font-weight: 800; }
.student-chip span:first-child { display: grid; place-items: center; width: 27px; height: 27px; overflow: hidden; border-radius: 50%; background: var(--yellow); }
.student-chip-avatar-image { width: 100%; height: 100%; object-fit: cover; }
.icon-button { width: 39px; height: 39px; color: var(--primary-dark); background: var(--lavender); font-size: 19px; }
.page-shell { width: min(100% - 40px, 1180px); margin: 0 auto; padding: 0 0 24px; }
.story-title-banner {
  position: relative;
  display: grid;
  height: clamp(154px, 17vw, 218px);
  margin: 0 0 26px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 0 0 28px 28px;
  background: #f7f1ff;
  box-shadow: 0 22px 46px rgba(72,66,145,.16);
  isolation: isolate;
}
.story-title-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 38%, rgba(81,61,172,.08));
  pointer-events: none;
  z-index: 1;
}
.story-title-banner-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.story-title-banner-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: inherit;
  padding: 24px 24px 20px;
  text-align: center;
}
.story-title-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 3px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 999px;
  color: #4f48c8;
  background: rgba(255,255,255,.8);
  box-shadow: 0 10px 24px rgba(72,66,145,.12);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0;
}
.story-logo-text {
  position: relative;
  margin: 0;
  color: #5d53e7;
  background: linear-gradient(180deg, #ffffff 0%, #fff0a3 22%, #7a70ff 52%, #33286f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 3px rgba(255,255,255,.96);
  font-size: 62px;
  line-height: 1;
  letter-spacing: 0;
  filter: drop-shadow(0 8px 0 rgba(74,62,164,.2)) drop-shadow(0 18px 26px rgba(45,37,112,.28));
}
.story-logo-text::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  -webkit-text-fill-color: #4b3dc8;
  -webkit-text-stroke: 9px rgba(75,61,200,.7);
}
.story-logo-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.86) 48%, transparent 67%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: .54;
}
.story-logo-sparkles {
  display: block;
  margin-top: 2px;
  color: #ffe07a;
  font-size: 20px;
  text-shadow: 0 3px 0 rgba(80,64,170,.18), 0 8px 16px rgba(80,64,170,.2);
}
.welcome-row { justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.welcome-row > div:first-child { padding-left: clamp(72px, 9vw, 164px); }
.welcome-profile { display: flex; align-items: center; gap: 18px; min-width: 0; }
.welcome-copy { min-width: 0; }
.avatar-upload-control { display: grid; grid-template-columns: 96px; justify-items: center; gap: 8px; flex: 0 0 auto; color: #514b9d; cursor: pointer; }
.avatar-upload-preview { display: grid; place-items: center; width: 96px; height: 96px; overflow: hidden; border: 4px solid rgba(255,255,255,.9); border-radius: 50%; background: linear-gradient(145deg, #fff3c0, #eceaff); box-shadow: 0 18px 36px rgba(72,66,145,.19); font-size: 40px; }
.avatar-upload-image { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-text { padding: 5px 9px; border-radius: 999px; color: #4d48b8; background: rgba(255,255,255,.82); font-size: 12px; font-weight: 950; box-shadow: 0 8px 18px rgba(72,66,145,.1); }
.avatar-upload-control:hover .avatar-upload-preview { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(72,66,145,.2); }
.welcome-row h2 { margin-bottom: 3px; }
.editable-name-button {
  display: inline-flex;
  max-width: min(100%, 520px);
  min-height: 34px;
  align-items: center;
  padding: 0 4px;
  border: 0;
  border-bottom: 2px dotted rgba(92,92,230,.35);
  border-radius: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: text;
}
.editable-name-button:hover, .editable-name-button:focus-visible {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  outline: none;
}
.home-name-form {
  display: inline-flex;
  max-width: min(100%, 520px);
  min-height: 38px;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}
.home-name-form input {
  width: min(42vw, 260px);
  min-width: 120px;
  height: 38px;
  padding: 6px 10px;
  border: 2px solid rgba(92,92,230,.28);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255,255,255,.96);
  font: inherit;
  font-size: max(16px, .82em);
  font-weight: 900;
  outline: none;
}
.home-name-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,92,230,.12);
}
.home-name-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(92,92,230,.18);
  border-radius: 50%;
  color: var(--primary-dark);
  background: #fff;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
}
.home-name-action:hover, .home-name-action:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(92,92,230,.13);
  outline: none;
}
.muted-text { color: var(--muted); font-size: 14px; line-height: 1.6; }
.streak-pill, .wallet-card, .date-card { gap: 7px; padding: 11px 14px; border: 1px solid #f2dfa9; border-radius: 999px; color: #87670e; background: #fff9d9; white-space: nowrap; font-size: 13px; }
.streak-pill strong { font-size: 19px; color: #5d4c15; }
.main-nav { display: flex; gap: 7px; width: max-content; max-width: 100%; margin-bottom: 26px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); overflow-x: auto; }
.nav-button { padding: 10px 17px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; white-space: nowrap; }
.nav-button.active { color: var(--primary-dark); background: white; box-shadow: 0 5px 13px rgba(67,65,128,.09); }
.view { display: none; animation: fade-up .24s ease; }
.view.active { display: block; }
@keyframes fade-up { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(310px, .72fr); gap: 22px; }
.home-top-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.home-top-panels > article { height: 100%; }
.pet-dashboard-grid { grid-template-columns: minmax(0, 1fr); }
.side-column { display: grid; align-content: start; gap: 22px; }
.panel-card { border: 1px solid rgba(232,231,246,.9); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding: 26px;
}
.guide-hero h2 {
  margin-bottom: 6px;
}
.guide-hero .muted-text {
  max-width: 720px;
  margin-bottom: 0;
}
.guide-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.guide-chapter {
  margin-bottom: 28px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.guide-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 22px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 18px 46px rgba(31,35,78,.15);
  backdrop-filter: blur(18px) saturate(1.08);
}
.guide-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: linear-gradient(145deg, #edeaff, #fff8e6);
}
.guide-card-copy {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 18px;
}
.guide-card-copy span {
  width: max-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  color: #276b54;
  background: #e4f7ee;
  font-size: 12px;
  font-weight: 900;
}
.guide-card-copy h3 {
  color: var(--primary-dark);
  font-size: 24px;
}
.guide-card-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}
.guide-card-copy .secondary-button {
  justify-self: start;
  margin-top: 4px;
}
.pet-interaction-panel { display: grid; gap: 18px; padding: 22px; overflow: hidden; }
.pet-interaction-panel.pet-wall-lobby-only .pet-scene-switcher,
.pet-interaction-panel.pet-wall-lobby-only .pet-interaction-share-button,
.pet-interaction-panel.pet-wall-lobby-only .pet-interaction-stage,
.pet-interaction-panel.pet-wall-lobby-only .pet-food-tray,
.pet-interaction-panel.pet-wall-lobby-only .pet-furniture-tray,
.pet-interaction-panel.pet-wall-lobby-only .shared-room-panel,
.pet-interaction-panel.pet-wall-lobby-only .room-chat-panel,
.pet-interaction-panel.pet-wall-lobby-only .pet-interaction-controls { display: none; }
.pet-interaction-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.pet-interaction-heading h2 { margin-bottom: 0; }
.pet-interaction-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.pet-scene-switcher { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pet-scene-switcher.single-scene { display: none; }
.scene-button { min-height: 43px; padding: 10px 14px; border: 2px solid #dfdcfb; border-radius: 999px; color: var(--primary-dark); background: rgba(255,255,255,.82); font-weight: 900; box-shadow: 0 8px 18px rgba(72,66,145,.09); }
.scene-button.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--primary), #7e7cf2); }
.pet-interaction-share-button { min-height: 43px; padding: 10px 15px; white-space: nowrap; }
.pet-interaction-stage { position: relative; overflow: hidden; min-height: 420px; aspect-ratio: 16 / 9; border: 2px solid rgba(255,255,255,.8); border-radius: 26px; background: #dff8d1 center / cover no-repeat; box-shadow: inset 0 -50px 90px rgba(28,32,72,.14), 0 18px 36px rgba(31,35,78,.15); isolation: isolate; touch-action: manipulation; }
.pet-interaction-stage[data-scene="home"] { background-image: url('assets/pet-interactions/scenes/blank-meadow-builder.png'); }
.pet-interaction-stage.feeding-ready { border-color: rgba(119,234,138,.95); box-shadow: inset 0 -50px 90px rgba(28,32,72,.14), 0 0 0 5px rgba(119,234,138,.25), 0 18px 36px rgba(31,35,78,.15); }
.pet-interaction-stage.placing-furniture { border-color: rgba(86,183,255,.88); box-shadow: inset 0 -50px 90px rgba(28,32,72,.14), 0 0 0 5px rgba(86,183,255,.18), 0 18px 36px rgba(31,35,78,.15); }
.pet-interaction-stage.placing-furniture::before { content: ""; position: absolute; left: 5%; right: 5%; bottom: 6%; height: 58%; z-index: 4; border: 2px solid rgba(86,183,255,.34); border-radius: 18px; background: rgba(161,218,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.34); pointer-events: none; backdrop-filter: blur(1px); }
.pet-interaction-stage::after { content: ""; position: absolute; inset: auto 0 0; height: 42%; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,0), rgba(17,26,49,.08)); }
.pet-placed-furniture-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pet-builder-grid { position: absolute; left: 5%; right: 5%; bottom: 6%; z-index: 5; display: grid; grid-template-columns: repeat(var(--builder-cols, 20), minmax(0, 1fr)); grid-template-rows: repeat(var(--builder-rows, 10), minmax(0, 1fr)); gap: 2px; height: 58%; opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
.pet-interaction-stage.placing-furniture .pet-builder-grid { opacity: 1; pointer-events: auto; transform: translateY(0); }
.pet-builder-cell { min-width: 0; min-height: 0; border: 1px dashed rgba(45,127,207,.46); border-radius: 7px; background: rgba(86, 183, 255, .18); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); cursor: copy; }
.pet-builder-cell:hover, .pet-builder-cell:focus-visible { border-color: rgba(45,127,207,.78); background: rgba(86,183,255,.32); outline: none; }
.placed-furniture { position: absolute; left: var(--decor-left); bottom: var(--decor-bottom); z-index: calc(2 + var(--decor-layer, 1)); display: grid; place-items: center; width: clamp(54px, 7vw, 104px); height: clamp(54px, 7vw, 104px); padding: 0; border: 0; background: transparent; filter: drop-shadow(0 14px 10px rgba(26,44,54,.18)); transform: translate(-50%, 12%); pointer-events: auto; cursor: pointer; transition: transform .18s ease, filter .18s ease; }
.placed-furniture span { display: block; font-size: calc(clamp(42px, 5.4vw, 76px) * var(--decor-size, 1)); line-height: 1; }
.placed-furniture img { display: block; width: calc(100% * var(--decor-size, 1)); height: calc(100% * var(--decor-size, 1)); object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.placed-furniture:hover, .placed-furniture:focus-visible { outline: none; filter: drop-shadow(0 16px 12px rgba(45,60,100,.22)); transform: translate(-50%, 7%) scale(1.06); }
.pet-interaction-track { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pet-interaction-pet { position: absolute; left: var(--pet-x, 50%); bottom: calc(var(--pet-y, 0) * 1%); z-index: 3; width: clamp(104px, 15vw, 168px); max-height: calc(100% - 28px); aspect-ratio: 1; padding: 0; border: 0; background: transparent; filter: drop-shadow(0 18px 12px rgba(36,45,70,.24)); transform: translateX(-50%) scale(var(--pet-scale, 1)); transform-origin: 50% 100%; transition: left 1.85s cubic-bezier(.22,.78,.26,1), transform .35s ease, filter .35s ease; pointer-events: auto; }
.pet-interaction-name { position: absolute; left: 50%; top: -13px; z-index: 4; max-width: 150%; padding: 7px 13px; border: 2px solid rgba(255,255,255,.78); border-radius: 999px; color: #245e32; background: rgba(255,255,255,.86); box-shadow: 0 10px 24px rgba(29,64,43,.16); font-size: 15px; font-weight: 1000; line-height: 1; white-space: nowrap; transform: translate(-50%, -100%); backdrop-filter: blur(10px); }
.pet-interaction-pet::before { content: ""; position: absolute; left: 50%; bottom: 9%; width: 42%; height: 8%; border-radius: 999px; background: rgba(34,54,35,.2); transform: translateX(-50%); filter: blur(2px); animation: creeper-footsteps 1.1s ease-in-out infinite; }
.pet-interaction-pet img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; transform: scaleX(var(--pet-dir, 1)); transform-origin: 50% 90%; animation: creeper-idle 2.4s ease-in-out infinite; }
.pet-interaction-pet:focus-visible { outline: 4px solid rgba(255,255,255,.95); outline-offset: 5px; border-radius: 24px; }
.pet-interaction-pet[data-pet-action="walk"] img { animation: creeper-walk 1.1s ease-in-out infinite; }
.pet-interaction-pet[data-pet-action="run"] { transition-duration: .75s; filter: drop-shadow(0 18px 12px rgba(36,45,70,.24)) saturate(1.12); }
.pet-interaction-pet[data-pet-action="run"] img { animation: creeper-run .55s ease-in-out infinite; }
.pet-interaction-pet[data-pet-action="sleep"] img { animation: creeper-sleep 2.7s ease-in-out infinite; filter: saturate(.88); }
.pet-interaction-pet[data-pet-action="wave"] { z-index: 5; }
.pet-interaction-pet[data-pet-action="wave"] img { animation: creeper-wave 1.05s ease-in-out infinite; }
.pet-interaction-pet[data-pet-action="explode"] { z-index: 5; }
.pet-interaction-pet[data-pet-action="explode"] img { animation: creeper-explode-body 1.2s ease-in-out both; }
.pet-interaction-pet[data-pet-action="feed"] { z-index: 5; transition-duration: .25s; }
.pet-interaction-pet[data-pet-action="feed"] img { animation: creeper-feed-bounce .72s cubic-bezier(.2,.9,.28,1.08) both; }
.pet-interaction-pet.being-fed img { animation: creeper-feed-bounce .72s cubic-bezier(.2,.9,.28,1.08) both; }
.pet-interaction-pet[data-pet-movement="fly_bounded"]::before,
.pet-interaction-pet[data-pet-movement="hover_bounded"]::before { opacity: 0; }
.pet-interaction-pet[data-pet-movement="fly_bounded"] img,
.pet-interaction-pet[data-pet-movement="hover_bounded"] img { animation: pet-float 2.15s ease-in-out infinite; }
.pet-interaction-pet[data-pet-movement="fly_bounded"][data-pet-action="run"] img,
.pet-interaction-pet[data-pet-movement="hover_bounded"][data-pet-action="run"] img { animation: pet-fly-dash .74s ease-in-out infinite; }
.pet-interaction-pet[data-pet-movement="fly_bounded"][data-pet-action="sleep"] img,
.pet-interaction-pet[data-pet-movement="hover_bounded"][data-pet-action="sleep"] img { animation: pet-float-sleep 2.9s ease-in-out infinite; filter: saturate(.9); }
.pet-interaction-pet[data-pet-movement="fly_bounded"][data-pet-action="wave"] img,
.pet-interaction-pet[data-pet-movement="hover_bounded"][data-pet-action="wave"] img { animation: pet-float-wave 1.05s ease-in-out infinite; }
.pet-interaction-pet[data-pet-movement="fly_bounded"][data-pet-action="feed"] img,
.pet-interaction-pet[data-pet-movement="hover_bounded"][data-pet-action="feed"] img { animation: pet-float-feed .82s cubic-bezier(.2,.9,.28,1.08) both; }
.pet-interaction-pet[data-pet-movement="fly_bounded"].being-fed img,
.pet-interaction-pet[data-pet-movement="hover_bounded"].being-fed img { animation: pet-float-feed .82s cubic-bezier(.2,.9,.28,1.08) both; }
.pet-interaction-effects { position: absolute; left: var(--pet-x, 50%); bottom: calc(var(--pet-y, 0) * 1% + 18%); z-index: 8; width: min(250px, 44vw); height: min(190px, 34vw); pointer-events: none; transform: translateX(-50%) scale(var(--pet-scale, 1)); transform-origin: 50% 100%; opacity: 0; }
.pet-interaction-effects[data-pet-action="explode"] { opacity: 1; animation: creeper-effect-pop 1.25s ease-out both; }
.pet-interaction-effects[data-pet-action="feed"] { opacity: 1; animation: creeper-heart-pop 1.25s ease-out both; }
.pet-interaction-effects span { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%); padding: 7px 13px; border-radius: 999px; color: #23612e; background: rgba(255,255,255,.84); font-weight: 1000; box-shadow: 0 10px 22px rgba(29,64,43,.18); }
.pet-interaction-effects i { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; border-radius: 5px; background: #85e772; box-shadow: 0 0 0 4px rgba(255,255,255,.22); animation: creeper-pixel-burst 1.05s ease-out both; }
.pet-interaction-effects .pet-heart { top: 12%; width: auto; height: auto; border-radius: 0; color: #ff5c94; background: transparent; box-shadow: none; font-size: 32px; font-style: normal; line-height: 1; text-shadow: 0 5px 12px rgba(155,54,104,.2); animation: creeper-heart-rise 1.15s ease-out both; }
.pet-interaction-effects .pet-heart:nth-child(2) { --heart-x: -46px; --heart-y: -72px; animation-delay: .02s; }
.pet-interaction-effects .pet-heart:nth-child(3) { --heart-x: 8px; --heart-y: -96px; color: #ff8db1; animation-delay: .12s; }
.pet-interaction-effects .pet-heart:nth-child(4) { --heart-x: 52px; --heart-y: -70px; color: #f54d83; animation-delay: .21s; }
.pet-interaction-effects i:nth-child(2) { --burst-x: -72px; --burst-y: -45px; background: #42bd54; }
.pet-interaction-effects i:nth-child(3) { --burst-x: 62px; --burst-y: -55px; background: #c7ff73; animation-delay: .04s; }
.pet-interaction-effects i:nth-child(4) { --burst-x: -48px; --burst-y: 34px; background: #f6e36b; animation-delay: .08s; }
.pet-interaction-effects i:nth-child(5) { --burst-x: 78px; --burst-y: 28px; background: #77ead0; animation-delay: .11s; }
.pet-interaction-effects i:nth-child(6) { --burst-x: 8px; --burst-y: -82px; background: #ffffff; animation-delay: .14s; }
.pet-interaction-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.pet-interaction-controls .primary-button, .pet-interaction-controls .secondary-button { min-width: 160px; }
.pet-food-tray { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 12px; border: 2px solid rgba(223,220,251,.85); border-radius: 22px; background: rgba(255,255,255,.68); box-shadow: inset 0 1px 0 rgba(255,255,255,.75); }
.pet-food-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; min-width: 118px; padding: 10px 14px; border: 2px solid rgba(223,220,251,.95); border-radius: 16px; color: var(--primary-dark); background: rgba(255,255,255,.9); font-size: 16px; font-weight: 1000; cursor: grab; box-shadow: 0 10px 20px rgba(72,66,145,.09); user-select: none; }
.pet-food-button.dragging { opacity: .65; transform: scale(.98); cursor: grabbing; }
.pet-food-button.selected { color: #fff; border-color: transparent; background: linear-gradient(135deg, #56b7d4, #6d69f2); box-shadow: 0 14px 28px rgba(86,105,242,.2); }
.pet-food-button:active { cursor: grabbing; transform: translateY(1px) scale(.98); }
.pet-food-button:focus-visible { outline: 4px solid rgba(96,93,232,.26); outline-offset: 3px; }
.pet-food-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #f5f3ff; font-size: 22px; line-height: 1; }
.pet-interaction-stage.feeding-ready #pet-interaction-pet,
.pet-interaction-stage.feeding-ready .pet-interaction-guest { cursor: copy; }
.pet-feed-bubble { position: absolute; left: 50%; top: -46px; z-index: 12; max-width: min(270px, 64vw); padding: 8px 13px; border: 2px solid rgba(255,255,255,.78); border-radius: 999px; color: #245e32; background: rgba(255,255,255,.94); box-shadow: 0 12px 26px rgba(29,64,43,.16); font-size: 14px; font-weight: 1000; line-height: 1.15; white-space: nowrap; transform: translate(-50%, -100%); pointer-events: none; animation: pet-feed-bubble-pop 3s ease both; }
.pet-feed-hearts { position: absolute; left: 50%; top: -22px; z-index: 11; width: 120px; height: 80px; transform: translateX(-50%); pointer-events: none; }
.pet-feed-hearts i { position: absolute; left: 50%; top: 50%; color: #ff5c94; font-size: 28px; font-style: normal; line-height: 1; text-shadow: 0 5px 12px rgba(155,54,104,.2); animation: pet-feed-heart-rise 1.3s ease-out both; }
.pet-feed-hearts i:nth-child(1) { --heart-x: -36px; --heart-y: -48px; animation-delay: .02s; }
.pet-feed-hearts i:nth-child(2) { --heart-x: 4px; --heart-y: -66px; color: #ff8db1; animation-delay: .12s; }
.pet-feed-hearts i:nth-child(3) { --heart-x: 42px; --heart-y: -46px; color: #f54d83; animation-delay: .22s; }
.pet-furniture-tray { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px; border: 2px solid rgba(198,235,255,.95); border-radius: 22px; background: rgba(244,251,255,.76); box-shadow: inset 0 1px 0 rgba(255,255,255,.75); }
.pet-furniture-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; min-width: 112px; padding: 10px 14px; border: 2px solid rgba(212,232,255,.98); border-radius: 16px; color: var(--primary-dark); background: rgba(255,255,255,.9); font-size: 16px; font-weight: 1000; cursor: pointer; box-shadow: 0 10px 20px rgba(72,66,145,.08); }
.pet-furniture-button.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, #56b7ff, #6d69f2); }
.pet-furniture-button.ghost { min-width: 90px; color: #5c5a87; border-style: dashed; background: rgba(255,255,255,.68); }
.pet-furniture-button:focus-visible { outline: 4px solid rgba(86,183,255,.28); outline-offset: 3px; }
.pet-furniture-icon { display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; border-radius: 10px; background: #eefaff; font-size: 22px; line-height: 1; }
.pet-furniture-icon img { width: 100%; height: 100%; object-fit: contain; }
.pet-furniture-hint { padding: 10px 12px; border-radius: 999px; color: #226b91; background: rgba(217,243,255,.92); font-size: 14px; font-weight: 1000; }
.pet-furniture-count { padding: 10px 12px; border-radius: 999px; color: #32779b; background: rgba(255,255,255,.72); font-size: 14px; font-weight: 1000; }
.pet-food-drag-ghost { position: fixed; z-index: 10000; display: grid; place-items: center; width: 58px; height: 58px; border: 2px solid rgba(255,255,255,.92); border-radius: 18px; background: rgba(255,255,255,.86); box-shadow: 0 16px 32px rgba(31,35,78,.18); pointer-events: none; transform: translate(-50%, -50%) scale(1.05); backdrop-filter: blur(10px); }
.pet-food-drag-ghost span { font-size: 34px; line-height: 1; }
@keyframes creeper-idle { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(0) rotate(-1deg) scaleY(1); } 50% { transform: scaleX(var(--pet-dir, 1)) translateY(-2px) rotate(1deg) scaleY(.99); } }
@keyframes creeper-walk { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(0) rotate(-2deg) scaleY(.99); } 25% { transform: scaleX(var(--pet-dir, 1)) translateY(-2px) rotate(1.6deg) scaleY(1.01); } 50% { transform: scaleX(var(--pet-dir, 1)) translateY(0) rotate(2deg) scaleY(.98); } 75% { transform: scaleX(var(--pet-dir, 1)) translateY(-2px) rotate(-1.6deg) scaleY(1.01); } }
@keyframes creeper-footsteps { 0%, 100% { opacity: .24; transform: translateX(-50%) scaleX(.92); } 50% { opacity: .34; transform: translateX(-50%) scaleX(1.08); } }
@keyframes creeper-run { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(0) rotate(-4deg) scale(1.02, .99); } 50% { transform: scaleX(var(--pet-dir, 1)) translateY(-3px) rotate(4deg) scale(1.04, 1.01); } }
@keyframes creeper-sleep { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(4px) rotate(-7deg) scale(.94); opacity: .92; } 50% { transform: scaleX(var(--pet-dir, 1)) translateY(2px) rotate(-7deg) scale(.98); opacity: 1; } }
@keyframes creeper-wave { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(0) rotate(-4deg) scale(1.08); } 25% { transform: scaleX(var(--pet-dir, 1)) translateY(-2px) rotate(8deg) scale(1.12); } 50% { transform: scaleX(var(--pet-dir, 1)) translateY(0) rotate(-8deg) scale(1.1); } 75% { transform: scaleX(var(--pet-dir, 1)) translateY(-2px) rotate(7deg) scale(1.12); } }
@keyframes creeper-explode { 0%, 70% { transform: translateX(-50%) scale(1.08) scaleX(var(--pet-dir, 1)); } 20% { transform: translateX(-50%) scale(1.24) scaleX(var(--pet-dir, 1)); } 40% { transform: translateX(-50%) scale(.98) scaleX(var(--pet-dir, 1)); } 100% { transform: translateX(-50%) scale(1) scaleX(var(--pet-dir, 1)); } }
@keyframes creeper-explode-body { 0%, 56% { opacity: 1; filter: brightness(1.1) saturate(1.25); } 62% { opacity: .18; transform: scale(1.18); } 100% { opacity: 1; filter: brightness(1) saturate(1); transform: scale(1); } }
@keyframes creeper-feed-bounce { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(0) scale(1); } 28% { transform: scaleX(var(--pet-dir, 1)) translateY(-11px) scale(1.08, .96); } 58% { transform: scaleX(var(--pet-dir, 1)) translateY(2px) scale(.98, 1.04); } 78% { transform: scaleX(var(--pet-dir, 1)) translateY(-4px) scale(1.03); } }
@keyframes pet-float { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(0) rotate(-1.5deg); } 50% { transform: scaleX(var(--pet-dir, 1)) translateY(-10px) rotate(1.5deg); } }
@keyframes pet-fly-dash { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translate(0, 0) rotate(-4deg) scale(1.02); } 50% { transform: scaleX(var(--pet-dir, 1)) translate(9px, -8px) rotate(4deg) scale(1.06); } }
@keyframes pet-float-sleep { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(5px) rotate(-6deg) scale(.95); opacity: .92; } 50% { transform: scaleX(var(--pet-dir, 1)) translateY(-5px) rotate(-4deg) scale(.98); opacity: 1; } }
@keyframes pet-float-wave { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(0) rotate(-6deg) scale(1.08); } 30% { transform: scaleX(var(--pet-dir, 1)) translateY(-8px) rotate(8deg) scale(1.13); } 60% { transform: scaleX(var(--pet-dir, 1)) translateY(-3px) rotate(-8deg) scale(1.1); } }
@keyframes pet-float-feed { 0%, 100% { transform: scaleX(var(--pet-dir, 1)) translateY(0) scale(1); } 26% { transform: scaleX(var(--pet-dir, 1)) translateY(-16px) scale(1.1, .96); } 58% { transform: scaleX(var(--pet-dir, 1)) translateY(2px) scale(.98, 1.04); } 78% { transform: scaleX(var(--pet-dir, 1)) translateY(-7px) scale(1.04); } }
@keyframes creeper-effect-pop { 0% { transform: translateX(-50%) scale(.4); opacity: 0; } 18% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(1.22); opacity: 0; } }
@keyframes creeper-heart-pop { 0% { transform: translateX(-50%) scale(calc(var(--pet-scale, 1) * .72)); opacity: 0; } 16% { transform: translateX(-50%) scale(var(--pet-scale, 1)); opacity: 1; } 100% { transform: translateX(-50%) scale(var(--pet-scale, 1)); opacity: 0; } }
@keyframes creeper-pixel-burst { 0% { transform: translate(-50%, -50%) scale(.5); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--burst-x)), calc(-50% + var(--burst-y))) rotate(34deg) scale(1.1); opacity: 0; } }
@keyframes creeper-heart-rise { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 18% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--heart-x)), calc(-50% + var(--heart-y))) scale(1.16); opacity: 0; } }
@keyframes pet-feed-bubble-pop { 0% { opacity: 0; transform: translate(-50%, -88%) scale(.9); } 10%, 82% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -112%) scale(.96); } }
@keyframes pet-feed-heart-rise { 0% { transform: translate(-50%, -35%) scale(.42); opacity: 0; } 16% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--heart-x)), calc(-50% + var(--heart-y))) scale(1.16); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pet-interaction-pet, .pet-interaction-pet img, .pet-interaction-effects, .pet-interaction-effects i { animation: none !important; transition: none !important; }
}
@media (max-width: 760px) {
  .guide-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .guide-hero-actions {
    justify-content: stretch;
  }
  .guide-hero-actions .primary-button,
  .guide-hero-actions .secondary-button {
    flex: 1 1 220px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .pet-interaction-heading { align-items: flex-start; flex-direction: column; }
  .pet-interaction-heading-actions { justify-content: flex-start; width: 100%; }
  .pet-scene-switcher { justify-content: flex-start; width: 100%; }
  .pet-interaction-share-button { width: 100%; }
  .pet-interaction-stage { min-height: 320px; }
  .pet-furniture-button { flex: 1 1 calc(33.333% - 8px); min-width: 108px; }
}
@media (max-width: 620px) {
  .guide-hero {
    padding: 18px;
    border-radius: 20px;
  }
  .guide-card {
    border-radius: 18px;
  }
  .guide-card-copy {
    padding: 15px;
  }
  .guide-card-copy h3 {
    font-size: 21px;
  }
  .guide-card-copy p {
    font-size: 15px;
  }
  .guide-card-copy .secondary-button {
    width: 100%;
  }
  .pet-interaction-panel { gap: 14px; padding: 15px; }
  .pet-interaction-stage { min-height: 280px; border-radius: 20px; }
  .pet-interaction-pet { width: clamp(92px, 30vw, 142px); }
  .pet-interaction-name { top: -8px; padding: 6px 10px; font-size: 13px; }
  .scene-button { flex: 1 1 calc(50% - 8px); min-width: 0; padding: 10px 8px; font-size: 14px; }
  .pet-builder-grid { left: 5%; right: 5%; bottom: 8%; gap: 4px; height: 48%; }
  .pet-builder-cell { border-radius: 7px; }
  .placed-furniture { width: clamp(38px, 13vw, 64px); height: clamp(38px, 13vw, 64px); }
  .placed-furniture span { font-size: calc(clamp(34px, 11vw, 56px) * var(--decor-size, 1)); }
  .pet-furniture-tray { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .pet-furniture-button { width: 100%; min-width: 0; min-height: 46px; padding: 8px 10px; font-size: 14px; }
  .pet-furniture-icon { width: 28px; height: 28px; font-size: 20px; }
  .pet-furniture-count { justify-self: center; grid-column: 1 / -1; }
  .pet-interaction-controls { display: grid; grid-template-columns: 1fr; }
  .pet-interaction-controls .primary-button, .pet-interaction-controls .secondary-button { width: 100%; min-width: 0; }
  .pet-interaction-effects { width: 190px; height: 150px; }
}
.kuromi-room-panel { gap: 12px; padding: 18px; }
.kuromi-room-panel .pet-interaction-heading { align-items: center; }
.kuromi-room-panel:not(.interaction-room-active) .kuromi-room-stage,
.kuromi-room-panel:not(.interaction-room-active) .kuromi-room-chat-panel,
.kuromi-room-panel:not(.interaction-room-active) .pet-interaction-share-button { display: none; }
.kuromi-room-panel.interaction-room-active .interaction-room-lobby { display: none; }
.interaction-room-lobby { display: grid; gap: 14px; }
.interaction-room-guide,
.interaction-room-create-form,
.interaction-room-card,
.interaction-room-menu-card,
.interaction-room-lobby-header,
.interaction-room-empty {
  border: 2px solid rgba(111,101,235,.14);
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 14px 28px rgba(65,57,129,.08);
}
.interaction-room-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.interaction-room-menu-card {
  display: grid;
  justify-items: start;
  gap: 9px;
  min-height: 168px;
  padding: 20px;
  color: var(--primary-dark);
  text-align: left;
  cursor: pointer;
}
.interaction-room-menu-card:hover,
.interaction-room-menu-card:focus-visible {
  border-color: rgba(84,84,236,.7);
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(226,248,243,.92));
  box-shadow: 0 18px 38px rgba(76,70,184,.16);
}
.interaction-room-menu-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(106,99,244,.16), rgba(88,193,177,.2));
  font-size: 30px;
}
.interaction-room-menu-card strong {
  color: var(--primary-dark);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 1000;
  line-height: 1.05;
}
.interaction-room-menu-card span:not(.interaction-room-menu-icon) {
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
}
.interaction-room-lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}
.interaction-room-lobby-header h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 1000;
  letter-spacing: 0;
}
.interaction-room-lobby-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.interaction-room-guide { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; }
.interaction-room-guide h3 { margin: 0 0 5px; color: var(--primary-dark); font-size: clamp(24px, 3vw, 34px); font-weight: 1000; letter-spacing: 0; }
.interaction-room-guide p,
.interaction-room-empty span { margin: 0; color: var(--muted); font-size: 16px; font-weight: 850; line-height: 1.5; }
.interaction-room-create-form { display: grid; gap: 14px; padding: 20px; }
.interaction-room-create-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.interaction-room-create-form label,
.interaction-room-join-form label { display: grid; gap: 6px; min-width: 0; color: var(--primary-dark); font-size: 15px; font-weight: 1000; }
.interaction-room-create-form input[type="text"],
.interaction-room-join-form input {
  width: 100%;
  min-height: 64px;
  border: 2px solid rgba(111,101,235,.18);
  border-radius: 18px;
  padding: 0 20px;
  color: var(--ink);
  background: rgba(255,255,255,.94);
  font-size: 22px;
  font-weight: 900;
}
.interaction-room-create-form input:focus,
.interaction-room-join-form input:focus { outline: 4px solid rgba(95,94,237,.16); border-color: rgba(95,94,237,.56); }
.interaction-room-lock-toggle {
  display: inline-flex !important;
  grid-template-columns: none;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 0 20px;
  border: 2px solid rgba(111,101,235,.16);
  border-radius: 16px;
  background: rgba(246,244,255,.9);
  cursor: pointer;
}
.interaction-room-lock-toggle input { width: 22px; height: 22px; accent-color: var(--primary); }
.interaction-room-password-row[hidden] { display: none !important; }
.interaction-map-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.interaction-map-picker legend {
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 1000;
}
.interaction-map-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.interaction-map-choice {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(128px, 38%) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 116px;
  padding: 10px;
  border: 2px solid rgba(111,101,235,.16);
  border-radius: 18px;
  background: rgba(249,248,255,.9);
  color: var(--primary-dark);
  cursor: pointer;
}
.interaction-map-choice.selected {
  border-color: rgba(84,84,236,.82);
  background: linear-gradient(135deg, rgba(244,244,255,.96), rgba(222,248,241,.92));
  box-shadow: 0 14px 32px rgba(74,71,184,.15);
}
.interaction-map-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.interaction-map-choice img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
}
.interaction-map-choice span { display: grid; gap: 3px; min-width: 0; }
.interaction-map-choice strong {
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 1000;
  letter-spacing: 0;
}
.interaction-map-choice small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}
.interaction-room-size-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(99,91,255,.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(242,251,248,.78));
  box-shadow: 0 14px 32px rgba(31,35,78,.08);
}
.interaction-room-size-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.interaction-room-size-head h4 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 1000;
}
.interaction-room-size-head > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}
.interaction-room-size-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.interaction-room-size-option {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 118px;
  padding: 12px;
  border: 2px solid rgba(99,91,255,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  color: var(--primary-dark);
  text-align: left;
  cursor: pointer;
}
.interaction-room-size-option:nth-child(2) {
  background: linear-gradient(135deg, rgba(255,251,231,.92), rgba(255,255,255,.88));
}
.interaction-room-size-option:nth-child(3) {
  background: linear-gradient(135deg, rgba(239,255,250,.92), rgba(255,255,255,.88));
}
.interaction-room-size-option:hover,
.interaction-room-size-option:focus-visible,
.interaction-room-size-option.selected {
  border-color: rgba(84,84,236,.72);
  box-shadow: 0 14px 30px rgba(74,71,184,.15);
}
.interaction-room-size-option.selected {
  background: linear-gradient(135deg, rgba(244,244,255,.98), rgba(226,248,243,.94));
}
.interaction-room-size-sample {
  display: grid;
  place-items: center;
  width: 112px;
  height: 92px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.96) 0 25%, rgba(255,255,255,0) 52%),
    linear-gradient(180deg, #dff7ff, #fff8d8 68%, #eadfc8 69%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.82),
    inset 0 -10px 18px rgba(101,76,38,.08);
}
.interaction-room-size-sample img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: auto;
  transform: scale(calc(var(--sample-scale, 1) * .76));
  transform-origin: 50% 50%;
  filter:
    drop-shadow(0 0 1px rgba(33,29,80,.42))
    drop-shadow(0 9px 6px rgba(43,38,96,.2));
}
.interaction-room-size-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.interaction-room-size-copy strong {
  color: var(--primary-dark);
  font-size: 19px;
  font-weight: 1000;
}
.interaction-room-size-copy small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}
.interaction-room-size-badge {
  align-self: start;
  justify-self: end;
  min-width: 48px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #544bd6;
  background: rgba(236,234,255,.96);
  font-size: 12px;
  font-weight: 1000;
  text-align: center;
  white-space: nowrap;
}
.interaction-room-size-option:nth-child(2) .interaction-room-size-badge {
  color: #81611a;
  background: rgba(255,238,167,.92);
}
.interaction-room-size-option:nth-child(3) .interaction-room-size-badge {
  color: #287665;
  background: rgba(203,250,237,.94);
}
.interaction-room-hero-pool {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(99,91,255,.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,248,230,.72));
  box-shadow: 0 14px 32px rgba(31,35,78,.08);
}
.interaction-room-hero-series {
  display: grid;
  gap: 8px;
}
.interaction-room-hero-series-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.interaction-room-hero-series-head strong {
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 1000;
}
.interaction-room-hero-series-head small {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #6b5719;
  background: rgba(255,238,167,.9);
  font-size: 11px;
  font-weight: 1000;
  text-align: center;
}
.interaction-room-hero-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.interaction-room-hero-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 116px;
  padding: 9px 8px;
  border: 2px solid rgba(99,91,255,.14);
  border-radius: 16px;
  color: var(--primary-dark);
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 22px rgba(72,66,145,.08);
  text-align: center;
  cursor: pointer;
}
.interaction-room-hero-card:hover,
.interaction-room-hero-card:focus-visible,
.interaction-room-hero-card.selected {
  border-color: rgba(67,191,150,.64);
  background: linear-gradient(135deg, rgba(239,255,250,.98), rgba(247,246,255,.96));
  box-shadow: 0 14px 26px rgba(47,151,129,.16);
}
.interaction-room-hero-card span {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / .72;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.95) 0 24%, rgba(255,255,255,0) 54%),
    linear-gradient(180deg, #e0f8ff, #fff5cf 70%, #eadfc8 71%);
}
.interaction-room-hero-card img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 1px rgba(33,29,80,.38))
    drop-shadow(0 8px 5px rgba(43,38,96,.18));
}
.interaction-room-hero-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 1000;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.interaction-room-hero-card small {
  min-width: 0;
  overflow: hidden;
  justify-self: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  color: #76719f;
  background: rgba(244,242,255,.78);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pet-collection-hero-pool {
  margin-top: 0;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(245,252,255,.76));
  box-shadow: 0 12px 28px rgba(66,64,140,.08);
}
.pet-collection-hero-head h4 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 1000;
}
.pet-collection-hero-card {
  min-height: 126px;
}
.pet-collection-hero-card.selected small {
  color: #287665;
  background: rgba(203,250,237,.94);
}
.interaction-room-recovery-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,190,88,.42);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,248,219,.94), rgba(255,255,255,.88));
  color: #736022;
  font-weight: 900;
}
.interaction-room-recovery-banner strong {
  color: #514216;
  font-size: 15px;
  font-weight: 1000;
}
.interaction-room-recovery-banner span {
  color: #7f7040;
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}
.interaction-room-friend-strip {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(99,91,255,.18);
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 14px 32px rgba(31,35,78,.08);
}
.interaction-room-friend-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.interaction-room-friend-strip h4 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 1000;
}
.interaction-room-friend-strip small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}
.interaction-room-friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.interaction-room-friend-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px;
  border: 1px solid rgba(99,91,255,.16);
  border-radius: 16px;
  background: rgba(246,246,255,.84);
}
.interaction-room-friend-card.online {
  border-color: rgba(64,190,166,.38);
  background: linear-gradient(135deg, rgba(239,255,250,.96), rgba(246,246,255,.92));
}
.interaction-room-friend-card.offline {
  opacity: .62;
}
.interaction-room-friend-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #fff3bd;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}
.interaction-room-friend-card strong,
.interaction-room-friend-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.interaction-room-friend-card strong {
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 1000;
}
.interaction-room-friend-join {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #655cf5, #42bea6);
  box-shadow: 0 8px 18px rgba(68,76,189,.18);
  font-weight: 1000;
  white-space: nowrap;
}
.interaction-room-friend-join:disabled {
  color: #77739b;
  background: rgba(230,229,255,.88);
  box-shadow: none;
}
.interaction-room-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.interaction-room-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; }
.interaction-room-card-main { display: grid; gap: 4px; min-width: 0; }
.interaction-room-card strong { color: var(--primary-dark); font-size: 21px; font-weight: 1000; overflow-wrap: anywhere; }
.interaction-room-card small { color: var(--muted); font-size: 14px; font-weight: 850; overflow-wrap: anywhere; }
.interaction-room-status { justify-self: start; padding: 7px 10px; border-radius: 999px; color: #286955; background: rgba(214,248,235,.95); font-size: 13px; font-weight: 1000; white-space: nowrap; }
.interaction-room-card.locked .interaction-room-status { color: #7d5b12; background: rgba(255,239,174,.95); }
.interaction-room-card.full { opacity: .68; }
.interaction-room-join-form { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.interaction-room-empty { display: grid; gap: 5px; padding: 18px; }
.interaction-room-empty strong { color: var(--primary-dark); font-size: 22px; font-weight: 1000; }
.kuromi-room-chat-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 0; }
.kuromi-room-chat-status strong { display: block; color: var(--primary-dark); font-size: 18px; font-weight: 1000; }
.kuromi-room-chat-status small { color: var(--muted); font-size: 13px; font-weight: 850; }
.kuromi-room-stage {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.92);
  border-radius: 24px;
  background: #fbf0fb;
  box-shadow: 0 18px 40px rgba(63, 48, 118, .2);
  touch-action: none;
}
.kuromi-room-stage::after { display: none; }
.kuromi-room-canvas { display: block; width: 100%; height: 100%; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.kuromi-room-orientation-hint {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 8;
  display: none;
  max-width: min(72%, 360px);
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 999px;
  color: #3c2a57;
  background: rgba(255,255,255,.78);
  box-shadow: 0 8px 20px rgba(31,24,65,.16);
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(12px) saturate(1.08);
  pointer-events: none;
}
.kuromi-room-fullscreen-button {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 9;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #6a63f4, #58c1b1);
  box-shadow: 0 10px 24px rgba(43,35,94,.22);
  font-size: 14px;
  font-weight: 1000;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.kuromi-room-fullscreen-button.is-exit-mode {
  min-width: 92px;
  min-height: 44px;
  padding: 9px 15px;
  border-color: rgba(255,255,255,.92);
  color: #fff;
  background: linear-gradient(135deg, #ff5b88, #655cf5);
  box-shadow: 0 12px 30px rgba(22,16,45,.34);
}
.kuromi-room-chat-toggle {
  position: absolute;
  left: 24px;
  bottom: 92px;
  z-index: 9;
  display: none;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #6a63f4, #58c1b1);
  box-shadow: 0 12px 26px rgba(43,35,94,.24);
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.kuromi-room-chat-toggle.is-open {
  background: linear-gradient(135deg, #ff78a2, #655cf5);
}
.kuromi-room-chat-toggle:focus-visible {
  outline: 4px solid rgba(255,255,255,.86);
  outline-offset: 3px;
}
.kuromi-room-controls {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  pointer-events: none;
  transform: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.kuromi-control-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 14px 30px rgba(35, 25, 73, .22);
  backdrop-filter: blur(14px) saturate(1.08);
  pointer-events: auto;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.kuromi-control-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #6a63f4, #58c1b1);
  box-shadow: 0 9px 20px rgba(73, 76, 185, .28);
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.kuromi-control-button-text {
  font-size: 18px;
  letter-spacing: 0;
  white-space: nowrap;
}
.kuromi-control-button.is-pressed,
.kuromi-control-button:active {
  filter: brightness(1.06) saturate(1.12);
  box-shadow: 0 6px 14px rgba(73, 76, 185, .23);
  transform: translateY(1px) scale(.97);
}
.kuromi-control-button:focus-visible {
  outline: 4px solid rgba(255,255,255,.86);
  outline-offset: 3px;
}
.kuromi-room-chat-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.kuromi-room-emoji-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.kuromi-room-emoji-list-inline {
  margin: 4px 0 9px;
  padding: 8px 10px;
  border: 1px solid rgba(223,220,251,.95);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.kuromi-room-emoji-button,
.kuromi-room-emoji-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 14px;
  color: #33295d;
  background: linear-gradient(135deg, #fff8c9, #fff1a6 48%, #c8fff1);
  box-shadow: 0 9px 19px rgba(73,76,185,.16);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}
.kuromi-room-emoji-button:hover,
.kuromi-room-emoji-toggle:hover {
  filter: brightness(1.03) saturate(1.08);
  transform: translateY(-1px);
}
.kuromi-room-emoji-button:active,
.kuromi-room-emoji-toggle:active {
  transform: translateY(1px) scale(.96);
}
.kuromi-room-emoji-button:focus-visible,
.kuromi-room-emoji-toggle:focus-visible {
  outline: 4px solid rgba(96,93,232,.18);
  outline-offset: 2px;
}
.kuromi-room-emoji-dock {
  position: absolute;
  left: 24px;
  bottom: 154px;
  z-index: 10;
  display: none;
}
.kuromi-room-emoji-dock[hidden] {
  display: none !important;
}
.kuromi-room-emoji-toggle {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  font-size: 26px;
}
.kuromi-room-emoji-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, #ffe889, #ffb5ce 48%, #7de1d2);
  box-shadow: 0 14px 28px rgba(43,35,94,.26);
}
.kuromi-room-emoji-popover {
  position: absolute;
  left: 0;
  bottom: 62px;
  width: min(292px, calc(100dvw - 32px));
  padding: 9px;
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 20px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 18px 36px rgba(26,20,59,.24);
  backdrop-filter: blur(16px) saturate(1.12);
}
.kuromi-room-emoji-list-mobile {
  justify-content: center;
}
.kuromi-room-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.kuromi-room-chat-form input {
  width: 100%;
  min-height: 54px;
  padding: 13px 16px;
  border: 2px solid rgba(223,220,251,.95);
  border-radius: 17px;
  outline: none;
  color: var(--ink);
  background: rgba(255,255,255,.92);
  font-size: 16px;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.kuromi-room-chat-form input:focus {
  border-color: rgba(96,93,232,.78);
  box-shadow: 0 0 0 4px rgba(96,93,232,.13);
}
.kuromi-room-chat-form .primary-button {
  min-width: 92px;
  min-height: 54px;
  padding: 12px 18px;
}
.mini-game-overlay {
  z-index: 10040;
}
.mini-game-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(980px, calc(100vw - 26px));
  max-height: calc(100dvh - 26px);
  overflow: auto;
  padding: 24px;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 26px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 28px 70px rgba(31,24,75,.28);
}
.mini-game-card h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 1000;
  letter-spacing: 0;
}
.mini-game-status {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.45;
  white-space: pre-line;
}
.mini-game-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.mini-game-choice {
  display: grid;
  min-width: 0;
  gap: 6px;
  min-height: 104px;
  padding: 8px;
  border: 2px solid rgba(111,101,235,.16);
  border-radius: 16px;
  color: var(--primary-dark);
  background: rgba(247,246,255,.92);
  text-align: left;
}
.mini-game-choice:hover,
.mini-game-choice:focus-visible {
  border-color: rgba(84,84,236,.72);
  background: linear-gradient(135deg, rgba(246,246,255,.98), rgba(222,248,241,.92));
}
.mini-game-choice-main {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 1fr;
  justify-items: start;
  gap: 5px;
  padding: 4px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.mini-game-choice span {
  font-size: 24px;
}
.mini-game-choice-h5 {
  align-content: space-between;
}
.mini-game-choice-h5 .mini-game-choice-main {
  grid-template-columns: 54px minmax(0,1fr);
  grid-template-rows: auto 1fr;
  align-items: center;
  column-gap: 10px;
}
.mini-game-choice-h5 .mini-game-choice-art {
  grid-row: 1 / 3;
  display: grid;
  width: 54px;
  height: 54px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(70,61,51,.16);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 12px rgba(36,42,64,.12);
}
.mini-game-choice-h5 .mini-game-choice-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-game-choice strong {
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 1000;
}
.mini-game-choice small {
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}
.mini-game-choice [data-fit-single-line] {
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.2;
}
.mini-game-choice-rank {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid rgba(111,101,235,.18);
  border-radius: 10px;
  color: #7464a2;
  background: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}
.mini-game-choice-rank:hover,.mini-game-choice-rank:focus-visible { color: #fff; background: #776ce8; }
.mini-game-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  max-height: min(62dvh, 540px);
  border: 2px solid rgba(111,101,235,.16);
  border-radius: 22px;
  background: #eaf7ff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}
.mini-game-canvas[hidden],
.mini-game-actions[hidden],
.h5-game-frame-shell[hidden] {
  display: none !important;
}
.h5-game-frame-shell {
  position: relative;
  width: 100%;
  min-height: min(68dvh,720px);
  overflow: hidden;
  border: 2px solid rgba(111,101,235,.16);
  border-radius: 22px;
  background: #080c1d;
  box-shadow: 0 18px 46px rgba(9,12,29,.24);
}
.h5-game-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
  background: #fff;
  pointer-events: auto;
  touch-action: auto;
}
.mini-game-runner-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.mini-game-runner-control-button {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, #5c5ce6, #43bf96);
  box-shadow: 0 14px 30px rgba(37,30,88,.18);
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.mini-game-runner-control-button span {
  display: block;
  line-height: 1;
}
.mini-game-runner-control-button:active,
.mini-game-runner-control-button.pressed {
  transform: translateY(2px) scale(.98);
}
.mini-game-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mini-game-actions .primary-button,
.mini-game-actions .secondary-button {
  flex: 1 1 180px;
  min-height: 54px;
}
.mini-game-page {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 2px solid rgba(111,101,235,.16);
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 18px 42px rgba(37,30,88,.08);
}
.mini-game-page [hidden] {
  display: none !important;
}
.mini-game-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mini-game-page-header > div {
  min-width: 0;
  flex: 1 1 auto;
}
.mini-game-page-header h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 1000;
  letter-spacing: 0;
}
.mini-game-page-header .secondary-button {
  min-height: 48px;
  white-space: nowrap;
}
.mini-game-page-header .mini-game-page-back-button {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 18px;
  font-size: 1.55rem;
  line-height: 1;
}
.mini-game-page-header .mini-game-fullscreen-button {
  position: static;
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 18px;
  font-size: 27px;
  line-height: 1;
}
.mini-game-page-canvas {
  max-height: min(66dvh, 620px);
}
.mini-game-keyboard-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}
body.mini-game-fullscreen-mode {
  overflow: hidden;
  overscroll-behavior: none;
  background: #070817 !important;
}
body.mini-game-fullscreen-mode .app-screen,
body.mini-game-fullscreen-mode .page-shell,
body.mini-game-fullscreen-mode #mini-game-embedded-page,
body.mini-game-fullscreen-mode .mini-game-page {
  background: #070817 !important;
}
body.mini-game-fullscreen-mode #mini-game-embedded-page:fullscreen,
body.mini-game-fullscreen-mode #mini-game-embedded-page::backdrop,
body.mini-game-fullscreen-mode .mini-game-page:fullscreen,
body.mini-game-fullscreen-mode .mini-game-page::backdrop {
  background: #070817 !important;
}
body.mini-game-fullscreen-mode .kuromi-room-panel {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #070817;
  box-shadow: none;
}
body.mini-game-fullscreen-mode .kuromi-room-panel .pet-interaction-heading,
body.mini-game-fullscreen-mode .kuromi-room-stage,
body.mini-game-fullscreen-mode .kuromi-room-chat-panel,
body.mini-game-fullscreen-mode .pet-interaction-share-button {
  display: none !important;
}
body.mini-game-fullscreen-mode .interaction-room-lobby {
  display: grid;
  min-height: 100dvh;
}
body.mini-game-fullscreen-mode .mini-game-page {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: grid;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 14px) calc(env(safe-area-inset-bottom) + 10px) calc(env(safe-area-inset-left) + 14px);
  border: 0;
  border-radius: 0;
  background: #070817;
  color: #fff;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  align-content: stretch;
  overflow: hidden;
}
body.mini-game-fullscreen-mode .mini-game-page-header {
  min-height: 48px;
}
body.mini-game-fullscreen-mode .mini-game-page-header h3,
body.mini-game-fullscreen-mode .mini-game-page .eyebrow,
body.mini-game-fullscreen-mode .mini-game-status,
body.mini-game-fullscreen-mode .mini-game-keyboard-hint {
  color: rgba(255,255,255,.88);
}
body.mini-game-fullscreen-mode .mini-game-fullscreen-button {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  right: calc(env(safe-area-inset-right) + 12px);
  z-index: 10110;
  display: grid;
  place-items: center;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 18px;
  font-size: 28px;
  line-height: 1;
}
body.mini-game-fullscreen-mode .language-toggle {
  display: none !important;
}
body.mini-game-fullscreen-mode .mini-game-canvas {
  justify-self: center;
  align-self: center;
  width: min(100%, calc((100dvh - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 5 / 3));
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border-color: rgba(255,255,255,.22);
  border-radius: 16px;
}
body.mini-game-fullscreen-mode .mini-game-actions {
  padding-inline: max(0px, env(safe-area-inset-left));
}
body.mini-game-fullscreen-mode .mini-game-actions .primary-button,
body.mini-game-fullscreen-mode .mini-game-actions .secondary-button {
  min-height: 50px;
}
body.mini-game-fullscreen-mode .mini-game-runner-controls {
  position: fixed;
  left: calc(env(safe-area-inset-left) + 18px);
  right: calc(env(safe-area-inset-right) + 18px);
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  z-index: 10078;
  justify-content: space-between;
  pointer-events: none;
}
body.mini-game-fullscreen-mode .mini-game-runner-control-button {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  font-size: 34px;
  pointer-events: auto;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell {
  padding: 0;
  grid-template-rows: minmax(0, 1fr);
  background: #070817;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-page-header {
  position: fixed;
  inset: auto;
  top: 0;
  right: 0;
  z-index: 10105;
  display: contents;
  min-height: 0;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-page-header div {
  display: none !important;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-page-header .secondary-button:not(.mini-game-page-back-button) {
  display: none !important;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-page-header .mini-game-page-back-button {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: calc(env(safe-area-inset-left) + 12px);
  z-index: 10112;
  display: grid !important;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  pointer-events: auto;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-fullscreen-button {
  pointer-events: auto;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-status,
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-keyboard-hint {
  display: none !important;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-canvas {
  position: fixed;
  inset: 0;
  z-index: 10060;
  width: min(100dvw, calc(100dvh * 5 / 3));
  height: min(100dvh, calc(100dvw * 3 / 5));
  max-width: 100dvw;
  max-height: 100dvh;
  margin: auto;
  border: 0;
  border-radius: 0;
  aspect-ratio: 5 / 3;
  background: #070817;
  box-shadow: none;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell:not(.mini-game-ended-shell) .mini-game-actions {
  display: none !important;
}
@media (max-width: 700px), (pointer: coarse) {
  .mini-game-page.mini-game-flappy-shell.mini-game-playing-shell:not(.mini-game-ended-shell) .mini-game-actions {
    display: none !important;
  }
  .mini-game-page.mini-game-playing-shell {
    position: relative;
    padding-top: 8px;
  }
  .mini-game-page.mini-game-playing-shell .mini-game-page-header {
    position: absolute;
    inset: 8px 8px auto 8px;
    z-index: 8;
    display: flex;
    justify-content: flex-end;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }
  .mini-game-page.mini-game-playing-shell .mini-game-page-header > div,
  .mini-game-page.mini-game-playing-shell .mini-game-page-header .secondary-button:not(.mini-game-page-back-button) {
    display: none !important;
  }
  .mini-game-page.mini-game-playing-shell .mini-game-page-header .mini-game-page-back-button {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    display: grid !important;
    pointer-events: auto;
  }
  .mini-game-page.mini-game-playing-shell .mini-game-fullscreen-button {
    pointer-events: auto;
  }
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell.mini-game-ended-shell .mini-game-actions {
  position: fixed;
  right: calc(env(safe-area-inset-right) + 16px);
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  left: calc(env(safe-area-inset-left) + 16px);
  z-index: 10084;
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  padding: 0;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell.mini-game-ended-shell:not(.mini-game-runner-shell) .mini-game-runner-controls {
  display: none !important;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-runner-shell.mini-game-ended-shell .mini-game-runner-controls {
  display: flex;
}
body.mini-game-fullscreen-mode .mini-game-page.mini-game-runner-shell.mini-game-ended-shell .mini-game-actions {
  display: none !important;
}
body.kuromi-room-fullscreen-mode {
  overflow: hidden;
  overscroll-behavior: none;
  background: #080411 !important;
}
body.kuromi-room-fullscreen-mode .app-screen,
body.kuromi-room-fullscreen-mode .page-shell,
body.kuromi-room-fullscreen-mode .kuromi-room-panel,
body.kuromi-room-fullscreen-mode .kuromi-room-panel:fullscreen,
body.kuromi-room-fullscreen-mode .kuromi-room-panel::backdrop {
  background: #080411 !important;
}
body.kuromi-room-fullscreen-mode .kuromi-room-panel {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0d0718;
  box-shadow: none;
}
body.kuromi-room-fullscreen-mode .kuromi-room-panel .pet-interaction-heading {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px);
  left: calc(env(safe-area-inset-left) + 12px);
  right: calc(env(safe-area-inset-right) + 12px);
  z-index: 12;
  pointer-events: none;
}
body.kuromi-room-fullscreen-mode .kuromi-room-panel .pet-interaction-heading .eyebrow,
body.kuromi-room-fullscreen-mode .kuromi-room-panel .pet-interaction-heading h2,
body.kuromi-room-fullscreen-mode .kuromi-room-panel .pet-interaction-share-button {
  display: none;
}
body.kuromi-room-fullscreen-mode .kuromi-room-stage {
  display: grid;
  place-items: center;
  width: 100dvw;
  height: calc(100dvh - 76px - env(safe-area-inset-bottom));
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #080411;
  box-shadow: none;
  aspect-ratio: auto;
  overflow: hidden;
}
body.kuromi-room-fullscreen-mode .kuromi-room-canvas {
  width: min(100dvw, calc((100dvh - 76px - env(safe-area-inset-bottom)) * 16 / 9));
  max-width: 100dvw;
  height: auto;
  max-height: calc(100dvh - 76px - env(safe-area-inset-bottom));
  aspect-ratio: 16 / 9;
}
body.kuromi-room-fullscreen-mode .kuromi-room-controls {
  left: calc(env(safe-area-inset-left) + 18px);
  right: calc(env(safe-area-inset-right) + 18px);
  bottom: calc(env(safe-area-inset-bottom) + 15px);
}
body.kuromi-room-fullscreen-mode .kuromi-room-fullscreen-button {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  right: calc(env(safe-area-inset-right) + 12px);
  z-index: 10120;
  min-width: 92px;
  min-height: 44px;
  font-size: 14px;
}
body.kuromi-room-fullscreen-mode .language-toggle {
  display: none !important;
}
body.kuromi-room-fullscreen-mode .kuromi-room-orientation-hint {
  display: none;
}
body.kuromi-room-fullscreen-mode .kuromi-room-chat-panel {
  padding: 8px max(10px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  background: #0d0718;
}
body.kuromi-room-fullscreen-mode .kuromi-room-chat-form input {
  min-height: 50px;
  color: #fff;
  border-color: rgba(255,255,255,.26);
  background: rgba(255,255,255,.13);
}
body.kuromi-room-fullscreen-mode .kuromi-room-chat-form input::placeholder {
  color: rgba(255,255,255,.62);
}
@media (max-width: 900px), (hover: none) {
  body.kuromi-room-fullscreen-mode .kuromi-room-panel {
    grid-template-rows: minmax(0, 1fr);
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-stage {
    height: 100dvh;
    background: #080411;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-canvas {
    width: min(100dvw, calc(100dvh * 16 / 9));
    height: min(100dvh, calc(100dvw * 9 / 16));
    max-width: 100dvw;
    max-height: 100dvh;
    object-fit: contain;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-controls {
    left: calc(env(safe-area-inset-left) + 18px);
    right: calc(env(safe-area-inset-right) + 18px);
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    align-items: flex-end;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-fullscreen-button {
    top: calc(env(safe-area-inset-top) + 10px);
    right: calc(env(safe-area-inset-right) + 12px);
    z-index: 10120;
    display: grid;
    place-items: center;
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 0;
    border-radius: 18px;
    font-size: 0;
    line-height: 1;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-fullscreen-button::before {
    content: "×";
    font-size: 30px;
    line-height: 1;
  }
  body.kuromi-room-fullscreen-mode .kuromi-control-cluster {
    gap: 18px;
    padding: 8px;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-chat-toggle {
    position: fixed;
    left: calc(env(safe-area-inset-left) + 24px);
    bottom: calc(env(safe-area-inset-bottom) + 104px);
    z-index: 10025;
    display: grid;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-emoji-dock {
    position: fixed;
    left: calc(env(safe-area-inset-left) + 25px);
    bottom: calc(env(safe-area-inset-bottom) + 168px);
    z-index: 10026;
    display: block;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-emoji-list-inline {
    display: none;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-emoji-popover {
    bottom: 62px;
    width: min(292px, calc(100dvw - env(safe-area-inset-left) - env(safe-area-inset-right) - 34px));
    background: rgba(255,255,255,.92);
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-chat-panel {
    position: fixed;
    left: calc(env(safe-area-inset-left) + 18px);
    right: calc(env(safe-area-inset-right) + 18px);
    bottom: calc(env(safe-area-inset-bottom) + 90px);
    z-index: 10024;
    display: block;
    padding: 0;
    background: transparent;
    pointer-events: auto;
  }
  body.kuromi-room-fullscreen-mode:not(.kuromi-room-chat-open) .kuromi-room-chat-panel {
    display: none;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-chat-status {
    display: none;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-chat-form {
    padding: 8px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 22px;
    background: rgba(9,7,21,.82);
    box-shadow: 0 18px 36px rgba(0,0,0,.28);
    backdrop-filter: blur(16px) saturate(1.1);
  }
}
@media (max-width: 760px) {
  .kuromi-room-panel .pet-interaction-heading { align-items: flex-start; }
  .kuromi-room-panel .pet-interaction-share-button { width: 100%; }
  .kuromi-room-stage { min-height: 0; border-radius: 20px; }
}
@media (max-width: 620px) {
  .kuromi-room-panel { gap: 9px; padding: 11px; border-radius: 20px; }
  .interaction-room-menu-grid { grid-template-columns: 1fr; }
  .interaction-room-hero-pool { padding: 12px; }
  .interaction-room-hero-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(118px, 38vw);
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 2px 2px 6px;
    scrollbar-width: thin;
  }
  .interaction-room-hero-card { min-height: 108px; }
  .mini-game-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-game-page {
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
  }
  .mini-game-page-header {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) 58px;
    align-items: center;
    gap: 10px;
  }
  .mini-game-page-header h3 { font-size: 30px; }
  .mini-game-page-header .secondary-button {
    min-height: 48px;
    padding-inline: 12px;
  }
  .mini-game-page-header .mini-game-fullscreen-button {
    width: 58px;
    min-width: 58px;
    height: 58px;
    min-height: 58px;
  }
  .mini-game-page .mini-game-picker {
    gap: 8px;
  }
  .mini-game-page .mini-game-choice {
    min-height: 98px;
    padding: 11px;
  }
  .interaction-room-menu-card { min-height: 124px; padding: 18px; }
  .interaction-room-menu-card strong { font-size: 28px; }
  .interaction-room-lobby-header,
  .interaction-room-guide,
  .interaction-room-create-main,
  .interaction-room-card,
  .interaction-room-join-form,
  .kuromi-room-chat-status { grid-template-columns: 1fr; display: grid; }
  .interaction-room-lobby-actions { justify-content: stretch; }
  .interaction-room-lobby-actions .secondary-button { width: 100%; }
  .interaction-room-guide { align-items: stretch; }
  .interaction-room-guide .secondary-button,
  .interaction-room-create-form .primary-button,
  .interaction-room-card .primary-button,
  .interaction-room-join-form .primary-button,
  .kuromi-room-chat-status .secondary-button { width: 100%; }
  .interaction-room-list { grid-template-columns: 1fr; }
  .interaction-room-card strong { font-size: 20px; }
  .interaction-room-create-form input[type="text"],
  .interaction-room-join-form input { min-height: 60px; font-size: 20px; }
  .interaction-room-lock-toggle { min-height: 60px; }
  .interaction-room-lock-toggle { justify-content: flex-start; }
  .interaction-map-choice-grid { grid-template-columns: 1fr; }
  .interaction-map-choice {
    grid-template-columns: minmax(112px, 42%) minmax(0, 1fr);
    min-height: 104px;
  }
  .interaction-map-choice strong { font-size: 18px; }
  .interaction-room-size-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .interaction-room-size-head > span {
    text-align: left;
  }
  .interaction-room-size-grid {
    grid-template-columns: 1fr;
  }
  .interaction-room-size-option {
    grid-template-columns: 96px minmax(0, 1fr) auto;
    min-height: 104px;
    padding: 10px;
  }
  .interaction-room-size-sample {
    width: 96px;
    height: 78px;
  }
  .interaction-room-size-sample img {
    width: 42px;
    height: 42px;
  }
  .kuromi-room-stage { min-height: 0; border-radius: 18px; }
  .kuromi-room-controls { left: 10px; right: 10px; bottom: 8px; gap: 14px; }
  .kuromi-control-cluster { gap: 10px; padding: 5px; }
  .kuromi-control-button { width: 42px; height: 42px; border-radius: 14px; font-size: 21px; }
  .kuromi-control-button-text { font-size: 15px; }
  .kuromi-room-fullscreen-button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
  .kuromi-room-chat-form { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .kuromi-room-chat-form input { min-height: 50px; padding: 11px 13px; font-size: 16px; }
  .kuromi-room-chat-form .primary-button { min-width: 74px; min-height: 50px; padding: 10px 13px; }
  .mini-game-card {
    width: calc(100vw - 18px);
    padding: 18px;
    border-radius: 22px;
  }
  .mini-game-canvas { max-height: 48dvh; }
}
@media (max-width: 620px) and (orientation: portrait) {
  .kuromi-room-stage {
    margin-bottom: 66px;
    overflow: visible;
  }
  .kuromi-room-orientation-hint {
    display: block;
  }
  .kuromi-room-controls {
    left: 4px;
    right: 4px;
    bottom: -58px;
  }
  .kuromi-control-cluster {
    gap: 12px;
  }
  body.kuromi-room-fullscreen-mode .kuromi-room-stage {
    margin-bottom: 0;
    overflow: hidden;
  }
body.kuromi-room-fullscreen-mode .kuromi-room-controls {
    left: calc(env(safe-area-inset-left) + 14px);
    right: calc(env(safe-area-inset-right) + 14px);
    bottom: calc(env(safe-area-inset-bottom) + 14px);
  }
}

/* Halloween seasonal UI: generated ornaments plus readable game surfaces. */
:root {
  --halloween-night: #170b28;
  --halloween-violet: #5a2b92;
  --halloween-orange: #ff9f2f;
  --halloween-gold: #ffd36f;
  --halloween-teal: #46d3b7;
  --halloween-ink: #21163b;
  --halloween-glow: rgba(255, 159, 47, .32);
}

body.halloween-theme {
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 159, 47, .18), transparent 30vw),
    radial-gradient(circle at 88% 18%, rgba(70, 211, 183, .18), transparent 28vw),
    linear-gradient(145deg, #14091f 0%, #241039 45%, #102b35 100%);
}

.seasonal-ui-overlay {
  display: none;
}

body.halloween-theme .seasonal-ui-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
  background-image: url('https://cdn.jsdelivr.net/gh/q2edu/daka-primary@main/assets/seasonal/halloween-ui-overlay.png?v=20260904-01');
  background-repeat: no-repeat;
  background-position: top center;
  background-size: min(1260px, 112vw) auto;
  opacity: .26;
  transform: translateZ(0);
  animation: halloween-overlay-breathe 7s ease-in-out infinite alternate;
}

body.halloween-theme.login-mode .seasonal-ui-overlay {
  opacity: .34;
}

body.halloween-theme.app-mode .seasonal-ui-overlay,
body.halloween-theme.teacher-mode .seasonal-ui-overlay {
  opacity: .24;
}

body.halloween-theme.mini-game-fullscreen-mode .seasonal-ui-overlay,
body.halloween-theme.kuromi-room-fullscreen-mode .seasonal-ui-overlay {
  display: none;
}

body.halloween-theme .app-background {
  background:
    radial-gradient(circle at 9% 24%, rgba(255, 159, 47, .24), transparent 24vw),
    radial-gradient(circle at 88% 14%, rgba(129, 86, 246, .24), transparent 28vw),
    radial-gradient(circle at 70% 86%, rgba(70, 211, 183, .2), transparent 25vw),
    linear-gradient(145deg, #14091f 0%, #26103e 46%, #102e39 100%);
}

body.halloween-theme .app-background::before {
  width: 46vw;
  height: 46vw;
  left: -16vw;
  top: 8vh;
  background: rgba(255, 143, 36, .3);
  filter: blur(22px);
  opacity: .72;
}

body.halloween-theme .app-background::after {
  width: 40vw;
  height: 40vw;
  right: -13vw;
  bottom: 3vh;
  background: rgba(70, 211, 183, .24);
  filter: blur(24px);
  opacity: .64;
}

body.halloween-theme .login-screen::after {
  background-image:
    url('https://cdn.jsdelivr.net/gh/q2edu/daka-primary@main/assets/seasonal/halloween-ui-overlay.png?v=20260904-01'),
    radial-gradient(circle at 18% 18%, rgba(255, 159, 47, .26), transparent 26vw),
    radial-gradient(circle at 88% 12%, rgba(70, 211, 183, .18), transparent 26vw),
    linear-gradient(90deg, rgba(13, 7, 28, .74) 0%, rgba(39, 18, 72, .48) 42%, rgba(12, 13, 34, .18) 72%, rgba(12, 13, 34, .34) 100%);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: top center, center left, top right, center;
  background-size: min(1220px, 112vw) auto, auto, auto, cover;
}

body.halloween-theme .app-screen::after {
  background-image:
    url('https://cdn.jsdelivr.net/gh/q2edu/daka-primary@main/assets/seasonal/halloween-ui-overlay.png?v=20260904-01'),
    radial-gradient(circle at 12% 8%, rgba(255, 159, 47, .18), transparent 25vw),
    radial-gradient(circle at 92% 6%, rgba(70, 211, 183, .16), transparent 24vw),
    linear-gradient(180deg, rgba(25, 11, 42, .5) 0%, rgba(247, 243, 255, .64) 34%, rgba(255, 248, 240, .74) 100%);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: top center, top left, top right, center;
  background-size: min(1240px, 112vw) auto, auto, auto, cover;
}

body.halloween-theme.mini-game-fullscreen-mode .app-screen::after,
body.halloween-theme.kuromi-room-fullscreen-mode .app-screen::after {
  background: linear-gradient(180deg, rgba(247,246,255,.64) 0%, rgba(247,246,255,.52) 44%, rgba(255,250,246,.68) 100%);
}

body.halloween-theme .login-card,
body.halloween-theme .center-logo,
body.halloween-theme .app-logo-lockup,
body.halloween-theme .language-toggle,
body.halloween-theme .student-chip {
  border-color: rgba(255, 211, 111, .55);
  box-shadow:
    0 18px 42px rgba(17, 8, 35, .18),
    0 0 0 1px rgba(255, 255, 255, .5),
    0 0 28px rgba(255, 159, 47, .12);
}

body.halloween-theme .login-card {
  background:
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(249,246,255,.76)),
    rgba(255,255,255,.82);
}

body.halloween-theme .login-card::before {
  background: linear-gradient(90deg, var(--halloween-orange), var(--halloween-violet), var(--halloween-teal), var(--halloween-gold));
}

body.halloween-theme .brand-mark {
  background: linear-gradient(145deg, #ff9f2f 0%, #6a35cf 54%, #25b99b 100%);
  box-shadow:
    inset -6px -8px 16px rgba(47, 16, 87, .2),
    inset 5px 6px 14px rgba(255,255,255,.28),
    0 18px 34px rgba(255, 143, 36, .26);
}

body.halloween-theme .app-screen .topbar,
body.halloween-theme .teacher-topbar,
body.halloween-theme .app-screen .main-nav,
body.halloween-theme .app-screen .panel-card,
body.halloween-theme .app-screen .pet-skills-panel,
body.halloween-theme .app-screen .pet-stats-under-card,
body.halloween-theme .app-screen .owned-equipment-panel,
body.halloween-theme .app-screen .pet-collection-panel,
body.halloween-theme .app-screen .message-wall-composer,
body.halloween-theme .app-screen .wall-post-card,
body.halloween-theme .app-screen .shop-item,
body.halloween-theme .app-screen .subject-card,
body.halloween-theme .app-screen .checkin-card,
body.halloween-theme .app-screen .question-card,
body.halloween-theme .app-screen .history-row,
body.halloween-theme .teacher-screen .panel-card {
  border-color: rgba(255, 211, 111, .42);
  background:
    linear-gradient(145deg, rgba(255,255,255,.91), rgba(255,250,245,.82)),
    rgba(255,255,255,.86);
  box-shadow:
    0 20px 48px rgba(20, 9, 31, .18),
    0 0 0 1px rgba(255,255,255,.48),
    0 0 30px rgba(255, 159, 47, .1);
}

body.halloween-theme .topbar,
body.halloween-theme .main-nav,
body.halloween-theme .panel-card,
body.halloween-theme .pet-skills-panel,
body.halloween-theme .pet-stats-under-card,
body.halloween-theme .owned-equipment-panel,
body.halloween-theme .pet-collection-panel,
body.halloween-theme .message-wall-composer,
body.halloween-theme .wall-post-card,
body.halloween-theme .shop-item,
body.halloween-theme .subject-card,
body.halloween-theme .checkin-card,
body.halloween-theme .question-card,
body.halloween-theme .history-row {
  position: relative;
}

body.halloween-theme .topbar::before,
body.halloween-theme .main-nav::before,
body.halloween-theme .panel-card::before,
body.halloween-theme .pet-skills-panel::before,
body.halloween-theme .pet-stats-under-card::before,
body.halloween-theme .owned-equipment-panel::before,
body.halloween-theme .pet-collection-panel::before,
body.halloween-theme .message-wall-composer::before,
body.halloween-theme .wall-post-card::before,
body.halloween-theme .shop-item::before,
body.halloween-theme .subject-card::before,
body.halloween-theme .checkin-card::before,
body.halloween-theme .question-card::before,
body.halloween-theme .history-row::before {
  content: "";
  position: absolute;
  inset: 0 12px auto;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 159, 47, 0), var(--halloween-orange), var(--halloween-violet), var(--halloween-teal), rgba(70, 211, 183, 0));
  opacity: .76;
  pointer-events: none;
}

body.halloween-theme .topbar::before,
body.halloween-theme .main-nav::before {
  inset-inline: 0;
}

body.halloween-theme .story-title-banner {
  border-color: rgba(255, 211, 111, .5);
  background: linear-gradient(145deg, rgba(34, 13, 55, .9), rgba(16, 48, 58, .82));
  box-shadow:
    0 24px 52px rgba(19, 8, 33, .24),
    0 0 34px rgba(255, 159, 47, .14);
}

body.halloween-theme .story-title-banner::after {
  background:
    linear-gradient(180deg, rgba(255, 211, 111, .14), rgba(255,255,255,0) 36%, rgba(70, 211, 183, .12)),
    radial-gradient(circle at 10% 18%, rgba(255, 159, 47, .14), transparent 18vw),
    radial-gradient(circle at 90% 20%, rgba(70, 211, 183, .13), transparent 18vw);
}

body.halloween-theme .nav-button.active,
body.halloween-theme .login-mode-button.active,
body.halloween-theme .primary-button {
  color: #fff;
  background: linear-gradient(135deg, #6f35d6 0%, #ff8f24 54%, #25b99b 100%);
  box-shadow: 0 12px 26px rgba(255, 143, 36, .24);
}

body.halloween-theme .secondary-button,
body.halloween-theme .icon-button {
  color: #4b2a85;
  background: linear-gradient(135deg, #fff4d8, #f1eaff);
  border: 1px solid rgba(255, 211, 111, .42);
}

body.halloween-theme .eyebrow {
  color: #6f35d6;
}

body.halloween-theme .wallet-card,
body.halloween-theme .date-card,
body.halloween-theme .streak-pill,
body.halloween-theme .attribute-chip,
body.halloween-theme .collection-title-badge {
  border-color: rgba(255, 211, 111, .46);
  background: linear-gradient(135deg, rgba(255, 246, 216, .92), rgba(239, 232, 255, .9));
}

body.halloween-theme .pet-stage,
body.halloween-theme .pet-interaction-stage,
body.halloween-theme .kuromi-room-stage,
body.halloween-theme .mini-game-canvas {
  border-color: rgba(255, 211, 111, .52);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.36),
    0 20px 45px rgba(22, 8, 34, .18),
    0 0 34px rgba(255, 159, 47, .12);
}

body.halloween-theme .form-error,
body.halloween-theme .inline-error-message,
body.halloween-theme .coin-feedback {
  color: #d52645;
}

@keyframes halloween-overlay-breathe {
  from {
    opacity: .22;
    transform: translate3d(0, -4px, 0);
  }
  to {
    opacity: .34;
    transform: translate3d(0, 2px, 0);
  }
}

@media (max-width: 620px) {
  body.halloween-theme .seasonal-ui-overlay {
    background-size: max(760px, 182vw) auto;
    background-position: top center;
    opacity: .18;
  }

  body.halloween-theme .login-screen::after,
  body.halloween-theme .app-screen::after {
    background-size: max(780px, 184vw) auto, auto, auto, cover;
  }

  body.halloween-theme .topbar::before,
  body.halloween-theme .main-nav::before,
  body.halloween-theme .panel-card::before,
  body.halloween-theme .pet-skills-panel::before,
  body.halloween-theme .pet-stats-under-card::before,
  body.halloween-theme .owned-equipment-panel::before,
  body.halloween-theme .pet-collection-panel::before,
  body.halloween-theme .message-wall-composer::before,
  body.halloween-theme .wall-post-card::before,
  body.halloween-theme .shop-item::before,
  body.halloween-theme .subject-card::before,
  body.halloween-theme .checkin-card::before,
  body.halloween-theme .question-card::before,
  body.halloween-theme .history-row::before {
    height: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.halloween-theme .seasonal-ui-overlay {
    animation: none;
    transform: none;
  }
}

/* Final cascade: keep the companion-home refresh above legacy polish layers. */
:root {
  --ink: #4f4660;
  --muted: #8d8297;
  --primary: #e78fab;
  --primary-dark: #9a6385;
  --lavender: #eee9ff;
  --peach: #ffe9dc;
  --mint: #dff7ec;
  --yellow: #fff2b9;
  --line: rgba(143,119,151,.14);
  --panel: rgba(255,255,255,.88);
  --shadow: 0 20px 50px rgba(107,83,113,.13);
}
body { color: var(--ink); background: #fff9f3; }
.login-screen { min-height: 100dvh; align-content: center; padding: clamp(76px,8vw,110px) clamp(22px,7vw,110px) clamp(28px,5vw,70px); }
.login-screen::after { background: linear-gradient(90deg,rgba(255,248,240,.98) 0%,rgba(255,248,240,.92) 34%,rgba(255,245,239,.26) 62%,rgba(230,245,241,.16) 100%); }
.login-card { width: min(100%,470px); overflow: hidden; padding: clamp(28px,4vw,44px); border: 3px solid rgba(255,255,255,.96); border-radius: 42px; text-align: left; background: rgba(255,253,250,.86); box-shadow: 0 28px 80px rgba(91,72,94,.2),inset 0 1px 0 #fff; backdrop-filter: blur(24px) saturate(1.04); }
.login-card::before { content: ""; position: absolute; inset: 11px; z-index: -1; width: auto; height: auto; border: 1px dashed rgba(227,150,173,.22); border-radius: 32px; background: transparent; pointer-events: none; }
.login-card .hero-copy { margin: 0 0 26px; color: #887b8e; font-size: 15px; line-height: 1.7; }

#pet-selection-modal .initial-pet-grid { display: flex; grid-template-columns: none; gap: clamp(13px,2vw,22px); margin: 0; overflow-x: auto; padding: 10px max(16px,calc((100% - 280px)/2)) 18px; scroll-behavior: smooth; scroll-padding-inline: 20px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#pet-selection-modal .initial-pet-grid::-webkit-scrollbar { display: none; }
#pet-selection-modal .initial-pet-card { flex: 0 0 clamp(220px,31vw,292px); min-width: 0; min-height: 330px; padding: 17px; border: 4px solid rgba(255,255,255,.94); border-radius: 34px; color: #5e5166; background: linear-gradient(155deg,#fff1ea,#fffaf2 54%,#e9f7f0); box-shadow: 0 16px 35px rgba(103,81,107,.12); scroll-snap-align: center; scroll-snap-stop: always; transform: scale(.94); transition: .24s ease; }
#pet-selection-modal .initial-pet-card { position: relative; }
#pet-selection-modal .initial-pet-recommended { position: absolute; z-index: 2; top: 12px; right: 12px; display: inline-flex; align-items: center; justify-content: center; min-width: 54px; padding: 7px 11px; border-radius: 999px; color: #fff; background: linear-gradient(135deg,#ff9f2f,#ef6b47); box-shadow: 0 7px 16px rgba(222,105,50,.24); font-size: 12px; font-weight: 950; letter-spacing: .04em; }
#pet-selection-modal .initial-pet-card:nth-child(3n + 2) { background: linear-gradient(155deg,#eee8ff,#fff8fb 56%,#e4f6f0); }
#pet-selection-modal .initial-pet-card:nth-child(3n) { background: linear-gradient(155deg,#e2f4ff,#fff9ef 56%,#ffe7ed); }
#pet-selection-modal .initial-pet-card:hover, #pet-selection-modal .initial-pet-card:focus-visible { outline: none; transform: translateY(-4px) scale(.97); }
#pet-selection-modal .initial-pet-card.selected { border-color: #efa9bd; background: linear-gradient(155deg,#fff1ea,#fffaf2 54%,#e9f7f0); box-shadow: 0 0 0 6px rgba(241,173,192,.18),0 22px 44px rgba(152,93,124,.2); transform: scale(1); }
#pet-selection-modal .initial-pet-card strong { display: block; margin: 2px 0 10px; color: #5b4c63; font-size: 22px; letter-spacing: -.02em; }
#pet-selection-modal .initial-pet-card .initial-pet-art { display: block; width: 100%; height: 225px; margin: 0 auto 8px; border-radius: 20px; background: transparent; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(91,72,96,.12)); }
#pet-selection-modal .initial-pet-card small { display: inline-flex; min-width: 54px; justify-content: center; margin-top: 7px; padding: 6px 10px; border-radius: 999px; color: #9a6c84; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 950; }
#pet-selection-modal .pet-adoption-fields { display: grid; grid-template-columns: 1fr 1fr; width: min(100%,660px); gap: 12px; margin: 0 auto 10px; text-align: left; }

@media (max-width: 760px) {
  .login-screen { place-items: end center; padding: 78px 14px max(14px,env(safe-area-inset-bottom)); }
  .login-screen::after { background: linear-gradient(180deg,rgba(255,248,240,.1) 0%,rgba(255,248,240,.52) 30%,rgba(255,248,240,.97) 68%,#fff8f0 100%); }
  .login-card { width: min(100%,500px); padding: 28px 24px 23px; border-radius: 34px 34px 26px 26px; }
}

@media (max-width: 620px) {
  #pet-selection-modal .pet-selection-card { width: calc(100% - 6px); max-height: calc(100dvh - 12px); padding: 20px 10px 16px; border-width: 3px; border-radius: 30px; }
  #pet-selection-modal .initial-pet-grid { gap: 10px; margin: 0; padding: 7px calc((100% - min(67vw,238px))/2) 12px; }
  #pet-selection-modal .initial-pet-card { flex-basis: min(67vw,238px); min-height: 267px; padding: 12px; border-width: 3px; border-radius: 27px; }
  #pet-selection-modal .initial-pet-card strong { margin-bottom: 5px; font-size: 18px; }
  #pet-selection-modal .initial-pet-card .initial-pet-art { height: 178px; }
  #pet-selection-modal .pet-adoption-fields { grid-template-columns: 1fr 1fr; gap: 7px; margin: 0 auto 10px; }
}

@media (max-width: 390px) {
  .login-card { padding: 24px 18px 20px; }
  #pet-selection-modal .pet-adoption-fields { grid-template-columns: 1fr; }
  #pet-selection-modal .initial-pet-card { min-height: 245px; }
  #pet-selection-modal .initial-pet-card .initial-pet-art { height: 157px; }
}

/* 2026 macaron companion-home refresh */
:root {
  --ink: #4f4660;
  --muted: #8d8297;
  --primary: #e78fab;
  --primary-dark: #9a6385;
  --lavender: #eee9ff;
  --peach: #ffe9dc;
  --mint: #dff7ec;
  --yellow: #fff2b9;
  --line: rgba(143, 119, 151, .14);
  --panel: rgba(255, 255, 255, .88);
  --shadow: 0 20px 50px rgba(107, 83, 113, .13);
  color: var(--ink);
  background: #fff9f3;
}

html { min-height: 100%; background: #fff9f3; }
body { min-height: 100dvh; overflow-x: hidden; background: #fff9f3; }
button, input { -webkit-tap-highlight-color: transparent; }

.login-screen {
  min-height: 100dvh;
  align-content: center;
  padding: clamp(76px, 8vw, 110px) clamp(22px, 7vw, 110px) clamp(28px, 5vw, 70px);
}
.login-screen::before {
  background-position: center;
  filter: saturate(.78) brightness(1.08);
  transform: scale(1.015);
}
.login-screen::after {
  background:
    linear-gradient(90deg, rgba(255,248,240,.98) 0%, rgba(255,248,240,.92) 34%, rgba(255,245,239,.26) 62%, rgba(230,245,241,.16) 100%);
}
.login-sky-decor { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.login-cloud { position: absolute; width: 150px; height: 48px; border-radius: 999px; background: rgba(255,255,255,.64); filter: blur(.3px); }
.login-cloud::before, .login-cloud::after { content: ""; position: absolute; bottom: 8px; border-radius: 50%; background: inherit; }
.login-cloud::before { left: 24px; width: 70px; height: 70px; }
.login-cloud::after { right: 18px; width: 54px; height: 54px; }
.cloud-one { left: 40%; top: 15%; animation: cloud-drift 8s ease-in-out infinite; }
.cloud-two { right: 3%; bottom: 16%; width: 110px; opacity: .64; animation: cloud-drift 9s ease-in-out -3s infinite reverse; }
.login-star { position: absolute; color: #f3b89d; font-size: clamp(24px, 3vw, 42px); opacity: .72; animation: soft-twinkle 2.8s ease-in-out infinite; }
.login-star.star-one { left: 48%; top: 27%; }
.login-star.star-two { right: 10%; top: 19%; color: #a8d9c4; animation-delay: .8s; }
@keyframes cloud-drift { 0%,100% { transform: translateX(-8px); } 50% { transform: translateX(12px); } }
@keyframes soft-twinkle { 0%,100% { opacity: .36; transform: rotate(-8deg) scale(.9); } 50% { opacity: .9; transform: rotate(8deg) scale(1.08); } }

.login-card {
  width: min(100%, 470px);
  padding: clamp(28px, 4vw, 44px);
  border: 3px solid rgba(255,255,255,.96);
  border-radius: 42px;
  text-align: left;
  background: rgba(255,253,250,.86);
  box-shadow: 0 28px 80px rgba(91,72,94,.2), inset 0 1px 0 #fff;
  backdrop-filter: blur(24px) saturate(1.04);
}
.login-card::before { content: ""; position: absolute; inset: 11px; z-index: -1; border: 1px dashed rgba(227,150,173,.22); border-radius: 32px; pointer-events: none; }
.login-welcome-badge { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; padding: 8px 13px; border-radius: 999px; color: #8a6f88; background: #fff0f4; font-size: 11px; font-weight: 1000; letter-spacing: .12em; }
.login-card .brand-mark { position: absolute; top: 32px; right: 34px; width: 62px; height: 62px; margin: 0; border: 4px solid white; border-radius: 22px; background: linear-gradient(145deg, #ffd8d0, #f3acd1); box-shadow: 0 12px 24px rgba(200,124,158,.2); font-size: 32px; transform: rotate(4deg); }
.login-card .eyebrow { margin-top: 10px; color: #b47d99; font-size: 12px; letter-spacing: .18em; }
.login-card h1 { margin: 4px 0 8px; color: #53465d; font-size: clamp(36px, 5vw, 50px); line-height: 1.08; }
.login-card .hero-copy { margin: 0 0 26px; color: #887b8e; font-size: 15px; line-height: 1.7; }
.login-form { gap: 9px; }
.login-form label { display: flex; align-items: center; gap: 7px; margin-top: 3px; color: #65596e; font-size: 13px; font-weight: 950; }
.login-field-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 9px; background: #fff1e5; font-size: 14px; }
.login-form > input { border: 2px solid rgba(196,171,199,.28); border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: inset 0 2px 5px rgba(111,82,112,.035); }
.login-form > input { min-height: 56px; padding: 15px 17px; }
.login-form > input:focus { border-color: #e8a8bb; box-shadow: 0 0 0 5px rgba(240,180,198,.18); }
.login-session-note { display: flex; align-items: center; gap: 7px; margin: 4px 0 2px; color: #9a8798; font-size: 12px; font-weight: 750; }
.login-submit-button { display: flex; min-height: 57px; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; border-radius: 18px; background: linear-gradient(135deg, #ef9eb4, #d99bd1); box-shadow: 0 13px 26px rgba(212,137,174,.28); font-size: 16px; }
.login-submit-button span:last-child { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.24); }
.login-help-copy { margin: 14px 0 0; color: #a092a4; font-size: 12px; text-align: center; }
.login-card .form-error { min-height: 18px; margin: 10px 0 0; text-align: center; }
.center-logo { top: clamp(15px, 3vw, 30px); right: clamp(16px, 3vw, 38px); width: clamp(118px, 14vw, 205px); border-radius: 20px; background: rgba(255,255,255,.76); box-shadow: 0 12px 32px rgba(100,78,104,.12); }

@media (max-width: 760px) {
  .login-screen { place-items: end center; padding: 78px 14px max(14px, env(safe-area-inset-bottom)); }
  .login-screen::before { background-position: 61% center; }
  .login-screen::after { background: linear-gradient(180deg, rgba(255,248,240,.1) 0%, rgba(255,248,240,.52) 30%, rgba(255,248,240,.97) 68%, #fff8f0 100%); }
  .login-card { width: min(100%, 500px); padding: 28px 24px 23px; border-radius: 34px 34px 26px 26px; }
  .login-card .brand-mark { top: 24px; right: 25px; width: 54px; height: 54px; font-size: 27px; }
  .center-logo { left: 14px; right: auto; width: 112px; }
  .cloud-one { left: 6%; top: 17%; }
  .login-card h1 { font-size: 36px; }
}

@media (max-width: 390px) {
  .login-screen { padding-inline: 8px; }
  .login-card { padding: 24px 18px 20px; }
  .login-card .brand-mark { width: 48px; height: 48px; font-size: 24px; }
  .login-card .hero-copy { margin-bottom: 18px; font-size: 13px; }
  .login-form > input { min-height: 51px; }
}

.app-screen {
  min-height: 100dvh;
  padding-bottom: 92px;
  --panel: rgba(255,255,255,.8);
}
.app-screen::before {
  background:
    radial-gradient(circle at 12% 12%, rgba(255,213,220,.72), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(208,242,228,.78), transparent 30%),
    radial-gradient(circle at 76% 88%, rgba(222,214,255,.68), transparent 32%),
    linear-gradient(145deg, #fff7ee 0%, #fdf8ff 48%, #edf9f2 100%);
}
.app-screen::after { background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,250,247,.42)); }
.app-screen .topbar { top: 10px; width: min(100% - 28px, 1180px); margin: 10px auto 0; padding: 10px 14px; border: 2px solid rgba(255,255,255,.92); border-radius: 24px; background: rgba(255,255,255,.72); box-shadow: 0 12px 34px rgba(111,85,115,.1); backdrop-filter: blur(18px); }
.app-screen .app-header-logo { max-height: 48px; }
.app-screen .student-chip { border: 1px solid rgba(219,178,196,.2); background: #fff4f6; }
.app-screen .icon-button { color: #8c6c80; background: #fff0e7; }
.app-screen .page-shell { width: min(100% - 28px, 1180px); padding-top: 14px; }
.app-screen .story-title-banner { display: none; }
.app-screen .welcome-row { min-height: 72px; margin: 2px 0 12px; padding: 8px 14px; border-radius: 24px; background: rgba(255,255,255,.54); backdrop-filter: blur(10px); }
.app-screen .welcome-profile { align-items: center; }
.app-screen .avatar-upload-control { grid-template-columns: 52px; }
.app-screen .avatar-upload-preview { width: 52px; height: 52px; border: 3px solid white; border-radius: 18px; background: #ffe7ec; }
.app-screen .avatar-upload-text { display: none; }
.app-screen .welcome-copy .eyebrow { margin-bottom: 1px; color: #ba7997; }
.app-screen .welcome-copy h2 { margin: 0; font-size: clamp(23px,3vw,32px); }
.app-screen .streak-pill { border: 1px solid rgba(241,202,126,.22); color: #8b6b3f; background: #fff4cd; }

.app-screen .main-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 120;
  width: min(calc(100% - 28px), 920px);
  margin: 0;
  padding: 8px;
  border: 2px solid rgba(255,255,255,.94);
  border-radius: 28px;
  background: rgba(255,253,250,.84);
  box-shadow: 0 18px 50px rgba(94,73,99,.2);
  transform: translateX(-50%);
  backdrop-filter: blur(22px) saturate(1.1);
}
.app-screen .nav-button { display: grid; min-width: 0; min-height: 54px; place-items: center; padding: 8px 10px; border-radius: 20px; color: #8d8191; background: transparent; font-size: 13px; line-height: 1.1; }
.app-screen .nav-button::before { display: block; margin-bottom: 3px; font-size: 20px; line-height: 1; }
.app-screen .nav-button[data-view="checkin-view"]::before { content: "📚"; }
.app-screen .nav-button[data-view="home-view"]::before { content: "🏡"; }
.app-screen .nav-button[data-view="guide-view"]::before { content: "🎮"; }
.app-screen .nav-button[data-view="shop-view"]::before { content: "🛍️"; }
.app-screen .nav-button[data-view="wall-view"]::before { content: "💌"; }
.app-screen .nav-button[data-view="friends-view"]::before { content: "🫶"; }
.app-screen .nav-button[data-view="music-box-view"]::before { content: "🎵"; }
.app-screen .nav-button.active { color: #9c617f; background: linear-gradient(145deg, #ffe8ee, #fff3dc); box-shadow: inset 0 0 0 1px rgba(231,148,174,.14); }

#home-view.active { display: flex; flex-direction: column; gap: 18px; }
#home-view .pet-dashboard-grid { order: 1; }
#home-view .home-top-panels { order: 2; }
#home-view .pet-collection-panel { order: 3; }
#home-view .pet-card { padding: clamp(18px,3vw,30px); border: 3px solid rgba(255,255,255,.86); border-radius: 38px; background: rgba(255,253,250,.7); box-shadow: 0 24px 60px rgba(100,78,105,.13); }
#home-view .pet-card > .panel-heading { position: relative; z-index: 3; margin-bottom: 3px; }
#home-view .pet-card > .panel-heading .eyebrow { color: #bc7d9a; }
#home-view .pet-card > .panel-heading h3 { color: #55475e; font-size: clamp(25px,3vw,34px); }
.pet-home-greeting { display: flex; width: fit-content; align-items: center; gap: 8px; margin: 0 auto -12px; padding: 9px 15px; border: 2px solid white; border-radius: 999px 999px 999px 10px; color: #785f72; background: rgba(255,255,255,.9); box-shadow: 0 10px 24px rgba(105,82,110,.12); font-size: 13px; font-weight: 850; transform: translateY(8px); }
.pet-home-scene { display: grid; grid-template-columns: minmax(90px,120px) minmax(0,1fr) minmax(90px,120px); align-items: center; gap: clamp(10px,2vw,24px); }
.pet-home-scene .pet-stage { min-height: clamp(410px,55vw,620px); aspect-ratio: 1.36 / 1; margin: 0; border: 5px solid rgba(255,255,255,.92); border-radius: 42px; background: linear-gradient(rgba(255,246,237,.1), rgba(255,246,237,.12)), url('assets/pet-interactions/scenes/cozy-home.png') center / cover no-repeat; box-shadow: inset 0 -70px 100px rgba(109,83,87,.08), 0 20px 45px rgba(91,73,96,.15); }
.pet-home-scene .pet-stage::before { display: none; }
.pet-home-scene .pet-stage.role-card-stage { background: linear-gradient(rgba(255,246,237,.18), rgba(255,246,237,.16)), url('assets/pet-interactions/scenes/cozy-home.png') center / cover no-repeat; }
.pet-home-scene .pet-avatar { z-index: 3; width: 92%; height: 92%; align-self: end; filter: drop-shadow(0 18px 12px rgba(88,67,88,.18)); }
.pet-home-scene .pet-avatar .role-card-art { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 30px; object-fit: contain; box-shadow: none; }
.pet-home-scene .role-card-stage .pet-avatar { width: 96%; height: 96%; }
.pet-room-window { position: absolute; top: 8%; right: 7%; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; width: 19%; aspect-ratio: 1; overflow: hidden; border: 6px solid rgba(255,255,255,.68); border-radius: 50% 50% 22px 22px; background: linear-gradient(#ccecf5,#f8e9c8); opacity: .72; }
.pet-room-window span:first-child { border-right: 3px solid rgba(255,255,255,.62); }
.pet-room-rug { position: absolute; left: 22%; right: 22%; bottom: 8%; z-index: 1; height: 14%; border-radius: 50%; background: rgba(242,177,179,.38); box-shadow: 0 0 0 8px rgba(255,255,255,.16); }
.pet-home-scene .pet-shadow { z-index: 2; bottom: 11%; width: 34%; background: rgba(97,75,87,.16); }
.pet-home-shortcuts { display: grid; gap: clamp(10px,2vw,19px); }
.pet-home-shortcut { display: grid; justify-items: center; min-height: 112px; padding: 12px 8px; border: 3px solid rgba(255,255,255,.94); border-radius: 28px; color: #66576c; background: var(--shortcut-bg,#ffe9e4); box-shadow: 0 13px 28px rgba(97,75,104,.11); transition: transform .2s ease, box-shadow .2s ease; }
.pet-home-shortcut:hover, .pet-home-shortcut:focus-visible { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 18px 34px rgba(97,75,104,.17); outline: none; }
.pet-home-shortcut span { display: grid; width: 45px; height: 45px; place-items: center; margin-bottom: 4px; border-radius: 16px; background: rgba(255,255,255,.64); font-size: 25px; }
.pet-home-shortcut strong { font-size: 14px; }
.pet-home-shortcut small { margin-top: 2px; color: #948596; font-size: 10px; font-weight: 800; line-height: 1.15; }
.shortcut-study { --shortcut-bg: #fff0c9; }
.shortcut-shop { --shortcut-bg: #ffe4e8; }
.shortcut-music { --shortcut-bg: #eee5ff; }
.shortcut-game { --shortcut-bg: #dcf3e8; }
.shortcut-friends { --shortcut-bg: #e2efff; }
.shortcut-wall { --shortcut-bg: #ffe8d8; }
#home-view .pet-card-actions { margin-top: 10px; }
#home-view .home-top-panels { grid-template-columns: 1.1fr .9fr; }
#home-view .stats-card, #home-view .mission-card, #home-view .pet-skills-panel, #home-view .pet-stats-under-card, #home-view .owned-equipment-panel, #home-view .pet-collection-panel { border: 2px solid rgba(255,255,255,.84); border-radius: 28px; }

#pet-selection-modal { padding: clamp(10px,3vw,32px); background: linear-gradient(145deg, rgba(255,240,237,.94), rgba(235,248,243,.95)); backdrop-filter: blur(16px); }
#pet-selection-modal::before, #pet-selection-modal::after { content: ""; position: fixed; z-index: -1; border-radius: 50%; pointer-events: none; }
#pet-selection-modal::before { width: 42vw; height: 42vw; left: -12vw; top: -14vw; background: rgba(255,212,221,.58); }
#pet-selection-modal::after { width: 38vw; height: 38vw; right: -10vw; bottom: -14vw; background: rgba(199,236,221,.64); }
#pet-selection-modal .pet-selection-card { width: min(100%,1120px); max-height: calc(100dvh - 28px); padding: clamp(26px,3.4vw,46px); overflow-x: hidden; overflow-y: auto; border: 4px solid rgba(255,255,255,.96); border-radius: 46px; background: rgba(255,253,250,.88); box-shadow: 0 30px 90px rgba(101,78,107,.19); backdrop-filter: blur(24px); }
.pet-selection-step { display: flex; width: min(100%,260px); align-items: center; justify-content: center; margin: 0 auto 12px; }
.pet-selection-step span { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border-radius: 50%; color: white; background: #e59bb1; font-size: 11px; font-style: normal; font-weight: 1000; }
.pet-selection-step span:nth-of-type(2), .pet-selection-step span:nth-of-type(3) { color: #9b8c9e; background: #eee8ef; }
.pet-selection-step i { width: 48px; height: 3px; background: #eee8ef; }
#pet-selection-modal .modal-paw { margin-bottom: 5px; font-size: 31px; }
#pet-selection-modal .eyebrow { color: #ba7b98; }
#pet-selection-modal h2 { margin-bottom: 6px; color: #54475d; font-size: clamp(28px,4vw,43px); }
#pet-selection-modal #pet-selection-copy { max-width: 720px; margin: 0 auto 18px; color: #8d8191; font-size: 14px; }
.pet-carousel-shell { position: relative; display: grid; grid-template-columns: 48px minmax(0,1fr) 48px; align-items: center; gap: 8px; }
.initial-pet-grid { display: flex; grid-template-columns: none; gap: clamp(13px,2vw,22px); overflow-x: auto; padding: 10px max(16px,calc((100% - 280px) / 2)) 18px; scroll-behavior: smooth; scroll-padding-inline: 20px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.initial-pet-grid::-webkit-scrollbar { display: none; }
.initial-pet-card { flex: 0 0 clamp(220px,31vw,292px); min-height: 330px; scroll-snap-align: center; scroll-snap-stop: always; padding: 17px; border: 4px solid rgba(255,255,255,.94); border-radius: 34px; color: #5e5166; background: linear-gradient(155deg,#fff1ea,#fffaf2 54%,#e9f7f0); box-shadow: 0 16px 35px rgba(103,81,107,.12); transform: scale(.94); transition: .24s ease; }
.initial-pet-card:nth-child(3n + 2) { background: linear-gradient(155deg,#eee8ff,#fff8fb 56%,#e4f6f0); }
.initial-pet-card:nth-child(3n) { background: linear-gradient(155deg,#e2f4ff,#fff9ef 56%,#ffe7ed); }
.initial-pet-card:hover, .initial-pet-card:focus-visible { outline: none; transform: translateY(-4px) scale(.97); }
.initial-pet-card.selected { border-color: #efa9bd; box-shadow: 0 0 0 6px rgba(241,173,192,.18), 0 22px 44px rgba(152,93,124,.2); transform: scale(1); }
.initial-pet-card strong { display: block; margin: 2px 0 10px; color: #5b4c63; font-size: 22px; letter-spacing: -.02em; }
.initial-pet-card .initial-pet-art { width: 100%; height: 225px; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(91,72,96,.12)); }
.initial-pet-card small { display: inline-flex; min-width: 54px; justify-content: center; margin-top: 7px; padding: 6px 10px; border-radius: 999px; color: #9a6c84; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 950; }
.pet-carousel-arrow { display: grid; width: 46px; height: 62px; place-items: center; border: 3px solid white; border-radius: 20px; color: #9b7088; background: #ffe7ed; box-shadow: 0 10px 23px rgba(112,83,110,.13); font-size: 38px; line-height: 1; transition: transform .18s ease; }
.pet-carousel-arrow:hover, .pet-carousel-arrow:focus-visible { outline: none; transform: scale(1.07); }
.pet-swipe-hint { margin: -3px 0 12px; color: #a18e9f; font-size: 12px; font-weight: 850; text-align: center; }
.pet-adoption-fields { width: min(100%,660px); margin: 0 auto 10px; }
.pet-adoption-fields label { color: #67596e; font-size: 12px; }
.pet-adoption-fields input { min-height: 48px; border: 2px solid rgba(202,177,202,.3); border-radius: 16px; background: rgba(255,255,255,.85); }
#pet-selection-modal #confirm-initial-pet { width: min(100%,460px); min-height: 54px; margin-inline: auto; border-radius: 18px; background: linear-gradient(135deg,#efa1b6,#d29fd3); box-shadow: 0 13px 28px rgba(206,137,177,.25); }

@media (max-width: 900px) {
  .app-screen .page-shell { width: min(100% - 18px,760px); }
  .pet-home-scene { grid-template-columns: 82px minmax(0,1fr) 82px; gap: 8px; }
  .pet-home-shortcut { min-height: 97px; padding: 8px 5px; border-radius: 23px; }
  .pet-home-shortcut span { width: 39px; height: 39px; font-size: 22px; }
  .pet-home-shortcut small { display: none; }
  .pet-home-scene .pet-stage { min-height: clamp(380px,67vw,540px); }
}

@media (max-width: 620px) {
  .app-screen { padding-bottom: 88px; }
  .app-screen .topbar { top: 5px; width: calc(100% - 12px); margin-top: 5px; padding: 7px 9px; border-radius: 19px; }
  .app-screen .app-header-logo { max-width: 100px; max-height: 37px; }
  .app-screen .student-chip { max-width: 132px; padding: 7px 9px; font-size: 12px; }
  .app-screen .icon-button { width: 38px; height: 38px; }
  .app-screen .page-shell { width: 100%; padding: 8px 6px 18px; }
  .app-screen .welcome-row { min-height: 58px; margin-bottom: 8px; padding: 6px 9px; border-radius: 18px; }
  .app-screen .avatar-upload-control { grid-template-columns: 42px; }
  .app-screen .avatar-upload-preview { width: 42px; height: 42px; border-radius: 14px; font-size: 21px; }
  .app-screen .welcome-copy h2 { font-size: 21px; }
  .app-screen .welcome-copy .eyebrow, .app-screen #today-label { display: none; }
  .app-screen .streak-pill { align-self: center; padding: 7px 9px; font-size: 11px; }
  .app-screen .streak-pill strong { font-size: 16px; }
  .app-screen .main-nav { display: flex; width: calc(100% - 12px); justify-content: flex-start; gap: 3px; overflow-x: auto; padding: 6px; border-radius: 22px; scrollbar-width: none; }
  .app-screen .main-nav::-webkit-scrollbar { display: none; }
  .app-screen .nav-button { flex: 0 0 66px; min-height: 57px; padding: 6px 3px; border-radius: 16px; font-size: 10px; }
  .app-screen .nav-button::before { font-size: 19px; }
  #home-view.active { gap: 10px; }
  #home-view .pet-card { padding: 13px 8px 16px; border-radius: 25px; }
  #home-view .pet-card > .panel-heading { padding: 0 8px; }
  #home-view .pet-card > .panel-heading h3 { font-size: 23px; }
  .pet-home-greeting { max-width: calc(100% - 50px); margin-bottom: -5px; padding: 7px 11px; font-size: 10px; transform: translateY(4px); }
  .pet-home-scene { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; align-items: stretch; }
  .pet-home-scene .pet-stage { grid-column: 1 / -1; grid-row: 1; min-height: 0; aspect-ratio: 4 / 3; border-width: 3px; border-radius: 26px; }
  .pet-home-shortcuts { display: contents; }
  .pet-home-shortcut { min-height: 72px; padding: 7px 4px; border-width: 2px; border-radius: 19px; }
  .pet-home-shortcut span { width: 32px; height: 32px; margin-bottom: 2px; border-radius: 11px; font-size: 18px; }
  .pet-home-shortcut strong { font-size: 11px; }
  .pet-home-shortcuts-left .pet-home-shortcut:nth-child(1) { grid-column: 1; grid-row: 2; }
  .pet-home-shortcuts-left .pet-home-shortcut:nth-child(2) { grid-column: 2; grid-row: 2; }
  .pet-home-shortcuts-left .pet-home-shortcut:nth-child(3) { grid-column: 3; grid-row: 2; }
  .pet-home-shortcuts-right .pet-home-shortcut:nth-child(1) { grid-column: 1; grid-row: 3; }
  .pet-home-shortcuts-right .pet-home-shortcut:nth-child(2) { grid-column: 2; grid-row: 3; }
  .pet-home-shortcuts-right .pet-home-shortcut:nth-child(3) { grid-column: 3; grid-row: 3; }
  .pet-home-scene .pet-avatar { width: 98%; height: 98%; }
  .pet-home-scene .pet-avatar .role-card-art { border-radius: 22px; }
  #home-view .home-top-panels { grid-template-columns: 1fr; }
  #pet-selection-modal { padding: 6px; }
  #pet-selection-modal .pet-selection-card { width: calc(100% - 6px); max-height: calc(100dvh - 12px); padding: 20px 10px 16px; border-width: 3px; border-radius: 30px; }
  .pet-selection-step { margin-bottom: 7px; }
  #pet-selection-modal .modal-paw { display: none; }
  #pet-selection-modal h2 { font-size: 27px; }
  #pet-selection-modal #pet-selection-copy { margin-bottom: 8px; padding: 0 12px; font-size: 12px; }
  .pet-carousel-shell { grid-template-columns: 35px minmax(0,1fr) 35px; gap: 2px; }
  .pet-carousel-arrow { width: 34px; height: 54px; border-width: 2px; border-radius: 14px; font-size: 29px; }
  .initial-pet-grid { gap: 10px; padding: 7px calc((100% - min(67vw,238px)) / 2) 12px; }
  .initial-pet-card { flex-basis: min(67vw,238px); min-height: 267px; padding: 12px; border-width: 3px; border-radius: 27px; }
  .initial-pet-card strong { margin-bottom: 5px; font-size: 18px; }
  .initial-pet-card .initial-pet-art { height: 178px; }
  .initial-pet-card small { margin-top: 3px; }
  .pet-swipe-hint { margin-bottom: 7px; }
  .pet-adoption-fields { grid-template-columns: 1fr 1fr; gap: 7px; }
  .pet-adoption-fields input { min-height: 44px; padding: 9px 10px; font-size: 12px; }
  #pet-selection-modal #confirm-initial-pet { min-height: 49px; }
}

@media (max-width: 390px) {
  .pet-home-scene .pet-stage { aspect-ratio: 1.08 / 1; }
  .pet-adoption-fields { grid-template-columns: 1fr; }
  .initial-pet-card { min-height: 245px; }
  .initial-pet-card .initial-pet-art { height: 157px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-cloud, .login-star { animation: none; }
  .initial-pet-grid { scroll-behavior: auto; }
}

body.new-player-guide-active {
  overflow: hidden;
}

body.new-player-guide-active .language-toggle {
  opacity: 0;
  pointer-events: none;
}

.new-player-guide-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  --new-player-guide-spotlight-x: 18px;
  --new-player-guide-spotlight-y: 18px;
  --new-player-guide-spotlight-w: calc(100vw - 36px);
  --new-player-guide-spotlight-h: calc(100dvh - 36px);
  --new-player-guide-spotlight-radius: 28px;
}

.new-player-guide-scrim {
  position: fixed;
  inset: 0;
  z-index: 130;
}

.new-player-guide-overlay.new-player-guide-no-spotlight .new-player-guide-scrim {
  background: rgba(0, 0, 0, .86);
  backdrop-filter: none;
}

.new-player-guide-overlay.new-player-guide-no-spotlight .new-player-guide-shade,
.new-player-guide-overlay.new-player-guide-no-spotlight .new-player-guide-spotlight-ring {
  display: none;
}

.new-player-guide-shade {
  position: fixed;
  z-index: 130;
  background: rgba(13, 14, 31, .66);
  backdrop-filter: grayscale(1) brightness(.5) blur(1px);
}

.new-player-guide-shade-top {
  top: 0;
  left: 0;
  right: 0;
  height: var(--new-player-guide-spotlight-y);
}

.new-player-guide-shade-right {
  top: var(--new-player-guide-spotlight-y);
  right: 0;
  width: calc(100vw - var(--new-player-guide-spotlight-x) - var(--new-player-guide-spotlight-w));
  height: var(--new-player-guide-spotlight-h);
}

.new-player-guide-shade-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100dvh - var(--new-player-guide-spotlight-y) - var(--new-player-guide-spotlight-h));
}

.new-player-guide-shade-left {
  top: var(--new-player-guide-spotlight-y);
  left: 0;
  width: var(--new-player-guide-spotlight-x);
  height: var(--new-player-guide-spotlight-h);
}

.new-player-guide-spotlight-ring {
  position: fixed;
  left: var(--new-player-guide-spotlight-x);
  top: var(--new-player-guide-spotlight-y);
  z-index: 132;
  width: var(--new-player-guide-spotlight-w);
  height: var(--new-player-guide-spotlight-h);
  border: 4px solid rgba(255,255,255,.94);
  border-radius: var(--new-player-guide-spotlight-radius);
  box-shadow: 0 0 0 7px rgba(109,105,242,.36), 0 18px 54px rgba(255,232,117,.3), inset 0 0 28px rgba(255,255,255,.24);
  transition: left .24s ease, top .24s ease, width .24s ease, height .24s ease, border-radius .24s ease;
}

.new-player-guide-focus {
  position: relative !important;
  z-index: 131 !important;
  filter: none !important;
  isolation: isolate;
  box-shadow: none !important;
}

.new-player-guide-close {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 18px);
  right: calc(env(safe-area-inset-right) + 18px);
  z-index: 175;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 999px;
  color: #fff;
  background: rgba(38, 37, 78, .82);
  font-size: 28px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 18px 42px rgba(8, 10, 30, .28);
  pointer-events: auto;
}

.new-player-guide-stage {
  position: fixed;
  right: clamp(18px, 4vw, 72px);
  bottom: calc(env(safe-area-inset-bottom) + clamp(18px, 4vh, 52px));
  z-index: 170;
  display: grid;
  grid-template-columns: minmax(300px, 560px) clamp(150px, 18vw, 238px);
  align-items: end;
  gap: clamp(12px, 2vw, 24px);
  width: min(780px, calc(100vw - 34px));
  pointer-events: none;
}

.new-player-guide-bubble {
  position: relative;
  right: 0;
  align-self: end;
  width: min(560px, 100%);
  min-height: 210px;
  padding: clamp(20px, 3vw, 30px);
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 28px;
  color: #201f52;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(246,245,255,.96));
  box-shadow: 0 24px 64px rgba(8, 10, 30, .28), inset 0 1px 0 rgba(255,255,255,.9);
  pointer-events: auto;
}

.new-player-guide-bubble::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: 46px;
  width: 34px;
  height: 34px;
  border-top: 3px solid rgba(255,255,255,.9);
  border-right: 3px solid rgba(255,255,255,.9);
  background: rgba(248,247,255,.98);
  transform: rotate(45deg);
}

.new-player-guide-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.new-player-guide-language-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(98,95,240,.14);
  border-radius: 999px;
  background: rgba(242,240,255,.9);
}

.new-player-guide-language-toggle .language-button {
  min-width: 40px;
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.new-player-guide-step {
  margin: 0;
  color: #625ff0;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.new-player-guide-bubble h2 {
  margin: 0 0 12px;
  color: #20204f;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

.new-player-guide-bubble p:not(.new-player-guide-step) {
  margin: 0;
  color: #5c5a87;
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 800;
  line-height: 1.52;
}

.new-player-guide-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.new-player-guide-actions .primary-button,
.new-player-guide-actions .secondary-button {
  min-height: 48px;
  padding: 12px 20px;
}

.new-player-guide-pet {
  display: block;
  width: clamp(150px, 18vw, 238px);
  height: auto;
  max-height: min(42vh, 250px);
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 24px 18px rgba(8, 10, 30, .34));
  animation: new-player-guide-pet-bob 1.8s ease-in-out infinite;
  pointer-events: none;
  transform-origin: 50% 100%;
}

@keyframes new-player-guide-pet-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@media (max-width: 760px) {
  .new-player-guide-stage {
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom) + 14px);
    grid-template-columns: minmax(0, 1fr) clamp(78px, 20vw, 104px);
    width: calc(100vw - 24px);
    gap: 8px;
  }

  .new-player-guide-overlay[data-guide-placement="top"] .new-player-guide-stage {
    top: calc(env(safe-area-inset-top) + 66px);
    bottom: auto;
    align-items: start;
  }

  .new-player-guide-bubble {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: min(45dvh, 380px);
    padding: 14px;
    border-radius: 22px;
  }

  .new-player-guide-meta {
    gap: 8px;
    margin-bottom: 8px;
  }

  .new-player-guide-language-toggle {
    padding: 3px;
  }

  .new-player-guide-language-toggle .language-button {
    min-width: 36px;
    min-height: 28px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .new-player-guide-overlay[data-guide-placement="top"] .new-player-guide-bubble {
    max-height: min(36dvh, 320px);
  }

  .new-player-guide-bubble::after {
    right: -15px;
    bottom: 34px;
    width: 24px;
    height: 24px;
  }

  .new-player-guide-overlay[data-guide-placement="top"] .new-player-guide-bubble::after {
    top: 34px;
    bottom: auto;
  }

  .new-player-guide-bubble h2 {
    font-size: 23px;
  }

  .new-player-guide-bubble p:not(.new-player-guide-step) {
    max-height: min(20dvh, 170px);
    padding-right: 3px;
    overflow: auto;
    font-size: 15px;
    line-height: 1.42;
  }

  .new-player-guide-actions {
    justify-content: stretch;
    gap: 8px;
    margin-top: 14px;
  }

  .new-player-guide-actions button {
    flex: 1 1 108px;
    min-height: 44px;
    padding: 10px 12px;
  }

  .new-player-guide-pet {
    width: clamp(78px, 20vw, 104px);
    max-height: min(20vh, 118px);
  }

  .new-player-guide-close {
    top: calc(env(safe-area-inset-top) + 12px);
    right: calc(env(safe-area-inset-right) + 12px);
    width: 42px;
    height: 42px;
    font-size: 25px;
  }
}

/* Final app chrome polish: the CY PETS STORY banner is a finished Imagen asset. */
.app-screen .page-shell {
  padding-top: 0;
}

.app-screen .app-logo-lockup {
  justify-content: center;
  padding: 10px 16px;
}

.app-screen .app-header-logo {
  width: clamp(176px, 19vw, 278px);
  max-height: 68px;
}

.app-screen .story-title-banner {
  height: clamp(158px, 17vw, 218px);
  margin: 0 0 26px;
  border-radius: 0 0 28px 28px;
}

.app-screen .story-title-banner-art {
  object-position: center;
}

.app-screen .story-title-banner-copy {
  display: none;
}

@media (max-width: 760px) {
  .app-screen .story-title-banner {
    height: clamp(154px, 28vw, 188px);
    min-height: 0;
    margin: 0 0 20px;
    border-radius: 0 0 22px 22px;
  }

  .app-screen .app-header-logo {
    width: min(62vw, 230px);
    max-height: 62px;
  }
}

@media (max-width: 620px) {
  .app-screen .page-shell {
    padding-top: 0;
  }

  .app-screen .app-logo-lockup {
    justify-content: center;
  }

  .app-screen .avatar-upload-control {
    grid-template-columns: 78px;
  }

  .app-screen .avatar-upload-preview {
    width: 78px;
    height: 78px;
    font-size: 32px;
  }
}
.pet-card { padding: 25px; }
.panel-heading { justify-content: space-between; gap: 16px; }
.panel-heading.compact { margin-bottom: 18px; }
.badge-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.level-badge, .rarity-badge { padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.level-badge { color: #6e5010; background: var(--yellow); }
.rarity-badge { color: #4b3b9b; background: #e8e4ff; }
.rarity-a { color: #596080; background: #edf0f8; }
.rarity-r { color: #2a6f9d; background: #dff2ff; }
.rarity-sr { color: #7b48a3; background: #f1e4ff; }
.rarity-ssr { color: #b05272; background: #ffe3ed; }
.rarity-legend { color: #8a5e08; background: linear-gradient(135deg, #fff1a8, #ffd86f); }
.rarity-limited { color: #6b3d00; background: linear-gradient(135deg, #fff3b0, #f7c948 48%, #fff8d5); box-shadow: 0 0 0 1px rgba(176, 121, 0, .2), 0 4px 12px rgba(176, 121, 0, .18); }
.rarity-mythic { color: #5d2a86; background: linear-gradient(135deg, #f5d7ff, #c6a0ff 48%, #ffe6a6); box-shadow: 0 0 0 1px rgba(122, 69, 168, .18), 0 4px 12px rgba(122, 69, 168, .18); }
.pet-progress-row { display: grid; gap: 8px; margin-bottom: 18px; }
.pet-stage { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; min-height: 0; margin: 16px 0 14px; padding: 12px 16px; overflow: hidden; box-sizing: border-box; border-radius: 30px; background: linear-gradient(145deg, #eeeaff 0%, #fff6ef 100%); }
.pet-stage::before { content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%; background: rgba(255,255,255,.72); }
.pet-stage.role-card-stage { padding: 0; background: rgba(255,255,255,.36); }
.pet-stage.role-card-stage::before { display: none; }
.pet-avatar { position: relative; z-index: 2; display: grid; place-items: center; width: 100%; height: 100%; font-size: 145px; line-height: 1; filter: drop-shadow(0 14px 8px rgba(74,67,143,.18)); animation: pet-float 3s ease-in-out infinite; }
.pet-avatar.role-card-mode { font-size: 0; }
.pet-avatar .role-card-art { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 24px; box-shadow: 0 22px 42px rgba(54,47,127,.26); }
.role-card-stage .pet-avatar { width: 98%; height: 98%; filter: none; animation: role-card-sway 3.4s ease-in-out infinite; transform-origin: 50% 55%; }
.role-card-stage .pet-avatar.evolution-ready-avatar { animation: role-card-sway 3.4s ease-in-out infinite, evolution-ready-glow 1.7s ease-in-out infinite; }
.role-card-stage .pet-avatar .role-card-art { width: 100%; height: 100%; object-fit: contain; background: rgba(255,255,255,.2); }
.pet-emoji-display { display: grid; place-items: center; width: 100%; height: 100%; }
.evolution-ready-avatar { animation: pet-float 3s ease-in-out infinite, evolution-ready-glow 1.7s ease-in-out infinite; }
.pet-card-actions { display: block; min-height: 0; margin: -2px 0 13px; }
.pet-card-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
}
.pet-form-selector {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 8px;
  width: min(690px, 100%);
  justify-self: center;
}
.pet-form-button {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 54px;
  padding: 9px 10px;
  border: 2px solid rgba(92,92,230,.18);
  border-radius: 16px;
  color: #514bd4;
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 18px rgba(72,66,145,.08);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.pet-form-button strong {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1.12;
}
.pet-form-button small {
  position: relative;
  z-index: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pet-form-button.active {
  border-color: rgba(67,191,150,.64);
  color: #2f8c77;
  background: linear-gradient(135deg, rgba(236,255,248,.98), rgba(247,246,255,.96));
  box-shadow: 0 12px 26px rgba(47,151,129,.16);
}
.pet-form-button.locked:not(:disabled) {
  border-color: rgba(255,198,73,.5);
  color: #80621b;
  background: linear-gradient(135deg, rgba(255,250,226,.98), rgba(255,255,255,.94));
}
.pet-form-button:disabled {
  cursor: not-allowed;
  opacity: .48;
  box-shadow: none;
}
.pet-form-button.form-route-glow {
  --form-ring-base: #ff82c9;
  --form-ready-a: #ffd4ee;
  --form-ready-b: #ff9fd8;
  --form-ready-c: #fff5fb;
  border-color: transparent;
  color: #b82d85;
  background: rgba(255,247,253,.98);
  box-shadow: 0 12px 26px rgba(255,159,216,.2), 0 0 0 4px rgba(255,212,238,.24);
}
.pet-form-button.form-route-glow.heroic-route {
  --form-ring-base: #050407;
  --form-ready-a: #ffe7a3;
  --form-ready-b: #f7c948;
  --form-ready-c: #fff7cf;
  color: #f6d978;
  background: #17131f;
  box-shadow: 0 12px 26px rgba(247,201,72,.2), 0 0 0 4px rgba(247,201,72,.16);
  text-shadow: 0 1px 6px rgba(247,201,72,.24);
}
.pet-form-button.form-route-glow.cute-route {
  color: #b82d85;
  background: rgba(255,247,253,.98);
}
.pet-form-button.form-route-glow::before {
  content: "";
  position: absolute;
  inset: -58%;
  z-index: 0;
  background: conic-gradient(
    from 0deg,
    var(--form-ring-base) 0deg,
    var(--form-ring-base) 54deg,
    var(--form-ready-a) 82deg,
    var(--form-ready-b) 112deg,
    var(--form-ready-c) 136deg,
    var(--form-ring-base) 172deg,
    var(--form-ring-base) 360deg
  );
  animation: pet-form-ready-border-spin 1.75s linear infinite;
}
.pet-form-button.form-route-glow::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 0;
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.86), rgba(255,255,255,0) 48%),
    linear-gradient(135deg, rgba(255,252,245,.98), rgba(246,244,255,.96));
  box-shadow: inset 0 0 18px rgba(255,255,255,.92);
}
.pet-form-button.form-route-glow.cute-route::after {
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.9), rgba(255,255,255,0) 48%),
    linear-gradient(135deg, #fff7fd, #ffe5f4);
  box-shadow: inset 0 0 18px rgba(255,255,255,.92), inset 0 0 0 1px rgba(255,159,216,.46);
}
.pet-form-button.form-route-glow.heroic-route::after {
  background:
    radial-gradient(circle at 50% 0%, rgba(255,231,163,.22), rgba(255,231,163,0) 45%),
    linear-gradient(135deg, #201a2a, #09080f);
  box-shadow: inset 0 0 0 1px rgba(255,231,163,.28), inset 0 0 18px rgba(0,0,0,.55);
}
.pet-form-button.form-route-glow:hover,
.pet-form-button.form-route-glow:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(92,92,230,.18), 0 0 0 5px rgba(255,241,168,.24);
}
.pet-form-button.form-route-glow:disabled {
  opacity: .74;
}
.pet-form-button.form-route-glow small {
  color: #a05f90;
}
.pet-form-button.form-route-glow.heroic-route small {
  color: rgba(255,231,163,.78);
}
.pet-form-button.evolution-ready.cute-route,
.pet-form-button.evolution-ready.heroic-route {
  border-color: transparent;
}
.pet-card-secondary-actions {
  grid-column: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.role-card-before-button,
.role-card-share-button { padding: 11px 16px; border: 2px solid #dad7fb; border-radius: 999px; background: rgba(255,255,255,.86); box-shadow: 0 10px 22px rgba(72,66,145,.1); font-size: 15px; }
.role-card-share-button { border-color: rgba(76,191,146,.32); background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(233,251,244,.92)); }
@keyframes pet-float { 0%, 100% { transform: translateY(3px) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes role-card-sway { 0%, 100% { transform: translateY(2px) rotate(-.7deg); } 50% { transform: translateY(-5px) rotate(.7deg); } }
@keyframes evolution-ready-glow { 0%, 100% { filter: drop-shadow(0 14px 8px rgba(74,67,143,.18)) drop-shadow(0 0 0 rgba(255,220,88,0)); } 50% { filter: drop-shadow(0 17px 10px rgba(74,67,143,.18)) drop-shadow(0 0 22px rgba(255,220,88,.72)); } }
@keyframes pet-form-ready-border-spin { to { transform: rotate(1turn); } }
.pet-shadow { position: absolute; z-index: 1; bottom: 66px; width: 155px; height: 28px; border-radius: 50%; background: rgba(74,67,143,.15); filter: blur(5px); }
.combat-power-wrap { display: flex; justify-content: center; margin: 3px 0 14px; }
.combat-power-wrap .combat-power-display { width: min(100%, 235px); }
.equipment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.equipment-slot { min-height: 104px; padding: 9px 7px; border: 2px dashed #c8c7ee; border-radius: 17px; color: var(--primary-dark); background: #fafaff; transition: .2s ease; }
.equipment-slot:hover, .equipment-slot.has-item { border-style: solid; border-color: var(--primary); background: #f1f0ff; transform: translateY(-2px); }
.equipment-slot .slot-label, .equipment-slot .slot-name { display: block; font-size: 10px; font-weight: 800; }
.equipment-slot .slot-label { color: var(--muted); }
.equipment-slot .slot-icon { display: block; margin: 5px 0; font-size: 25px; line-height: 1; }
.equipment-slot.has-item .slot-icon { font-size: 29px; }
.combat-power-display { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 86px; padding: 10px 6px; border-radius: 17px; background: linear-gradient(145deg, #fff8c9, #ffe7a6); box-shadow: inset 0 0 0 1px rgba(238,192,68,.35); }
.combat-power-label { color: #81641d; font-size: 11px; font-weight: 900; white-space: nowrap; }
.combat-power-display strong { color: #4b3b17; font-size: 32px; line-height: 1; letter-spacing: -.05em; }
.combat-power-change { min-height: 17px; color: #2c9a6a; font-size: 12px; font-weight: 900; }
.combat-power-change.negative { color: #d45a6f; }
.combat-power-display.power-jump { animation: power-jump .65s cubic-bezier(.2,.8,.25,1); }
.combat-power-display.power-jump strong { animation: number-pop .65s cubic-bezier(.2,.8,.25,1); }
@keyframes power-jump { 0% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(238,192,68,.35); } 42% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(255,220,93,.25), 0 10px 30px rgba(231,174,35,.28); } 100% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(238,192,68,.35); } }
@keyframes number-pop { 0% { color: #4b3b17; } 42% { color: #d78c16; } 100% { color: #4b3b17; } }
.stats-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 18px; }
.attribute-chip { display: grid; gap: 2px; min-width: 0; overflow: hidden; padding: 7px 4px; border-radius: 11px; text-align: center; background: #fafaff; }
.attribute-chip strong { display: block; min-width: 0; max-width: 100%; overflow: hidden; font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.08; text-overflow: ellipsis; white-space: nowrap; }
.attribute-chip small { color: var(--muted); font-size: 9px; font-weight: 800; }
.attribute-chip.stat-up { animation: stat-flash .75s ease; }
.attribute-chip.stat-down { animation: stat-flash-down .75s ease; }
@keyframes stat-flash { 0%,100% { background: #fafaff; } 40% { background: #dff9ec; transform: translateY(-3px); } }
@keyframes stat-flash-down { 0%,100% { background: #fafaff; } 40% { background: #ffe3ea; transform: translateY(2px); } }
.equipped-layer { position: absolute; z-index: 3; top: 30px; right: 28px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 42%; }
.equipped-tag { padding: 7px 9px; border: 2px solid white; border-radius: 999px; background: #fff; box-shadow: 0 6px 12px rgba(54,47,127,.1); font-size: 17px; }
.sparkle { position: absolute; color: #aaaaf8; font-size: 26px; animation: twinkle 1.9s ease-in-out infinite; }
.sparkle-one { top: 72px; left: 24%; }
.sparkle-two { right: 22%; bottom: 82px; animation-delay: .5s; }
@keyframes twinkle { 0%,100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
.pet-progress-row { display: grid; gap: 8px; margin-bottom: 18px; }
.pet-progress-row > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.pet-progress-row strong { font-size: 13px; }
.pet-progress-row .muted-text { font-size: 12px; }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #e9e8fb; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f5bd58, #fa8c9d, #7878ef); transition: width .5s ease; }
.stats-card, .mission-card { padding: 23px; }
.mini-icon, .mission-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 12px; background: var(--lavender); font-size: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-box { display: grid; gap: 3px; padding: 13px 11px; border-radius: 16px; background: #fafaff; }
.stat-icon { font-size: 21px; }
.stat-box strong { font-size: 23px; letter-spacing: -.04em; }
.stat-box small { color: var(--muted); font-size: 11px; }
.mission-card { background: linear-gradient(145deg, #fffdf5, #fff4d8); border-color: #f5e6be; }
.mission-card p { margin: 16px 0 18px; color: #7c6b45; font-size: 14px; line-height: 1.7; }
.section-title-row { justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-title-row h2 { margin-bottom: 3px; }
.date-card { border-radius: 14px; }
.checkin-card { padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.subject-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.subject-card { min-height: 145px; padding: 18px 12px; border: 2px solid transparent; border-radius: 19px; text-align: center; color: var(--ink); background: #fafaff; transition: .18s ease; }
.subject-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 10px 22px rgba(92,92,230,.12); }
.subject-card .subject-icon { display: block; margin-bottom: 11px; font-size: 38px; }
.subject-card strong, .subject-card small { display: block; }
.subject-card strong { font-size: 15px; }
.subject-card small { margin-top: 6px; color: var(--muted); font-size: 11px; }
.checkin-day-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 11px 14px; border-radius: 14px; color: #665d3e; background: #fff8dc; }
.checkin-day-progress strong { font-size: 16px; }
.checkin-day-progress span { color: #89794f; font-size: 13px; }
.subject-card.is-complete { border-color: #8dcea9; color: #2e7f5b; background: #edf9f2; cursor: default; }
.subject-card.is-complete .subject-icon { filter: saturate(.9); }
.quiz-wrap { max-width: 780px; margin: 0 auto; }
.quiz-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; color: var(--muted); font-size: 13px; font-weight: 800; }
.quiz-progress { height: 8px; margin-bottom: 24px; border-radius: 99px; background: #eaeafa; overflow: hidden; }
.quiz-progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7b7bec, #f49bb1); transition: width .3s ease; }
.question-card { padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.question-number { color: var(--primary); font-size: 13px; font-weight: 900; }
.question-card h3 { margin: 11px 0 22px; font-size: clamp(22px, 4vw, 30px); line-height: 1.45; }
.options-list { display: grid; gap: 10px; }
.option-label { position: relative; display: flex; align-items: center; gap: 11px; padding: 15px; border: 2px solid var(--line); border-radius: 14px; background: #fff; transition: .18s ease; }
.option-label:hover { border-color: #aaaaf5; background: #fafaff; }
.option-label input { accent-color: var(--primary); }
.option-label.is-correct { border-color: #6bcaa0; background: #eafbf2; }
.option-label.is-wrong { border-color: #ef8fa3; background: #fff0f3; }
.feedback { min-height: 26px; margin: 16px 0 10px; font-size: 14px; font-weight: 800; }
.feedback.good { color: #2e9b6e; }
.feedback.retry { color: #c05b70; }
.quiz-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 17px; }
.done-card { padding: 40px 25px; text-align: center; border: 1px solid #eadfae; border-radius: 24px; background: linear-gradient(145deg, #fffdf0, #fff6ce); box-shadow: var(--shadow); }
.done-card .result-icon { font-size: 65px; }
.done-card h3 { margin: 10px 0; font-size: 28px; }
.reward-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.reward-pill { padding: 10px 14px; border-radius: 999px; color: #735a14; background: rgba(255,255,255,.78); font-weight: 800; }
.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(41,37,91,.42); backdrop-filter: blur(7px); }
.pet-selection-card { position: relative; width: min(100%, 650px); max-height: min(92vh, 760px); overflow: auto; padding: 30px; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; text-align: center; background: #fff; box-shadow: 0 24px 80px rgba(30,25,86,.25); }
.registration-success-card { position: relative; display: grid; justify-items: center; width: min(100%, 440px); padding: 32px 28px 28px; border: 1px solid rgba(255,255,255,.84); border-radius: 28px; text-align: center; color: var(--ink); background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(244,242,255,.96)); box-shadow: 0 24px 80px rgba(30,25,86,.25); }
.registration-success-card h2 { margin-bottom: 12px; font-size: clamp(28px, 5vw, 38px); }
.registration-success-id { display: inline-grid; place-items: center; min-height: 72px; min-width: min(100%, 260px); margin: 4px 0 14px; padding: 12px 22px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #5c5ce6, #49bea7); box-shadow: 0 18px 42px rgba(92,92,230,.28); font-size: clamp(36px, 9vw, 54px); font-weight: 1000; letter-spacing: 0; }
.avatar-crop-card { position: relative; display: grid; justify-items: center; width: min(100%, 430px); max-height: min(92vh, 720px); overflow: auto; padding: 30px 26px 24px; border: 1px solid rgba(255,255,255,.82); border-radius: 28px; text-align: center; background: linear-gradient(145deg, #fff, #f6f3ff); box-shadow: 0 24px 80px rgba(30,25,86,.25); }
.avatar-crop-card h2 { margin-bottom: 6px; }
.avatar-crop-canvas { width: min(260px, 72vw); height: min(260px, 72vw); margin: 16px 0 14px; border-radius: 50%; background: #eeeaff; box-shadow: inset 0 0 0 8px rgba(255,255,255,.78), 0 18px 34px rgba(72,66,145,.18); touch-action: none; cursor: grab; }
.avatar-crop-canvas:active { cursor: grabbing; }
.avatar-crop-zoom-label { justify-self: start; width: min(260px, 72vw); color: #4e4aa3; font-size: 13px; font-weight: 950; text-align: left; }
.avatar-crop-zoom { width: min(260px, 72vw); accent-color: var(--primary); }
.avatar-crop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(320px, 100%); margin-top: 16px; }
.evolution-choice-card { position: relative; width: min(100%, 980px); max-height: min(92vh, 780px); overflow: auto; padding: 32px; border: 1px solid rgba(255,255,255,.86); border-radius: 28px; background: rgba(255,255,255,.94); box-shadow: 0 24px 80px rgba(30,25,86,.25); text-align: center; }
.evolution-choice-card h2 { margin: 4px 0 8px; font-size: clamp(30px, 5vw, 48px); }
.evolution-choice-card .muted-text { max-width: 760px; margin: 0 auto 14px; font-size: clamp(17px, 2.3vw, 22px); line-height: 1.55; }
.evolution-choice-pet-name { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin-bottom: 18px; padding: 8px 16px; border-radius: 999px; color: #4d49bb; background: #f1efff; font-size: 18px; }
.evolution-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.evolution-style-card { display: grid; gap: 12px; padding: 14px; border: 2px solid rgba(92,92,230,.2); border-radius: 22px; color: var(--ink); background: #fbfbff; box-shadow: 0 12px 34px rgba(72,66,145,.12); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.evolution-style-card:hover { border-color: var(--primary); box-shadow: 0 18px 42px rgba(92,92,230,.18); transform: translateY(-3px); }
.evolution-style-card.cute { background: linear-gradient(145deg, #fff1fb, #f3fbff); }
.evolution-style-card.heroic { background: linear-gradient(145deg, #f1efff, #fff8dd); }
.evolution-style-image-wrap { display: grid; aspect-ratio: 16 / 9; place-items: center; overflow: hidden; border-radius: 18px; background: rgba(255,255,255,.72); }
.evolution-style-image-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.evolution-style-card strong { color: #4d49bb; font-size: clamp(22px, 3vw, 32px); }
.evolution-style-card small { color: var(--muted); font-size: clamp(15px, 2vw, 18px); line-height: 1.5; }
.modal-close-button { position: absolute; top: 16px; right: 16px; z-index: 4; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(92,92,230,.18); border-radius: 50%; color: #4d49bb; background: rgba(255,255,255,.92); box-shadow: 0 10px 24px rgba(41,37,91,.16); font-size: 28px; font-weight: 800; line-height: 1; cursor: pointer; }
.modal-close-button:hover { color: #fff; background: var(--primary); transform: translateY(-1px); }
.modal-close-button.warm { color: #8a650e; border-color: rgba(138,101,14,.2); }
.modal-close-button.warm:hover { color: #fff; background: #d8901d; }
.modal-close-button.dark { color: #fff4c2; border-color: rgba(255,244,194,.28); background: rgba(255,255,255,.12); }
.modal-close-button.dark:hover { color: #20184f; background: #fff4c2; }
.modal-paw { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; background: var(--lavender); font-size: 28px; }
.pet-selection-card h2 { margin-bottom: 9px; }
.initial-pet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.initial-pet-card { padding: 15px 8px; border: 2px solid var(--line); border-radius: 18px; background: #fafaff; color: var(--ink); transition: .18s ease; }
.initial-pet-card:hover, .initial-pet-card.selected { border-color: var(--primary); background: #f0efff; transform: translateY(-3px); box-shadow: 0 9px 18px rgba(92,92,230,.13); }
.initial-pet-card .initial-pet-icon, .initial-pet-card .initial-pet-art { display: block; margin: 0 auto 8px; }
.initial-pet-card .initial-pet-icon { font-size: 50px; }
.initial-pet-card .initial-pet-art { width: 100%; height: 112px; object-fit: contain; object-position: center; border-radius: 12px; background: #f1efff; }
.initial-pet-card strong, .initial-pet-card small { display: block; }
.initial-pet-card small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.evolution-style-card.selected { border-color: var(--primary); background: #f0efff; box-shadow: 0 14px 32px rgba(92,92,230,.18); }
.shop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.shop-item { display: flex; flex-direction: column; min-height: 280px; padding: 18px; border: 1px solid var(--line); border-radius: 21px; background: var(--panel); box-shadow: 0 12px 30px rgba(72,66,145,.08); }
.item-art { display: grid; aspect-ratio: 1; min-height: 0; place-items: center; overflow: hidden; margin-bottom: 14px; padding: 10px; border-radius: 17px; background: linear-gradient(145deg, #f3f1ff, #fff5e9); font-size: 67px; }
.shop-item h3 { font-size: 17px; }
.item-meta { display: flex; justify-content: space-between; gap: 8px; margin: -2px 0 5px; color: #8c88b6; font-size: 10px; font-weight: 800; }
.item-stats { min-height: 18px; margin: 0 0 10px; color: #2d8d69; font-size: 11px; font-weight: 900; }
.item-description { min-height: 38px; margin: 5px 0 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.premium-item { cursor: pointer; }
.premium-item:not(.revealed) .premium-lock { margin-top: 7px; padding: 10px; border-radius: 12px; color: #6e5b9e; background: #f1edff; font-size: 12px; font-weight: 900; text-align: center; }
.premium-item.revealed { border-color: #e8bf58; box-shadow: 0 14px 34px rgba(202,151,45,.18); }
.premium-item.revealed .premium-lock { color: #8c6a15; background: #fff5c9; }
.premium-details { margin-top: 7px; }
.premium-details.premium-collapsed { display: none; }
.premium-item.revealed .premium-details.premium-collapsed { display: block; }
.shop-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; grid-column: 1 / -1; padding: 14px 16px; border: 1px solid #dcd9fb; border-radius: 18px; background: rgba(255,255,255,.78); box-shadow: 0 10px 24px rgba(64, 58, 142, .08); }
.shop-filter-bar p { margin: 0; color: #69659b; font-size: 14px; font-weight: 900; }
.shop-slot-filter { display: flex; align-items: center; gap: 10px; color: #4a47a3; font-size: 13px; font-weight: 900; }
.shop-slot-select { min-width: min(280px, 62vw); min-height: 52px; padding: 0 44px 0 16px; border: 2px solid #dcd7ff; border-radius: 16px; color: #34306f; background: #fff; font: inherit; font-size: 16px; font-weight: 900; }
.item-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.item-price { color: #8d6c12; font-weight: 900; }
.item-footer button { padding: 9px 11px; font-size: 12px; }
.item-footer button:disabled { cursor: not-allowed; opacity: .55; }
.owned-label { color: #2e9b6e; font-size: 12px; font-weight: 900; }
.history-list { display: grid; gap: 12px; }
.history-row { display: grid; grid-template-columns: 120px 1fr auto auto; align-items: center; gap: 15px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 9px 23px rgba(72,66,145,.06); }
.history-date { color: var(--muted); font-size: 13px; }
.history-subject { display: flex; align-items: center; gap: 8px; font-weight: 850; }
.history-score { color: #3b3b99; font-weight: 900; }
.history-reward { color: #8d6c12; font-weight: 850; white-space: nowrap; }
.checkin-history-panel { margin-top: 22px; padding: 22px; }
.compact-title-row { margin-bottom: 16px; }
.music-box-locked { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; }
.music-box-locked .result-icon { filter: drop-shadow(0 12px 24px rgba(92,92,230,.22)); }
.music-player-panel { --track-accent: #6f67f1; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto minmax(280px, auto); align-items: center; gap: 14px; margin: 0 0 14px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--track-accent), white 72%); border-radius: 18px; background: linear-gradient(135deg, rgba(255,255,255,.96), color-mix(in srgb, var(--track-accent), white 91%)); box-shadow: 0 12px 28px rgba(31,35,78,.08); }
.music-player-art { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--track-accent), color-mix(in srgb, var(--track-accent), #49bea7 42%)); font-size: 30px; font-weight: 1000; box-shadow: 0 10px 20px color-mix(in srgb, var(--track-accent), transparent 72%); }
.music-player-panel.is-playing .music-player-art { animation: musicPulse 1.25s ease-in-out infinite; }
.music-player-copy { min-width: 0; }
.music-player-copy span { color: var(--track-accent); font-size: 11px; font-weight: 1000; letter-spacing: 0; text-transform: uppercase; }
.music-player-copy h3 { overflow: hidden; margin: 2px 0 3px; color: var(--primary-dark); font-size: 22px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.music-player-copy p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 850; line-height: 1.25; }
.music-player-controls { display: flex; align-items: center; gap: 8px; }
.music-player-icon-button { display: inline-grid; width: 46px; height: 46px; place-items: center; border: 0; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--primary), #49bea7); font-size: 18px; font-weight: 1000; cursor: pointer; box-shadow: 0 10px 22px rgba(92,92,230,.18); }
.music-player-icon-button:hover { transform: translateY(-1px); }
.music-player-mode-group { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.music-mode-button { min-height: 38px; border: 1px solid color-mix(in srgb, var(--track-accent), white 72%); border-radius: 999px; padding: 9px 12px; color: color-mix(in srgb, var(--track-accent), #1f2148 28%); background: rgba(255,255,255,.72); font-size: 12px; font-weight: 950; white-space: nowrap; cursor: pointer; }
.music-mode-button span { margin-right: 5px; }
.music-mode-button.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--track-accent), color-mix(in srgb, var(--track-accent), #49bea7 38%)); box-shadow: 0 9px 18px color-mix(in srgb, var(--track-accent), transparent 78%); }
@keyframes musicPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.music-box-grid { display: grid; gap: 12px; max-height: min(66vh, 650px); overflow-x: hidden; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.music-series-section { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: stretch; gap: 10px; padding: 10px; border: 1px solid rgba(129,121,221,.16); border-radius: 18px; background: rgba(255,255,255,.76); box-shadow: 0 10px 26px rgba(31,35,78,.06); }
.music-series-heading { display: grid; align-content: center; gap: 4px; min-height: 104px; padding: 10px 12px; border-left: 5px solid var(--track-accent); border-radius: 13px; background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(245,244,255,.82)); }
.music-series-heading h3 { margin: 0; color: var(--track-accent); font-size: 17px; font-weight: 1000; line-height: 1.15; }
.music-series-heading span { color: var(--muted); font-size: 11px; font-weight: 900; }
.music-series-track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 8px; min-width: 0; }
.music-track-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 104px; padding: 10px; border: 2px solid rgba(129,121,221,.16); border-radius: 14px; background: linear-gradient(145deg, #fff, #f8f6ff); box-shadow: 0 8px 18px rgba(31,35,78,.06); }
.music-track-card.active { border-color: var(--track-accent); box-shadow: 0 12px 24px rgba(31,35,78,.1); }
.music-track-card.locked { background: linear-gradient(145deg, #fff, #fffaf0); }
.music-track-art { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: var(--track-accent); background: linear-gradient(145deg, color-mix(in srgb, var(--track-accent) 16%, white), rgba(255,255,255,.94)); font-size: 22px; }
.music-track-copy { min-width: 0; }
.music-track-copy span { color: var(--track-accent); font-size: 12px; font-weight: 1000; letter-spacing: 0; text-transform: uppercase; }
.music-track-copy h3 { overflow: hidden; margin: 2px 0; color: var(--primary-dark); font-size: 14px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.music-track-copy p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; line-height: 1.25; }
.music-track-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.music-track-actions .primary-button, .music-track-actions .secondary-button { min-height: 30px; padding: 7px 8px; font-size: 10px; border-radius: 11px; }
.music-track-actions [data-music-wall-share] { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .music-player-panel { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 11px; }
  .music-player-art { width: 48px; height: 48px; border-radius: 14px; font-size: 26px; }
  .music-player-copy h3 { font-size: 17px; }
  .music-player-copy p { font-size: 11px; }
  .music-player-controls { gap: 6px; }
  .music-player-icon-button { width: 40px; height: 40px; border-radius: 13px; font-size: 16px; }
  .music-player-mode-group { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .music-mode-button { min-height: 34px; padding: 8px 11px; font-size: 11px; }
  .music-box-grid { max-height: none; overflow: visible; padding-right: 0; }
  .music-series-section { grid-template-columns: 1fr; gap: 8px; padding: 9px; }
  .music-series-heading { min-height: auto; grid-template-columns: 1fr auto; align-items: center; padding: 9px 11px; }
  .music-series-heading h3 { font-size: 16px; }
  .music-series-track-grid { grid-auto-flow: column; grid-auto-columns: minmax(172px, 72vw); grid-template-columns: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .music-track-card { scroll-snap-align: start; }
}
.wall-leaderboard-panel { margin-bottom: 18px; padding: 18px; border-radius: 24px; }
.wall-leaderboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.wall-leaderboard-heading > div:first-child { flex: 0 1 440px; }
.wall-leaderboard-heading h3 { margin: 0; color: var(--primary-dark); font-size: clamp(22px, 2.4vw, 32px); }
.wall-leaderboard-heading p { margin: 4px 0 0; color: var(--muted); font-weight: 800; }
.wall-leaderboard-tabs { display: flex; flex: 1 1 auto; flex-wrap: wrap; justify-content: center; gap: 10px; }
.wall-leaderboard-tab { --tab-color: #4d48b8; --tab-bg: #f0eeff; --tab-active: linear-gradient(135deg, var(--primary), #49bea7); min-height: 48px; border: 0; border-radius: 999px; padding: 13px 18px; color: var(--tab-color); background: var(--tab-bg); font-size: 16px; font-weight: 950; cursor: pointer; }
.wall-leaderboard-tab[data-wall-leaderboard="power"] { --tab-color: #3f4fd6; --tab-bg: #ecefff; --tab-active: linear-gradient(135deg, #5c5ce6, #4bbda8); }
.wall-leaderboard-tab[data-wall-leaderboard="coins"] { --tab-color: #8d6300; --tab-bg: #fff3c0; --tab-active: linear-gradient(135deg, #ffc447, #f29f32); }
.wall-leaderboard-tab[data-wall-leaderboard="reaction"] { --tab-color: #b43b79; --tab-bg: #ffeaf5; --tab-active: linear-gradient(135deg, #ef5da8, #8c63ff); }
.wall-leaderboard-tab[data-wall-leaderboard="flappy"] { --tab-color: #187997; --tab-bg: #e8f9ff; --tab-active: linear-gradient(135deg, #38bdf8, #49bea7); }
.wall-leaderboard-tab[data-wall-leaderboard="runner"] { --tab-color: #8a4718; --tab-bg: #fff0de; --tab-active: linear-gradient(135deg, #fb923c, #6a63f4); }
.wall-leaderboard-tab[data-wall-leaderboard="jumpCharge"] { --tab-color: #25637c; --tab-bg: #e9fbff; --tab-active: linear-gradient(135deg, #44c2b2, #5d63f0); }
.wall-leaderboard-tab.active { color: #fff; background: var(--tab-active); box-shadow: 0 12px 24px rgba(72,66,145,.16); }
.wall-leaderboard-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 14px; max-height: min(43vh, 430px); overflow-y: auto; overflow-x: hidden; padding-right: 6px; scrollbar-width: thin; }
.wall-rank-list, .wall-self-card, .wall-pet-breakdown { display: grid; gap: 8px; }
.wall-rank-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid #e5e2fb; border-radius: 16px; background: rgba(255,255,255,.82); }
.wall-rank-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px; color: #735400; background: #fff3be; font-weight: 1000; }
.wall-rank-art { width: 46px; height: 46px; object-fit: cover; border-radius: 13px; background: #f0eeff; }
.wall-rank-art.empty { display: grid; place-items: center; }
.wall-rank-copy { min-width: 0; }
.wall-rank-copy strong { display: block; overflow: hidden; color: var(--primary-dark); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.wall-rank-copy small { color: var(--muted); font-size: 12px; font-weight: 800; }
.wall-rank-score { color: #4842c6; font-size: 18px; font-weight: 1000; text-align: right; }
.wall-self-card { align-content: start; padding: 14px; border-radius: 18px; background: linear-gradient(145deg, #fff7ca, #f2efff); }
.wall-self-card span { color: var(--muted); font-size: 12px; font-weight: 900; }
.wall-self-card strong { color: var(--primary-dark); font-size: 34px; }
.wall-self-card small { color: var(--muted); font-weight: 850; }
.wall-pet-breakdown { margin-top: 10px; max-height: 310px; overflow: auto; }
.wall-pet-breakdown-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.72); }
.wall-pet-breakdown-row img, .wall-pet-breakdown-row > span:first-child { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; object-fit: cover; background: #f0eeff; }
.wall-pet-breakdown-row b { display: block; color: var(--primary-dark); font-size: 13px; }
.wall-pet-breakdown-row small { display: block; overflow: hidden; color: var(--muted); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.wall-leaderboard-empty { padding: 18px; border-radius: 16px; color: var(--muted); background: #f6f4ff; font-weight: 850; text-align: center; }
@media (max-width: 820px) {
  .wall-leaderboard-heading { display: grid; }
  .wall-leaderboard-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .wall-leaderboard-layout { grid-template-columns: 1fr; max-height: min(62vh, 520px); }
  .wall-rank-row { grid-template-columns: auto auto minmax(0, 1fr); }
  .wall-rank-score { grid-column: 3; justify-self: start; }
}
.empty-state { padding: 42px 20px; text-align: center; border: 1px dashed #c9c8e9; border-radius: 20px; color: var(--muted); background: rgba(255,255,255,.5); }
.app-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 40px; padding: 18px 0 4px; color: #9b9ab2; font-size: 11px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 25px; max-width: min(90vw, 460px); padding: 13px 18px; border-radius: 999px; color: white; background: #302e65; box-shadow: 0 14px 32px rgba(35,30,90,.25); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .25s ease; font-size: 13px; font-weight: 800; }
.demo-free-button { margin-top: 15px; color: #3f3d91; border: 1px solid #d6d4fa; background: #f1f0ff; }
.level-up-overlay { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(29,25,78,.48); backdrop-filter: blur(5px); animation: overlay-in .18s ease; }
.level-up-card { position: relative; width: min(100%, 400px); padding: 34px 25px 28px; overflow: hidden; border: 3px solid #ffe18a; border-radius: 28px; text-align: center; background: linear-gradient(145deg, #fffef1, #fff0b9); box-shadow: 0 25px 90px rgba(35,28,110,.34); animation: level-card-in .55s cubic-bezier(.2,.9,.25,1.2); }
.level-up-card::before, .level-up-card::after { content: "✦"; position: absolute; color: #f1ba30; font-size: 38px; animation: sparkle-burst 1.2s ease-in-out infinite; }
.level-up-card::before { top: 18px; left: 24px; }
.level-up-card::after { right: 24px; bottom: 20px; animation-delay: .25s; }
.level-up-burst { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 8px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #f6b928, #f47b54); font-size: 34px; box-shadow: 0 8px 20px rgba(231,146,31,.3); animation: burst-spin 1.4s ease-in-out infinite; }
.level-up-card h2 { margin-bottom: 16px; color: #754d0b; }
.level-up-deltas { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.level-up-delta { padding: 8px 10px; border-radius: 999px; color: #287a59; background: #e2faed; font-size: 13px; font-weight: 900; }
.level-up-delta.negative { color: #bd4e62; background: #ffe4e9; }
.level-up-power-text { display: block; color: #8a650e; font-size: 17px; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes level-card-in { 0% { opacity: 0; transform: scale(.65) translateY(18px); } 72% { transform: scale(1.04) translateY(-2px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes burst-spin { 0%,100% { transform: rotate(-10deg) scale(1); } 50% { transform: rotate(12deg) scale(1.12); } }
@keyframes sparkle-burst { 0%,100% { opacity: .45; transform: scale(.8) rotate(0deg); } 50% { opacity: 1; transform: scale(1.2) rotate(25deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }
@media (max-width: 900px) { .subject-grid { grid-template-columns: repeat(3, 1fr); } .shop-grid { grid-template-columns: repeat(2, 1fr); } .dashboard-grid { grid-template-columns: 1fr; } .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .story-title-banner { min-height: 188px; margin-top: -8px; border-radius: 22px; } .story-title-banner-copy { padding: 26px 18px; } .story-title-kicker { min-height: 30px; font-size: 11px; } .story-title-banner h1 { max-width: 10ch; font-size: 40px; line-height: .98; -webkit-text-stroke-width: 1.4px; } }
@media (max-width: 620px) { .topbar { padding: 14px 16px; } .brand-lockup strong { font-size: 13px; } .student-chip { max-width: 145px; overflow: hidden; } .student-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .page-shell { width: min(100% - 24px, 560px); padding-top: 28px; } .welcome-row, .section-title-row { align-items: flex-start; flex-direction: column; } .streak-pill, .date-card, .wallet-card { align-self: stretch; justify-content: center; } .main-nav { width: 100%; } .pet-card, .stats-card, .mission-card, .checkin-card, .question-card { padding: 19px; } .pet-stage { min-height: 290px; } .pet-avatar { font-size: 113px; } .pet-avatar .role-card-art { width: min(44vw, 160px); max-height: 220px; } .pet-shadow { bottom: 47px; } .pet-loadout { grid-template-columns: 1fr 1.1fr 1fr; gap: 6px; } .equipment-slot { min-height: 79px; } .combat-power-display { min-height: 79px; } .combat-power-display strong { font-size: 27px; } .stats-summary { gap: 4px; } .attribute-chip strong { font-size: 13px; } .attribute-chip small { font-size: 8px; } .side-column { grid-template-columns: 1fr; } .subject-grid { grid-template-columns: repeat(2, 1fr); } .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .shop-item { padding: 13px; min-height: 260px; } .item-art { min-height: 105px; font-size: 53px; } .history-row { grid-template-columns: 1fr auto; gap: 8px; } .history-score, .history-reward { justify-self: end; } .initial-pet-grid { grid-template-columns: repeat(2, 1fr); } .app-footer { flex-direction: column; align-items: center; text-align: center; } }
@media (max-width: 620px) { .welcome-row > div:first-child { padding-left: 0; } .welcome-profile { width: 100%; gap: 12px; } .avatar-upload-control { grid-template-columns: 58px; } .avatar-upload-preview { width: 58px; height: 58px; font-size: 26px; } .avatar-upload-text { font-size: 11px; } }
.item-art img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; image-rendering: pixelated; }
.item-english { min-height: 14px; margin: -5px 0 5px; color: #8c88b6; font-size: 10px; line-height: 1.25; }
.slot-image { display: block; width: 54px; height: 54px; margin: 3px auto; object-fit: contain; border-radius: 8px; image-rendering: pixelated; }
.equipped-tag { display: grid; place-items: center; width: 45px; height: 45px; padding: 4px; }
.equipped-tag img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; image-rendering: pixelated; }
@media (max-width: 390px) { .login-card { padding: 32px 20px 26px; } .subject-grid { grid-template-columns: 1fr 1fr; } .shop-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .home-top-panels { grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
  .home-top-panels .stats-card, .home-top-panels .mission-card { padding: 16px; }
  .pet-dashboard-grid { gap: 0; }
  .pet-card { padding: 15px; border-radius: 20px; }
  .pet-stage { aspect-ratio: 16 / 9; min-height: 220px; margin: 12px 0 12px; padding: 8px 10px; border-radius: 22px; }
  .pet-stage::before { width: 260px; height: 260px; }
  .pet-avatar .role-card-art { width: 100%; height: auto; max-width: 100%; max-height: 100%; border-radius: 18px; }
  .pet-stage.role-card-stage { padding: 0; }
  .pet-stage.role-card-stage .pet-avatar .role-card-art { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
  .pet-shadow { bottom: 30px; width: 130px; }
  .equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; }
  .equipment-slot { min-height: 94px; padding: 8px 5px; border-radius: 14px; }
  .equipment-slot .slot-label, .equipment-slot .slot-name { font-size: 9px; }
  .slot-image { width: 52px; height: 52px; }
  .combat-power-wrap { margin-bottom: 12px; }
  .combat-power-wrap .combat-power-display { min-height: 76px; }
  .combat-power-display strong { font-size: 28px; }
  .stats-summary { gap: 4px; margin-bottom: 14px; }
  .attribute-chip { padding: 6px 2px; }
  .attribute-chip strong { font-size: 13px; }
  .attribute-chip small { font-size: 8px; }
}

/* Large, dense UI pass: clearer type with less empty space. */
body { font-size: 18px; }
.eyebrow { margin-bottom: 6px; font-size: 13px; }
h1 { font-size: clamp(34px, 6vw, 46px); }
h2 { font-size: clamp(29px, 4vw, 39px); }
h3 { font-size: 24px; }
.muted-text { font-size: 16px; line-height: 1.5; }
.brand-lockup strong { font-size: 17px; }
.brand-lockup span { font-size: 13px; }
.app-logo-lockup #holiday-status { font-size: 14px; }
.brand-icon { width: 42px; height: 42px; font-size: 23px; }
.student-chip { font-size: 15px; }
.icon-button { width: 43px; height: 43px; font-size: 21px; }
.page-shell { padding-top: 30px; }
.welcome-row { margin-bottom: 20px; }
.streak-pill, .wallet-card, .date-card { padding: 10px 14px; font-size: 15px; }
.streak-pill strong { font-size: 21px; }
.main-nav { gap: 5px; margin-bottom: 18px; padding: 4px; }
.nav-button { padding: 11px 18px; font-size: 15px; }
.home-top-panels { gap: 14px; margin-bottom: 16px; align-items: start; }
.home-top-panels > article { height: auto; }
.panel-card { border-radius: 22px; }
.pet-card { padding: 18px; }
.panel-heading { gap: 12px; }
.panel-heading.compact { margin-bottom: 12px; }
.level-badge, .rarity-badge { padding: 8px 12px; font-size: 14px; }
.pet-stage { margin: 12px 0 10px; padding: 8px 10px; }
.combat-power-wrap { margin: 2px 0 10px; }
.combat-power-wrap .combat-power-display { width: min(100%, 250px); }
.combat-power-display { min-height: 80px; padding: 9px 6px; }
.combat-power-label { font-size: 13px; }
.combat-power-display strong { font-size: 36px; }
.combat-power-change { font-size: 14px; }
.equipment-grid { gap: 8px; margin-bottom: 12px; }
.equipment-slot { min-height: 106px; padding: 9px 7px; border-radius: 15px; }
.equipment-slot .slot-label, .equipment-slot .slot-name { font-size: 12px; }
.equipment-slot .slot-icon { margin: 4px 0; font-size: 29px; }
.equipment-slot.has-item .slot-icon { font-size: 32px; }
.slot-image { width: 58px; height: 58px; }
.stats-summary { gap: 5px; margin-bottom: 12px; }
.attribute-chip { padding: 8px 4px; }
.attribute-chip strong { font-size: 18px; }
.attribute-chip small { font-size: 11px; }
.pet-progress-row { gap: 6px; margin-bottom: 14px; }
.pet-progress-row strong { font-size: 15px; }
.pet-progress-row .muted-text { font-size: 14px; }
.progress-track { height: 11px; }
.stats-card, .mission-card { padding: 18px; }
.mini-icon, .mission-icon { width: 40px; height: 40px; font-size: 21px; }
.stats-grid { gap: 8px; }
.stat-box { gap: 2px; padding: 11px 10px; }
.stat-icon { font-size: 24px; }
.stat-box strong { font-size: 28px; }
.stat-box small { font-size: 13px; }
.mission-card p { margin: 12px 0 14px; font-size: 16px; line-height: 1.55; }
.primary-button, .secondary-button { padding: 14px 18px; font-size: 16px; }
.checkin-card { padding: 22px; }
.subject-grid { gap: 10px; }
.subject-card { min-height: 132px; padding: 14px 10px; }
.subject-card .subject-icon { margin-bottom: 8px; font-size: 42px; }
.subject-card strong { font-size: 17px; }
.subject-card small { margin-top: 4px; font-size: 13px; }
.quiz-topline { margin-bottom: 12px; font-size: 15px; }
.quiz-progress { height: 10px; margin-bottom: 18px; }
.question-card { padding: 24px; }
.question-number { font-size: 15px; }
.question-card h3 { margin: 9px 0 18px; font-size: clamp(24px, 4vw, 32px); }
.option-label { gap: 12px; padding: 14px; font-size: 17px; }
.feedback { margin: 12px 0 8px; font-size: 16px; }
.quiz-actions { gap: 8px; margin-top: 13px; }
.shop-grid { gap: 12px; }
.shop-item { min-height: 260px; padding: 15px; }
.item-art { margin-bottom: 10px; font-size: 72px; }
.shop-item h3 { font-size: 20px; }
.item-meta { font-size: 12px; }
.item-stats { margin-bottom: 7px; font-size: 13px; }
.item-description { min-height: 34px; margin: 4px 0 6px; font-size: 14px; }
.premium-item:not(.revealed) .premium-lock { padding: 9px; font-size: 14px; }
.item-price { font-size: 15px; }
.item-footer button { padding: 10px 12px; font-size: 14px; }
.owned-label { font-size: 14px; }
.history-list { gap: 9px; }
.history-row { gap: 12px; padding: 14px 16px; }
.history-date { font-size: 15px; }
.history-subject { font-size: 16px; }
.history-score, .history-reward { font-size: 15px; }
.empty-state { padding: 32px 18px; font-size: 16px; }
.app-footer { margin-top: 26px; padding-top: 12px; font-size: 13px; }
.toast { bottom: 20px; padding: 13px 18px; font-size: 15px; }
.login-form label { font-size: 16px; }
.login-form input { padding: 15px 16px; font-size: 17px; }
.demo-login { margin-top: 16px; font-size: 14px; }
.form-error { font-size: 15px; }
.pet-selection-card { padding: 24px; }
.initial-pet-grid { gap: 10px; margin: 16px 0; }
.initial-pet-card { padding: 13px 7px; }
.initial-pet-card .initial-pet-icon { font-size: 54px; }
.initial-pet-card strong { font-size: 16px; }
.initial-pet-card small { font-size: 13px; }

@media (max-width: 620px) {
  body { font-size: 16px; }
  h3 { font-size: 22px; }
  .page-shell { padding-top: 22px; }
  .nav-button { padding: 10px 14px; font-size: 14px; }
  .pet-card { padding: 14px; }
  .home-top-panels .stats-card, .home-top-panels .mission-card { padding: 15px; }
  .level-badge, .rarity-badge { padding: 7px 10px; font-size: 13px; }
  .pet-stage { margin: 10px 0 9px; padding: 7px 8px; }
  .equipment-slot { min-height: 98px; padding: 8px 5px; }
  .equipment-slot .slot-label, .equipment-slot .slot-name { font-size: 11px; }
  .slot-image { width: 54px; height: 54px; }
  .attribute-chip strong { font-size: 15px; }
  .attribute-chip small { font-size: 10px; }
  .stat-box strong { font-size: 25px; }
  .mission-card p { font-size: 15px; }
  .primary-button, .secondary-button { font-size: 15px; }
  .subject-card strong { font-size: 16px; }
  .subject-card small { font-size: 12px; }
  .question-card { padding: 20px; }
  .option-label { font-size: 16px; }
  .shop-item h3 { font-size: 19px; }
  .item-description { font-size: 13px; }
}

/* Extra-large pet controls: equipment and progress must read as primary actions. */
.equipment-grid { gap: 10px; }
.equipment-slot { min-height: 136px; padding: 13px 9px; border-width: 2px; border-radius: 18px; line-height: 1.2; }
.equipment-slot .slot-label, .equipment-slot .slot-name { font-size: 18px; font-weight: 900; }
.equipment-slot .slot-label { color: var(--ink); }
.equipment-slot .slot-icon { margin: 8px 0; font-size: 42px; }
.equipment-slot.has-item .slot-icon { font-size: 42px; }
.slot-image { width: 72px; height: 72px; margin: 5px auto; }
.combat-power-display { min-height: 94px; }
.combat-power-label { font-size: 15px; }
.combat-power-display strong { font-size: 42px; }
.combat-power-change { font-size: 16px; }
.stats-summary { gap: 7px; }
.attribute-chip { padding: 11px 4px; min-height: 78px; align-content: center; }
.attribute-chip strong { font-size: 23px; }
.attribute-chip small { font-size: 14px; }
.pet-progress-row { gap: 8px; }
.pet-progress-row strong { font-size: 18px; }
.pet-progress-row .muted-text { font-size: 16px; }
.progress-track { height: 13px; }
.pet-card > .secondary-button { padding: 16px 18px; font-size: 18px; }

@media (max-width: 620px) {
  .equipment-slot { min-height: 122px; padding: 11px 6px; }
  .equipment-slot .slot-label, .equipment-slot .slot-name { font-size: 16px; }
  .equipment-slot .slot-icon { margin: 7px 0; font-size: 36px; }
  .equipment-slot.has-item .slot-icon { font-size: 36px; }
  .slot-image { width: 64px; height: 64px; }
  .combat-power-display strong { font-size: 36px; }
  .attribute-chip { min-height: 70px; padding: 9px 3px; }
  .attribute-chip strong { font-size: 20px; }
  .attribute-chip small { font-size: 12px; }
  .pet-progress-row strong { font-size: 17px; }
  .pet-progress-row .muted-text { font-size: 14px; }
  .pet-card > .secondary-button { padding: 14px 16px; font-size: 17px; }
}

/* Purchased equipment lives on the pet page so students can manage it without reopening the shop. */
.owned-equipment-panel { margin-top: 20px; padding: 20px; border: 2px solid #dedcf8; border-radius: 22px; background: linear-gradient(145deg, #fbfaff, #f3f1ff); }
.owned-equipment-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.owned-equipment-heading .eyebrow { margin: 0 0 3px; }
.owned-equipment-heading h4 { margin: 0; color: var(--primary-dark); font-size: 24px; }
.owned-equipment-count { padding: 7px 12px; border-radius: 999px; color: #5e58a8; background: #e9e7ff; font-size: 15px; font-weight: 900; white-space: nowrap; }
.owned-equipment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.owned-equipment-card { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 2px solid #e4e2f8; border-radius: 17px; background: white; box-shadow: 0 8px 18px rgba(72,66,145,.06); }
.owned-equipment-card.equipped { border-color: #8f8bea; background: #f7f6ff; box-shadow: 0 8px 20px rgba(92,92,230,.12); }
.owned-equipment-art { display: grid; place-items: center; width: 96px; height: 96px; overflow: hidden; padding: 8px; border-radius: 13px; background: linear-gradient(145deg, #f1efff, #fff5e9); }
.owned-equipment-art img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.owned-equipment-info { min-width: 0; }
.owned-equipment-slot, .owned-equipment-info strong, .owned-equipment-info small { display: block; }
.owned-equipment-slot { margin-bottom: 3px; color: #7772b6; font-size: 13px; font-weight: 900; }
.owned-equipment-info strong { overflow: hidden; color: var(--primary-dark); font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.owned-equipment-info small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.owned-equipment-action { min-width: 64px; padding: 10px 12px; font-size: 15px; white-space: nowrap; }
.owned-equipment-empty { grid-column: 1 / -1; padding: 24px 18px; }
.owned-equipment-empty p { margin: 7px 0 14px; }
.slot-action { display: block; margin-top: 3px; color: #716bc4; font-size: 12px; font-weight: 900; }
.slot-action.locked { color: #4b9b83; }
.equipment-slot.equipped-locked { cursor: default; }
.equipment-slot.equipped-locked:hover { transform: none; }
.owned-equipment-panel-compact { margin-top: 12px; padding: 13px; border-radius: 18px; background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(246,244,255,.84)); }
.owned-equipment-panel-compact .owned-equipment-heading { margin-bottom: 10px; }
.owned-equipment-panel-compact .owned-equipment-heading h4 { font-size: 20px; }
.owned-equipment-panel-compact .owned-equipment-count { padding: 6px 10px; font-size: 13px; }
.owned-equipment-panel-compact .owned-equipment-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.owned-equipment-panel-compact .owned-equipment-card { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; border-radius: 14px; box-shadow: none; }
.owned-equipment-panel-compact .owned-equipment-card.equipped { background: linear-gradient(135deg, #f8fff9, #f1f8ff); border-color: #9be0c6; }
.owned-equipment-panel-compact .owned-equipment-art { width: 54px; height: 54px; padding: 4px; border-radius: 12px; }
.owned-equipment-panel-compact .owned-equipment-slot { font-size: 11px; }
.owned-equipment-panel-compact .owned-equipment-info strong { font-size: 14px; }
.owned-equipment-panel-compact .owned-equipment-info small { font-size: 10px; }
.owned-equipment-panel-compact .owned-equipment-action { min-width: 52px; padding: 8px 10px; font-size: 13px; border-radius: 12px; }
.equipped-lock-badge { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; padding: 7px 10px; border-radius: 999px; color: #236d5a; background: #dff8eb; font-size: 12px; font-weight: 1000; white-space: nowrap; }
.compact-owned-empty { padding: 12px 14px; border-radius: 14px; text-align: left; }
.compact-owned-empty p { margin: 5px 0 0; }
.shop-wallet-card { min-width: 190px; gap: 10px; padding: 11px 16px; border: 2px solid #efc54d; border-radius: 19px; background: linear-gradient(145deg, #fff9d8, #ffe9a8); box-shadow: 0 8px 18px rgba(201,157,38,.18); }
.shop-wallet-card .wallet-icon { font-size: 28px; }
.shop-wallet-card .wallet-copy { display: grid; gap: 1px; }
.shop-wallet-card .wallet-copy small { color: #8b6a12; font-size: 14px; font-weight: 900; }
.shop-wallet-card .wallet-copy strong { color: #5d4810; font-size: 30px; line-height: 1; }
.shop-wallet-card .wallet-unit { align-self: end; padding-bottom: 2px; color: #8b6a12; font-size: 15px; font-weight: 900; }
.pet-exclusive-shop-panel { border-color: #f0d783; background: linear-gradient(145deg, #fffdf3, #fff7dc); }
.pet-exclusive-shop-copy { margin: -4px 0 14px; line-height: 1.6; }
.pet-exclusive-equipment-card { border-color: #f0dfaa; background: rgba(255,255,255,.88); }
.pet-exclusive-equipment-card.equipped { border-color: #d4a936; background: #fff9df; }
.pet-exclusive-action { display: flex; min-width: 82px; align-items: flex-end; flex-direction: column; gap: 7px; }
.pet-exclusive-price { color: #8d6c12; font-size: 13px; font-weight: 900; white-space: nowrap; }
.exclusive-gear-lock-note { grid-column: 1 / -1; padding: 13px 15px; border: 2px dashed rgba(125,118,226,.35); border-radius: 16px; color: #5e58a8; background: rgba(244,242,255,.78); font-size: 14px; font-weight: 900; text-align: center; }
.catalog-mode-card { display: flex; min-width: 190px; align-items: center; gap: 10px; padding: 11px 16px; border: 2px solid #cfcdf5; border-radius: 19px; background: linear-gradient(145deg, #f6f4ff, #e9e7ff); box-shadow: 0 8px 18px rgba(92,92,230,.12); }
.catalog-mode-icon { font-size: 28px; }
.catalog-mode-card div { display: grid; gap: 1px; }
.catalog-mode-card small { color: #6862a9; font-size: 12px; font-weight: 900; }
.catalog-mode-card strong { color: #3f3b83; font-size: 22px; line-height: 1; }
.catalog-mode-note { align-self: end; padding-bottom: 2px; color: #6862a9; font-size: 12px; font-weight: 900; white-space: nowrap; }
.catalog-only-label { color: #6862a9; font-size: 12px; font-weight: 900; white-space: nowrap; }
@media (max-width: 900px) { .owned-equipment-list { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .owned-equipment-panel { margin-top: 16px; padding: 14px; border-radius: 18px; }
  .owned-equipment-panel-compact { margin-top: 10px; padding: 10px; }
  .owned-equipment-heading h4 { font-size: 21px; }
  .owned-equipment-panel-compact .owned-equipment-heading h4 { font-size: 18px; }
  .owned-equipment-count { font-size: 14px; }
  .owned-equipment-panel-compact .owned-equipment-list { display: flex; gap: 8px; overflow-x: auto; padding: 0 2px 4px; scroll-snap-type: x proximity; }
  .owned-equipment-card { grid-template-columns: 86px minmax(0, 1fr) auto; gap: 9px; padding: 9px; border-radius: 14px; }
  .owned-equipment-panel-compact .owned-equipment-card { flex: 0 0 min(84vw, 310px); grid-template-columns: 54px minmax(0, 1fr) auto; scroll-snap-align: start; }
  .owned-equipment-art { width: 86px; height: 86px; padding: 7px; }
  .owned-equipment-panel-compact .owned-equipment-art { width: 54px; height: 54px; padding: 4px; }
  .owned-equipment-art img { width: 100%; height: 100%; }
  .owned-equipment-slot { font-size: 12px; }
  .owned-equipment-panel-compact .owned-equipment-slot { font-size: 11px; }
  .owned-equipment-info strong { font-size: 15px; }
  .owned-equipment-panel-compact .owned-equipment-info strong { font-size: 14px; }
  .owned-equipment-info small { font-size: 11px; }
  .owned-equipment-panel-compact .owned-equipment-info small { font-size: 10px; }
  .owned-equipment-action { min-width: 56px; padding: 9px 8px; font-size: 14px; }
  .owned-equipment-panel-compact .owned-equipment-action { min-width: 52px; padding: 8px 9px; font-size: 13px; }
  .shop-wallet-card { width: 100%; min-width: 0; justify-content: flex-start !important; }
  .catalog-mode-card { width: 100%; min-width: 0; justify-content: flex-start; }
  .pet-exclusive-action { align-items: flex-start; }
}
@media (max-width: 390px) {
  .owned-equipment-card { grid-template-columns: 76px minmax(0, 1fr); }
  .owned-equipment-panel-compact .owned-equipment-card { grid-template-columns: 50px minmax(0, 1fr) auto; }
  .owned-equipment-art { width: 76px; height: 76px; padding: 6px; }
  .owned-equipment-panel-compact .owned-equipment-art { width: 50px; height: 50px; padding: 4px; }
  .owned-equipment-art img { width: 100%; height: 100%; }
  .owned-equipment-action { grid-column: 2; justify-self: start; margin-top: 2px; }
  .owned-equipment-panel-compact .owned-equipment-action, .owned-equipment-panel-compact .equipped-lock-badge { grid-column: auto; justify-self: end; margin-top: 0; }
  .pet-exclusive-action { grid-column: 2; align-items: flex-start; margin-top: 2px; }
}

/* Shop is grouped by equipment slot so students can find a specific part quickly. */
#shop-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.shop-category { display: grid; gap: 12px; }
.shop-category-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border: 2px solid #e2e0fa; border-radius: 17px; color: var(--primary-dark); background: linear-gradient(135deg, #fbfaff, #f0efff); }
.shop-category-heading > div { display: flex; align-items: center; gap: 9px; }
.shop-category-heading h3 { margin: 0; font-size: 22px; }
.shop-category-heading > span { color: #7772b6; font-size: 14px; font-weight: 900; white-space: nowrap; }
.shop-category-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: white; font-size: 21px; }
.shop-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.item-exclusive-note { min-height: 18px; margin: 2px 0 5px; color: #a45d35; font-size: 12px; font-weight: 900; line-height: 1.35; }
.exclusive-item { border-color: #f0c776; }
.exclusive-item.revealed { border-color: #e3a62f; box-shadow: 0 14px 34px rgba(205,145,36,.22); }
#exclusive-set-status { margin: 0 0 18px; }
.exclusive-set-status { padding: 15px 17px; border: 2px solid #dedcf8; border-radius: 18px; background: linear-gradient(135deg, #fbfaff, #f0efff); }
.exclusive-set-status.complete { border-color: #eac052; background: linear-gradient(135deg, #fffbe5, #fff0ba); box-shadow: 0 8px 20px rgba(202,151,45,.13); }
.exclusive-set-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exclusive-set-heading strong { color: var(--primary-dark); font-size: 18px; }
.exclusive-set-heading span { color: #8c6c16; font-size: 13px; font-weight: 900; }
.exclusive-set-status p { margin: 5px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.exclusive-set-progress { display: flex; align-items: center; gap: 10px; }
.exclusive-set-progress > span { flex: 1; height: 10px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.8); }
.exclusive-set-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8a83ed, #f1ad48); }
.exclusive-set-progress b { color: #6f58a9; font-size: 14px; }
@media (max-width: 900px) { .shop-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .shop-category-heading { padding: 11px 13px; }
  .shop-category-heading h3 { font-size: 19px; }
  .shop-category-heading > span { font-size: 12px; }
  .shop-category-grid { gap: 10px; }
  .item-exclusive-note { font-size: 11px; }
  .exclusive-set-status { padding: 13px 14px; }
  .exclusive-set-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* Evolution, awakening and companion-draw feedback. */
.evolved-pet-avatar .role-card-art { filter: saturate(1.18) drop-shadow(0 0 18px rgba(126,103,255,.55)); }
.pet-collection-panel { grid-column: 1 / -1; margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(136,116,68,.35); }
.pet-collection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--primary-dark); }
.pet-collection-heading span { color: var(--muted); font-size: 13px; font-weight: 900; }
.pet-collection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pet-collection-card { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px; border: 2px solid #e7e4fa; border-radius: 14px; color: var(--primary-dark); background: rgba(255,255,255,.74); text-align: left; cursor: pointer; }
.pet-collection-card.active { border-color: #8d87eb; background: #f3f1ff; box-shadow: 0 6px 16px rgba(92,92,230,.12); }
.pet-collection-card img { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 9px; object-fit: contain; background: #eeecff; }
.pet-collection-card span { display: grid; min-width: 0; gap: 2px; }
.pet-collection-card strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pet-collection-card small { color: var(--muted); font-size: 10px; }
.evolution-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; padding: 20px; background: radial-gradient(circle at center, rgba(84,55,190,.86), rgba(11,8,38,.97) 72%); }
.evolution-rays { position: absolute; inset: -45%; z-index: 1; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.04) 0deg 7deg, transparent 7deg 18deg); animation: evolution-rays-spin 5s linear infinite; pointer-events: none; }
.evolution-cinematic-layer { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at center, rgba(34,25,80,.7), rgba(11,8,38,.94)); opacity: 1; transition: opacity .45s ease, visibility .45s ease; }
.evolution-video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; display: block; transform: scale(1.08); transform-origin: center; }
.evolution-video-close { position: absolute; top: 18px; right: 18px; z-index: 5; }
.evolution-video-play { position: absolute; z-index: 4; min-height: 56px; padding: 14px 22px; border: 0; border-radius: 999px; color: #262252; background: rgba(255,244,194,.94); box-shadow: 0 14px 36px rgba(0,0,0,.35); font-size: 18px; font-weight: 900; }
.evolution-cinematic-finished .evolution-cinematic-layer { opacity: 0; visibility: hidden; pointer-events: none; }
.evolution-card { position: relative; z-index: 3; width: min(820px, 94vw); max-height: calc(100vh - 40px); overflow: auto; padding: 30px 30px 26px; border: 2px solid rgba(255,236,153,.78); border-radius: 30px; color: white; background: linear-gradient(155deg, rgba(77,59,177,.96), rgba(28,17,79,.97)); box-shadow: 0 0 0 8px rgba(255,221,102,.1), 0 22px 90px rgba(0,0,0,.45); text-align: center; transform: scale(.72) rotate(-3deg); opacity: 0; pointer-events: none; }
.evolution-playing .evolution-card { animation: evolution-card-in .75s cubic-bezier(.2,1.5,.35,1) forwards; }
.evolution-cinematic-running .evolution-card { animation: none; opacity: 0; pointer-events: none; transform: scale(.86); }
.evolution-cinematic-finished .evolution-card { pointer-events: auto; }
.evolution-card .eyebrow { color: #ffe79a; }
.evolution-card h2 { margin: 0 0 7px; font-size: clamp(30px, 7vw, 46px); text-shadow: 0 0 20px rgba(255,224,116,.65); }
.evolution-burst { margin: -10px auto 4px; color: #fff0a8; font-size: 44px; animation: burst-pulse 1s ease-in-out infinite alternate; }
.evolution-image-wrap { width: min(720px, 100%); aspect-ratio: 16 / 9; margin: 12px auto 16px; overflow: hidden; border: 3px solid rgba(255,238,164,.7); border-radius: 18px; background: #161237; box-shadow: 0 0 30px rgba(147,123,255,.8); }
.evolution-image-wrap img { width: 100%; height: 100%; object-fit: contain; }
.evolution-card > strong { display: block; color: #fff4c2; font-size: clamp(25px, 4vw, 36px); }
.evolution-stat-text { margin: 8px 0 0; color: #ddd5ff; font-size: clamp(15px, 2.3vw, 20px); font-weight: 800; }
@media (max-width: 760px) and (orientation: portrait) {
  .evolution-video { position: absolute; left: 50%; top: 50%; width: 100dvh; height: 100dvw; transform: translate(-50%, -50%) rotate(90deg) scale(1.08); }
  .evolution-card { width: min(94vw, 620px); padding: 22px 16px 18px; border-radius: 24px; }
  .evolution-image-wrap { width: 100%; }
}
@keyframes evolution-rays-spin { to { transform: rotate(360deg); } }
@keyframes evolution-card-in { 0% { opacity: 0; transform: scale(.72) rotate(-3deg); } 55% { opacity: 1; transform: scale(1.06) rotate(1deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes burst-pulse { from { transform: scale(.82) rotate(-8deg); filter: brightness(1); } to { transform: scale(1.18) rotate(8deg); filter: brightness(1.8); } }
/* 让主导航横向铺开，四个入口拥有同等点击宽度。 */
.main-nav { width: 100%; max-width: none; }
.nav-button { flex: 1 1 0; min-width: 0; text-align: center; }

/* 属性独立放在宠物卡片正下方，形成清晰的成长信息层。 */
.pet-stats-under-card { padding: 15px 17px 17px; border: 1px solid rgba(232,231,246,.9); border-radius: 22px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); }
.pet-stats-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.pet-stats-heading strong { color: var(--primary-dark); font-size: 19px; }
.pet-stats-heading span { color: var(--muted); font-size: 13px; }
.pet-stats-under-card .stats-summary { margin-bottom: 0; }

/* 我的宠物：在宠物首页集中查看所有已拥有伙伴的独立状态。 */
.pet-collection-panel { grid-column: 1 / -1; margin-top: 18px; padding: 22px; border: 2px solid #dedcf8; border-radius: 24px; background: linear-gradient(145deg, #fffdf1, #f7f5ff); box-shadow: var(--shadow); }
.pet-collection-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.pet-collection-heading .eyebrow { margin: 0 0 3px; }
.pet-collection-heading h3 { margin: 0; color: var(--primary-dark); font-size: 25px; }
.pet-collection-heading > span { padding: 7px 12px; border-radius: 999px; color: #5e58a8; background: #e9e7ff; font-size: 15px; font-weight: 900; white-space: nowrap; }
.pet-collection-panel > .muted-text { margin: 0 0 15px; font-size: 14px; }
.pet-collection-content { display: grid; gap: 12px; }
.pet-status-card { display: grid; grid-template-columns: minmax(245px, 1.25fr) minmax(245px, 1fr) minmax(190px, .9fr) auto; align-items: center; gap: 16px; min-width: 0; padding: 15px; border: 2px solid #e5e2f8; border-radius: 19px; background: rgba(255,255,255,.88); box-shadow: 0 8px 20px rgba(72,66,145,.06); }
.pet-status-card.active { border-color: #8d87eb; background: #f3f1ff; box-shadow: 0 10px 24px rgba(92,92,230,.14); }
.pet-status-card.evolved { border-color: #eac052; background: linear-gradient(135deg, #fffdf0, #fff4c9); }
.pet-status-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pet-status-image { width: 78px; height: 78px; flex: 0 0 78px; border-radius: 13px; object-fit: contain; background: #eeecff; }
.pet-status-title { min-width: 0; }
.pet-status-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.pet-status-name-row h4 { margin: 0; overflow: hidden; color: var(--primary-dark); font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.pet-current-badge { padding: 4px 8px; border-radius: 999px; color: white; background: #8179df; font-size: 11px; font-weight: 900; white-space: nowrap; }
.pet-status-title p { margin: 5px 0 0; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
.pet-status-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.pet-status-metrics div { min-width: 0; padding: 9px 7px; border-radius: 12px; background: rgba(241,239,255,.78); text-align: center; }
.pet-status-metrics small, .pet-status-metrics strong { display: block; }
.pet-status-metrics small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pet-status-metrics strong { margin-top: 3px; overflow: hidden; color: var(--primary-dark); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.pet-status-exp { display: grid; grid-template-columns: auto auto; gap: 5px 8px; color: var(--muted); font-size: 12px; font-weight: 900; }
.pet-status-exp span:nth-child(2) { text-align: right; }
.pet-status-exp i { grid-column: 1 / -1; display: block; height: 9px; overflow: hidden; border-radius: 99px; background: #e8e6f8; }
.pet-status-exp i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8179df, #f0b24c); }
.pet-status-action { justify-self: end; color: #756fc1; font-size: 13px; font-weight: 900; text-align: center; }
.pet-status-action.current { max-width: 105px; }
.pet-switch-button { min-width: 116px; padding: 10px 12px; font-size: 14px; white-space: nowrap; }
.pet-collection-empty { padding: 24px 18px; }
@media (max-width: 980px) {
  .pet-status-card { grid-template-columns: minmax(220px, 1.2fr) minmax(230px, 1fr); }
  .pet-status-main, .pet-status-exp { grid-column: 1 / 2; }
  .pet-status-metrics { grid-column: 2 / 3; }
  .pet-status-action, .pet-switch-button { grid-column: 2 / 3; justify-self: end; }
}
@media (max-width: 620px) {
  .pet-collection-panel { margin-top: 15px; padding: 14px; border-radius: 18px; }
  .pet-collection-heading { align-items: flex-start; }
  .pet-collection-heading h3 { font-size: 21px; }
  .pet-collection-heading > span { padding: 6px 10px; font-size: 13px; }
  .pet-collection-panel > .muted-text { font-size: 12px; line-height: 1.5; }
  .pet-status-card { grid-template-columns: 1fr; gap: 11px; padding: 11px; border-radius: 15px; }
  .pet-status-main, .pet-status-metrics, .pet-status-exp, .pet-status-action, .pet-switch-button { grid-column: 1; }
  .pet-status-image { width: 66px; height: 66px; flex-basis: 66px; }
  .pet-status-name-row h4 { font-size: 17px; }
  .pet-status-title p { font-size: 12px; }
  .pet-status-metrics strong { font-size: 13px; }
  .pet-status-action, .pet-switch-button { justify-self: stretch; max-width: none; }
  .evolution-card { padding: 22px 17px 19px; }
  .evolution-image-wrap { width: 100%; }
  .main-nav { gap: 3px; padding: 4px; }
  .nav-button { padding: 10px 6px; font-size: 14px; }
  .pet-stats-under-card { padding: 13px 12px 14px; border-radius: 18px; }
  .pet-stats-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .pet-stats-heading strong { font-size: 18px; }
  .pet-stats-heading span { font-size: 12px; }
  .checkin-day-progress { align-items: flex-start; flex-direction: column; gap: 3px; }
  .checkin-day-progress strong { font-size: 15px; }
  .checkin-day-progress span { font-size: 12px; }
  .pet-adoption-fields { grid-template-columns: 1fr; }
  .teacher-hero, .teacher-panel-heading, .teacher-reward-bar { align-items: stretch; flex-direction: column; }
  .teacher-reward-buttons { width: 100%; grid-template-columns: repeat(3, minmax(58px, 1fr)); gap: 7px; }
  .teacher-reward-buttons .primary-button { min-width: 0; min-height: 42px; padding: 9px 6px; border-radius: 12px; font-size: 14px; line-height: 1; }
  .pet-shop-grid { grid-template-columns: 1fr 1fr; }
  .pet-skills-content { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .pet-skill-label { padding-left: 1px; padding-right: 1px; }
  .pet-skill-label strong { font-size: 10px; }
  .pet-skill-label small { font-size: 9px; }
}

/* 会议后新增：老师奖励入口、宠物商店和宠物独立技能素材。 */
.teacher-screen { min-height: 100vh; }
.teacher-topbar { position: sticky; top: 0; z-index: 4; }
.teacher-shell { width: min(1080px, calc(100% - 34px)); margin: 0 auto; padding: 38px 0 60px; }
.teacher-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 28px; }
.teacher-hero h1 { margin: 4px 0 8px; color: var(--primary-dark); font-size: clamp(26px, 4vw, 40px); }
.teacher-rule-card { display: grid; min-width: 245px; padding: 22px; border-radius: 22px; color: #5a3e87; background: linear-gradient(135deg, #fff4c9, #ffe6f4); text-align: center; }
.teacher-rule-card strong { font-size: 25px; letter-spacing: .04em; }
.teacher-rule-card span { margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 800; }
.teacher-controls { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 14px; margin-bottom: 18px; padding: 18px; }
.teacher-controls label { display: grid; min-width: 0; gap: 7px; color: var(--primary-dark); font-size: 13px; font-weight: 900; }
.teacher-controls label span { display: block; }
.teacher-controls input, .teacher-controls select { box-sizing: border-box; display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #dcd8f5; border-radius: 12px; color: var(--primary-dark); background: #fff; font: inherit; }
.teacher-controls input:focus, .teacher-controls select:focus { outline: 3px solid rgba(124,116,226,.18); border-color: #8379dd; }
.teacher-controls .secondary-button { min-height: 44px; padding: 10px 16px; }
.teacher-controls .muted-text { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.teacher-import-panel { margin-bottom: 18px; padding: 22px; }
.teacher-import-panel .teacher-panel-heading { align-items: flex-start; margin-bottom: 16px; }
.teacher-import-panel .compact-button { padding: 10px 13px; white-space: nowrap; }
.teacher-import-defaults { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 15px; }
.teacher-import-defaults label { display: grid; gap: 7px; color: var(--primary-dark); font-size: 13px; font-weight: 900; }
.teacher-import-defaults input { box-sizing: border-box; width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid #dcd8f5; border-radius: 13px; color: var(--primary-dark); background: #fff; font: inherit; }
.teacher-import-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 330px); gap: 16px; align-items: stretch; }
.teacher-import-grid label { display: grid; gap: 7px; color: var(--primary-dark); font-size: 13px; font-weight: 900; }
.teacher-import-textarea { box-sizing: border-box; min-height: 188px; padding: 13px 14px; border: 1px solid #dcd8f5; border-radius: 14px; color: var(--primary-dark); background: #fff; font: 800 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; resize: vertical; }
.teacher-import-textarea:focus, .teacher-import-file-label input:focus, .teacher-import-defaults input:focus { outline: 3px solid rgba(124,116,226,.18); border-color: #8379dd; }
.teacher-import-side { display: grid; align-content: start; gap: 13px; }
.teacher-import-file-label input { box-sizing: border-box; width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid #dcd8f5; border-radius: 13px; background: #fff; color: var(--primary-dark); font: inherit; }
.teacher-import-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.teacher-import-actions button { width: 100%; min-height: 44px; }
.teacher-import-preview { margin-top: 16px; overflow: auto; border: 1px solid #ebe8ff; border-radius: 15px; background: #fbfaff; }
.teacher-import-preview:empty { display: none; }
.teacher-import-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid #ebe8ff; color: var(--primary-dark); font-size: 13px; font-weight: 900; }
.teacher-import-summary span { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border-radius: 999px; background: #eeebff; }
.teacher-import-table { width: 100%; min-width: 760px; border-collapse: collapse; color: var(--primary-dark); font-size: 13px; }
.teacher-import-table th, .teacher-import-table td { padding: 10px 12px; border-bottom: 1px solid #eeeafd; text-align: left; vertical-align: top; }
.teacher-import-table th { background: #f1efff; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.teacher-import-table tr:last-child td { border-bottom: 0; }
.teacher-import-errors { display: grid; gap: 6px; padding: 12px 14px; border-top: 1px solid #f1d5df; color: #a22d58; background: #fff6fa; font-size: 13px; font-weight: 800; }
.teacher-panel { padding: 24px; }
.teacher-panel-heading, .teacher-reward-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.teacher-panel-heading h2 { margin: 0; color: var(--primary-dark); }
.teacher-panel-heading .muted-text { margin: 5px 0 0; }
.select-all-label { display: inline-flex; align-items: center; gap: 7px; color: var(--primary-dark); font-weight: 900; white-space: nowrap; }
.teacher-student-list { display: grid; gap: 10px; margin: 20px 0; }
.teacher-student-row { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid #e4e1fa; border-radius: 16px; background: #fbfaff; cursor: pointer; }
.teacher-student-row:has(input:checked) { border-color: #9288e9; background: #f1efff; box-shadow: 0 7px 18px rgba(92,92,230,.1); }
.teacher-student-row input, .select-all-label input { width: 18px; height: 18px; accent-color: var(--primary); }
.teacher-student-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: #ebe8ff; font-size: 20px; }
.teacher-student-copy, .teacher-student-balance { display: grid; gap: 3px; }
.teacher-student-copy strong, .teacher-student-balance { color: var(--primary-dark); }
.teacher-student-copy small, .teacher-student-balance small { color: var(--muted); font-size: 12px; font-weight: 700; }
.teacher-student-balance { justify-items: end; font-weight: 900; }
.teacher-reward-bar { padding-top: 17px; border-top: 1px solid #ebe9f8; color: var(--primary-dark); font-weight: 900; }
.teacher-reward-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 8px; width: min(100%, 640px); }
.teacher-reward-buttons .primary-button { width: 100%; min-width: 0; padding: 10px 12px; white-space: nowrap; }
.teacher-entry-button { display: block; width: 100%; margin-top: 12px; text-align: center; }
.pet-adoption-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; text-align: left; }
.pet-adoption-fields label { display: grid; gap: 6px; color: var(--primary-dark); font-size: 13px; font-weight: 900; }
.pet-adoption-fields input { width: 100%; padding: 11px 12px; border: 1px solid #dcd8f5; border-radius: 12px; color: var(--primary-dark); background: #fff; font: inherit; }
.pet-adoption-fields input:focus { outline: 3px solid rgba(124,116,226,.18); border-color: #8379dd; }
.pet-shop-panel, .pet-skills-panel { margin-top: 18px; padding: 22px; border: 2px solid #dedcf8; border-radius: 24px; background: linear-gradient(145deg, #fffdf1, #f7f5ff); box-shadow: var(--shadow); }
.pet-skills-panel { margin: 18px 0 20px; padding: 15px; border-width: 1px; border-radius: 19px; background: linear-gradient(145deg, #fffdf7, #f4f2ff); }
.pet-skills-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.pet-skills-heading .eyebrow { margin: 0 0 3px; }
.pet-skills-heading h3 { margin: 0; color: var(--primary-dark); font-size: 20px; }
.pet-skills-heading > span { color: #7770c7; font-size: 12px; font-weight: 900; white-space: nowrap; }
.pet-skills-panel > .muted-text { margin: 0 0 12px; font-size: 12px; }
.pet-shop-panel > .muted-text { margin: 0 0 15px; font-size: 14px; }
.pet-shop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pet-shop-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid #e6e2f7; border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: 0 8px 18px rgba(72,66,145,.06); }
.pet-shop-card.current { border: 2px solid #8f85e5; }
.pet-shop-card.owned { background: #fbfaff; }
.pet-shop-art { height: 132px; padding: 8px; background: linear-gradient(135deg, #eeeaff, #fff5e6); }
.pet-shop-art img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.pet-shop-copy { padding: 12px 12px 0; }
.pet-shop-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pet-shop-title h3 { min-width: 0; margin: 0; overflow: hidden; color: var(--primary-dark); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.pet-shop-title .rarity-badge { padding: 4px 6px; font-size: 10px; }
.pet-shop-copy p { min-height: 33px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.pet-shop-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 12px; }
.pet-price { color: #9b5f1b; font-size: 13px; font-weight: 900; white-space: nowrap; }
.pet-shop-footer .primary-button, .pet-shop-footer .secondary-button { padding: 8px 10px; font-size: 12px; }
.owned-label { color: #7770c7; font-size: 12px; font-weight: 900; }
.pet-skills-content { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.pet-skill-card { overflow: hidden; border: 1px solid #e4e0fa; border-radius: 14px; background: rgba(255,255,255,.88); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.pet-skill-card.single-skill:hover { transform: translateY(-2px); }
.pet-skill-card.open { border-color: #8f85e5; box-shadow: 0 9px 22px rgba(92,92,230,.14); }
.pet-skill-icon-button { display: block; width: 100%; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; font: inherit; text-align: left; }
.pet-skill-image-wrap { display: grid; aspect-ratio: 1; place-items: center; padding: 7px; background: linear-gradient(145deg, #20255d, #6652b5); }
.pet-skill-icon-button img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 11px; image-rendering: pixelated; }
.pet-skill-label { display: grid; gap: 2px; padding: 7px 4px 9px; color: var(--primary-dark); text-align: center; }
.pet-skill-label strong { font-size: 12px; }
.pet-skill-label small { overflow: hidden; color: #716bc0; font-size: 11px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.pet-skill-icon-button:focus-visible { outline: 3px solid #b7b1ff; outline-offset: -3px; }
.pet-skill-explanation { padding: 12px 14px 14px; border-top: 1px solid #e7e3fa; color: var(--primary-dark); background: #f6f4ff; }
.pet-skill-explanation[hidden] { display: none; }
.pet-skill-explanation strong { font-size: 14px; }
.pet-skill-explanation p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
@media (max-width: 760px) {
  .teacher-shell { width: min(100% - 22px, 620px); padding-top: 22px; }
  .teacher-hero, .teacher-panel { padding: 18px; }
  .teacher-controls { grid-template-columns: 1fr; padding: 18px; }
  .teacher-import-panel { padding: 18px; }
  .teacher-import-defaults { grid-template-columns: 1fr; }
  .teacher-import-grid { grid-template-columns: 1fr; }
  .teacher-import-panel .teacher-panel-heading { display: grid; }
  .teacher-student-row { grid-template-columns: auto auto 1fr; }
  .teacher-student-balance { grid-column: 3; justify-items: start; }
  .pet-shop-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 430px) {
  .pet-shop-grid { grid-template-columns: 1fr; }
  .pet-shop-art { height: 165px; }
}

/* Mobile readability and vertical-only layout pass. */
html, body { max-width: 100%; overflow-x: hidden; }
body { font-size: 18px; }
body { min-width: 0; }
img, svg, canvas, video { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }
h1, h2, h3 { letter-spacing: 0; }
.page-shell, .teacher-shell, .login-card, .panel-card, .pet-card, .pet-stage, .pet-skills-panel, .pet-stats-under-card, .owned-equipment-panel, .pet-collection-panel { max-width: 100%; min-width: 0; }
.modal-backdrop, .pet-selection-card { max-width: 100%; min-width: 0; }
.dashboard-grid > *, .home-top-panels > *, .pet-dashboard-grid > *, .side-column > *, .stats-summary > *, .equipment-grid > *, .owned-equipment-list > *, .pet-skills-content > *, .pet-shop-grid > *, .shop-category-grid > * { min-width: 0; }
.panel-heading, .pet-skills-heading, .owned-equipment-heading, .pet-collection-heading, .section-title-row, .welcome-row, .topbar, .topbar-actions, .brand-lockup { min-width: 0; }
.panel-heading > div, .pet-skills-heading > div, .owned-equipment-heading > div, .pet-collection-heading > div, .section-title-row > div, .welcome-row > div, .brand-lockup > div { min-width: 0; }
.pet-card, .pet-skills-panel, .pet-stats-under-card { overflow: hidden; }
.pet-selection-card { width: min(calc(100vw - 40px), 650px); }
.muted-text { font-size: 17px; line-height: 1.55; }
.primary-button, .secondary-button { font-size: 17px; }
.nav-button { font-size: 16px; }
.login-form label { font-size: 17px; }
.login-form input { font-size: 18px; }
.mission-card p { font-size: 17px; }
.question-card h3 { font-size: clamp(26px, 4vw, 34px); }
.option-label { font-size: 18px; }
.subject-card strong { font-size: 18px; }
.subject-card small { font-size: 14px; }
.item-description { font-size: 15px; }
.pet-skills-heading h3 { font-size: 23px; }
.pet-skills-heading > span { font-size: 13px; }
.pet-skills-panel > .muted-text { font-size: 15px; }
.pet-skill-label strong { font-size: 13px; }
.pet-skill-label small { font-size: 12px; }
.pet-skill-explanation strong { font-size: 15px; }
.pet-skill-explanation p { font-size: 14px; }

@media (max-width: 620px) {
  body { font-size: 17px; }
  h1 { font-size: clamp(32px, 9vw, 40px); }
  h2 { font-size: clamp(28px, 8vw, 36px); }
  h3 { font-size: 23px; }
  .page-shell { width: calc(100% - 24px); max-width: 100%; padding-top: 22px; }
  .dashboard-grid, .pet-dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar { gap: 10px; padding: 12px; }
  .brand-lockup { gap: 8px; }
  .brand-lockup strong { font-size: 16px; }
  .brand-lockup span { font-size: 12px; }
  .student-chip { max-width: 138px; font-size: 14px; }
  .main-nav { width: 100%; max-width: 100%; flex-wrap: wrap; overflow-x: visible; gap: 6px; }
  .nav-button { flex: 1 1 calc(50% - 6px); min-width: 0; padding: 12px 8px; font-size: 15px; line-height: 1.25; white-space: normal; }
  .welcome-row, .section-title-row { gap: 12px; }
  .muted-text { font-size: 15px; line-height: 1.6; }
  .primary-button, .secondary-button { font-size: 16px; }
  .login-screen { padding: 18px 12px; }
  .login-card { padding: 34px 22px 28px; border-radius: 24px; }
  .login-form label { font-size: 16px; }
  .login-form input { font-size: 17px; }
  .pet-card { padding: 16px; overflow: hidden; }
  .pet-stage { width: 100%; min-height: 210px; }
  .pet-card-actions { margin: -2px 0 12px; }
  .role-card-before-button { width: 100%; font-size: 16px; }
  .equipped-layer { display: none; }
  .stats-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .attribute-chip { min-height: 68px; padding: 9px 4px; }
  .attribute-chip strong { font-size: 20px; }
  .attribute-chip small { font-size: 12px; }
  .equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipment-slot { min-height: 116px; padding: 10px 6px; }
  .equipment-slot .slot-label, .equipment-slot .slot-name { font-size: 15px; }
  .pet-skills-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .pet-skills-heading > span { font-size: 13px; white-space: normal; }
  .pet-skills-panel > .muted-text { font-size: 15px; }
  .pet-skills-content { grid-template-columns: 1fr; gap: 10px; }
  .pet-skill-card { width: 100%; }
  .pet-skill-icon-button { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: center; }
  .pet-skill-image-wrap { min-height: 86px; padding: 8px; }
  .pet-skill-label { padding: 10px 12px; text-align: left; }
  .pet-skill-label strong { font-size: 15px; }
  .pet-skill-label small { margin-top: 2px; overflow: visible; font-size: 14px; line-height: 1.35; text-overflow: clip; white-space: normal; }
  .pet-skill-explanation { padding: 12px 14px 14px; }
  .pet-skill-explanation strong { font-size: 16px; }
  .pet-skill-explanation p { font-size: 15px; line-height: 1.6; }
  .question-card h3 { font-size: clamp(24px, 7vw, 30px); }
  .option-label { font-size: 17px; }
  .subject-card strong { font-size: 17px; }
  .subject-card small { font-size: 13px; }
  .shop-grid, .shop-category-grid, .pet-shop-grid { grid-template-columns: 1fr; }
  .owned-equipment-card { grid-template-columns: 64px minmax(0, 1fr); }
  .owned-equipment-action, .pet-exclusive-action { grid-column: 2; justify-self: start; max-width: 100%; margin-top: 2px; }
  .modal-backdrop { overflow-x: hidden; padding: 14px; }
  .pet-selection-card { width: min(calc(100vw - 28px), 650px); padding: 22px 16px; border-radius: 22px; }
  .evolution-choice-card { width: min(calc(100vw - 28px), 980px); padding: 26px 14px 18px; border-radius: 22px; }
  .evolution-choice-grid { grid-template-columns: 1fr; gap: 12px; }
  .evolution-choice-card .muted-text { font-size: 16px; }
  .evolution-style-card { gap: 8px; padding: 10px; border-radius: 18px; }
  .evolution-style-card strong { font-size: 22px; }
  .evolution-style-card small { font-size: 14px; }
  .modal-close-button { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 25px; }
  .initial-pet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .initial-pet-card { min-width: 0; padding: 12px 6px; }
  .initial-pet-card .initial-pet-art { height: 104px; }
  .teacher-reward-buttons { grid-template-columns: repeat(3, minmax(58px, 1fr)); gap: 7px; }
  .teacher-reward-buttons .primary-button { min-width: 0; min-height: 42px; padding: 9px 6px; border-radius: 12px; font-size: 14px; line-height: 1; }
}

/* Keep non-square uploaded art inside fixed UI frames. */
.pet-skill-image-wrap {
  overflow: hidden;
}
.pet-skill-icon-button img {
  object-fit: contain;
  object-position: center;
}
.item-art, .owned-equipment-art, .equipped-tag {
  overflow: hidden;
}
.slot-image, .item-art img, .owned-equipment-art img, .equipped-tag img {
  object-fit: contain;
  object-position: center;
}
@media (max-width: 620px) {
  .pet-skill-image-wrap {
    width: 86px;
    height: 86px;
    min-height: 86px;
    overflow: hidden;
  }
  .pet-skill-explanation {
    grid-column: 1 / -1;
  }
}

/* Student message wall: preset sharing keeps the discussion safe and fast. */
.home-wall-share-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 16px;
  border: 2px solid #d8d5f6;
  border-radius: 19px;
  background: linear-gradient(145deg, #fbfaff, #effbf5);
}
.home-wall-share-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.home-wall-share-heading .eyebrow {
  margin: 0 0 3px;
}
.home-wall-share-heading h4 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 23px;
}
#home-wall-share-power {
  padding: 7px 12px;
  border-radius: 999px;
  color: #7a5a10;
  background: #fff2bf;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}
.home-wall-share-panel .muted-text {
  margin: 0;
  font-size: 15px;
}
.home-wall-share-panel.compact-share {
  gap: 12px;
}
.home-share-menu {
  position: relative;
  display: grid;
  gap: 9px;
}
.home-share-menu-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.home-share-menu-options[hidden] {
  display: none;
}
.home-share-option {
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid rgba(92,92,230,.16);
  border-radius: 15px;
  color: #34306f;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 22px rgba(64, 58, 142, .08);
  font-size: 16px;
  font-weight: 900;
}
.home-share-option:hover {
  transform: translateY(-1px);
}
.home-wall-post-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.home-wall-post-presets .wall-preset-button {
  padding: 10px 8px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.25;
  white-space: normal;
}
.wall-badge {
  align-self: center;
  padding: 11px 16px;
  border: 2px solid #b9e5d5;
  border-radius: 18px;
  color: #226850;
  background: linear-gradient(145deg, #eefbf4, #fff7d9);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}
.message-wall-composer {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-bottom: 20px;
  padding: 20px;
}
.home-message-icon { line-height: 1; }
#message-wall-view { padding-bottom: 44px; }
#message-wall-view .message-wall-composer,
#message-wall-view .message-wall-list { width: min(1040px,100%); margin-left: auto; margin-right: auto; }
#message-wall-view .message-wall-composer {
  align-items: start;
  border: 2px solid rgba(177,154,202,.42);
  background: linear-gradient(145deg,rgba(255,253,248,.97),rgba(255,239,246,.96));
  box-shadow: 0 18px 42px rgba(91,70,117,.13);
}
.wall-message-field { display: grid; gap: 8px; color: #5e4c70; font-weight: 950; }
.wall-message-field textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 14px 16px;
  border: 2px solid #dccfea;
  border-radius: 18px;
  outline: 0;
  color: #453952;
  background: rgba(255,255,255,.96);
  font: inherit;
  font-size: 16px;
  line-height: 1.55;
  box-shadow: inset 0 2px 7px rgba(83,63,108,.05);
}
.wall-message-field textarea:focus { border-color: #a989cf; box-shadow: 0 0 0 4px rgba(169,137,207,.15); }
.wall-message-meta { display: flex; justify-content: space-between; gap: 12px; color: #8d7c96; font-size: 13px; font-weight: 800; }
.wall-message-meta strong { color: #6f5784; white-space: nowrap; }
.wall-preset-heading { display: block; margin-bottom: 8px; color: #7a687d; font-size: 13px; font-weight: 900; }
.wall-message-status { min-height: 20px; margin: 0; color: #3b806b; font-size: 14px; font-weight: 850; }
.wall-message-status.error { color: #bd3f56; }
.wall-card-preview {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 14px;
  border: 2px solid #d9d6f8;
  border-radius: 18px;
  background: linear-gradient(145deg, #fbfaff, #fff8df);
}
.wall-card-preview img {
  width: 116px;
  height: 116px;
  object-fit: contain;
  border-radius: 15px;
  background: #eeecff;
}
.wall-preview-copy {
  min-width: 0;
}
.wall-preview-copy span,
.wall-preview-copy small {
  display: block;
}
.wall-preview-copy span {
  color: #6b65b5;
  font-size: 14px;
  font-weight: 900;
}
.wall-preview-copy strong {
  display: block;
  margin: 4px 0;
  overflow: hidden;
  color: var(--primary-dark);
  font-size: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wall-preview-copy small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.wall-power-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #775812;
  background: #fff1b7;
  font-size: 15px;
  font-weight: 900;
}
.wall-composer-actions {
  display: grid;
  align-content: center;
  gap: 13px;
  min-width: 0;
}
.wall-preset-grid,
.wall-comment-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wall-preset-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wall-preset-select-wrap {
  display: none;
}
.wall-preset-select {
  width: 100%;
  min-height: 52px;
  padding: 0 46px 0 16px;
  border: 2px solid #dcd7ff;
  border-radius: 16px;
  color: #34306f;
  background: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(64, 58, 142, .08);
}
.wall-preset-button,
.wall-comment-button,
.wall-like-button {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}
.wall-preset-button {
  padding: 11px 14px;
  color: #3f3b83;
  background: #efedff;
  font-size: 16px;
}
.wall-preset-button.active {
  color: white;
  background: linear-gradient(135deg, #5c5ce6, #4cbf92);
  box-shadow: 0 8px 18px rgba(76, 191, 146, .18);
}
.message-wall-list {
  display: grid;
  gap: 15px;
}
@media (max-width: 760px) {
  #message-wall-view .message-wall-composer { grid-template-columns: 1fr; padding: 14px; }
  #message-wall-view .wall-card-preview { grid-template-columns: 88px minmax(0,1fr); }
  #message-wall-view .wall-card-preview img { width: 88px; height: 88px; }
  .wall-message-meta { align-items: flex-start; }
}
.wall-post-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 15px;
  min-width: 0;
  padding: 16px;
  border: 2px solid #e1def8;
  border-radius: 20px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 28px rgba(72,66,145,.08);
}
.wall-post-art {
  display: grid;
  align-content: start;
  gap: 8px;
}
.wall-image-button {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(145deg, #eeeaff, #fff5e6);
  transition: transform .18s ease, box-shadow .18s ease;
}
.wall-image-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(72,66,145,.16);
}
.wall-post-art img,
.wall-image-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}
.wall-post-power {
  display: block;
  padding: 7px 8px;
  border-radius: 12px;
  color: #7a5a10;
  background: #fff2bf;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}
.wall-post-body {
  min-width: 0;
}
.wall-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.wall-post-owner { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wall-owner-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, #fff0bd, #eeecff); box-shadow: 0 9px 18px rgba(72,66,145,.12); font-size: 21px; }
.wall-owner-avatar-image { width: 100%; height: 100%; object-fit: cover; }
.wall-post-header h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 22px;
}
.wall-post-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.wall-post-time {
  color: #8c88b6;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.wall-message-text {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #33446f;
  background: linear-gradient(145deg, #eefaf5, #f8f5ff);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.45;
}
.wall-music-share {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px;
  border: 2px solid color-mix(in srgb, var(--track-accent), white 68%);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.96), color-mix(in srgb, var(--track-accent), white 90%));
}
.wall-music-share-art {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  color: var(--track-accent);
  background: rgba(255,255,255,.82);
  font-size: 26px;
}
.wall-music-share-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.wall-music-share-copy span {
  color: var(--track-accent);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}
.wall-music-share-copy strong {
  overflow: hidden;
  color: var(--primary-dark);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wall-music-share-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.wall-music-share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.wall-music-share-actions .primary-button,
.wall-music-share-actions .secondary-button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}
@media (max-width: 720px) {
  .wall-music-share {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .wall-music-share-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .wall-music-share-actions .primary-button,
  .wall-music-share-actions .secondary-button {
    flex: 1 1 130px;
  }
}
.wall-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 12px;
}
.wall-stat-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 6px;
  border-radius: 13px;
  background: #fafaff;
  text-align: center;
}
.wall-stat-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.wall-stat-grid strong {
  overflow: hidden;
  color: var(--primary-dark);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wall-equipment-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.wall-equipment-list.empty {
  display: block;
  padding: 10px 12px;
  border-radius: 13px;
  color: var(--muted);
  background: #f4f2ff;
  font-size: 14px;
  font-weight: 800;
}
.wall-equipment-list span {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 3px 7px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border-radius: 13px;
  background: #fff8e4;
}
.wall-equipment-list img {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}
.wall-equipment-list b,
.wall-equipment-list strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wall-equipment-list b {
  color: #8b6a12;
  font-size: 11px;
}
.wall-equipment-list strong {
  color: #5b4a85;
  font-size: 13px;
}
.wall-post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.wall-like-button {
  padding: 9px 13px;
  color: #c25b72;
  background: #ffe8ee;
  font-size: 16px;
}
.wall-like-button.liked {
  color: white;
  background: linear-gradient(135deg, #e76583, #f1a34a);
}
.wall-comment-button {
  padding: 8px 11px;
  color: #27705a;
  background: #e7f8f0;
  font-size: 14px;
}
.wall-custom-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0 0 12px;
}
.wall-custom-comment-input {
  min-width: 0;
  padding: 11px 13px;
  border: 2px solid #ddd9fb;
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255,255,255,.94);
  font-size: 15px;
  font-weight: 800;
}
.wall-custom-comment-input:focus {
  outline: 3px solid rgba(92,92,230,.16);
  border-color: #8179df;
}
.wall-custom-comment-button {
  min-width: 76px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #4cbf92, #5c5ce6);
  font-size: 15px;
  font-weight: 900;
}
.wall-comments {
  display: grid;
  gap: 7px;
}
.wall-comment-row {
  padding: 9px 11px;
  border-radius: 13px;
  color: #4d4a7a;
  background: #f4f2ff;
  font-size: 14px;
  line-height: 1.45;
}
.wall-comment-row strong {
  color: var(--primary-dark);
}
.wall-empty {
  padding: 30px 18px;
}
.image-viewer-overlay {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23,20,64,.54);
  backdrop-filter: blur(8px);
}
.image-viewer-card {
  position: relative;
  width: min(100%, 920px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 26px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 80px rgba(15,18,58,.32);
}
.image-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-right: 52px;
}
.image-viewer-header > div {
  min-width: 0;
}
.image-viewer-card h2 {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: clamp(25px, 4vw, 34px);
}
.image-viewer-card .muted-text {
  margin: 0 0 16px;
}
.image-viewer-share-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid rgba(76,191,146,.28);
  border-radius: 999px;
  background: rgba(233,251,244,.9);
  font-size: 15px;
}
.image-viewer-share-button[hidden] {
  display: none;
}
.image-viewer-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.image-viewer-figure {
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
}
.image-viewer-figure img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 18px;
  background: linear-gradient(145deg, #eeeaff, #fff6e5);
}
.image-viewer-figure figcaption {
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}
.image-viewer-hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

/* Bilingual controls and long English copy should stay inside fixed-width UI. */
.language-toggle { position: fixed; top: 14px; left: 50%; z-index: 120; display: inline-flex; gap: 4px; padding: 5px; border: 1px solid rgba(255,255,255,.72); border-radius: 999px; background: rgba(255,255,255,.72); box-shadow: 0 12px 30px rgba(31,35,78,.16); backdrop-filter: blur(14px) saturate(1.12); transform: translateX(-50%); }
.app-mode .language-toggle,
.teacher-mode .language-toggle { top: max(10px, calc(env(safe-area-inset-top) + 8px)); right: 12px; left: auto; z-index: 140; opacity: .94; box-shadow: 0 8px 22px rgba(31,35,78,.16); transform: none; }
.language-button { min-width: 48px; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 999px; color: #5e58a8; background: transparent; font-size: 13px; font-weight: 900; line-height: 1; }
.app-mode .language-button,
.teacher-mode .language-button { min-width: 42px; min-height: 30px; padding: 6px 8px; font-size: 12px; }
.language-button.active { color: #fff; background: linear-gradient(135deg, var(--primary), #8181f5); box-shadow: 0 6px 15px rgba(92,92,230,.22); }
.primary-button, .secondary-button, .nav-button, .text-button { white-space: normal; overflow-wrap: anywhere; }
.wall-custom-comment-button { white-space: normal; overflow-wrap: anywhere; }
.pet-selection-card, .level-up-card, .evolution-card { overflow-wrap: anywhere; }
.image-viewer-card { overflow-wrap: anywhere; }
.pet-shop-title h3,
.owned-equipment-info strong,
.pet-status-name-row h4,
.wall-preview-copy strong,
.wall-post-header h3 {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .home-wall-post-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .message-wall-composer {
    grid-template-columns: 1fr;
  }
  .wall-card-preview {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .wall-card-preview img {
    width: 96px;
    height: 96px;
  }
  .wall-post-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .wall-image-button,
  .wall-post-art img {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 620px) {
  .home-wall-share-panel {
    padding: 14px;
    border-radius: 17px;
  }
  .home-wall-share-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .home-wall-share-heading h4 {
    font-size: 21px;
  }
  #home-wall-share-power {
    width: 100%;
    text-align: center;
  }
  .home-share-menu-options {
    grid-template-columns: 1fr;
  }
  .home-share-option {
    min-height: 50px;
    font-size: 15px;
  }
  .home-wall-post-presets {
    grid-template-columns: 1fr;
  }
  .wall-badge {
    align-self: stretch;
    text-align: center;
  }
  .message-wall-composer {
    padding: 14px;
    border-radius: 18px;
  }
  .wall-card-preview,
  .wall-post-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .wall-card-preview img,
  .wall-image-button,
  .wall-post-art img {
    width: 100%;
    height: auto;
    max-height: 220px;
  }
  .wall-image-button {
    aspect-ratio: 1;
    max-width: min(100%, 260px);
    justify-self: center;
  }
  .wall-post-art {
    justify-items: center;
  }
  .wall-post-power {
    width: 100%;
  }
  .wall-preview-copy strong,
  .wall-post-header h3 {
    white-space: normal;
  }
  .wall-message-text {
    font-size: 18px;
  }
  .wall-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wall-equipment-list {
    grid-template-columns: 1fr;
  }
  .wall-preset-button {
    flex: 1 1 100%;
    font-size: 15px;
  }
  .wall-preset-button-row {
    display: none;
  }
  .wall-preset-select-wrap {
    display: block;
    width: 100%;
  }
  .wall-preset-select {
    min-height: 54px;
    font-size: 16px;
  }
  .shop-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .shop-slot-filter {
    align-items: stretch;
    flex-direction: column;
  }
  .shop-slot-select {
    min-width: 0;
    width: 100%;
  }
  .wall-comment-button {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  .wall-custom-comment-form {
    grid-template-columns: 1fr;
  }
  .wall-custom-comment-button {
    width: 100%;
  }
  .app-logo-lockup {
    max-width: min(100%, 210px);
    padding: 6px 9px;
  }
  .app-header-logo {
    width: min(36vw, 138px);
  }
  .app-logo-lockup #holiday-status {
    font-size: 11px;
  }
  .image-viewer-overlay {
    padding: 14px;
  }
  .image-viewer-card {
    max-height: calc(100vh - 28px);
    padding: 22px 16px 18px;
    border-radius: 22px;
  }
  .image-viewer-header {
    flex-direction: column;
    margin-right: 46px;
    gap: 8px;
  }
  .image-viewer-card h2,
  .image-viewer-card .muted-text {
    margin-right: 0;
  }
  .image-viewer-share-button {
    align-self: flex-start;
  }
  .image-viewer-gallery {
    grid-template-columns: 1fr;
  }
  .language-toggle { top: 8px; }
  .language-button { min-height: 32px; padding: 6px 9px; font-size: 12px; }
}

/* UI/UX Pro Max polish: child-friendly glass-clay surfaces, stable touch targets, clearer hierarchy. */
:root {
  --surface-glass: rgba(255,255,255,.88);
  --surface-strong: rgba(255,255,255,.96);
  --surface-tint: rgba(245,244,255,.84);
  --outline-soft: rgba(123,116,226,.2);
  --outline-strong: rgba(92,92,230,.34);
  --accent-mint: #43bf96;
  --accent-gold: #f5bd47;
  --shadow-soft: 0 18px 48px rgba(43,42,108,.14);
  --shadow-lift: 0 20px 54px rgba(43,42,108,.2);
  --press-scale: .985;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  overflow-x: hidden;
  color: #232149;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.managed-site-announcement {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  z-index: 10020;
  max-width: min(680px, calc(100vw - 24px));
  padding: 10px 16px;
  border: 1px solid rgba(60, 111, 82, .28);
  border-radius: 12px;
  color: #315640;
  background: rgba(239, 250, 242, .96);
  box-shadow: 0 10px 26px rgba(38, 70, 49, .16);
  font-weight: 850;
  text-align: center;
  transform: translateX(-50%);
}

.managed-site-announcement.is-maintenance {
  color: #8a3f38;
  border-color: rgba(174, 77, 66, .3);
  background: rgba(255, 241, 237, .97);
}

.coin-redeem-card {
  border-color: color-mix(in srgb, var(--managed-site-primary, #6556d8) 28%, #eadfce);
}

button,
a,
select,
input {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.wall-image-button:focus-visible,
.initial-pet-card:focus-visible,
.subject-card:focus-visible,
.shop-item:focus-visible {
  outline: 3px solid rgba(67,191,150,.55);
  outline-offset: 3px;
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
  transform: none !important;
  box-shadow: none !important;
}

.primary-button,
.secondary-button,
.icon-button,
.nav-button,
.scene-button,
.wall-preset-button,
.wall-comment-button,
.wall-like-button,
.pet-food-button,
.wall-custom-comment-button {
  min-height: 44px;
  transition:
    transform .18s cubic-bezier(.2,.8,.2,1),
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.primary-button:active,
.secondary-button:active,
.icon-button:active,
.nav-button:active,
.scene-button:active,
.wall-preset-button:active,
.wall-comment-button:active,
.wall-like-button:active,
.pet-food-button:active,
.wall-custom-comment-button:active {
  transform: scale(var(--press-scale));
}

.login-card,
.panel-card,
.message-wall-composer,
.wall-post-card,
.pet-selection-card,
.level-up-card,
.image-viewer-card {
  border-color: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
}

.login-card {
  overflow: hidden;
  border-width: 2px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.84), rgba(247,247,255,.7)),
    rgba(255,255,255,.74);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--primary), var(--accent-mint), var(--accent-gold));
}

.brand-mark {
  box-shadow:
    inset -5px -6px 14px rgba(38,33,126,.18),
    inset 5px 6px 16px rgba(255,255,255,.26),
    0 16px 32px rgba(78,76,219,.28);
}

.center-logo,
.app-logo-lockup,
.language-toggle {
  border: 1px solid rgba(255,255,255,.86);
  background: rgba(255,255,255,.82);
  box-shadow: 0 14px 34px rgba(31,35,78,.14);
}

.topbar {
  border-bottom: 1px solid rgba(255,255,255,.78);
  background: rgba(255,255,255,.76);
  box-shadow: 0 14px 32px rgba(35,34,92,.09);
}

.app-screen .topbar {
  background: rgba(255,255,255,.78);
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.student-chip {
  border-color: rgba(92,92,230,.14);
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.main-nav {
  width: 100%;
  border: 1px solid rgba(255,255,255,.78);
  background: rgba(255,255,255,.7);
  box-shadow: 0 14px 34px rgba(35,34,92,.11);
  scrollbar-width: thin;
  scrollbar-color: rgba(92,92,230,.38) transparent;
}

.nav-button {
  position: relative;
  flex: 1 0 auto;
  color: #5d5a86;
}

.nav-button-locked {
  color: #8b88ad;
  background: rgba(255,255,255,.44);
}

.nav-button-locked::before {
  content: "🔒";
  margin-right: 5px;
  font-size: .9em;
}

.nav-button.active {
  color: #2f2b8e;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,243,255,.92));
  box-shadow:
    inset 0 0 0 1px rgba(92,92,230,.12),
    0 8px 18px rgba(72,66,145,.12);
}

.nav-button.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 5px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent-mint));
}

.nav-button.has-friend-alert {
  color: #2f2b8e;
  background: rgba(255,255,255,.9);
  box-shadow:
    0 0 0 2px rgba(255,79,134,.34),
    0 0 22px rgba(255,79,134,.3),
    0 10px 22px rgba(72,66,145,.14);
  animation: friend-alert-pulse 1.15s ease-in-out infinite;
}

.nav-button.has-friend-alert::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff4f86;
  box-shadow: 0 0 0 4px rgba(255,79,134,.16);
}

@keyframes friend-alert-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

.panel-card {
  border-width: 1px;
  background: var(--surface-glass);
}

.stats-card,
.mission-card,
.pet-card,
.checkin-card,
.question-card,
.shop-item,
.owned-equipment-panel,
.pet-skills-panel,
.pet-stats-under-card,
.pet-collection-panel {
  box-shadow: var(--shadow-soft);
}

.stat-box,
.attribute-chip,
.subject-card,
.equipment-slot,
.wall-stat-grid span {
  border: 1px solid rgba(92,92,230,.08);
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.74);
}

.primary-button {
  background:
    linear-gradient(135deg, #5655e8 0%, #7473f4 55%, #43bf96 100%);
  box-shadow: 0 12px 24px rgba(92,92,230,.22);
}

.secondary-button {
  border: 1px solid rgba(92,92,230,.12);
  background: linear-gradient(145deg, #f2f1ff, #ffffff);
}

.primary-button:hover,
.secondary-button:hover,
.nav-button:hover,
.scene-button:hover,
.pet-food-button:hover {
  box-shadow: var(--shadow-lift);
}

.wall-badge {
  border-color: rgba(67,191,150,.24);
  background: linear-gradient(145deg, #e9fbf4, #fff5c9);
}

.message-wall-composer,
.home-wall-share-panel {
  border-color: rgba(92,92,230,.24);
  background:
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(239,251,245,.76));
}

.wall-card-preview,
.wall-post-card {
  border-color: rgba(92,92,230,.22);
  background:
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(247,246,255,.9));
}

.wall-card-preview img,
.wall-image-button,
.wall-post-art img {
  border: 1px solid rgba(92,92,230,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.wall-preset-button,
.wall-comment-button,
.wall-like-button {
  min-height: 42px;
}

.wall-preset-button {
  border: 1px solid rgba(92,92,230,.08);
  background: #f0efff;
}

.wall-preset-button.active {
  background: linear-gradient(135deg, #5655e8, #43bf96);
}

.wall-message-text {
  border: 1px solid rgba(67,191,150,.12);
}

.wall-custom-comment-input,
.login-form input,
.teacher-controls input,
.teacher-controls select,
.shop-slot-select,
.wall-preset-select {
  min-height: 48px;
  border-color: rgba(92,92,230,.2);
  background: rgba(255,255,255,.96);
}

.toast {
  z-index: 160;
  background: rgba(35,32,88,.94);
  backdrop-filter: blur(12px);
}
.inline-message-anchor {
  position: relative;
}
.button-inline-error {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  z-index: 8;
  transform: translate(-4px, -50%);
  max-width: min(180px, 52vw);
  padding: 5px 9px;
  border: 1px solid rgba(218,45,82,.28);
  border-radius: 999px;
  color: #da2d52;
  background: rgba(255,244,247,.98);
  box-shadow: 0 10px 20px rgba(159,36,66,.16);
  font-size: 13px;
  font-weight: 1000;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .18s ease, transform .18s ease;
}
.button-inline-error.show {
  opacity: 1;
  transform: translate(0, -50%);
}

@media (min-width: 1040px) {
  .page-shell {
    width: min(100% - 48px, 1240px);
  }

  .message-wall-composer {
    grid-template-columns: minmax(320px, .78fr) minmax(0, 1.22fr);
  }

  .wall-post-card {
    grid-template-columns: 148px minmax(0, 1fr);
  }

  .wall-image-button {
    width: 148px;
    height: 148px;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .student-chip {
    flex: 1 1 auto;
    min-width: 0;
  }

  .main-nav {
    gap: 6px;
    padding: 6px;
  }

  .nav-button {
    min-height: 48px;
    padding-inline: 14px;
  }

  .wall-composer-actions {
    align-content: start;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .language-toggle {
    top: max(8px, env(safe-area-inset-top));
    left: 14px;
    transform: none;
  }

  .login-screen {
    min-height: 100dvh;
    place-items: end center;
    padding: 70px 14px max(18px, env(safe-area-inset-bottom));
  }

  .center-logo {
    width: min(44vw, 164px);
    padding: 6px 9px;
    border-radius: 13px;
  }

  .login-card {
    width: min(100%, 430px);
    padding: 31px 20px 25px;
    border-radius: 25px;
  }

  .brand-mark {
    width: 62px;
    height: 62px;
    margin-bottom: 14px;
    border-radius: 20px;
    font-size: 31px;
  }

  .hero-copy {
    margin-bottom: 22px;
    line-height: 1.55;
  }

  .primary-button,
  .secondary-button {
    min-height: 50px;
  }

  .topbar {
    padding: 12px;
  }

  .app-logo-lockup {
    width: 100%;
    max-width: none;
    justify-content: space-between;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .page-shell {
    width: calc(100% - 20px);
    padding-top: 18px;
  }

  .welcome-row,
  .section-title-row {
    gap: 12px;
    margin-bottom: 16px;
  }

  .main-nav {
    position: sticky;
    top: 113px;
    z-index: 18;
    margin-bottom: 16px;
    border-radius: 18px;
  }

  .pet-card,
  .stats-card,
  .mission-card,
  .checkin-card,
  .question-card,
  .message-wall-composer,
  .wall-post-card {
    border-radius: 20px;
  }

  .wall-preset-select-wrap {
    position: relative;
  }

  .wall-preset-select {
    min-height: 56px;
    padding-right: 42px;
    border-width: 2px;
    border-radius: 18px;
    color: #2f2b65;
    background:
      linear-gradient(145deg, rgba(255,255,255,.98), rgba(243,242,255,.94));
  }

  .wall-preset-button-row {
    display: none;
  }

  .home-wall-post-presets .wall-preset-button-row {
    display: none;
  }

  .wall-comment-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .wall-comment-button {
    min-height: 46px;
    padding: 9px 8px;
    font-size: 14px;
  }

  .wall-post-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .wall-like-button {
    width: 100%;
    min-height: 48px;
  }

  .wall-custom-comment-input,
  .wall-custom-comment-button {
    min-height: 50px;
  }

  .image-viewer-card {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .wall-comment-presets {
    grid-template-columns: 1fr;
  }

  .nav-button {
    padding-inline: 12px;
  }

  .app-header-logo {
    width: min(42vw, 132px);
  }
}

/* Series pet shop and compact community updates. */
.pet-exclusive-shop-panel[hidden],
.pet-collection-grid-expanded[hidden] {
  display: none !important;
}

.pet-collection-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 2px solid var(--outline-strong);
  border-radius: 18px;
  color: #302b67;
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(242,240,255,.92));
  box-shadow: 0 12px 28px rgba(43,42,108,.1);
  cursor: pointer;
}

.pet-collection-toggle span,
.pet-collection-toggle strong {
  min-width: 0;
  font-weight: 900;
}

.pet-collection-toggle strong {
  overflow: hidden;
  color: #5c5ce6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-collection-collapsed-note {
  margin-top: 9px;
  padding: 10px 13px;
  border-radius: 14px;
  color: #7772a8;
  background: rgba(244,242,255,.78);
  font-size: 14px;
  font-weight: 800;
}

.pet-collection-collapsed-note.hidden {
  display: none;
}

.pet-collection-grid-expanded {
  display: grid;
  gap: 12px;
  margin-top: 13px;
}

.shop-grid:empty {
  display: none !important;
}

.pet-shop-mode-card {
  border-color: rgba(76,191,146,.42);
  background: linear-gradient(145deg, rgba(244,255,250,.96), rgba(240,238,255,.92));
}

.pet-shop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.pet-series-toolbar {
  display: grid;
  gap: 12px;
}

.pet-series-select-wrap {
  display: none;
}

.pet-series-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.pet-series-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid rgba(125,118,226,.24);
  border-radius: 999px;
  color: #3f3b83;
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 24px rgba(43,42,108,.08);
  cursor: pointer;
}

.pet-series-button strong,
.pet-series-button small {
  font-weight: 900;
}

.pet-series-button small {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: #6c65c8;
  background: #efedff;
}

.pet-series-button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #5c5ce6, #43bf96);
}

.pet-series-button.active small {
  color: #315047;
  background: rgba(255,255,255,.82);
}

.pet-series-section {
  display: grid;
  gap: 13px;
}

.pet-series-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid rgba(125,118,226,.22);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(243,242,255,.84));
}

.pet-series-heading h3,
.pet-series-heading p {
  margin: 0;
}

.pet-series-heading h3 {
  color: var(--primary-dark);
  font-size: 24px;
}

.pet-series-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.pet-series-heading > span {
  color: #6c65c8;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.pet-series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pet-series-grid .pet-shop-card {
  border-width: 2px;
}

.pet-shop-gear-panel {
  display: grid;
  gap: 8px;
  margin: 12px;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(125,118,226,.22);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255,253,239,.9), rgba(246,244,255,.86));
}

.pet-shop-gear-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pet-shop-gear-heading span {
  color: #332f70;
  font-size: 14px;
  font-weight: 900;
}

.pet-shop-gear-heading small {
  overflow: hidden;
  color: #8b6a12;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-shop-gear-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.pet-shop-gear-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 2px 7px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(125,118,226,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.82);
}

.pet-shop-gear-item img {
  grid-row: 1 / 4;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #f3f1ff;
  image-rendering: pixelated;
}

.pet-shop-gear-item b,
.pet-shop-gear-item strong,
.pet-shop-gear-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-shop-gear-item b {
  color: #7a73bd;
  font-size: 11px;
}

.pet-shop-gear-item strong {
  color: #332f70;
  font-size: 12px;
}

.pet-shop-gear-item small {
  color: #8b6a12;
  font-size: 10px;
  font-weight: 900;
}

.pet-shop-gear-item.owned {
  border-color: rgba(76,191,146,.36);
  background: rgba(238,250,245,.9);
}

.pet-shop-gear-item.equipped {
  border-color: #f0c95a;
  background: #fff7d8;
}

.pet-shop-gear-item.locked {
  grid-template-columns: 1fr;
  border-style: dashed;
  color: #7772a8;
  background: rgba(244,242,255,.72);
  text-align: center;
}

.pet-shop-gear-item.locked b,
.pet-shop-gear-item.locked strong,
.pet-shop-gear-item.locked small {
  white-space: normal;
}

.pet-shop-gear-empty {
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(244,242,255,.82);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.wall-post-details {
  margin: 0 0 12px;
  border: 1px solid rgba(125,118,226,.22);
  border-radius: 15px;
  background: rgba(248,247,255,.72);
}

.wall-post-details summary {
  min-height: 46px;
  padding: 12px 14px;
  color: #4b45a6;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.wall-post-details[open] summary {
  border-bottom: 1px solid rgba(125,118,226,.18);
}

.wall-post-details .wall-stat-grid,
.wall-post-details .wall-equipment-list {
  margin: 10px 12px;
}

.wall-comment-select-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: min(100%, 520px);
}

.wall-comments-panel {
  margin-top: 4px;
  border: 1px solid rgba(125,118,226,.18);
  border-radius: 16px;
  background: rgba(247,245,255,.68);
  overflow: hidden;
}

.wall-comments-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 13px;
  color: #4b45a6;
  font-size: 14px;
  font-weight: 1000;
  cursor: pointer;
  list-style: none;
}

.wall-comments-summary::-webkit-details-marker { display: none; }

.wall-comments-summary b {
  display: grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: #27705a;
  background: #e7f8f0;
  font-size: 13px;
}

.wall-comments-content {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(125,118,226,.14);
}

.wall-comment-select-label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.wall-comment-select-label span,
.wall-comments-meta {
  color: #7772a8;
  font-size: 12px;
  font-weight: 900;
}

.wall-comment-select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 13px;
  border: 2px solid #dcd7ff;
  border-radius: 14px;
  color: #302b67;
  background: rgba(255,255,255,.96);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}

.wall-comment-select-button {
  min-height: 46px;
  padding: 0 13px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #43bf96, #5c5ce6);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.wall-comments-meta {
  margin: 0 0 7px;
}

@media (max-width: 1060px) {
  .pet-series-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .pet-series-buttons {
    display: none;
  }

  .pet-series-select-wrap {
    display: grid;
    gap: 7px;
  }

  .pet-series-select-wrap span {
    color: #514b91;
    font-size: 14px;
    font-weight: 900;
  }

  .pet-series-select {
    min-height: 54px;
    padding: 0 42px 0 15px;
    border: 2px solid #dcd7ff;
    border-radius: 17px;
    color: #302b67;
    background: rgba(255,255,255,.96);
    font: inherit;
    font-size: 16px;
    font-weight: 900;
  }
}

@media (max-width: 620px) {
  .pet-collection-toggle {
    align-items: flex-start;
    flex-direction: column;
    min-height: 64px;
    padding: 12px 13px;
  }

  .pet-collection-toggle strong {
    white-space: normal;
  }

  .pet-series-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 13px;
  }

  .pet-series-heading h3 {
    font-size: 22px;
  }

  .pet-series-grid {
    grid-template-columns: 1fr;
  }

  .pet-shop-gear-grid {
    grid-template-columns: 1fr;
  }

  .wall-post-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
  }

  .wall-post-art {
    gap: 7px;
  }

  .wall-image-button {
    width: 88px;
    height: 88px;
    border-radius: 14px;
  }

  .wall-post-power {
    padding: 6px 5px;
    font-size: 12px;
  }

  .wall-post-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 7px;
  }

  .wall-post-header h3 {
    font-size: 18px;
  }

  .wall-post-header p,
  .wall-post-time {
    font-size: 12px;
  }

  .wall-message-text {
    margin-bottom: 9px;
    padding: 9px 11px;
    border-radius: 13px;
    font-size: 16px;
  }

  .wall-post-details summary {
    min-height: 42px;
    padding: 10px 11px;
    font-size: 13px;
  }

  .wall-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wall-equipment-list {
    grid-template-columns: 1fr;
  }

  .wall-comment-select-form {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }

  .wall-comment-select,
  .wall-comment-select-button {
    min-height: 48px;
  }

  .wall-comments {
    gap: 6px;
  }

  .wall-comment-row {
    padding: 8px 10px;
    font-size: 13px;
  }

  .gift-claim-card {
    max-width: min(94vw, 520px);
  }

  .reward-row,
  .reward-row-duplicate {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .reward-row img,
  .reward-coin-icon {
    width: 78px;
    height: 78px;
  }
}

@media (max-width: 390px) {
  .wall-post-card {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 9px;
  }

  .wall-image-button {
    width: 74px;
    height: 74px;
  }

  .wall-message-text {
    font-size: 15px;
  }
}

.friends-dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.friends-panel { min-width: 0; padding: 20px; }
.friend-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.friend-search-form input,
.shared-room-row select,
.gift-select-label select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; color: var(--ink); background: rgba(255,255,255,.9); font-size: 16px; font-weight: 800; }
.friend-search-results,
.friend-notifications,
.friend-list,
.friend-profile-content { display: grid; gap: 10px; min-width: 0; }
.friend-result-row,
.friend-mail-row,
.friend-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px; border: 1px solid rgba(111,101,235,.18); border-radius: 14px; background: rgba(255,255,255,.72); }
.friend-mail-row.unread { border-color: rgba(77,199,177,.4); background: rgba(234,255,249,.8); }
.friend-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: rgba(111,101,235,.12); font-size: 22px; font-weight: 1000; }
.friend-avatar.large { width: 54px; height: 54px; font-size: 26px; }
.friend-copy,
.friend-card-main,
.friend-mail-row > div { min-width: 0; }
.friend-copy strong,
.friend-card strong,
.friend-mail-row strong { display: block; color: var(--primary-dark); font-size: 16px; font-weight: 1000; overflow-wrap: anywhere; }
.friend-copy small,
.friend-card small,
.friend-mail-row small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.friend-card { align-items: stretch; flex-direction: column; }
.friend-card-main { display: flex; align-items: center; gap: 12px; }
.friend-card-actions,
.friend-mail-actions,
.friend-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.friend-mail-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.compact-button { min-height: 38px; padding: 0 12px; border-radius: 12px; font-size: 13px; }
.notification-light { color: #c7c5df; font-size: 22px; line-height: 1; }
.notification-light.active { color: #ff4f86; filter: drop-shadow(0 0 10px rgba(255,79,134,.35)); }
.compact-empty { padding: 14px; border-radius: 14px; font-size: 14px; }
.friend-profile-card { display: grid; gap: 14px; }
.friend-profile-hero { display: grid; grid-template-columns: minmax(96px, 148px) minmax(0, 1fr); align-items: center; gap: 14px; }
.friend-profile-hero img { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; object-fit: cover; background: rgba(111,101,235,.08); }
.friend-profile-hero h3 { margin: 0 0 4px; color: var(--primary-dark); font-size: 22px; overflow-wrap: anywhere; }
.friend-profile-hero p { margin: 0; color: var(--muted); font-weight: 800; }
.friend-collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.friend-collection-series { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(246,244,255,.9); color: var(--muted); font-weight: 900; }
.friend-collection-series strong { color: var(--primary-dark); }
.friend-readonly-home { gap: 16px; }
.friend-readonly-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.friend-readonly-top h3 { margin: 0; color: var(--primary-dark); font-size: clamp(22px, 3vw, 34px); line-height: 1.1; overflow-wrap: anywhere; }
.friend-readonly-top p { margin: 4px 0 0; color: var(--muted); font-weight: 800; overflow-wrap: anywhere; }
.friend-readonly-hero { display: grid; grid-template-columns: minmax(220px, 1.25fr) minmax(180px, .75fr); gap: 14px; align-items: stretch; }
.friend-readonly-hero > img { width: 100%; aspect-ratio: 16 / 10; border-radius: 18px; object-fit: cover; background: rgba(111,101,235,.08); box-shadow: 0 16px 34px rgba(41,45,95,.12); }
.friend-readonly-summary { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 0; padding: 16px; border-radius: 18px; background: rgba(246,244,255,.78); }
.friend-readonly-summary strong { color: var(--primary-dark); font-size: clamp(26px, 4vw, 42px); line-height: 1; }
.friend-readonly-summary small { color: var(--muted); font-weight: 900; overflow-wrap: anywhere; }
.friend-readonly-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.friend-readonly-stats span,
.friend-readonly-equipment span { display: grid; gap: 5px; min-width: 0; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.82); border: 1px solid rgba(111,101,235,.12); }
.friend-readonly-stats small,
.friend-readonly-equipment b { color: var(--muted); font-size: 12px; font-weight: 900; }
.friend-readonly-stats strong { color: var(--primary-dark); font-size: 22px; font-weight: 1000; overflow-wrap: anywhere; }
.friend-readonly-section { display: grid; gap: 10px; }
.friend-readonly-section > strong { color: var(--primary-dark); font-size: 16px; font-weight: 1000; }
.friend-readonly-equipment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.friend-readonly-equipment span { grid-template-columns: 52px minmax(0, 1fr); align-items: center; }
.friend-readonly-equipment img { grid-row: span 2; width: 52px; height: 52px; border-radius: 12px; object-fit: contain; background: rgba(246,244,255,.9); }
.friend-readonly-equipment strong { color: var(--primary-dark); font-size: 15px; font-weight: 1000; overflow-wrap: anywhere; }
.friend-readonly-empty { padding: 12px; border-radius: 14px; color: var(--muted); background: rgba(246,244,255,.82); font-weight: 900; }
.friend-room-preview { display: grid; gap: 8px; padding: 14px; border: 1px solid rgba(111,101,235,.16); border-radius: 16px; background: rgba(246,244,255,.78); }
.friend-room-preview strong { color: var(--primary-dark); font-size: 16px; font-weight: 1000; }
.friend-room-preview p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 850; overflow-wrap: anywhere; }
.friend-room-preview .secondary-button { justify-self: start; }
.friend-pet-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.friend-pet-mini { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; padding: 8px; border: 2px solid rgba(111,101,235,.14); border-radius: 16px; color: var(--ink); background: rgba(255,255,255,.78); text-align: left; }
.friend-pet-mini.active { border-color: #5f5eed; background: rgba(236,234,255,.95); }
.friend-pet-mini img { width: 62px; height: 44px; border-radius: 10px; object-fit: cover; background: rgba(246,244,255,.9); }
.friend-pet-mini strong,
.friend-pet-mini small { display: block; overflow-wrap: anywhere; }
.friend-pet-mini strong { color: var(--primary-dark); font-size: 14px; font-weight: 1000; }
.friend-pet-mini small { color: var(--muted); font-size: 12px; font-weight: 800; }
.friend-gift-card,
.gift-claim-card { width: min(100% - 28px, 720px); max-height: min(86vh, 720px); overflow: auto; padding: 28px; border-radius: 28px; background: rgba(255,255,255,.96); box-shadow: 0 28px 80px rgba(31,35,78,.24); }
.gift-type-tabs { display: flex; gap: 8px; padding: 5px; border-radius: 16px; background: rgba(111,101,235,.1); }
.gift-type-tab { flex: 1; min-height: 44px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 15px; font-weight: 1000; }
.gift-type-tab.active { color: #fff; background: linear-gradient(135deg, #5f5eed, #45beb1); }
.friend-gift-content { display: grid; gap: 12px; margin: 18px 0; }
.gift-amount-grid,
.gift-item-grid,
.gift-pet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gift-choice,
.gift-item-choice,
.gift-pet-choice { min-height: 58px; border: 2px solid rgba(111,101,235,.16); border-radius: 16px; color: var(--primary-dark); background: rgba(255,255,255,.8); font-size: 16px; font-weight: 1000; }
.gift-choice.selected,
.gift-item-choice.selected,
.gift-pet-choice.selected { border-color: #5f5eed; background: rgba(236,234,255,.95); }
.gift-item-choice,
.gift-pet-choice { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; text-align: left; gap: 10px; padding: 8px; }
.gift-item-choice img,
.gift-pet-choice img { width: 64px; height: 64px; border-radius: 12px; object-fit: contain; background: rgba(246,244,255,.85); }
.gift-select-label { display: grid; gap: 6px; color: var(--primary-dark); font-size: 14px; font-weight: 1000; }
.gift-shop-preview { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px; border: 1px solid rgba(111,101,235,.15); border-radius: 16px; background: rgba(246,244,255,.75); }
.gift-shop-preview img { width: 78px; height: 78px; border-radius: 14px; object-fit: contain; background: rgba(255,255,255,.8); }
.music-gift-preview { grid-template-columns: 78px minmax(0, 1fr) auto; }
.music-gift-icon { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 18px; color: var(--track-accent, #6f67f1); background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(236,234,255,.9)); font-size: 38px; box-shadow: inset 0 0 0 1px rgba(111,101,235,.14); }
.gift-shop-preview strong,
.gift-shop-preview small { display: block; overflow-wrap: anywhere; }
.gift-shop-preview strong { color: var(--primary-dark); font-size: 17px; font-weight: 1000; }
.gift-shop-preview small { color: var(--muted); font-size: 13px; font-weight: 800; }
.friend-gift-actions { display: flex; justify-content: flex-end; gap: 10px; }
.gift-claim-card { text-align: center; max-width: 520px; }
.gift-claim-burst { color: #ffb423; font-size: 58px; line-height: 1; }
.gift-sender-name { display: inline-block; margin: 0 4px; color: #4541c9; font-size: 1.16em; font-weight: 1000; text-shadow: 0 8px 18px rgba(95,94,237,.18); }
.teacher-reward-notice-detail { display: grid; gap: 5px; margin-top: 8px; color: var(--muted); font-size: 14px; font-weight: 850; }
.gift-reveal-button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  width: min(220px, 62vw);
  margin: 16px auto;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 1000;
  cursor: pointer;
}
.gift-reveal-button::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,216,88,.72), rgba(255,130,178,.26) 48%, rgba(111,101,235,0) 72%);
  filter: blur(8px);
  animation: gift-glow 1.2s ease-in-out infinite alternate;
}
.gift-reveal-button img {
  position: relative;
  z-index: 1;
  width: min(170px, 50vw);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(95,94,237,.25));
  animation: gift-bounce 1.05s ease-in-out infinite;
}
.gift-reveal-button span {
  position: relative;
  z-index: 1;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
}
.gift-claim-rewards,
.reward-list { display: grid; gap: 10px; margin-top: 12px; text-align: left; }
.reward-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid rgba(111,101,235,.14);
  border-radius: 16px;
  background: rgba(246,244,255,.76);
}
.reward-row img {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  object-fit: contain;
  background: rgba(255,255,255,.82);
}
.reward-row strong,
.reward-row small { display: block; overflow-wrap: anywhere; }
.reward-row strong { color: var(--primary-dark); font-size: 16px; font-weight: 1000; }
.reward-row small { color: var(--muted); font-size: 13px; font-weight: 850; }
.reward-coin-icon { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 20px; background: rgba(255,249,217,.92); font-size: 48px; }
.reward-row-duplicate { grid-template-columns: 92px minmax(0, 1fr); }
.duplicate-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.duplicate-actions select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(111,101,235,.2);
  border-radius: 12px;
  padding: 0 10px;
  color: var(--primary-dark);
  background: rgba(255,255,255,.92);
  font-weight: 900;
}
.title-choice-grid { display: grid; gap: 10px; margin-top: 14px; }
.title-choice-button {
  min-height: 58px;
  border: 2px solid rgba(111,101,235,.16);
  border-radius: 16px;
  padding: 10px 14px;
  color: var(--primary-dark);
  background: rgba(255,255,255,.88);
  text-align: left;
}
.title-choice-button strong,
.title-choice-button small { display: block; overflow-wrap: anywhere; }
.title-choice-button strong { font-size: 16px; font-weight: 1000; }
.title-choice-button small { color: var(--muted); font-size: 12px; font-weight: 850; }
.collection-title-badge {
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 320px);
  margin-left: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #6f520c;
  background: rgba(255,248,194,.94);
  font-size: .64em;
  font-style: normal;
  font-weight: 1000;
  line-height: 1.1;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.wall-preview-copy .collection-title-badge,
.wall-post-header .collection-title-badge { font-size: 13px; }
.blind-box-shop-panel {
  display: grid;
  grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px;
  border: 2px solid rgba(246,188,60,.5);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,249,217,.94), rgba(246,244,255,.9));
}
.blind-box-shop-art img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(95,94,237,.18));
}
.blind-box-shop-copy { display: grid; gap: 4px; min-width: 0; }
.blind-box-shop-copy h3 { margin: 0; color: var(--primary-dark); font-size: 24px; font-weight: 1000; }
.blind-box-shop-copy p,
.blind-box-shop-copy small { margin: 0; color: var(--muted); font-size: 14px; font-weight: 850; overflow-wrap: anywhere; }
.blind-box-shop-actions { display: grid; gap: 8px; min-width: 150px; }
@keyframes gift-bounce {
  0%, 100% { transform: translateY(0) scale(1) rotate(-2deg); }
  50% { transform: translateY(-12px) scale(1.05) rotate(2deg); }
}
@keyframes gift-glow {
  from { transform: scale(.95); opacity: .72; }
  to { transform: scale(1.12); opacity: 1; }
}
.room-lobby-panel,
.room-chat-panel,
.shared-room-panel { display: grid; gap: 10px; padding: 14px; border: 1px solid rgba(111,101,235,.15); border-radius: 18px; background: rgba(255,255,255,.72); }
.room-lobby-heading,
.room-chat-heading,
.shared-room-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-lobby-heading strong,
.room-chat-heading strong,
.shared-room-header strong { display: block; color: var(--primary-dark); font-size: 17px; font-weight: 1000; }
.room-lobby-heading small,
.room-chat-heading small,
.shared-room-header small,
.shared-room-row span,
.shared-room-empty { color: var(--muted); font-size: 13px; font-weight: 800; }
.room-lobby-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.room-card-shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; min-width: 0; }
.room-card { display: grid; gap: 4px; min-height: 72px; padding: 12px; border: 2px solid rgba(111,101,235,.14); border-radius: 16px; color: var(--ink); background: rgba(255,255,255,.76); text-align: left; }
.room-card.active { border-color: #5f5eed; background: rgba(236,234,255,.95); }
.room-card.closed,
.room-card:disabled { opacity: .62; cursor: not-allowed; }
.room-card-title { color: var(--primary-dark); font-size: 16px; font-weight: 1000; overflow-wrap: anywhere; }
.room-card small { color: var(--muted); font-size: 12px; font-weight: 850; overflow-wrap: anywhere; }
.room-card-close-button { display: grid; place-items: center; width: 42px; min-height: 72px; border: 2px solid rgba(222,83,112,.22); border-radius: 16px; color: #bd3559; background: rgba(255,238,243,.86); font-size: 24px; font-weight: 1000; cursor: pointer; }
.room-card-close-button:focus-visible { outline: 4px solid rgba(222,83,112,.22); outline-offset: 2px; }
.room-join-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.room-settings-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: end; }
.room-settings-form label { display: grid; gap: 5px; min-width: 0; color: var(--primary-dark); font-size: 13px; font-weight: 1000; }
.room-join-form input,
.room-settings-form input,
.room-chat-form input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; color: var(--ink); background: rgba(255,255,255,.92); font-size: 15px; font-weight: 850; }
.danger-lite-button { min-height: 44px; border: 1px solid rgba(222,83,112,.26); border-radius: 12px; padding: 0 14px; color: #bd3559; background: rgba(255,235,242,.88); font-weight: 1000; }
.shared-room-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shared-room-row label { display: grid; gap: 5px; min-width: 0; }
.room-member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.room-member-chip { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; max-width: 100%; padding: 8px 10px; border-radius: 999px; color: var(--primary-dark); background: rgba(246,244,255,.9); font-weight: 1000; }
.room-member-chip strong,
.room-member-chip small { overflow-wrap: anywhere; }
.room-member-chip small { color: var(--muted); font-size: 12px; font-weight: 850; }
.icon-mini-button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 999px; color: #fff; background: #d94d70; font-size: 18px; font-weight: 1000; line-height: 1; }
.room-request-list { display: grid; gap: 8px; padding: 10px; border-radius: 16px; background: rgba(255,247,219,.72); }
.room-request-list > strong { color: var(--primary-dark); font-size: 15px; font-weight: 1000; }
.room-request-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid rgba(246,188,60,.22); border-radius: 14px; background: rgba(255,255,255,.82); }
.room-request-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: rgba(236,234,255,.92); }
.room-request-row span { min-width: 0; }
.room-request-row strong,
.room-request-row small { display: block; overflow-wrap: anywhere; }
.room-request-row strong { color: var(--primary-dark); font-weight: 1000; }
.room-request-row small { color: var(--muted); font-size: 12px; font-weight: 850; }
.room-chat-list { display: grid; gap: 6px; max-height: 220px; overflow: auto; padding-right: 4px; }
.room-chat-message,
.room-chat-empty,
.room-lobby-empty { padding: 10px 12px; border-radius: 14px; background: rgba(246,244,255,.78); color: var(--muted); font-size: 14px; font-weight: 850; }
.room-chat-message { display: grid; grid-template-columns: minmax(84px, .24fr) minmax(0, 1fr) auto; align-items: center; gap: 8px; color: var(--ink); }
.room-chat-message strong { color: var(--primary-dark); overflow-wrap: anywhere; }
.room-chat-message span { overflow-wrap: anywhere; }
.room-chat-message small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.room-chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.shared-room-decorations { display: flex; flex-wrap: wrap; gap: 8px; }
.room-decoration-button { min-height: 40px; border: 1px solid rgba(111,101,235,.16); border-radius: 999px; padding: 0 12px; color: var(--primary-dark); background: rgba(246,244,255,.88); font-weight: 1000; }
.pet-interaction-guest { position: absolute; left: var(--guest-x, 50%); bottom: calc(var(--guest-y, 8) * 1%); z-index: 4; width: clamp(76px, 10vw, 120px); border: 0; background: transparent; transform: translateX(-50%); pointer-events: auto; filter: drop-shadow(0 14px 10px rgba(36,45,70,.2)); animation: room-guest-wander var(--guest-duration, 5.8s) ease-in-out var(--guest-delay, 0s) infinite alternate; will-change: transform; }
.pet-interaction-guest .pet-interaction-guest-name { position: absolute; left: 50%; top: -8px; padding: 5px 9px; border-radius: 999px; color: #245e32; background: rgba(255,255,255,.86); font-size: 12px; font-weight: 1000; white-space: nowrap; transform: translate(-50%, -100%); }
.pet-interaction-guest img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; animation: creeper-idle 2.2s ease-in-out infinite; }
.pet-interaction-guest[data-pet-movement="fly_bounded"] img,
.pet-interaction-guest[data-pet-movement="hover_bounded"] img { animation: pet-float 2.4s ease-in-out infinite; }
.pet-interaction-guest.being-fed img { animation: creeper-feed-bounce .72s cubic-bezier(.2,.9,.28,1.08) both; }
.pet-interaction-guest[data-pet-movement="fly_bounded"].being-fed img,
.pet-interaction-guest[data-pet-movement="hover_bounded"].being-fed img { animation: pet-float-feed .82s cubic-bezier(.2,.9,.28,1.08) both; }
.pet-interaction-guest .pet-feed-bubble { top: -42px; max-width: min(240px, 62vw); padding: 7px 11px; font-size: 12px; }
.pet-interaction-guest .pet-feed-hearts { top: -18px; transform: translateX(-50%) scale(.86); transform-origin: 50% 100%; }
.room-decoration { position: absolute; left: var(--decor-x, 50%); top: var(--decor-y, 70%); z-index: calc(2 + var(--decor-layer, 0)); font-size: calc(32px * var(--decor-scale, 1)); transform: translate(-50%, -50%); filter: drop-shadow(0 8px 8px rgba(36,45,70,.18)); pointer-events: none; }

@keyframes room-guest-wander {
  0% { transform: translateX(-50%) translate(0, 0) scale(1); }
  45% { transform: translateX(-50%) translate(calc(var(--guest-dx, 5vw) * .5), calc(var(--guest-dy, -5px) * .55)) scale(1.03); }
  100% { transform: translateX(-50%) translate(var(--guest-dx, 5vw), var(--guest-dy, -5px)) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .pet-interaction-guest { animation: none; }
}

@media (max-width: 760px) {
  .friends-dashboard { grid-template-columns: 1fr; }
  .friend-search-form,
  .shared-room-row,
  .room-join-form,
  .room-settings-form,
  .room-chat-form,
  .room-request-row { grid-template-columns: 1fr; }
  .friend-result-row,
  .friend-mail-row { align-items: stretch; flex-direction: column; }
  .friend-result-row .secondary-button,
  .friend-mail-row .primary-button,
  .friend-mail-row .secondary-button,
  .friend-card-actions .primary-button,
  .friend-card-actions .secondary-button { width: 100%; }
  .friend-profile-hero,
  .friend-readonly-hero,
  .friend-readonly-top { grid-template-columns: 1fr; }
  .friend-readonly-top { display: grid; }
  .friend-collection-grid,
  .friend-readonly-stats,
  .friend-readonly-equipment,
  .friend-pet-mini-grid,
  .gift-amount-grid,
  .gift-item-grid,
  .gift-pet-grid { grid-template-columns: 1fr; }
  .blind-box-shop-panel { grid-template-columns: 1fr; text-align: center; }
  .blind-box-shop-art { justify-self: center; width: min(170px, 62vw); }
  .blind-box-shop-actions { min-width: 0; }
  .duplicate-actions { grid-template-columns: 1fr; }
  .collection-title-badge { display: inline-flex; margin: 6px 0 0; max-width: 100%; }
  .friend-gift-card,
  .gift-claim-card { padding: 22px; border-radius: 22px; }
  .friend-gift-actions { flex-direction: column; }
  .friend-gift-actions .primary-button,
  .friend-gift-actions .secondary-button,
  .room-join-form .primary-button,
  .room-settings-form .secondary-button,
  .room-settings-form .danger-lite-button,
  .room-chat-form .primary-button,
  .room-request-row .primary-button,
  .room-request-row .secondary-button { width: 100%; }
  .pet-interaction-guest { width: clamp(62px, 18vw, 96px); }
}

/* Late mobile pass: make the app feel like a phone-first game surface instead of a squeezed desktop page. */
@media (max-width: 620px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 17px;
  }

  .app-screen::after {
    background: linear-gradient(180deg, rgba(247,246,255,.64) 0%, rgba(247,246,255,.52) 44%, rgba(255,250,246,.68) 100%);
  }

  .topbar {
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 8px 10px;
  }

  .page-shell {
    width: 100%;
    padding: 12px 6px max(18px, env(safe-area-inset-bottom));
  }

  .welcome-row,
  .section-title-row {
    padding-inline: 4px;
  }

  .welcome-row h1 {
    font-size: clamp(34px, 12vw, 54px);
    line-height: 1.02;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin: 0 0 12px;
    padding: 4px;
    gap: 4px;
    border-radius: 16px;
    overflow-x: visible;
  }

  .nav-button {
    min-width: 0;
    min-height: 50px;
    padding: 8px 5px;
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.15;
  }

  .panel-card,
  .pet-card,
  .pet-skills-panel,
  .pet-stats-under-card,
  .owned-equipment-panel,
  .pet-collection-panel,
  .message-wall-composer,
  .wall-post-card,
  .friends-panel,
  .room-lobby-panel,
  .room-chat-panel,
  .shared-room-panel {
    border-radius: 18px;
  }

  .panel-card,
  .pet-skills-panel,
  .pet-stats-under-card,
  .owned-equipment-panel,
  .pet-collection-panel,
  .message-wall-composer,
  .friends-panel {
    padding: 14px 12px;
  }

  .pet-card {
    padding: 12px 10px;
  }

  .pet-stage {
    min-height: clamp(320px, 72vw, 420px);
    border-radius: 18px;
  }

  .pet-card-actions {
    gap: 8px;
  }

  .pet-card-action-row {
    grid-template-columns: 1fr;
  }

  .pet-form-selector,
  .pet-card-secondary-actions {
    grid-column: 1;
  }

  .pet-form-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pet-card-secondary-actions {
    justify-content: center;
  }

  .pet-card-secondary-actions .secondary-button,
  .pet-card-secondary-actions .primary-button {
    flex: 1 1 145px;
    min-height: 48px;
  }

  .button-inline-error {
    top: calc(100% + 5px);
    left: auto;
    right: 0;
    transform: translateY(-4px);
  }

  .button-inline-error.show {
    transform: translateY(0);
  }

  .pet-stats-under-card .stats-grid,
  .stats-grid,
  .mission-grid,
  .dashboard-grid,
  .home-top-panels {
    gap: 8px;
  }

  .stat-card,
  .mission-card,
  .wallet-card,
  .date-card,
  .streak-pill {
    border-radius: 16px;
  }

  .message-wall-composer {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .wall-post-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .wall-post-art {
    align-items: stretch;
  }

  .wall-image-button {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    border-radius: 16px;
  }

  .wall-post-power {
    justify-self: start;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 15px;
  }

  .wall-post-header h3 {
    font-size: 22px;
  }

  .wall-post-header p,
  .wall-post-time {
    font-size: 13px;
  }

  .wall-message-text {
    font-size: 17px;
    line-height: 1.45;
  }

  .wall-comments-content {
    padding: 10px;
  }

  .wall-comment-row {
    font-size: 14px;
    line-height: 1.45;
  }

  .friend-card,
  .friend-result-row,
  .friend-mail-row,
  .friend-room-preview {
    border-radius: 16px;
    padding: 11px;
  }

  .friend-gift-card,
  .gift-claim-card,
  .pet-selection-card,
  .level-up-card,
  .evolution-card,
  .image-viewer-card {
    width: calc(100% - 12px);
    max-height: 92dvh;
    border-radius: 22px;
    padding: 20px 14px;
  }

  .reward-row,
  .reward-row-duplicate,
  .gift-shop-preview {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
  }
  .music-gift-preview {
    grid-template-columns: 74px minmax(0, 1fr);
  }
  .music-gift-preview .secondary-button {
    grid-column: 1 / -1;
  }

  .reward-row img,
  .reward-coin-icon,
  .gift-shop-preview img,
  .music-gift-icon {
    width: 74px;
    height: 74px;
    border-radius: 15px;
  }

  .room-lobby-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile game-feel pass: make the app less like a squeezed desktop page. */
@media (max-width: 620px) {
  .app-screen {
    overflow-x: hidden;
  }

  .page-shell {
    width: 100%;
    padding-inline: 4px;
  }

  .view {
    gap: 12px;
  }

  .panel-card,
  .pet-card,
  .pet-skills-panel,
  .pet-stats-under-card,
  .pet-collection-panel,
  .message-wall-composer,
  .wall-post-card,
  .friends-panel,
  .room-lobby-panel,
  .room-chat-panel,
  .shared-room-panel {
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(14px);
  }

  .welcome-row h1 {
    font-size: clamp(30px, 10vw, 46px);
  }

  .welcome-row .muted-text {
    font-size: 14px;
  }

  .stats-card,
  .mission-card,
  .checkin-card,
  .question-card {
    padding: 13px 11px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .pet-card,
  .pet-interaction-panel {
    margin-inline: 0;
  }

  .pet-interaction-heading-actions {
    gap: 6px;
  }

  .pet-interaction-stage {
    min-height: 292px;
    border-radius: 18px;
  }

  .pet-interaction-stage.placing-furniture::before {
    left: 4%;
    right: 4%;
    bottom: 8%;
    height: 56%;
    border-radius: 14px;
  }

  .pet-builder-grid {
    left: 4%;
    right: 4%;
    bottom: 8%;
    height: 56%;
    gap: 2px;
  }

  .pet-builder-cell {
    border-radius: 5px;
  }

  .pet-food-tray,
  .pet-furniture-tray {
    position: sticky;
    bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 40;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 8px;
    border-radius: 18px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .pet-food-button,
  .pet-furniture-button {
    flex: 0 0 92px;
    min-width: 92px;
    min-height: 64px;
    flex-direction: column;
    gap: 4px;
    padding: 7px 6px;
    font-size: 13px;
    line-height: 1.15;
    scroll-snap-align: start;
  }

  .pet-food-button span:last-child,
  .pet-furniture-button span:last-child {
    display: grid;
    gap: 1px;
  }

  .pet-furniture-button small {
    font-size: 11px;
  }

  .pet-food-icon,
  .pet-furniture-icon {
    width: 34px;
    height: 34px;
  }

  .pet-furniture-hint,
  .pet-furniture-count {
    flex: 0 0 auto;
    align-self: center;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .placed-furniture {
    width: clamp(40px, 14vw, 68px);
    height: clamp(40px, 14vw, 68px);
  }

  .room-lobby-heading,
  .shared-room-header,
  .room-chat-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-join-form,
  .room-chat-form,
  .room-settings-form {
    grid-template-columns: 1fr;
  }

  .room-chat-list {
    max-height: 240px;
  }
}

@media (max-width: 620px) {
  .interaction-room-recovery-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .interaction-room-recovery-banner span {
    text-align: left;
  }

  .interaction-room-friend-strip-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .interaction-room-friend-grid {
    grid-template-columns: 1fr;
    max-height: 260px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .interaction-room-friend-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .interaction-room-friend-join {
    grid-column: 1 / -1;
    width: 100%;
  }

  .kuromi-room-stage {
    min-height: 0;
    border-radius: 18px;
  }

  .kuromi-room-controls {
    left: 10px;
    right: 10px;
    bottom: 8px;
    gap: 14px;
  }

  .kuromi-control-cluster {
    gap: 10px;
  }

  .kuromi-room-chat-panel {
    padding: 0;
  }
}

@media (max-width: 620px) and (orientation: portrait) {
  .kuromi-room-stage {
    margin-bottom: 66px;
    overflow: visible;
  }

  .kuromi-room-orientation-hint {
    display: block;
  }

  .kuromi-room-controls {
    left: 4px;
    right: 4px;
    bottom: -58px;
  }

  body.kuromi-room-fullscreen-mode .kuromi-room-stage {
    margin-bottom: 0;
    overflow: hidden;
  }

  body.kuromi-room-fullscreen-mode .kuromi-room-controls {
    left: calc(env(safe-area-inset-left) + 14px);
    right: calc(env(safe-area-inset-right) + 14px);
    bottom: calc(env(safe-area-inset-bottom) + 14px);
  }
}

/* Final Halloween seasonal overrides: keep this at EOF so late mobile passes do not wash it out. */
body.halloween-theme {
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 159, 47, .18), transparent 30vw),
    radial-gradient(circle at 88% 18%, rgba(70, 211, 183, .18), transparent 28vw),
    linear-gradient(145deg, #14091f 0%, #241039 45%, #102b35 100%);
}

body.halloween-theme .seasonal-ui-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
  background-image: url('https://cdn.jsdelivr.net/gh/q2edu/daka-primary@main/assets/seasonal/halloween-ui-overlay.png?v=20260904-01');
  background-repeat: no-repeat;
  background-position: top center;
  background-size: min(1260px, 112vw) auto;
  opacity: .24;
  transform: translateZ(0);
  animation: halloween-overlay-breathe 7s ease-in-out infinite alternate;
}

body.halloween-theme.login-mode .seasonal-ui-overlay {
  opacity: .34;
}

body.halloween-theme.mini-game-fullscreen-mode .seasonal-ui-overlay,
body.halloween-theme.kuromi-room-fullscreen-mode .seasonal-ui-overlay {
  display: none !important;
}

body.halloween-theme .app-background {
  background:
    radial-gradient(circle at 9% 24%, rgba(255, 159, 47, .24), transparent 24vw),
    radial-gradient(circle at 88% 14%, rgba(129, 86, 246, .24), transparent 28vw),
    radial-gradient(circle at 70% 86%, rgba(70, 211, 183, .2), transparent 25vw),
    linear-gradient(145deg, #14091f 0%, #26103e 46%, #102e39 100%);
}

body.halloween-theme .login-screen::after {
  background-image:
    url('https://cdn.jsdelivr.net/gh/q2edu/daka-primary@main/assets/seasonal/halloween-ui-overlay.png?v=20260904-01'),
    radial-gradient(circle at 18% 18%, rgba(255, 159, 47, .26), transparent 26vw),
    radial-gradient(circle at 88% 12%, rgba(70, 211, 183, .18), transparent 26vw),
    linear-gradient(90deg, rgba(13, 7, 28, .74) 0%, rgba(39, 18, 72, .48) 42%, rgba(12, 13, 34, .18) 72%, rgba(12, 13, 34, .34) 100%);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: top center, center left, top right, center;
  background-size: min(1220px, 112vw) auto, auto, auto, cover;
}

body.halloween-theme .app-screen::after {
  background-image:
    url('https://cdn.jsdelivr.net/gh/q2edu/daka-primary@main/assets/seasonal/halloween-ui-overlay.png?v=20260904-01'),
    radial-gradient(circle at 12% 8%, rgba(255, 159, 47, .18), transparent 25vw),
    radial-gradient(circle at 92% 6%, rgba(70, 211, 183, .16), transparent 24vw),
    linear-gradient(180deg, rgba(25, 11, 42, .5) 0%, rgba(247, 243, 255, .64) 34%, rgba(255, 248, 240, .74) 100%);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: top center, top left, top right, center;
  background-size: min(1240px, 112vw) auto, auto, auto, cover;
}

body.halloween-theme.mini-game-fullscreen-mode .app-screen::after,
body.halloween-theme.kuromi-room-fullscreen-mode .app-screen::after {
  background: linear-gradient(180deg, rgba(247,246,255,.64) 0%, rgba(247,246,255,.52) 44%, rgba(255,250,246,.68) 100%);
}

body.halloween-theme .app-screen .topbar,
body.halloween-theme .teacher-topbar,
body.halloween-theme .app-screen .main-nav,
body.halloween-theme .app-screen .panel-card,
body.halloween-theme .app-screen .pet-skills-panel,
body.halloween-theme .app-screen .pet-stats-under-card,
body.halloween-theme .app-screen .owned-equipment-panel,
body.halloween-theme .app-screen .pet-collection-panel,
body.halloween-theme .app-screen .message-wall-composer,
body.halloween-theme .app-screen .wall-post-card,
body.halloween-theme .app-screen .shop-item,
body.halloween-theme .app-screen .subject-card,
body.halloween-theme .app-screen .checkin-card,
body.halloween-theme .app-screen .question-card,
body.halloween-theme .app-screen .history-row,
body.halloween-theme .teacher-screen .panel-card,
body.halloween-theme .login-card {
  border-color: rgba(255, 211, 111, .42);
  background:
    linear-gradient(145deg, rgba(255,255,255,.91), rgba(255,250,245,.82)),
    rgba(255,255,255,.86);
  box-shadow:
    0 20px 48px rgba(20, 9, 31, .18),
    0 0 0 1px rgba(255,255,255,.48),
    0 0 30px rgba(255, 159, 47, .1);
}

body.halloween-theme .app-screen .topbar,
body.halloween-theme .teacher-topbar,
body.halloween-theme .main-nav,
body.halloween-theme .panel-card,
body.halloween-theme .pet-skills-panel,
body.halloween-theme .pet-stats-under-card,
body.halloween-theme .owned-equipment-panel,
body.halloween-theme .pet-collection-panel,
body.halloween-theme .message-wall-composer,
body.halloween-theme .wall-post-card,
body.halloween-theme .shop-item,
body.halloween-theme .subject-card,
body.halloween-theme .checkin-card,
body.halloween-theme .question-card,
body.halloween-theme .history-row {
  position: relative;
}

body.halloween-theme .app-screen .topbar::before,
body.halloween-theme .teacher-topbar::before,
body.halloween-theme .main-nav::before,
body.halloween-theme .panel-card::before,
body.halloween-theme .pet-skills-panel::before,
body.halloween-theme .pet-stats-under-card::before,
body.halloween-theme .owned-equipment-panel::before,
body.halloween-theme .pet-collection-panel::before,
body.halloween-theme .message-wall-composer::before,
body.halloween-theme .wall-post-card::before,
body.halloween-theme .shop-item::before,
body.halloween-theme .subject-card::before,
body.halloween-theme .checkin-card::before,
body.halloween-theme .question-card::before,
body.halloween-theme .history-row::before {
  content: "";
  position: absolute;
  inset: 0 12px auto;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 159, 47, 0), #ff9f2f, #5a2b92, #46d3b7, rgba(70, 211, 183, 0));
  opacity: .76;
  pointer-events: none;
}

body.halloween-theme .story-title-banner,
body.halloween-theme .pet-stage,
body.halloween-theme .pet-interaction-stage,
body.halloween-theme .kuromi-room-stage,
body.halloween-theme .mini-game-canvas {
  border-color: rgba(255, 211, 111, .52);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.36),
    0 20px 45px rgba(22, 8, 34, .18),
    0 0 34px rgba(255, 159, 47, .12);
}

body.halloween-theme .nav-button.active,
body.halloween-theme .login-mode-button.active,
body.halloween-theme .primary-button {
  color: #fff;
  background: linear-gradient(135deg, #6f35d6 0%, #ff8f24 54%, #25b99b 100%);
  box-shadow: 0 12px 26px rgba(255, 143, 36, .24);
}

body.halloween-theme .secondary-button,
body.halloween-theme .icon-button {
  color: #4b2a85;
  background: linear-gradient(135deg, #fff4d8, #f1eaff);
  border: 1px solid rgba(255, 211, 111, .42);
}

@media (max-width: 620px) {
  body.halloween-theme .seasonal-ui-overlay {
    background-size: max(760px, 182vw) auto;
    background-position: top center;
    opacity: .18;
  }

  body.halloween-theme .login-screen::after,
  body.halloween-theme .app-screen::after {
    background-size: max(780px, 184vw) auto, auto, auto, cover;
  }

  body.halloween-theme .app-screen .topbar::before,
  body.halloween-theme .teacher-topbar::before,
  body.halloween-theme .main-nav::before,
  body.halloween-theme .panel-card::before,
  body.halloween-theme .pet-skills-panel::before,
  body.halloween-theme .pet-stats-under-card::before,
  body.halloween-theme .owned-equipment-panel::before,
  body.halloween-theme .pet-collection-panel::before,
  body.halloween-theme .message-wall-composer::before,
  body.halloween-theme .wall-post-card::before,
  body.halloween-theme .shop-item::before,
  body.halloween-theme .subject-card::before,
  body.halloween-theme .checkin-card::before,
  body.halloween-theme .question-card::before,
  body.halloween-theme .history-row::before {
    height: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.halloween-theme .seasonal-ui-overlay {
    animation: none;
    transform: none;
  }
}

/* CY PETS REFRESH FINAL OVERRIDES */
:root {
  --ink: #4f4660;
  --muted: #8d8297;
  --primary: #e78fab;
  --primary-dark: #9a6385;
  --lavender: #eee9ff;
  --peach: #ffe9dc;
  --mint: #dff7ec;
  --yellow: #fff2b9;
  --line: rgba(143,119,151,.14);
  --panel: rgba(255,255,255,.88);
  --shadow: 0 20px 50px rgba(107,83,113,.13);
}
body { color: var(--ink); background: #fff9f3; }
.login-card .login-title { margin: 4px 0 8px; color: #53465d; font-size: clamp(36px,5vw,50px); line-height: 1.08; letter-spacing: -.04em; }
.login-screen { min-height: 100dvh; align-content: center; padding: clamp(76px,8vw,110px) clamp(22px,7vw,110px) clamp(28px,5vw,70px); }
.login-screen::after { background: linear-gradient(90deg,rgba(255,248,240,.98) 0%,rgba(255,248,240,.92) 34%,rgba(255,245,239,.26) 62%,rgba(230,245,241,.16) 100%); }
.login-card { width: min(100%,470px); overflow: hidden; padding: clamp(28px,4vw,44px); border: 3px solid rgba(255,255,255,.96); border-radius: 42px; text-align: left; background: rgba(255,253,250,.86); box-shadow: 0 28px 80px rgba(91,72,94,.2),inset 0 1px 0 #fff; backdrop-filter: blur(24px) saturate(1.04); }
.login-card::before { content: ""; position: absolute; inset: 11px; z-index: -1; width: auto; height: auto; border: 1px dashed rgba(227,150,173,.22); border-radius: 32px; background: transparent; pointer-events: none; }
.login-card .hero-copy { margin: 0 0 26px; color: #887b8e; font-size: 15px; line-height: 1.7; }

#pet-selection-modal .initial-pet-grid { display: flex; grid-template-columns: none; gap: clamp(13px,2vw,22px); margin: 0; overflow-x: auto; padding: 10px max(16px,calc((100% - 280px)/2)) 18px; scroll-behavior: smooth; scroll-padding-inline: 20px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#pet-selection-modal .initial-pet-grid::-webkit-scrollbar { display: none; }
#pet-selection-modal .initial-pet-card { flex: 0 0 clamp(220px,31vw,292px); min-width: 0; min-height: 330px; padding: 17px; border: 4px solid rgba(255,255,255,.94); border-radius: 34px; color: #5e5166; background: linear-gradient(155deg,#fff1ea,#fffaf2 54%,#e9f7f0); box-shadow: 0 16px 35px rgba(103,81,107,.12); scroll-snap-align: center; scroll-snap-stop: always; transform: scale(.94); transition: .24s ease; }
#pet-selection-modal .initial-pet-card:nth-child(3n + 2) { background: linear-gradient(155deg,#eee8ff,#fff8fb 56%,#e4f6f0); }
#pet-selection-modal .initial-pet-card:nth-child(3n) { background: linear-gradient(155deg,#e2f4ff,#fff9ef 56%,#ffe7ed); }
#pet-selection-modal .initial-pet-card:hover, #pet-selection-modal .initial-pet-card:focus-visible { outline: none; transform: translateY(-4px) scale(.97); }
#pet-selection-modal .initial-pet-card.selected { border-color: #efa9bd; background: linear-gradient(155deg,#fff1ea,#fffaf2 54%,#e9f7f0); box-shadow: 0 0 0 6px rgba(241,173,192,.18),0 22px 44px rgba(152,93,124,.2); transform: scale(1); }
#pet-selection-modal .initial-pet-card strong { display: block; margin: 2px 0 10px; color: #5b4c63; font-size: 22px; letter-spacing: -.02em; }
#pet-selection-modal .initial-pet-card .initial-pet-art { display: block; width: 100%; height: 225px; margin: 0 auto 8px; border-radius: 20px; background: transparent; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(91,72,96,.12)); }
#pet-selection-modal .initial-pet-card small { display: inline-flex; min-width: 54px; justify-content: center; margin-top: 7px; padding: 6px 10px; border-radius: 999px; color: #9a6c84; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 950; }
#pet-selection-modal .pet-adoption-fields { display: grid; grid-template-columns: 1fr 1fr; width: min(100%,660px); gap: 12px; margin: 0 auto 10px; text-align: left; }

@media (max-width: 760px) {
  .login-screen { place-items: end center; padding: 78px 14px max(14px,env(safe-area-inset-bottom)); }
  .login-screen::after { background: linear-gradient(180deg,rgba(255,248,240,.1) 0%,rgba(255,248,240,.52) 30%,rgba(255,248,240,.97) 68%,#fff8f0 100%); }
  .login-card { width: min(100%,500px); padding: 28px 24px 23px; border-radius: 34px 34px 26px 26px; }
  .login-card .login-title { font-size: 36px; }
}

@media (max-width: 620px) {
  #pet-selection-modal .pet-selection-card { width: calc(100% - 6px); max-height: calc(100dvh - 12px); padding: 20px 10px 16px; border-width: 3px; border-radius: 30px; }
  #pet-selection-modal .initial-pet-grid { gap: 10px; margin: 0; padding: 7px calc((100% - min(67vw,238px))/2) 12px; }
  #pet-selection-modal .initial-pet-card { flex-basis: min(67vw,238px); min-height: 267px; padding: 12px; border-width: 3px; border-radius: 27px; }
  #pet-selection-modal .initial-pet-card strong { margin-bottom: 5px; font-size: 18px; }
  #pet-selection-modal .initial-pet-card .initial-pet-art { height: 178px; }
  #pet-selection-modal .pet-adoption-fields { grid-template-columns: 1fr 1fr; gap: 7px; margin: 0 auto 10px; }
}

@media (max-width: 390px) {
  .login-card { padding: 24px 18px 20px; }
  #pet-selection-modal .pet-adoption-fields { grid-template-columns: 1fr; }
  #pet-selection-modal .initial-pet-card { min-height: 245px; }
  #pet-selection-modal .initial-pet-card .initial-pet-art { height: 157px; }
}

/* Talking-pet home: one room, one character, edge controls only. */
body.companion-home-mode { height: 100dvh; overflow: hidden; background: #45382e; }
body.companion-home-mode .seasonal-ui-overlay,
body.companion-home-mode .app-background,
body.companion-home-mode .language-toggle,
body.companion-home-mode .app-screen::before,
body.companion-home-mode .app-screen::after,
body.companion-home-mode .story-title-banner,
body.companion-home-mode .welcome-row,
body.companion-home-mode .main-nav,
body.companion-home-mode .app-footer,
body.companion-home-mode #home-view .home-top-panels,
body.companion-home-mode #home-view .pet-collection-panel { display: none !important; }

body.companion-home-mode .app-screen { width: 100%; height: 100dvh; min-height: 0; overflow: hidden; padding: 0; background: #45382e; }
body.companion-home-mode .app-screen .topbar {
  position: fixed;
  top: max(8px,env(safe-area-inset-top));
  right: 10px;
  left: 10px;
  z-index: 80;
  width: auto;
  min-height: 48px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  background: rgba(250,249,246,.94);
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  backdrop-filter: none;
}
body.companion-home-mode .app-logo-lockup { padding: 0; border: 0; background: transparent; box-shadow: none; }
body.companion-home-mode .app-header-logo { width: auto; max-width: 126px; max-height: 34px; }
body.companion-home-mode .topbar-actions { gap: 6px; }
body.companion-home-mode .student-chip { min-height: 34px; padding: 5px 9px; border: 1px solid #c9c5bf; border-radius: 8px; color: #403a35; background: #fff; box-shadow: none; }
body.companion-home-mode .icon-button { width: 34px; height: 34px; border: 1px solid #c9c5bf; border-radius: 8px; color: #4b4640; background: #fff; box-shadow: none; }

body.companion-home-mode .app-screen .page-shell { position: fixed; inset: 0; width: 100%; max-width: none; padding: 0; }
body.companion-home-mode #home-view.active { position: fixed; inset: 0; z-index: 1; display: block; padding: 0; }
body.companion-home-mode #home-logout-button:not([hidden]) {
  position: fixed;
  top: max(12px,env(safe-area-inset-top));
  left: max(12px,env(safe-area-inset-left));
  z-index: 120;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(68,54,43,.42);
  border-radius: 50%;
  color: #4d4138;
  background: rgba(255,253,248,.92);
  box-shadow: 0 4px 12px rgba(47,35,26,.22);
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}
body.companion-home-mode #home-logout-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.companion-home-mode #home-logout-button:hover,
body.companion-home-mode #home-logout-button:focus-visible { outline: 3px solid rgba(255,255,255,.9); outline-offset: 2px; transform: translateY(-1px); }
body.companion-home-mode #home-logout-button:active { transform: scale(.94); }
body.companion-home-mode #home-view .pet-dashboard-grid,
body.companion-home-mode #home-view .pet-card { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
body.companion-home-mode #home-view .pet-card > * { display: none !important; }
body.companion-home-mode #home-view .pet-card > .panel-heading,
body.companion-home-mode #home-view .pet-card > .pet-home-greeting,
body.companion-home-mode #home-view .pet-card > .pet-home-scene { display: flex !important; }

body.companion-home-mode #home-view .pet-card > .panel-heading {
  position: fixed;
  top: max(68px,calc(env(safe-area-inset-top) + 61px));
  left: 50%;
  z-index: 60;
  align-items: center;
  width: auto;
  max-width: calc(100% - 150px);
  gap: 10px;
  margin: 0;
  padding: 6px 11px;
  border: 1px solid rgba(0,0,0,.28);
  border-radius: 8px;
  color: #27231f;
  background: rgba(250,249,246,.92);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transform: translateX(-50%);
}
body.companion-home-mode #home-view .pet-card > .panel-heading .eyebrow { display: none; }
body.companion-home-mode #home-view .pet-card > .panel-heading h3 { margin: 0; color: #2d2925; font-size: 15px; font-weight: 800; white-space: nowrap; }
body.companion-home-mode #home-view .badge-group { flex-wrap: nowrap; gap: 4px; }
body.companion-home-mode #home-view .rarity-badge,
body.companion-home-mode #home-view .level-badge { padding: 3px 6px; border-radius: 5px; font-size: 9px; }

body.companion-home-mode .pet-home-greeting {
  position: fixed;
  top: 112px;
  left: 50%;
  z-index: 55;
  width: max-content;
  max-width: min(74vw,340px);
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,.3);
  border-radius: 9px;
  color: #28231f;
  background: rgba(255,255,255,.94);
  box-shadow: 0 2px 8px rgba(0,0,0,.24);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%,-8px);
  transition: opacity .16s ease, transform .16s ease;
}
body.companion-home-mode .pet-home-greeting.visible { opacity: 1; transform: translate(-50%,0); }

body.companion-home-mode .pet-home-scene { position: fixed; inset: 0; z-index: 1; display: block !important; }
body.companion-home-mode .pet-home-scene .pet-stage,
body.companion-home-mode .pet-home-scene .pet-stage.role-card-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #665142 url('assets/pet-interactions/scenes/scene-home.png') center / cover no-repeat;
  box-shadow: none;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
body.companion-home-mode .pet-home-scene .pet-stage::before { display: none; }
body.companion-home-mode .pet-avatar,
body.companion-home-mode .role-card-stage .pet-avatar { position: absolute; inset: 0; z-index: 3; display: block; width: 100%; height: 100%; filter: none; animation-name: none; }
body.companion-home-mode .pet-avatar .role-card-art,
body.companion-home-mode .pet-avatar .pet-emoji-display { display: none; }
body.companion-home-mode .pet-avatar .home-pet-art {
  position: absolute;
  left: 50%;
  bottom: 2.5%;
  display: block;
  width: auto;
  max-width: min(52vw,620px);
  height: auto;
  max-height: 76dvh;
  object-fit: contain;
  filter: drop-shadow(0 12px 8px rgba(0,0,0,.28));
  transform: translateX(-50%);
  transform-origin: 50% 92%;
  user-select: none;
  -webkit-user-drag: none;
}
body.companion-home-mode .pet-avatar.home-pet-asset-fallback .role-card-art { position: absolute; left: 50%; bottom: 4%; display: block; width: min(70vw,720px); height: auto; max-height: 72dvh; border-radius: 0; box-shadow: none; object-fit: contain; transform: translateX(-50%); }
body.companion-home-mode .pet-avatar.home-pet-asset-fallback .home-pet-art { display: none; }
body.companion-home-mode .pet-avatar.home-pet-reacting .home-pet-art { animation: user-pet-tap .68s cubic-bezier(.2,.78,.3,1) both; }
body.companion-home-mode .pet-shadow { position: absolute; bottom: 2.5%; left: 50%; z-index: 2; display: block; width: min(34vw,340px); height: 4.5%; border-radius: 50%; background: rgba(0,0,0,.28); filter: blur(7px); transform: translateX(-50%); }
body.companion-home-mode .equipped-layer { display: none; }

body.companion-home-mode .pet-home-shortcuts { position: fixed; top: 18%; bottom: 10%; z-index: 45; display: flex; flex-direction: column; justify-content: space-between; gap: 0; }
body.companion-home-mode .pet-home-shortcuts-left { left: 14px; }
body.companion-home-mode .pet-home-shortcuts-right { right: 14px; }
body.companion-home-mode .pet-home-shortcut {
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  min-height: 0;
  place-items: center;
  padding: 6px;
  border: 2px solid rgba(55,49,43,.72);
  border-radius: 50%;
  color: #fff;
  background: rgba(250,249,246,.9);
  box-shadow: 0 3px 8px rgba(0,0,0,.32);
  transition: transform .12s ease;
}
body.companion-home-mode .pet-home-shortcut:hover,
body.companion-home-mode .pet-home-shortcut:focus-visible { outline: 2px solid #fff; outline-offset: 2px; transform: scale(1.05); box-shadow: 0 3px 8px rgba(0,0,0,.32); }
body.companion-home-mode .pet-home-shortcut:active { transform: scale(.94); }
body.companion-home-mode .pet-home-shortcut img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
body.companion-home-mode .pet-home-shortcut strong { position: absolute; top: calc(100% + 2px); left: 50%; color: #fff; font-size: 11px; font-weight: 900; line-height: 1; text-shadow: 0 1px 3px #000,0 0 4px #000; white-space: nowrap; transform: translateX(-50%); }
body.companion-home-mode .pet-home-shortcut small,
body.companion-home-mode .pet-home-shortcut span { display: none; }

@media (max-width: 620px) {
  body.companion-home-mode #home-logout-button:not([hidden]) { top: max(8px,env(safe-area-inset-top)); left: max(8px,env(safe-area-inset-left)); width: 42px; height: 42px; }
  body.companion-home-mode .app-screen .topbar { top: max(5px,env(safe-area-inset-top)); right: 6px; left: 6px; min-height: 43px; padding: 4px 6px; }
  body.companion-home-mode .app-header-logo { max-width: 98px; max-height: 29px; }
  body.companion-home-mode .student-chip { max-width: 116px; min-height: 31px; padding: 4px 7px; font-size: 11px; }
  body.companion-home-mode .icon-button { width: 31px; height: 31px; }
  body.companion-home-mode #home-view .pet-card > .panel-heading { top: max(55px,calc(env(safe-area-inset-top) + 50px)); max-width: calc(100% - 128px); padding: 5px 8px; }
  body.companion-home-mode #home-view .pet-card > .panel-heading h3 { max-width: 30vw; overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
  body.companion-home-mode .pet-home-greeting { top: 94px; font-size: 11px; }
  body.companion-home-mode .pet-avatar .home-pet-art { bottom: 2%; max-width: 78vw; max-height: 70dvh; }
  body.companion-home-mode .pet-shadow { bottom: 2%; width: 48vw; }
  body.companion-home-mode .pet-home-shortcuts { top: 16%; bottom: 9%; }
  body.companion-home-mode .pet-home-shortcuts-left { left: 7px; }
  body.companion-home-mode .pet-home-shortcuts-right { right: 7px; }
  body.companion-home-mode .pet-home-shortcut { width: 52px; height: 52px; padding: 5px; border-width: 2px; }
  body.companion-home-mode .pet-home-shortcut img { width: 38px; height: 38px; }
  body.companion-home-mode .pet-home-shortcut strong { font-size: 9px; }
}

@media (max-height: 590px) and (orientation: landscape) {
  body.companion-home-mode .pet-home-shortcuts { top: 19%; bottom: 8%; }
  body.companion-home-mode .pet-home-shortcut { width: 48px; height: 48px; }
  body.companion-home-mode .pet-home-shortcut img { width: 34px; height: 34px; }
  body.companion-home-mode .pet-avatar .home-pet-art { max-width: 48vw; max-height: 78dvh; }
}

@media (prefers-reduced-motion: reduce) {
  body.companion-home-mode .pet-avatar.home-pet-reacting .home-pet-art { animation: none; }
}

/* Game shell rebuild: one bottom-left menu and clean full-screen content pages. */
body.app-mode .app-screen .topbar,
body.app-mode .story-title-banner,
body.app-mode .welcome-row,
body.app-mode .app-footer { display: none !important; }

body.app-mode .app-screen {
  min-height: 100dvh;
  padding: 0;
  background: #f3ede4;
}

body.app-mode .app-screen .page-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

.game-dock {
  position: fixed;
  left: max(12px,env(safe-area-inset-left));
  bottom: max(12px,env(safe-area-inset-bottom));
  z-index: 180;
}

.game-dock > summary {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  padding: 5px;
  border: 2px solid #5b4a3d;
  border-radius: 50%;
  color: #342d27;
  background: #fffdf9;
  box-shadow: 0 3px 8px rgba(46,37,29,.22);
  cursor: pointer;
  list-style: none;
}

.game-dock > summary::-webkit-details-marker { display: none; }
.game-dock > summary img { width: 34px; height: 34px; object-fit: contain; }
.game-dock > summary span { margin-top: -5px; font-size: 9px; font-weight: 900; line-height: 1; }
.game-dock[open] > summary { background: #f2e5d5; }

.game-dock-panel {
  position: absolute;
  bottom: 68px;
  left: 0;
  width: min(292px,calc(100vw - 24px));
  padding: 10px;
  border: 2px solid #5b4a3d;
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: 0 8px 22px rgba(46,37,29,.24);
}

.game-dock-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid #ded4c8;
}

.game-dock-player-name { display: flex; min-width: 0; align-items: center; gap: 7px; }
.game-dock-player-name > span { display: grid; width: 28px; height: 28px; overflow: hidden; place-items: center; border-radius: 50%; background: #efe6db; }
.game-dock-player-name img { width: 100%; height: 100%; object-fit: cover; }
.game-dock-player-name strong { overflow: hidden; color: #3d342d; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
#dock-logout-button { min-height: 30px; padding: 4px 10px; border: 1px solid #b8aa9c; border-radius: 8px; color: #4c4138; background: #fff; font-size: 11px; font-weight: 800; }

body.app-mode .game-dock .main-nav,
body.companion-home-mode .game-dock .main-nav {
  position: static;
  display: grid !important;
  width: 100%;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.app-mode .game-dock .nav-button {
  display: block;
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid #d6cabc;
  border-radius: 9px;
  color: #4a4037;
  background: #f8f3ec;
  box-shadow: none;
  font-size: 12px;
  font-weight: 850;
}

body.app-mode .game-dock .nav-button::before { display: none !important; content: none !important; }
body.app-mode .game-dock .nav-button:hover,
body.app-mode .game-dock .nav-button:focus-visible { outline: 2px solid #7e6957; outline-offset: 1px; transform: none; }
body.app-mode .game-dock .nav-button.active { border-color: #5b4a3d; color: #fff; background: #5b4a3d; }
body.app-mode .game-dock .nav-button.nav-button-locked { opacity: .45; }

/* Home room */
body.companion-home-mode .app-screen,
body.companion-home-mode .app-screen .page-shell { background: #45382e; }
body.companion-home-mode #home-view .pet-card > .panel-heading {
  top: max(12px,env(safe-area-inset-top));
  padding: 5px 10px;
  border-color: rgba(54,45,37,.55);
  border-radius: 8px;
  background: rgba(255,253,249,.92);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
body.companion-home-mode .pet-home-greeting { top: max(52px,calc(env(safe-area-inset-top) + 48px)); }
body.companion-home-mode .pet-avatar .home-pet-art {
  top: 50%;
  bottom: auto;
  max-width: min(54vw,600px);
  max-height: 64dvh;
  transform: translate(-50%,-50%);
}
body.companion-home-mode .pet-avatar.home-pet-asset-fallback .role-card-art {
  top: 50%;
  bottom: auto;
  max-height: 64dvh;
  transform: translate(-50%,-50%);
}
body.companion-home-mode .pet-shadow { top: 72%; bottom: auto; height: 3.5%; }

/* Shared pages reached from the game menu. */
body.app-mode:not(.companion-home-mode) .view.active {
  display: block;
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: clamp(18px,3vw,34px) clamp(14px,4vw,48px) 96px;
  background: #f3ede4;
}

body.app-mode:not(.companion-home-mode) .view > .section-title-row,
body.app-mode:not(.companion-home-mode) .pet-interaction-heading {
  width: min(1120px,100%);
  align-items: flex-end;
  gap: 14px;
  margin: 0 auto 18px;
  padding: 0 0 12px;
  border-bottom: 2px solid #cdbfad;
}

body.app-mode:not(.companion-home-mode) .section-title-row .eyebrow,
body.app-mode:not(.companion-home-mode) .pet-interaction-heading .eyebrow { display: none; }
body.app-mode:not(.companion-home-mode) .section-title-row h2,
body.app-mode:not(.companion-home-mode) .pet-interaction-heading h2 { margin: 0; color: #332c26; font-size: clamp(26px,5vw,38px); line-height: 1.1; }
body.app-mode:not(.companion-home-mode) .section-title-row .muted-text { max-width: 680px; margin: 5px 0 0; color: #75695e; font-size: 13px; line-height: 1.55; }

body.app-mode:not(.companion-home-mode) .panel-card,
body.app-mode:not(.companion-home-mode) .pet-shop-panel,
body.app-mode:not(.companion-home-mode) .music-player-panel,
body.app-mode:not(.companion-home-mode) .music-series-section,
body.app-mode:not(.companion-home-mode) .music-track-card,
body.app-mode:not(.companion-home-mode) .pet-shop-card,
body.app-mode:not(.companion-home-mode) .subject-card,
body.app-mode:not(.companion-home-mode) .checkin-card,
body.app-mode:not(.companion-home-mode) .friend-card,
body.app-mode:not(.companion-home-mode) .friend-mail-row,
body.app-mode:not(.companion-home-mode) .wall-post-card {
  border: 1px solid #d8cdbf;
  border-radius: 14px;
  background: #fffdf9;
  box-shadow: none;
  backdrop-filter: none;
}

body.app-mode:not(.companion-home-mode) #checkin-content,
body.app-mode:not(.companion-home-mode) .checkin-history-panel,
body.app-mode:not(.companion-home-mode) .pet-shop-panel,
body.app-mode:not(.companion-home-mode) #shop-grid,
body.app-mode:not(.companion-home-mode) .music-player-panel,
body.app-mode:not(.companion-home-mode) #music-box-grid,
body.app-mode:not(.companion-home-mode) .wall-leaderboard-panel,
body.app-mode:not(.companion-home-mode) .message-wall-composer,
body.app-mode:not(.companion-home-mode) .message-wall-list,
body.app-mode:not(.companion-home-mode) .friends-dashboard,
body.app-mode:not(.companion-home-mode) .pet-interaction-panel {
  width: min(1120px,100%);
  margin-right: auto;
  margin-left: auto;
}

body.app-mode:not(.companion-home-mode) .primary-button,
body.app-mode:not(.companion-home-mode) .secondary-button {
  border-radius: 9px;
  box-shadow: none;
}
body.app-mode:not(.companion-home-mode) .primary-button { border-color: #5b4a3d; color: #fff; background: #5b4a3d; }
body.app-mode:not(.companion-home-mode) .secondary-button { border-color: #bcae9f; color: #453a32; background: #fff; }

body.app-mode:not(.companion-home-mode) .subject-grid,
body.app-mode:not(.companion-home-mode) .pet-shop-grid,
body.app-mode:not(.companion-home-mode) .music-series-track-grid { gap: 12px; }
body.app-mode:not(.companion-home-mode) .date-card,
body.app-mode:not(.companion-home-mode) .catalog-mode-card,
body.app-mode:not(.companion-home-mode) .wallet-card,
body.app-mode:not(.companion-home-mode) .wall-badge { border: 1px solid #d1c4b5; color: #4a4037; background: #fffdf9; box-shadow: none; }

body.app-mode:not(.companion-home-mode) #guide-view.active { padding-right: clamp(8px,2vw,24px); padding-left: clamp(8px,2vw,24px); }
body.app-mode:not(.companion-home-mode) .pet-interaction-panel { padding: clamp(10px,2vw,20px); border: 0; background: transparent; box-shadow: none; }
body.app-mode:not(.companion-home-mode) .pet-interaction-stage { overflow: hidden; border: 2px solid #5b4a3d; border-radius: 14px; box-shadow: none; }

@media (max-width: 620px) {
  .game-dock { left: max(8px,env(safe-area-inset-left)); bottom: max(8px,env(safe-area-inset-bottom)); }
  .game-dock > summary { width: 52px; height: 52px; }
  .game-dock > summary img { width: 30px; height: 30px; }
  .game-dock-panel { bottom: 60px; width: min(278px,calc(100vw - 16px)); }
  body.companion-home-mode #home-view .pet-card > .panel-heading { top: max(8px,env(safe-area-inset-top)); max-width: calc(100% - 24px); }
  body.companion-home-mode #home-view .pet-card > .panel-heading h3 { max-width: 44vw; }
  body.companion-home-mode .pet-home-greeting { top: max(48px,calc(env(safe-area-inset-top) + 44px)); }
  body.companion-home-mode .pet-avatar .home-pet-art { max-width: 78vw; max-height: 58dvh; }
  body.companion-home-mode .pet-avatar.home-pet-asset-fallback .role-card-art { width: 82vw; max-height: 58dvh; }
  body.companion-home-mode .pet-shadow { top: 68%; width: 46vw; }
  body.app-mode:not(.companion-home-mode) .view.active { padding: 16px 10px 82px; }
  body.app-mode:not(.companion-home-mode) .view > .section-title-row { align-items: flex-start; }
  body.app-mode:not(.companion-home-mode) .section-title-row h2 { font-size: 28px; }
  body.app-mode:not(.companion-home-mode) .section-title-row .muted-text { font-size: 12px; }
  body.app-mode:not(.companion-home-mode) .date-card,
  body.app-mode:not(.companion-home-mode) .catalog-mode-card,
  body.app-mode:not(.companion-home-mode) .wallet-card,
  body.app-mode:not(.companion-home-mode) .wall-badge { display: none; }
}

/* Persistent bubble navigation: every route is a visible bubble at bottom left. */
.game-dock > summary,
.game-dock-panel,
.game-dock-player { display: none !important; }

body.app-mode #game-dock.game-dock.main-nav,
body.companion-home-mode #game-dock.game-dock.main-nav {
  position: fixed;
  right: auto;
  left: max(12px,env(safe-area-inset-left));
  bottom: max(12px,env(safe-area-inset-bottom));
  z-index: 180;
  display: grid !important;
  width: max-content;
  height: auto;
  grid-template-columns: repeat(3,58px);
  grid-auto-rows: 58px;
  align-items: center;
  justify-content: start;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.app-mode #game-dock .nav-button,
body.app-mode #game-dock #dock-logout-button {
  position: relative;
  display: grid;
  flex: none;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  place-items: center;
  margin: 0;
  padding: 5px;
  border: 2px solid rgba(76,61,49,.78);
  border-radius: 50%;
  color: #40372f;
  background: rgba(255,253,249,.94);
  box-shadow: 0 3px 7px rgba(41,32,24,.2);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
}

body.app-mode #game-dock .nav-button::before,
body.app-mode #game-dock #dock-logout-button::before { display: none !important; content: none !important; }
body.app-mode #game-dock .nav-button:hover,
body.app-mode #game-dock .nav-button:focus-visible,
body.app-mode #game-dock #dock-logout-button:hover,
body.app-mode #game-dock #dock-logout-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  transform: translateY(-2px);
}
body.app-mode #game-dock .nav-button:active,
body.app-mode #game-dock #dock-logout-button:active { transform: scale(.94); }
body.app-mode #game-dock .nav-button.active { border-color: #fff; color: #fff; background: #5b4a3d; box-shadow: 0 0 0 2px #5b4a3d,0 3px 7px rgba(41,32,24,.24); }
body.app-mode #game-dock .nav-button.nav-button-locked { opacity: .46; }
body.app-mode #game-dock #dock-logout-button { color: #6a4740; background: rgba(255,244,239,.96); }
body.app-mode:not(.companion-home-mode) .view.active { padding-bottom: 218px; }

@media (max-width: 620px) {
  body.app-mode #game-dock.game-dock.main-nav,
  body.companion-home-mode #game-dock.game-dock.main-nav {
    left: max(8px,env(safe-area-inset-left));
    bottom: max(8px,env(safe-area-inset-bottom));
    grid-template-columns: repeat(3,52px);
    grid-auto-rows: 52px;
    gap: 6px;
  }
  body.app-mode #game-dock .nav-button,
  body.app-mode #game-dock #dock-logout-button {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    padding: 4px;
    font-size: 10px;
  }
  body.app-mode:not(.companion-home-mode) .view.active { padding-bottom: 190px; }
}

@media (max-height: 620px) and (orientation: landscape) {
  body.app-mode #game-dock.game-dock.main-nav,
  body.companion-home-mode #game-dock.game-dock.main-nav {
    grid-template-columns: repeat(4,48px);
    grid-auto-rows: 48px;
    gap: 5px;
  }
  body.app-mode #game-dock .nav-button,
  body.app-mode #game-dock #dock-logout-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 9px;
  }
  body.app-mode:not(.companion-home-mode) .view.active { padding-bottom: 118px; }
}

/* Hand-drawn home layout: left action rail, right world portal, bottom actions. */
body.companion-home-mode #home-view .pet-card > .panel-heading { display: none !important; }
body.companion-home-mode .pet-home-greeting { top: max(12px,env(safe-area-inset-top)); }

body.companion-home-mode #game-dock.game-dock.main-nav {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: block !important;
  width: 100%;
  height: 100dvh;
  padding: 0;
  pointer-events: none;
}

body.companion-home-mode #game-dock .dock-home,
body.companion-home-mode #game-dock .dock-music,
body.companion-home-mode #game-dock .dock-logout { display: none !important; }

body.companion-home-mode #game-dock .nav-button,
body.companion-home-mode #game-dock .dock-bubble-button {
  position: fixed;
  left: max(10px,env(safe-area-inset-left));
  display: grid;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  place-items: center;
  padding: 6px;
  border: 2px solid rgba(65,53,43,.82);
  border-radius: 50%;
  color: #3e342c;
  background: rgba(255,253,249,.94);
  box-shadow: 0 3px 8px rgba(35,27,21,.24);
  pointer-events: auto;
}

body.companion-home-mode #game-dock .nav-button img,
body.companion-home-mode #game-dock .dock-bubble-button img {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: contain;
}

body.companion-home-mode #game-dock .nav-button span,
body.companion-home-mode #game-dock .dock-bubble-button span {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 3px #000,0 0 4px #000;
  white-space: nowrap;
  transform: translateX(-50%);
}

body.companion-home-mode #game-dock .dock-rank { top: 26%; }
body.companion-home-mode #game-dock .dock-checkin { top: 38%; }
body.companion-home-mode #game-dock .dock-games { top: 50%; }
body.companion-home-mode #game-dock .dock-gift { top: 62%; }
body.companion-home-mode #game-dock .dock-pk { top: 74%; }

body.companion-home-mode #game-dock .dock-shop,
body.companion-home-mode #game-dock .dock-share { top: auto; bottom: max(14px,env(safe-area-inset-bottom)); }
body.companion-home-mode #game-dock .dock-shop { right: 80px; left: auto; }
body.companion-home-mode #game-dock .dock-share { right: 14px; left: auto; }

body.companion-home-mode #game-dock .nav-button:hover,
body.companion-home-mode #game-dock .nav-button:focus-visible,
body.companion-home-mode #game-dock .dock-bubble-button:hover,
body.companion-home-mode #game-dock .dock-bubble-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; transform: scale(1.05); }
body.companion-home-mode #game-dock .nav-button:active,
body.companion-home-mode #game-dock .dock-bubble-button:active { transform: scale(.94); }

body.companion-home-mode .home-resource-hud {
  position: fixed;
  top: max(12px,env(safe-area-inset-top));
  right: max(12px,env(safe-area-inset-right));
  z-index: 90;
  display: grid;
  width: min(150px,42vw);
  gap: 6px;
}

body.companion-home-mode .home-resource-row {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  border: 2px solid rgba(68,55,44,.72);
  border-radius: 10px;
  color: #3d332b;
  background: rgba(255,253,249,.94);
  box-shadow: 0 2px 6px rgba(35,27,21,.2);
  font-size: 11px;
  font-weight: 850;
}
body.companion-home-mode .home-resource-row strong { font-size: 14px; }

body.companion-home-mode .home-world-portal {
  position: fixed;
  top: 46%;
  right: max(12px,env(safe-area-inset-right));
  z-index: 80;
  display: grid;
  width: 92px;
  min-height: 118px;
  place-items: center;
  gap: 2px;
  padding: 6px;
  border: 2px solid rgba(65,53,43,.86);
  border-radius: 46px;
  color: #fff;
  background: rgba(255,253,249,.94);
  box-shadow: 0 4px 10px rgba(35,27,21,.28);
  transform: translateY(-50%);
}
body.companion-home-mode .home-world-portal img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; }
body.companion-home-mode .home-world-portal strong,
body.companion-home-mode .home-world-portal span { color: #3f352d; line-height: 1; }
body.companion-home-mode .home-world-portal strong { font-size: 11px; }
body.companion-home-mode .home-world-portal span { font-size: 9px; }
body.companion-home-mode .home-world-portal:hover,
body.companion-home-mode .home-world-portal:focus-visible { outline: 2px solid #fff; outline-offset: 2px; transform: translateY(-50%) scale(1.04); }
body.companion-home-mode .home-world-portal:active { transform: translateY(-50%) scale(.95); }

body.app-mode:not(.companion-home-mode) #game-dock img { display: block; width: 30px; height: 30px; object-fit: contain; }
body.app-mode:not(.companion-home-mode) #game-dock span { font-size: 9px; font-weight: 900; }
body.app-mode:not(.companion-home-mode) #game-dock .dock-share { display: none; }
body.app-mode:not(.companion-home-mode) #game-dock .dock-bubble-button {
  display: grid;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  place-items: center;
  padding: 5px;
  border: 2px solid rgba(76,61,49,.78);
  border-radius: 50%;
  color: #40372f;
  background: rgba(255,253,249,.94);
  box-shadow: 0 3px 7px rgba(41,32,24,.2);
  font-size: 10px;
  font-weight: 900;
}

@media (max-width: 620px) {
  body.companion-home-mode #game-dock .nav-button,
  body.companion-home-mode #game-dock .dock-bubble-button { width: 52px; height: 52px; min-width: 52px; min-height: 52px; padding: 5px; }
  body.companion-home-mode #game-dock .nav-button img,
  body.companion-home-mode #game-dock .dock-bubble-button img { width: 38px; height: 38px; }
  body.companion-home-mode #game-dock .dock-rank { top: 25%; }
  body.companion-home-mode #game-dock .dock-checkin { top: 36.5%; }
  body.companion-home-mode #game-dock .dock-games { top: 48%; }
  body.companion-home-mode #game-dock .dock-gift { top: 59.5%; }
  body.companion-home-mode #game-dock .dock-pk { top: 71%; }
  body.companion-home-mode #game-dock .dock-shop { right: 68px; }
  body.companion-home-mode #game-dock .dock-share { right: 8px; }
  body.companion-home-mode .home-world-portal { right: 8px; width: 76px; min-height: 102px; border-radius: 38px; }
  body.companion-home-mode .home-world-portal img { width: 62px; height: 62px; }
  body.companion-home-mode .home-resource-hud { top: max(8px,env(safe-area-inset-top)); right: 8px; width: min(136px,40vw); }
  body.companion-home-mode .home-resource-row { min-height: 28px; padding: 4px 8px; }
  body.app-mode:not(.companion-home-mode) #game-dock .dock-bubble-button { width: 52px; height: 52px; min-width: 52px; min-height: 52px; }
}

@media (max-height: 620px) and (orientation: landscape) {
  body.companion-home-mode #game-dock .nav-button,
  body.companion-home-mode #game-dock .dock-bubble-button { width: 46px; height: 46px; min-width: 46px; min-height: 46px; }
  body.companion-home-mode #game-dock .nav-button img,
  body.companion-home-mode #game-dock .dock-bubble-button img { width: 33px; height: 33px; }
  body.companion-home-mode #game-dock .dock-rank { top: 18%; }
  body.companion-home-mode #game-dock .dock-checkin { top: 34%; }
  body.companion-home-mode #game-dock .dock-games { top: 50%; }
  body.companion-home-mode #game-dock .dock-gift { top: 66%; }
  body.companion-home-mode #game-dock .dock-pk { top: 82%; }
  body.companion-home-mode .home-world-portal { width: 72px; min-height: 92px; }
  body.companion-home-mode .home-world-portal img { width: 58px; height: 58px; }
}

/* 2026-09 complete student UI: scene-first virtual-pet interface. */
:root {
  --game-ink: #3f352d;
  --game-line: #7b6959;
  --game-paper: #fffaf2;
  --game-peach: #ffd9c8;
  --game-mint: #d9efe2;
  --game-lilac: #e6ddf5;
  --game-yellow: #fff0bb;
}

/* Login and first-pet choice are part of the same game, not web dashboards. */
#login-screen.login-screen {
  min-height: 100dvh;
  padding: max(18px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
  background: #93d9d2 url('assets/backgrounds/pet-island-home.png') center / cover no-repeat;
}
#login-screen .login-sky-decor,
#login-screen .login-welcome-badge,
#login-screen .brand-mark { display: none !important; }
#login-screen .center-logo { top: max(16px,env(safe-area-inset-top)); width: clamp(112px,24vw,170px); }
#login-screen .login-card {
  width: min(92vw,420px);
  margin-top: clamp(54px,10vh,92px);
  padding: clamp(22px,5vw,34px);
  border: 2px solid rgba(75,61,48,.72);
  border-radius: 24px;
  background: rgba(255,250,242,.97);
  box-shadow: 0 12px 32px rgba(57,40,28,.25);
  backdrop-filter: none;
}
#login-screen .login-card::before,
#login-screen .login-card::after { display: none !important; }
#login-screen .login-title { margin: 4px 0 8px; color: var(--game-ink); font-size: clamp(30px,7vw,42px); }
#login-screen .hero-copy { color: #746457; }
#login-screen .login-form input { min-height: 48px; border: 1px solid #bcaa98; border-radius: 12px; background: #fff; box-shadow: none; }
#login-screen .login-submit-button { min-height: 50px; border: 2px solid #5a493c; border-radius: 14px; color: #fff; background: #6e5948; box-shadow: none; }
#login-screen .login-session-note { border: 0; color: #75685d; background: transparent; }

#pet-selection-modal.modal-backdrop {
  padding: max(10px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  background: #93d9d2 url('assets/backgrounds/pet-island-home.png') center / cover no-repeat;
  backdrop-filter: none;
}
#pet-selection-modal .pet-selection-card {
  width: min(96vw,820px);
  max-height: calc(100dvh - 20px);
  border: 2px solid rgba(75,61,48,.74);
  border-radius: 24px;
  background: rgba(255,250,242,.98);
  box-shadow: 0 12px 32px rgba(57,40,28,.25);
}
#pet-selection-modal .pet-selection-card::before,
#pet-selection-modal .pet-selection-card::after,
#pet-selection-modal .modal-paw { display: none !important; }
#pet-selection-modal .initial-pet-card { border: 2px solid #c8b6a5; border-radius: 20px; background: #fffdf8; box-shadow: none; }
#pet-selection-modal .initial-pet-card.selected { border-color: #6e5948; background: var(--game-yellow); box-shadow: 0 0 0 3px #fff; }
#pet-selection-modal .pet-carousel-arrow { border: 2px solid #6e5948; color: #fff; background: #6e5948; box-shadow: none; }

/* Home: one full-screen room, centered pet and fixed edge controls. */
body.companion-home-mode .app-screen .topbar,
body.companion-home-mode #game-dock { display: none !important; }
body.companion-home-mode #game-dock.game-dock.main-nav,
body.companion-home-mode #game-dock.game-dock.main-nav *,
body.companion-home-mode #pet-card-actions,
body.companion-home-mode .pet-home-shortcuts { display: none !important; visibility: hidden !important; pointer-events: none !important; }
body.companion-home-mode .pet-home-scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block !important;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}
body.companion-home-mode .pet-home-scene .pet-stage,
body.companion-home-mode .pet-home-scene .pet-stage.role-card-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #93d9d2 url('assets/backgrounds/pet-island-home.png') center / cover no-repeat;
}
body.companion-home-mode .home-action-rail {
  position: fixed;
  top: auto;
  bottom: max(34px,calc(env(safe-area-inset-bottom) + 30px));
  left: max(8px,env(safe-area-inset-left));
  z-index: 130;
  display: flex !important;
  flex-direction: column;
  gap: clamp(8px,1.55dvh,14px);
  transform: none;
}
body.companion-home-mode .home-corner-actions {
  position: fixed;
  right: max(9px,env(safe-area-inset-right));
  bottom: max(10px,env(safe-area-inset-bottom));
  z-index: 130;
  display: flex !important;
  align-items: flex-end;
  gap: 9px;
}
body.companion-home-mode .home-scene-button {
  position: relative;
  display: grid;
  width: clamp(48px,8vw,62px);
  height: clamp(48px,8vw,62px);
  min-width: 0;
  place-items: center;
  padding: 5px;
  border: 2px solid rgba(69,55,43,.86);
  border-radius: 50%;
  color: var(--game-ink);
  background: rgba(255,250,242,.96);
  box-shadow: 0 3px 8px rgba(41,31,23,.25);
}
body.companion-home-mode .home-scene-button img { display: block; width: 82%; height: 82%; border-radius: 50%; object-fit: contain; }
body.companion-home-mode .home-scene-button span {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  color: #fff;
  font-size: clamp(9px,1.8vw,11px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 3px #2d241d,0 0 4px #2d241d;
  white-space: nowrap;
  transform: translateX(-50%);
}
body.companion-home-mode .home-scene-button .home-pk-lock-icon,
body.companion-home-mode #game-dock .home-pk-lock-icon {
  position: static;
  color: #695f7f;
  font-size: clamp(23px,5vw,31px);
  line-height: 1;
  text-shadow: none;
  transform: none;
}
body.companion-home-mode .home-scene-button.is-coming-soon { background: rgba(244,239,251,.97); }
body.companion-home-mode .home-scene-button:hover,
body.companion-home-mode .home-scene-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; transform: scale(1.06); }
body.companion-home-mode .home-scene-button:active { transform: scale(.94); }

body.companion-home-mode .home-resource-hud {
  top: max(9px,env(safe-area-inset-top));
  right: max(9px,env(safe-area-inset-right));
  width: clamp(118px,26vw,156px);
}
body.companion-home-mode .home-energy-meter,
body.companion-home-mode .home-coin-counter {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 2px solid rgba(68,55,44,.72);
  border-radius: 10px;
  color: var(--game-ink);
  background: rgba(255,250,242,.96);
  box-shadow: 0 2px 6px rgba(35,27,21,.2);
}
body.companion-home-mode .home-energy-icon,
body.companion-home-mode .home-coin-counter > span { flex: 0 0 auto; font-size: 15px; line-height: 1; }
body.companion-home-mode .home-energy-track { flex: 1 1 auto; height: 9px; overflow: hidden; border: 1px solid #8a7158; border-radius: 999px; background: #eadfce; }
body.companion-home-mode .home-energy-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: #f0bc43; transition: width .25s ease; }
body.companion-home-mode .home-energy-meter strong,
body.companion-home-mode .home-coin-counter strong { flex: 0 0 auto; min-width: 22px; font-size: 14px; line-height: 1; text-align: right; }
body.companion-home-mode .home-coin-counter { width: max-content; min-width: 72px; justify-self: end; }

body.companion-home-mode .home-world-nest {
  position: fixed;
  top: 51%;
  right: max(5px,env(safe-area-inset-right));
  z-index: 100;
  width: clamp(110px,24vw,190px);
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 7px 8px rgba(49,36,27,.3));
  transform: translateY(-50%);
}
body.companion-home-mode .home-world-nest img { display: block; width: 100%; height: auto; }
body.companion-home-mode .home-world-nest:hover,
body.companion-home-mode .home-world-nest:focus-visible { outline: 3px solid rgba(255,255,255,.94); outline-offset: -6px; border-radius: 50%; transform: translateY(-50%) scale(1.06); }
body.companion-home-mode .home-world-nest:active { transform: translateY(-50%) scale(.94); }

body.companion-home-mode .pet-avatar .home-pet-art {
  top: 51%;
  left: 50%;
  bottom: auto;
  max-width: min(56vw,610px);
  max-height: 66dvh;
  transform: translate(-50%,-50%);
}
body.companion-home-mode .pet-avatar.home-pet-asset-fallback .role-card-art {
  top: 51%;
  left: 50%;
  bottom: auto;
  width: min(58vw,620px);
  max-height: 66dvh;
  transform: translate(-50%,-50%);
}
body.companion-home-mode .pet-shadow { top: 74%; bottom: auto; }

/* Every feature is a full game scene, with opaque readable controls. */
body.app-mode:not(.companion-home-mode) .app-screen,
body.app-mode:not(.companion-home-mode) .page-shell { min-height: 100dvh; background: #d9c0a3; }
body.app-mode:not(.companion-home-mode) .app-screen > .topbar,
body.app-mode:not(.companion-home-mode) .story-title-banner,
body.app-mode:not(.companion-home-mode) .welcome-row,
body.app-mode:not(.companion-home-mode) .app-footer { display: none !important; }
body.app-mode:not(.companion-home-mode) .page-shell { width: 100%; max-width: none; padding: 0; }
body.app-mode:not(.companion-home-mode) .view.active {
  min-height: 100dvh;
  padding: max(76px,calc(env(safe-area-inset-top) + 68px)) max(14px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
  background-color: #dcc9b2;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body.app-mode:not(.companion-home-mode) #checkin-view.active,
body.app-mode:not(.companion-home-mode) #shop-view.active,
body.app-mode:not(.companion-home-mode) #music-box-view.active,
body.app-mode:not(.companion-home-mode) #wall-view.active,
body.app-mode:not(.companion-home-mode) #message-wall-view.active,
body.app-mode:not(.companion-home-mode) #friends-view.active,
body.app-mode:not(.companion-home-mode) #guide-view.active { background-image: url('assets/backgrounds/pet-island-home.png'); }

body.app-mode:not(.companion-home-mode) .view > .section-title-row,
body.app-mode:not(.companion-home-mode) .pet-interaction-heading {
  align-items: center;
  width: min(1080px,100%);
  margin: 0 auto 12px;
  padding: 12px 14px;
  border: 2px solid rgba(76,61,49,.74);
  border-radius: 16px;
  background: rgba(255,250,242,.97);
  box-shadow: 0 5px 14px rgba(50,36,26,.2);
}
body.app-mode:not(.companion-home-mode) .section-title-row h2,
body.app-mode:not(.companion-home-mode) .pet-interaction-heading h2 { font-size: clamp(24px,5vw,34px); }
body.app-mode:not(.companion-home-mode) .panel-card,
body.app-mode:not(.companion-home-mode) .pet-shop-panel,
body.app-mode:not(.companion-home-mode) .music-player-panel,
body.app-mode:not(.companion-home-mode) .music-series-section,
body.app-mode:not(.companion-home-mode) .music-track-card,
body.app-mode:not(.companion-home-mode) .pet-shop-card,
body.app-mode:not(.companion-home-mode) .subject-card,
body.app-mode:not(.companion-home-mode) .checkin-card,
body.app-mode:not(.companion-home-mode) .friend-card,
body.app-mode:not(.companion-home-mode) .friend-mail-row,
body.app-mode:not(.companion-home-mode) .wall-post-card {
  border: 2px solid rgba(92,75,61,.55);
  border-radius: 16px;
  background: rgba(255,250,242,.97);
  box-shadow: 0 5px 14px rgba(50,36,26,.18);
}
body.app-mode:not(.companion-home-mode) #guide-view.active { padding: max(70px,calc(env(safe-area-inset-top) + 62px)) max(8px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); }
body.app-mode:not(.companion-home-mode) #guide-view .pet-interaction-panel { width: min(1180px,100%); padding: 0; }
body.app-mode:not(.companion-home-mode) #guide-view .pet-interaction-stage { border: 2px solid #8d7765; border-radius: 16px; background: #1e1a18; }

/* Entry pages reset to one focused surface; navigation always returns through the island. */
body.app-mode #game-dock.game-dock.main-nav,
body.app-mode #game-dock.game-dock.main-nav * { display: none !important; visibility: hidden !important; pointer-events: none !important; }
body.app-mode:not(.companion-home-mode) .entry-page-home-button {
  position: fixed;
  top: max(10px,env(safe-area-inset-top));
  left: max(10px,env(safe-area-inset-left));
  z-index: 240;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(69,55,43,.82);
  border-radius: 50%;
  background: rgba(255,250,242,.97);
  box-shadow: 0 4px 12px rgba(50,36,26,.24);
  font-size: 25px;
}
body.app-mode:not(.companion-home-mode) .entry-page-home-button:hover,
body.app-mode:not(.companion-home-mode) .entry-page-home-button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; transform: scale(1.05); }
body.app-mode:not(.companion-home-mode) .entry-page-home-icon {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-1px);
}
body.companion-home-mode .entry-page-home-button { display: none !important; }

/* Legacy dock styling remains below for compatibility but is suppressed by the reset rule above. */
body.app-mode:not(.companion-home-mode) #game-dock.game-dock.main-nav {
  position: fixed;
  right: 50%;
  bottom: max(8px,env(safe-area-inset-bottom));
  left: auto;
  z-index: 220;
  display: flex !important;
  width: max-content;
  max-width: calc(100vw - 16px);
  height: auto;
  align-items: center;
  gap: 6px;
  padding: 7px;
  overflow-x: auto;
  border: 2px solid rgba(76,61,49,.7);
  border-radius: 20px;
  background: rgba(255,250,242,.97);
  box-shadow: 0 5px 16px rgba(50,36,26,.24);
  transform: translateX(50%);
  scrollbar-width: none;
}
body.app-mode:not(.companion-home-mode) #game-dock::-webkit-scrollbar { display: none; }
body.app-mode:not(.companion-home-mode) #game-dock .nav-button,
body.app-mode:not(.companion-home-mode) #game-dock .dock-bubble-button,
body.app-mode:not(.companion-home-mode) #game-dock #dock-logout-button {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  place-items: center;
  padding: 4px;
  border: 1px solid #b7a493;
  border-radius: 50%;
  color: var(--game-ink);
  background: #fffdf8;
  box-shadow: none;
  font-size: 9px;
}
body.app-mode:not(.companion-home-mode) #game-dock .nav-button.active { border-color: #5b493b; color: #fff; background: #6e5948; box-shadow: none; }
body.app-mode:not(.companion-home-mode) #game-dock img { width: 29px; height: 29px; }
body.app-mode:not(.companion-home-mode) #game-dock .dock-share { display: none !important; }

@media (max-width: 620px) {
  #login-screen .center-logo { width: 118px; }
  #login-screen .login-card { width: min(94vw,390px); margin-top: 48px; padding: 22px 18px; border-radius: 20px; }
  #pet-selection-modal .pet-selection-card { width: calc(100vw - 12px); padding: 18px 9px 14px; border-radius: 20px; }
  body.companion-home-mode .home-action-rail { bottom: max(32px,calc(env(safe-area-inset-bottom) + 28px)); left: max(6px,env(safe-area-inset-left)); gap: clamp(7px,1.4dvh,11px); }
  body.companion-home-mode .home-scene-button { width: clamp(44px,13vw,52px); height: clamp(44px,13vw,52px); padding: 4px; }
  body.companion-home-mode .home-corner-actions { right: max(7px,env(safe-area-inset-right)); gap: 7px; }
  body.companion-home-mode .home-world-nest { right: max(-5px,calc(env(safe-area-inset-right) - 5px)); width: clamp(106px,32vw,126px); }
  body.companion-home-mode .home-resource-hud { right: max(7px,env(safe-area-inset-right)); width: min(128px,38vw); }
  body.companion-home-mode .pet-avatar .home-pet-art { max-width: 74vw; max-height: 61dvh; }
  body.companion-home-mode .pet-avatar.home-pet-asset-fallback .role-card-art { width: 76vw; max-height: 61dvh; }
  body.companion-home-mode .pet-shadow { top: 70%; }
  body.app-mode:not(.companion-home-mode) .view.active { padding: max(68px,calc(env(safe-area-inset-top) + 60px)) max(8px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); background-attachment: scroll; }
  body.app-mode:not(.companion-home-mode) .view > .section-title-row,
  body.app-mode:not(.companion-home-mode) .pet-interaction-heading { margin-bottom: 9px; padding: 10px 12px; border-radius: 13px; }
  body.app-mode:not(.companion-home-mode) .section-title-row .muted-text { display: none; }
  body.app-mode:not(.companion-home-mode) #game-dock.game-dock.main-nav { right: 8px; left: 8px; width: auto; max-width: none; justify-content: flex-start; transform: none; }
  body.app-mode:not(.companion-home-mode) #game-dock .nav-button,
  body.app-mode:not(.companion-home-mode) #game-dock .dock-bubble-button,
  body.app-mode:not(.companion-home-mode) #game-dock #dock-logout-button { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
  body.app-mode:not(.companion-home-mode) .entry-page-home-button { width: 50px; height: 50px; font-size: 23px; }
  body.companion-home-mode .home-energy-meter,
  body.companion-home-mode .home-coin-counter { min-height: 30px; gap: 5px; padding: 4px 7px; }
  body.companion-home-mode .home-energy-track { height: 8px; }
}

@media (max-width: 380px) {
  body.companion-home-mode .home-action-rail { gap: 7px; }
  body.companion-home-mode .home-scene-button { width: 43px; height: 43px; }
  body.companion-home-mode .home-world-nest { width: 112px; }
  body.companion-home-mode .home-resource-hud { width: 116px; }
  body.companion-home-mode .home-resource-row { min-height: 26px; font-size: 10px; }
}

@media (max-height: 620px) and (orientation: landscape) {
  body.companion-home-mode .home-action-rail { bottom: max(24px,calc(env(safe-area-inset-bottom) + 20px)); gap: 5px; }
  body.companion-home-mode .home-scene-button { width: 43px; height: 43px; }
  body.companion-home-mode .home-scene-button span { font-size: 8px; }
  body.companion-home-mode .home-world-nest { width: clamp(94px,16vw,132px); }
  body.companion-home-mode .pet-avatar .home-pet-art { max-width: 48vw; max-height: 74dvh; }
  body.companion-home-mode .pet-shadow { top: 78%; width: 28vw; }
  body.app-mode:not(.companion-home-mode) .view.active { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  body.app-mode:not(.companion-home-mode) #game-dock .nav-button,
  body.app-mode:not(.companion-home-mode) #game-dock .dock-bubble-button,
  body.app-mode:not(.companion-home-mode) #game-dock #dock-logout-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  body.companion-home-mode .home-scene-button,
  body.companion-home-mode .home-world-nest { transition: none; }
}

/* Final route reset guard: no legacy dock may reappear after later compatibility rules. */
html body.app-mode #game-dock.game-dock.main-nav,
html body.app-mode #game-dock.game-dock.main-nav * { display: none !important; visibility: hidden !important; pointer-events: none !important; }

/* Learning Islands: map -> subject -> quiz. */
body.app-mode:not(.companion-home-mode) #checkin-view.active {
  background-color: #7fd7e4;
  background-image: url('assets/backgrounds/pet-island-home.png');
}
#checkin-view #checkin-content { width: min(760px,100%); margin: 0 auto 18px; }
.checkin-island-map-shell { width: min(100%,720px); margin: 0 auto; }
.checkin-map-progress {
  position: sticky;
  top: max(8px,env(safe-area-inset-top));
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  width: min(92%,460px);
  margin: 0 auto -62px;
  padding: 10px 14px;
  border: 2px solid rgba(60,76,67,.7);
  border-radius: 16px;
  color: #30493c;
  background: rgba(255,250,230,.96);
  box-shadow: 0 6px 16px rgba(29,70,77,.22);
}
.checkin-map-progress span { font-size: 13px; font-weight: 900; }
.checkin-map-progress strong { grid-row: 1 / 3; grid-column: 2; color: #d28128; font-size: 23px; }
.checkin-map-progress small { color: #64786d; font-size: 11px; font-weight: 750; }
.checkin-island-map {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,.92);
  border-radius: 28px;
  background: #63cadc url('assets/backgrounds/checkin-island-level-map.png') center / cover no-repeat;
  box-shadow: 0 12px 30px rgba(27,74,87,.28);
}
.checkin-island-node {
  position: absolute;
  z-index: 4;
  display: grid;
  width: clamp(66px,14vw,90px);
  min-height: clamp(66px,14vw,90px);
  place-items: center;
  padding: 5px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #405347;
  background: #fff4bf;
  box-shadow: 0 4px 0 #9a7040,0 7px 14px rgba(19,63,72,.27);
  transform: translate(-50%,-50%);
}
.checkin-island-node-1 { left: 58%; top: 81%; }
.checkin-island-node-2 { left: 27%; top: 56%; }
.checkin-island-node-3 { left: 74%; top: 41%; }
.checkin-island-node-4 { left: 33%; top: 25%; }
.checkin-island-node-5 { left: 69%; top: 12%; }
.checkin-island-node-badge { font-size: clamp(23px,5vw,34px); line-height: 1; }
.checkin-island-node strong,
.checkin-island-node small {
  position: absolute;
  left: 50%;
  width: max-content;
  max-width: 135px;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(255,253,244,.96);
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}
.checkin-island-node strong { top: calc(100% + 7px); border: 1px solid rgba(64,83,71,.35); font-size: 12px; }
.checkin-island-node small { top: calc(100% + 32px); color: #6b766f; font-size: 10px; font-weight: 850; }
.checkin-island-node.is-current { border-color: #fff; background: #ffe17d; animation: checkin-island-pulse 1.8s ease-in-out infinite; }
.checkin-island-node.is-cleared { color: #fff; background: #8ad4a7; box-shadow: 0 4px 0 #4c9d6c,0 7px 14px rgba(19,63,72,.22); }
.checkin-island-node.is-locked { border-color: rgba(255,255,255,.76); background: rgba(211,217,214,.88); box-shadow: 0 4px 0 #84918a; filter: grayscale(.45); opacity: .82; cursor: not-allowed; }
.checkin-island-node:not(:disabled):hover,
.checkin-island-node:not(:disabled):focus-visible { outline: 4px solid rgba(255,255,255,.9); outline-offset: 3px; transform: translate(-50%,-50%) scale(1.08); }
@keyframes checkin-island-pulse {
  0%,100% { box-shadow: 0 4px 0 #9a7040,0 0 0 0 rgba(255,226,98,.65),0 7px 14px rgba(19,63,72,.27); }
  50% { box-shadow: 0 4px 0 #9a7040,0 0 0 10px rgba(255,226,98,0),0 7px 14px rgba(19,63,72,.27); }
}
.checkin-subject-select {
  width: min(100%,760px);
  margin: 0 auto;
  padding: clamp(16px,3vw,26px);
  border: 2px solid rgba(73,61,49,.65);
  border-radius: 24px;
  background: rgba(255,250,236,.97);
  box-shadow: 0 10px 26px rgba(41,55,44,.22);
}
.checkin-map-back { min-height: 42px; margin-bottom: 15px; padding: 8px 13px; border: 1px solid #917b67; border-radius: 12px; color: #51463c; background: #fff; font-weight: 850; }
.checkin-island-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.checkin-island-heading > span { display: grid; width: 58px; height: 58px; flex: 0 0 58px; place-items: center; border-radius: 50%; background: var(--game-yellow); font-size: 31px; }
.checkin-island-heading h3 { margin: 0; color: var(--game-ink); font-size: clamp(25px,5vw,34px); }
.checkin-island-heading p:last-child { margin: 4px 0 0; color: #75695e; font-size: 13px; }
.checkin-island-subject-grid { grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); }
.checkin-island-subject-grid .subject-card { min-height: 132px; border: 2px solid #c9b8a6; background: #fffdf7; box-shadow: none; }
#checkin-view .quiz-wrap { padding: clamp(14px,3vw,24px); border: 2px solid rgba(73,61,49,.65); border-radius: 22px; background: rgba(255,250,236,.97); box-shadow: 0 10px 26px rgba(41,55,44,.22); }
#checkin-view .quiz-progress > div { background: #f0bc43; }

/* Dedicated ranking page: overall rankings and game rankings. */
#wall-view .wall-leaderboard-panel { width: min(1040px,100%); margin: 0 auto; padding: clamp(14px,3vw,24px); }
.wall-leaderboard-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(520px,100%); margin: 0 auto 22px; padding: 6px; border: 2px solid #b9a895; border-radius: 18px; background: #fffdf8; }
.wall-leaderboard-group { min-height: 50px; border: 0; border-radius: 12px; color: #625549; background: transparent; font-size: 17px; font-weight: 950; }
.wall-leaderboard-group.active { color: #fff; background: #6e5948; box-shadow: 0 3px 8px rgba(63,47,35,.2); }
#wall-view .wall-leaderboard-tabs { justify-content: flex-end; }
#wall-view .wall-leaderboard-tab { min-height: 42px; padding: 9px 14px; border: 1px solid #b9a895; color: #55483e; background: #fffdf8; box-shadow: none; font-size: 13px; }
#wall-view .wall-leaderboard-tab.active { border-color: #6e5948; color: #fff; background: #6e5948; }
#wall-view .wall-leaderboard-layout { max-height: none; }

@media (max-width: 620px) {
  .checkin-map-progress { margin-bottom: -54px; padding: 8px 11px; }
  .checkin-island-map { border-width: 2px; border-radius: 20px; }
  .checkin-island-node { width: clamp(58px,18vw,72px); min-height: clamp(58px,18vw,72px); border-width: 2px; }
  .checkin-island-node-badge { font-size: 25px; }
  .checkin-island-node strong { top: calc(100% + 5px); max-width: 112px; padding: 2px 5px; font-size: 10px; }
  .checkin-island-node small { top: calc(100% + 27px); padding: 2px 5px; font-size: 9px; }
  .checkin-subject-select { padding: 14px 10px; border-radius: 18px; }
  .checkin-island-heading > span { width: 50px; height: 50px; flex-basis: 50px; font-size: 27px; }
  .checkin-island-subject-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .checkin-island-subject-grid .subject-card { min-height: 112px; padding: 10px 6px; }
  .wall-leaderboard-groups { margin-bottom: 14px; }
  .wall-leaderboard-group { min-height: 46px; font-size: 15px; }
  #wall-view .wall-leaderboard-heading { gap: 10px; }
  #wall-view .wall-leaderboard-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  #wall-view .wall-leaderboard-tab { min-height: 40px; padding: 7px 8px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .checkin-island-node.is-current { animation: none; }
}

/* Cheng Pin Education uses a compact round mark instead of the previous wide lockup. */
#login-screen .center-logo {
  width: clamp(104px,13vw,146px);
  aspect-ratio: 1116 / 1026;
  padding: 6px;
  border-radius: 28px;
  object-fit: contain;
}
.app-screen .app-header-logo {
  width: clamp(60px,6vw,76px);
  max-height: 76px;
  aspect-ratio: 1116 / 1026;
  object-fit: contain;
}
@media (max-width: 620px) {
  #login-screen .center-logo { width: 104px; }
  .app-screen .app-header-logo { width: 58px; max-height: 58px; }
}

/* The home uses transparent in-game pet sprites; rectangular role cards stay in detail views. */
body.companion-home-mode .pet-avatar .role-card-art { display: none !important; }
body.companion-home-mode .pet-avatar .home-pet-art {
  width: auto;
  max-width: min(48vw,240px);
  max-height: 38dvh;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 16px 13px rgba(35,63,50,.28));
}
.home-pet-fallback-emoji { display: none; }
body.companion-home-mode .pet-avatar.home-pet-asset-missing .home-pet-fallback-emoji {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  font-size: 88px;
  filter: drop-shadow(0 14px 12px rgba(35,63,50,.24));
}

/* Portrait top-down interaction world. */
.among-world-panel {
  width: min(100%,520px);
  margin: 0 auto;
  padding: max(58px,calc(env(safe-area-inset-top) + 50px)) 10px max(18px,env(safe-area-inset-bottom));
}
.among-world-heading { margin: 0 auto 10px; color: #473f53; text-align: center; }
.among-world-heading h2 { margin: 0; font-size: clamp(24px,5vw,34px); }
.among-world-heading p:last-child { margin: 5px 0 0; color: #6e6476; font-size: 13px; font-weight: 750; }
.among-world-stage {
  position: relative;
  width: auto;
  max-width: 100%;
  height: min(78dvh,820px);
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 30px;
  outline: none;
  background: #cfe9ff;
  box-shadow: 0 18px 46px rgba(42,52,94,.28), inset 0 0 0 1px rgba(64,60,99,.18);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.among-world-stage:focus-visible { box-shadow: 0 0 0 4px rgba(122,111,223,.34), 0 18px 46px rgba(42,52,94,.28); }
.among-world-canvas { position: absolute; inset: 0; z-index: 1; overflow: hidden; border-radius: inherit; }
.among-world-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.among-world-home-button,
.mini-game-home-button {
  position: absolute;
  z-index: 8;
  top: max(14px,env(safe-area-inset-top));
  left: max(14px,env(safe-area-inset-left));
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.86);
  border-radius: 50%;
  color: #fff;
  background: rgba(25,30,57,.78);
  box-shadow: 0 8px 22px rgba(9,12,29,.28);
  font-size: 24px;
  font-weight: 950;
  backdrop-filter: blur(10px);
}
.among-world-joystick {
  position: absolute;
  z-index: 5;
  bottom: max(18px,env(safe-area-inset-bottom));
  left: max(18px,env(safe-area-inset-left));
  width: 104px;
  height: 104px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.88);
  border-radius: 50%;
  background: rgba(48,54,92,.3);
  box-shadow: inset 0 0 0 9px rgba(255,255,255,.16), 0 8px 22px rgba(25,32,65,.26);
  backdrop-filter: blur(5px);
  touch-action: none;
}
.among-world-joystick-knob {
  position: absolute;
  top: calc(50% - 25px);
  left: calc(50% - 25px);
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255,255,255,.96);
  border-radius: 50%;
  background: linear-gradient(145deg,#ffbbb0,#a7a0f4);
  box-shadow: 0 6px 14px rgba(39,35,78,.32), inset 0 3px 7px rgba(255,255,255,.55);
  pointer-events: none;
  transition: transform 45ms linear;
}

body.among-world-fullscreen-mode { overflow: hidden; overscroll-behavior: none; }
body.among-world-fullscreen-mode .language-toggle { display: none !important; }
body.app-mode.among-world-fullscreen-mode #guide-view.active {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: block;
  width: 100dvw;
  height: 100dvh;
  padding: 0 !important;
  overflow: hidden;
  background: #070b19;
}
body.among-world-fullscreen-mode .among-world-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 0;
}
body.among-world-fullscreen-mode .among-world-heading { display: none; }
body.among-world-fullscreen-mode .among-world-stage,
.among-world-stage:fullscreen {
  width: 100dvw;
  height: 100dvh;
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #070b19;
  box-shadow: none;
}
.among-world-stage:fullscreen::backdrop { background: #070b19; }

body.mini-game-fullscreen-mode #mini-game-overlay,
#mini-game-overlay:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: grid;
  width: 100dvw;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #080c1d;
}
body.mini-game-fullscreen-mode #mini-game-overlay.hidden { display: none !important; }
body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-card,
#mini-game-overlay:fullscreen .mini-game-card {
  width: 100dvw;
  height: 100dvh;
  max-height: none;
  padding: max(72px,calc(env(safe-area-inset-top) + 64px)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #11182e;
  box-shadow: none;
}
body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-home-button,
#mini-game-overlay:fullscreen .mini-game-home-button { position: fixed; }
body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-card h2,
body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-status { color: #fff; }
body.mini-game-fullscreen-mode #mini-game-overlay .eyebrow { color: #b8d8ff; }
body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-picker {
  width: min(100%,960px);
  margin: auto;
}
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-playing-shell .mini-game-card {
  place-content: center;
  overflow: hidden;
}
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-playing-shell .mini-game-card > .eyebrow,
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-playing-shell .mini-game-card > h2,
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-playing-shell .mini-game-status,
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-playing-shell .mini-game-picker { display: none !important; }
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-h5-shell .mini-game-card,
body.mini-game-fullscreen-mode .mini-game-page.mini-game-h5-shell {
  padding: 0;
  overflow: hidden;
  background: #080c1d;
}
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-h5-shell .mini-game-home-button,
body.mini-game-fullscreen-mode .mini-game-page.mini-game-h5-shell .mini-game-page-back-button {
  z-index: 10130;
}
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-h5-shell .h5-game-frame-shell,
body.mini-game-fullscreen-mode .mini-game-page.mini-game-h5-shell .h5-game-frame-shell,
#mini-game-overlay:fullscreen.mini-game-h5-shell .h5-game-frame-shell {
  position: fixed;
  inset: 0;
  z-index: 10105;
  width: 100dvw;
  height: 100dvh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-h5-shell .h5-game-frame,
body.mini-game-fullscreen-mode .mini-game-page.mini-game-h5-shell .h5-game-frame,
#mini-game-overlay:fullscreen.mini-game-h5-shell .h5-game-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
}
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-playing-shell .mini-game-canvas {
  width: min(160dvw,calc(100dvh * 5 / 3));
  height: auto;
  max-width: none;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: 5 / 3;
}
body.mini-game-fullscreen-mode .language-toggle { display: none !important; }

/* Fullscreen games stay proportional: landscape fills the height, portrait zooms and safely crops the side margins. */
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell .mini-game-canvas,
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-playing-shell .mini-game-canvas,
#mini-game-overlay:fullscreen.mini-game-playing-shell .mini-game-canvas {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(160dvw,calc(100dvh * 5 / 3)) !important;
  height: auto !important;
  max-width: none !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  aspect-ratio: 5 / 3 !important;
  object-fit: contain;
  transform: translate(-50%,-50%);
}

/* Direct coin gifting replaces friend search, lists and profile pages. */
.coin-gift-shell { width: min(100%,620px); margin: 0 auto; }
.coin-gift-card { padding: clamp(20px,5vw,34px); border: 2px solid rgba(85,70,58,.68); border-radius: 26px; }
.coin-gift-balance { display: flex; align-items: center; justify-content: center; gap: 13px; margin-bottom: 24px; padding: 15px; border-radius: 20px; background: #fff3c7; }
.coin-gift-balance > span { font-size: 36px; }
.coin-gift-balance small,.coin-gift-balance strong { display: block; }
.coin-gift-balance small { color: #7d6b4d; font-size: 12px; font-weight: 800; }
.coin-gift-balance strong { margin-top: 2px; color: #473b2c; font-size: 30px; }
.coin-gift-form { display: grid; gap: 9px; }
.coin-gift-form label { margin-top: 7px; color: #5f5262; font-size: 13px; font-weight: 900; }
.coin-gift-form input { min-height: 54px; border: 2px solid #d8c9bc; border-radius: 15px; background: #fff; font-size: 16px; }
.coin-gift-form button { margin-top: 9px; min-height: 54px; }
.coin-gift-status { min-height: 24px; margin: 14px 0 0; font-size: 13px; font-weight: 900; text-align: center; }
.coin-gift-status.is-error { color: #b7434e; }
.coin-gift-status.is-success { color: #257a56; }
.coin-gift-note { margin: 4px 0 0; color: #8a7d83; font-size: 11px; line-height: 1.55; text-align: center; }

/* Correct-answer celebration. */
.quiz-correct-celebration { position: fixed; inset: 0; z-index: 1200; overflow: hidden; pointer-events: none; }
.quiz-correct-celebration span {
  position: absolute;
  top: -12%;
  left: var(--celebration-x);
  font-size: clamp(28px,7vw,54px);
  animation: quiz-celebration-fall 1.35s cubic-bezier(.2,.74,.35,1) var(--celebration-delay) both;
}
@keyframes quiz-celebration-fall {
  0% { opacity: 0; transform: translate(-50%,-10vh) rotate(0deg) scale(.55); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,108vh) rotate(520deg) scale(1.15); }
}

@media (max-width: 620px) {
  body.companion-home-mode .pet-avatar .home-pet-art { max-width: min(52vw,205px); max-height: 34dvh; }
  .among-world-panel { width: 100%; padding-right: 5px; padding-left: 5px; }
  .among-world-heading { margin-bottom: 7px; }
  .among-world-stage { height: min(80dvh,720px); border-width: 2px; border-radius: 24px; }
  .among-world-joystick { width: 96px; height: 96px; }
  body.among-world-fullscreen-mode .among-world-stage { width: 100dvw; height: 100dvh; border-width: 0; border-radius: 0; }
  body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-picker { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .coin-gift-card { padding: 20px 16px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-correct-celebration span { animation-duration: .8s; }
}

/* Reference-matched island login: large centered logo, peeking pet and one soft welcome panel. */
#login-screen.login-screen {
  position: relative;
  display: grid;
  min-height: 100dvh;
  place-items: start center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(250px,36dvh,360px) max(12px,env(safe-area-inset-right)) max(58px,calc(env(safe-area-inset-bottom) + 42px)) max(12px,env(safe-area-inset-left));
  background: #9bd9e6 url('assets/backgrounds/pet-island-home.png') center / cover no-repeat;
}
#login-screen.login-screen::before { display: none; }
#login-screen.login-screen::after {
  display: block;
  z-index: 0;
  background: linear-gradient(180deg,rgba(224,233,255,.2) 0%,rgba(255,247,235,0) 40%,rgba(255,245,227,.22) 100%);
  pointer-events: none;
}
#login-screen > .center-logo {
  position: absolute;
  top: max(24px,4dvh);
  left: 50%;
  right: auto;
  z-index: 4;
  width: clamp(164px,34vw,236px);
  height: auto;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 12px 30px rgba(106,62,55,.18);
  transform: translateX(-50%);
  backdrop-filter: none;
}
#login-screen .login-shell {
  position: relative;
  z-index: 2;
  width: min(calc(100vw - 40px),560px);
  max-width: 100%;
  margin: 0 auto;
}
#login-screen .login-pet-peek {
  position: absolute;
  top: clamp(-190px,-24vw,-142px);
  left: clamp(-18px,1vw,12px);
  z-index: 2;
  width: clamp(210px,56vw,320px);
  height: clamp(190px,46vw,258px);
  overflow: hidden;
  pointer-events: none;
}
.login-pet-mascot {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: clamp(210px,56vw,320px);
  height: auto;
  max-width: none;
  filter: drop-shadow(0 16px 14px rgba(103,61,74,.18));
  transform: translateX(-50%);
}
#login-screen .login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: clamp(68px,16vw,96px) clamp(22px,6vw,42px) clamp(18px,4vw,30px);
  overflow: visible;
  border: 4px solid rgba(202,189,243,.9);
  border-radius: clamp(42px,10vw,76px) clamp(42px,10vw,76px) 30px 30px;
  color: #654b3f;
  text-align: left;
  background: rgba(255,251,241,.96);
  box-shadow: 0 24px 56px rgba(91,64,53,.2),inset 0 1px 0 rgba(255,255,255,.96);
  backdrop-filter: blur(13px) saturate(1.04);
}
#login-screen .login-card::before,
#login-screen .login-card::after { display: none !important; }
#login-screen .login-title {
  margin: 0 0 4px;
  color: #654636;
  font-size: clamp(38px,10vw,58px);
  font-weight: 1000;
  line-height: 1.04;
  letter-spacing: -.06em;
}
#login-screen .login-card .hero-copy {
  margin: 0 0 clamp(18px,4vw,26px);
  color: #90766b;
  font-size: clamp(16px,4.4vw,22px);
  font-weight: 700;
  line-height: 1.45;
}
#login-screen .login-form { display: grid; width: 100%; min-width: 0; gap: 10px; }
#login-screen .login-control {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr);
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 70px;
  overflow: hidden;
  padding: 10px 18px;
  border: 1px solid rgba(235,222,209,.9);
  border-radius: 24px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 24px rgba(119,88,68,.08),inset 0 1px 0 #fff;
  transition: border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
#login-screen .login-control:focus-within {
  border-color: #a8dfd2;
  box-shadow: 0 0 0 5px rgba(108,214,204,.16),0 12px 24px rgba(119,88,68,.08);
  transform: translateY(-1px);
}
#login-screen .login-field-icon {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: transparent;
  opacity: .62;
}
#login-screen .login-control-body {
  display: grid;
  min-width: 0;
  gap: 2px;
  margin: 0;
  color: #60483e;
  font-size: 15px;
  font-weight: 950;
}
#login-screen .login-control-label { line-height: 1.2; }
#login-screen .login-control input,
#login-screen .login-form .login-control input {
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #554038;
  background: transparent;
  box-shadow: none;
  font-size: clamp(14px,3.8vw,18px);
  font-weight: 650;
}
#login-screen .login-control input::placeholder { color: #b8aaa6; opacity: 1; }
#login-screen .login-session-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 4px 0;
  border: 0;
  color: #7d6c65;
  background: transparent;
  font-size: clamp(12px,3.3vw,15px);
  font-weight: 720;
}
#login-screen .login-session-check {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: #c7b8f2;
  box-shadow: inset 0 -3px 5px rgba(116,83,174,.13),0 4px 9px rgba(99,78,147,.12);
}
#login-screen .login-session-check img { width: 21px; height: 21px; filter: invert(1); }
#login-screen .login-submit-button {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(105deg,#67d8c5 0%,#55c9df 58%,#55aef1 100%);
  box-shadow: 0 15px 26px rgba(71,177,196,.28),inset 0 2px 0 rgba(255,255,255,.35);
  font-size: clamp(18px,5vw,25px);
  font-weight: 1000;
  letter-spacing: .02em;
}
#login-screen .login-submit-button:hover { transform: translateY(-2px); box-shadow: 0 18px 30px rgba(71,177,196,.34),inset 0 2px 0 rgba(255,255,255,.4); }
#login-screen .login-submit-button:active { transform: translateY(0) scale(.99); }
#login-screen .login-submit-button > img { width: 29px; height: 29px; filter: invert(1); }
#login-screen .login-card .form-error { min-height: 18px; margin: 8px 0 0; }
#login-screen .login-card .form-error:empty { display: none; }
#login-screen .login-help-copy { display: none; }

@media (min-width: 761px) and (max-height: 780px) {
  #login-screen.login-screen { padding-top: 200px; }
  #login-screen > .center-logo { top: 14px; width: 150px; }
  #login-screen .login-card { padding-top: 70px; padding-bottom: 20px; }
  #login-screen .login-pet-peek { top: -150px; width: 240px; height: 190px; }
  .login-pet-mascot { width: 240px; }
}

@media (max-width: 390px) {
  #login-screen.login-screen { padding-top: clamp(230px,34dvh,280px); padding-inline: 7px; }
  #login-screen > .center-logo { top: max(18px,3dvh); width: clamp(154px,42vw,176px); }
  #login-screen .login-shell { width: min(96vw,560px); }
  #login-screen .login-pet-peek { top: -154px; left: -5px; width: 230px; height: 184px; }
  .login-pet-mascot { width: 230px; }
  #login-screen .login-card { padding: 68px 18px 17px; border-width: 3px; border-radius: 42px 42px 24px 24px; }
  #login-screen .login-control { min-height: 66px; padding: 8px 14px; border-radius: 21px; }
  #login-screen .login-submit-button { min-height: 56px; }
}

@media (max-height: 700px) {
  #login-screen.login-screen { padding-top: 190px; }
  #login-screen > .center-logo { top: 10px; width: 138px; }
  #login-screen .login-pet-peek { top: -132px; width: 208px; height: 158px; }
  .login-pet-mascot { width: 208px; }
  #login-screen .login-card { padding-top: 58px; }
  #login-screen .login-title { font-size: 34px; }
  #login-screen .login-card .hero-copy { margin-bottom: 12px; font-size: 15px; }
  #login-screen .login-control { min-height: 62px; }
  #login-screen .login-submit-button { min-height: 54px; }
}

/* 2026-09-23: gamepad entry, wearable pet layers and the customizable Phaser home. */
.home-game-emoji,
.home-cabinet-emoji,
.home-message-icon {
  display: grid;
  width: 82%;
  height: 82%;
  place-items: center;
  font-size: clamp(24px,5vw,34px);
  line-height: 1;
}
body.companion-home-mode .home-scene-button > .home-game-emoji,
body.companion-home-mode .home-scene-button > .home-cabinet-emoji,
body.companion-home-mode .home-scene-button > .home-message-icon {
  position: static;
  top: auto;
  left: auto;
  color: inherit;
  font-size: clamp(24px,5vw,34px);
  text-shadow: none;
  transform: none;
}

/* Three complete outfit presets replace individual wearable controls. */
.shop-category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
  padding: 8px;
  border: 2px solid rgba(255,255,255,.84);
  border-radius: 24px;
  background: rgba(255,250,242,.92);
  box-shadow: 0 12px 32px rgba(61,55,92,.11);
}
.shop-category-tab {
  display: flex;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid transparent;
  border-radius: 17px;
  color: #665860;
  background: rgba(255,255,255,.72);
  font: inherit;
  cursor: pointer;
}
.shop-category-tab span { font-size: 24px; }
.shop-category-tab strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.shop-category-tab:hover { border-color: #d7c8d0; background: #fff; }
.shop-category-tab.active {
  border-color: #6fcdb1;
  color: #245e4f;
  background: #e6f8f1;
  box-shadow: 0 7px 17px rgba(55,133,110,.14);
}
.shop-category-tab:focus-visible { outline: 3px solid rgba(101,190,164,.28); outline-offset: 2px; }
.shop-category-panel,
.outfit-preset-shop-panel {
  margin-top: 22px;
  padding: clamp(16px, 3vw, 26px);
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 28px;
  background: rgba(255,250,242,.97);
  box-shadow: 0 18px 44px rgba(61,55,92,.14);
}
.shop-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.shop-category-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.shop-category-heading > div > span { font-size: 30px; }
.shop-category-heading h3,
.shop-category-heading p { margin: 0; }
.shop-category-heading small { color: #83767c; font-weight: 800; }
.outfit-preset-shop { margin-top: 20px; }
.evolution-journey {
  margin: 16px 0 20px;
  padding: clamp(14px, 2.5vw, 20px);
  border: 2px solid rgba(112,190,166,.32);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(239,253,248,.98), rgba(250,247,255,.96));
}
.evolution-journey-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.evolution-journey-heading h4,.evolution-journey-heading p { margin: 0; }
.evolution-journey-heading h4 { color: #4f433f; font-size: clamp(20px, 3vw, 27px); }
.evolution-current-form { padding: 7px 11px; border-radius: 999px; color: #327966; background: #daf5eb; font-size: 12px; font-weight: 900; }
.evolution-journey-steps { display: grid; gap: 9px; }
.evolution-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 2px solid rgba(202,190,196,.48);
  border-radius: 17px;
  background: rgba(255,255,255,.88);
}
.evolution-step.ready { border-color: #e8bd58; box-shadow: 0 0 0 4px rgba(245,204,104,.12); }
.evolution-step.complete { border-color: rgba(102,198,167,.48); background: rgba(239,253,247,.94); }
.evolution-step.locked { opacity: .78; }
.evolution-step-index { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #fff; background: #a99aa2; font-size: 14px; font-weight: 1000; }
.evolution-step.ready .evolution-step-index { color: #624c14; background: #ffd978; }
.evolution-step.complete .evolution-step-index { background: #64bea3; }
.evolution-step strong,.evolution-step small { display: block; }
.evolution-step > div > strong { color: #584a51; font-size: 15px; }
.evolution-step > div > small { margin-top: 3px; color: #85767d; font-size: 12px; font-weight: 750; }
.evolution-step > button,.evolution-step > .evolution-step-complete { min-width: 150px; min-height: 40px; }
.evolution-step-complete { display: inline-flex; align-items: center; justify-content: center; color: #277b62; font-size: 12px; font-weight: 950; }
.evolution-step-track { display: block; height: 6px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #eadfe4; }
.evolution-step-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #70cbb0, #f1c55d); }
.evolution-form-switcher { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(110,93,101,.14); }
.evolution-form-switcher > div > strong,.evolution-form-switcher > div > small { display: block; }
.evolution-form-switcher > div > small { margin-top: 3px; color: #85767d; font-size: 11px; }
.evolution-form-switcher .pet-form-selector { grid-column: auto; width: 100%; }
.outfit-growth-ready { display: inline-flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; padding: 8px; border-radius: 13px; color: #80621b; background: #fff4ce; font-size: 12px; font-weight: 900; text-align: center; }
.evolution-style-card.unlocked { border-color: #64bea3; box-shadow: 0 0 0 4px rgba(100,190,163,.14), 0 14px 32px rgba(55,132,109,.12); }
.outfit-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.outfit-preset-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(150px, 1fr) auto auto;
  gap: 11px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border: 2px solid rgba(213,199,202,.68);
  border-radius: 23px;
  background: linear-gradient(155deg, rgba(255,255,255,.98), rgba(255,248,237,.92));
  box-shadow: 0 9px 22px rgba(79,63,70,.09);
}
.outfit-preset-card.preset-cute { background: linear-gradient(155deg, #fffafd, #fff0f6); }
.outfit-preset-card.preset-handsome { background: linear-gradient(155deg, #f8fbff, #eaf1ff); }
.outfit-preset-card.active {
  border-color: #6bc6aa;
  box-shadow: 0 0 0 4px rgba(107,198,170,.14), 0 14px 28px rgba(58,143,118,.14);
}
.outfit-preset-card.locked:not(.preset-default) .outfit-preset-art { filter: saturate(.55); opacity: .72; }
.outfit-preset-art {
  display: grid;
  place-items: center;
  min-height: 150px;
  overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 72%, rgba(255,255,255,.96), rgba(236,228,250,.68));
}
.outfit-preset-art img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
}
.outfit-preset-art > span { font-size: 58px; }
.outfit-preset-copy span,
.outfit-preset-copy strong,
.outfit-preset-copy small { display: block; }
.outfit-preset-copy span { color: #51444b; font-size: 18px; font-weight: 950; }
.outfit-preset-copy strong { margin-top: 4px; color: #716269; font-size: 13px; line-height: 1.45; }
.outfit-preset-copy small { margin-top: 5px; color: #96868d; line-height: 1.4; }
.outfit-preset-card > button,
.outfit-preset-card > .home-cabinet-equipped { width: 100%; min-height: 44px; }
.outfit-preset-card > .home-cabinet-equipped { display: flex; align-items: center; justify-content: center; padding: 9px; border-radius: 13px; text-align: center; }
.cabinet-outfit-presets { margin-top: 2px; }
body.companion-home-mode .equipped-layer { display: none !important; }

@media (max-width: 760px) {
  .shop-category-tabs { gap: 6px; padding: 6px; border-radius: 20px; }
  .shop-category-tab { min-height: 52px; gap: 5px; padding: 8px 5px; border-radius: 14px; }
  .shop-category-tab span { font-size: 20px; }
  .shop-category-tab strong { font-size: 12px; }
  .evolution-journey-heading { align-items: flex-start; flex-direction: column; }
  .evolution-step { grid-template-columns: 30px minmax(0, 1fr); }
  .evolution-step-index { width: 29px; height: 29px; }
  .evolution-step > button,.evolution-step > .evolution-step-complete { grid-column: 2; width: 100%; min-width: 0; }
  .evolution-form-switcher { grid-template-columns: 1fr; }
  .evolution-form-switcher .pet-form-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outfit-preset-grid { grid-template-columns: 1fr; }
  .outfit-preset-card { grid-template-columns: 108px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; }
  .outfit-preset-art { grid-row: 1 / 3; min-height: 116px; }
  .outfit-preset-art img { height: 126px; }
  .outfit-preset-card > button,
  .outfit-preset-card > .home-cabinet-equipped { grid-column: 2; }
  .shop-category-heading { align-items: flex-start; }
  .shop-category-heading > small { display: none; }
}
body.companion-home-mode .home-scene-button > .home-message-icon svg {
  display: block;
  width: clamp(27px,5.5vw,38px);
  height: clamp(27px,5.5vw,38px);
  overflow: visible;
  fill: #8d78d9;
  stroke: #4d3d72;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.companion-home-mode .home-scene-button > .home-message-icon circle { fill: #fffaf2; stroke: none; }

body.companion-home-mode .equipped-layer {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: block !important;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  pointer-events: none;
}
body.companion-home-mode .equipped-wearable {
  position: absolute;
  display: grid;
  width: clamp(46px,8vw,88px);
  aspect-ratio: 1;
  place-items: center;
  filter: drop-shadow(0 5px 6px rgba(73,49,47,.3));
  transform: translate(-50%,-50%);
}
body.companion-home-mode .equipped-wearable img { display: block; width: 100%; height: 100%; object-fit: contain; }
body.companion-home-mode .equipped-wearable-generated::before,
body.companion-home-mode .equipped-wearable-generated::after {
  content: '';
  position: absolute;
  box-sizing: border-box;
  filter: drop-shadow(0 4px 4px rgba(41,42,64,.25));
}
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-head::before {
  inset: 17% 10% 39%;
  border: clamp(2px,.35vw,4px) solid var(--wearable-outline);
  border-radius: 45% 45% 18% 18%;
  background: linear-gradient(145deg,var(--wearable-accent),var(--wearable-primary) 42%,var(--wearable-secondary));
}
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-head::after {
  top: 49%; left: 16%; width: 68%; height: 12%;
  border: clamp(2px,.25vw,3px) solid var(--wearable-outline);
  border-radius: 999px;
  background: var(--wearable-primary);
}
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-body::before {
  inset: 12% 12% 8%;
  border: clamp(2px,.35vw,4px) solid var(--wearable-outline);
  border-radius: 24% 24% 18% 18%;
  background: linear-gradient(150deg,var(--wearable-accent),var(--wearable-primary) 35%,var(--wearable-secondary));
  clip-path: polygon(10% 10%,30% 0,40% 15%,60% 15%,70% 0,90% 10%,100% 34%,82% 43%,77% 100%,23% 100%,18% 43%,0 34%);
}
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-body::after {
  top: 35%; left: 41%; width: 18%; height: 40%;
  border-radius: 999px;
  background: color-mix(in srgb,var(--wearable-accent) 75%,transparent);
}
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-weapon::before {
  top: 9%; left: 44%; width: 13%; height: 82%;
  border: 2px solid var(--wearable-outline);
  border-radius: 999px;
  background: #986441;
  transform: rotate(36deg);
}
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-weapon::after {
  top: 14%; left: 16%; width: 68%; height: 18%;
  border: clamp(2px,.3vw,4px) solid var(--wearable-outline);
  border-radius: 999px 35% 35% 999px;
  background: linear-gradient(90deg,var(--wearable-accent),var(--wearable-primary),var(--wearable-secondary));
  transform: rotate(-4deg);
}
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-accessory::before {
  inset: 25%;
  border: clamp(2px,.3vw,4px) solid var(--wearable-outline);
  background: radial-gradient(circle at 35% 30%,var(--wearable-accent),var(--wearable-primary) 38%,var(--wearable-secondary));
  transform: rotate(45deg);
}
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-hands::before,
body.companion-home-mode .equipped-wearable-generated.equipped-wearable-feet::before {
  inset: 25% 14%;
  border: clamp(2px,.3vw,4px) solid var(--wearable-outline);
  border-radius: 38%;
  background: linear-gradient(145deg,var(--wearable-accent),var(--wearable-primary),var(--wearable-secondary));
}
body.companion-home-mode .equipped-wearable-head { top: 30%; left: 50%; }
body.companion-home-mode .equipped-wearable-body { top: 50%; left: 50%; width: clamp(58px,10vw,108px); opacity: .9; }
body.companion-home-mode .equipped-wearable-weapon { top: 50%; left: 39%; transform: translate(-50%,-50%) rotate(-10deg); }
body.companion-home-mode .equipped-wearable-accessory { top: 48%; left: 61%; }
body.companion-home-mode .equipped-wearable-hands { top: 56%; left: 41%; }
body.companion-home-mode .equipped-wearable-feet { top: 67%; left: 50%; }

.home-world-status {
  position: absolute;
  z-index: 7;
  top: max(14px,env(safe-area-inset-top));
  left: 50%;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 16px;
  color: #4f443b;
  background: rgba(255,250,235,.92);
  box-shadow: 0 8px 20px rgba(59,81,42,.2);
  transform: translateX(-50%);
  backdrop-filter: blur(9px);
}
.home-world-status strong { white-space: nowrap; }
.home-world-status small { color: #807064; font-weight: 800; white-space: nowrap; }
.home-world-hint {
  position: absolute;
  z-index: 7;
  top: max(68px,calc(env(safe-area-inset-top) + 58px));
  left: 50%;
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(132,96,65,.16);
  border-radius: 999px;
  color: #69594e;
  background: rgba(255,251,240,.88);
  box-shadow: 0 7px 18px rgba(74,55,36,.13);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .3s ease, transform .3s ease;
  backdrop-filter: blur(8px);
}
.among-world-stage.home-pet-met .home-world-hint,
.among-world-stage.placing-home-furniture .home-world-hint,
.among-world-stage.storing-home-furniture .home-world-hint,
.among-world-stage.editing-home-furniture .home-world-hint { opacity: 0; transform: translate(-50%,-5px); }
@media (prefers-reduced-motion: reduce) {
  .home-world-hint { transition: none; }
}
.home-world-tools {
  position: absolute;
  z-index: 7;
  right: max(16px,env(safe-area-inset-right));
  bottom: max(18px,env(safe-area-inset-bottom));
  display: grid;
  gap: 9px;
}
.home-world-tools button {
  display: flex;
  min-width: 92px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 13px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 16px;
  color: #56473d;
  background: rgba(255,249,231,.93);
  box-shadow: 0 8px 20px rgba(54,78,38,.22);
  font-weight: 950;
  backdrop-filter: blur(9px);
}
.home-world-tools button.active,
.home-world-tools button[aria-pressed="true"] { color: #fff; background: #df7c91; }
.among-world-stage.placing-home-furniture { cursor: crosshair; }
.among-world-stage.storing-home-furniture { cursor: pointer; }
.among-world-stage.editing-home-furniture { cursor: grab; }
.among-world-stage.dragging-home-furniture { cursor: grabbing; }
.home-world-editor {
  position: absolute;
  z-index: 9;
  top: max(76px,calc(env(safe-area-inset-top) + 62px));
  left: 50%;
  width: min(470px,calc(100% - 230px));
  padding: 10px;
  border: 2px solid rgba(255,255,255,.94);
  border-radius: 20px;
  background: rgba(255,249,238,.95);
  box-shadow: 0 12px 30px rgba(75,51,63,.22);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}
.home-world-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #5d4550; }
.home-world-editor-heading strong,
.home-world-editor-heading small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-world-editor-heading small { color: #8a7079; font-size: 11px; font-weight: 850; }
.home-world-editor-controls { display: grid; grid-template-columns: repeat(10,minmax(30px,1fr)); gap: 5px; margin-top: 8px; }
.home-world-editor-controls button {
  min-width: 0;
  min-height: 34px;
  padding: 4px;
  border: 1px solid rgba(116,82,96,.24);
  border-radius: 11px;
  color: #674b57;
  background: #fff;
  font-size: 16px;
  font-weight: 950;
  box-shadow: 0 4px 10px rgba(84,58,70,.1);
}
.home-world-editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.home-world-editor-actions button { min-height: 36px; padding: 6px 10px; border-radius: 12px; }
body.among-world-fullscreen-mode .among-world-home-button,
body.among-world-fullscreen-mode .among-world-joystick,
body.among-world-fullscreen-mode .home-world-status,
body.among-world-fullscreen-mode .home-world-hint,
body.among-world-fullscreen-mode .home-world-tools,
.among-world-stage:fullscreen .among-world-home-button,
.among-world-stage:fullscreen .among-world-joystick,
.among-world-stage:fullscreen .home-world-status,
.among-world-stage:fullscreen .home-world-hint,
.among-world-stage:fullscreen .home-world-tools { position: fixed; }
body.among-world-fullscreen-mode .home-world-editor,
.among-world-stage:fullscreen .home-world-editor {
  position: fixed;
  top: auto;
  bottom: max(14px,env(safe-area-inset-bottom));
  width: min(560px,calc(100dvw - 260px));
  max-height: min(42dvh,310px);
  overflow-y: auto;
}
body.app-mode.among-world-fullscreen-mode #guide-view.active,
body.among-world-fullscreen-mode .among-world-stage,
.among-world-stage:fullscreen { background: #f4dce7; }

.home-cabinet-overlay {
  z-index: 10550;
  padding: max(16px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  background: rgba(52,43,57,.5);
  backdrop-filter: blur(9px);
}
.home-cabinet-card {
  position: relative;
  width: min(920px,100%);
  max-height: min(92dvh,900px);
  margin: auto;
  padding: clamp(20px,4vw,34px);
  overflow: auto;
  border: 3px solid rgba(255,255,255,.92);
  border-radius: clamp(24px,5vw,38px);
  color: #57483f;
  background: linear-gradient(145deg,#fffaf0 0%,#fff2f6 48%,#eef9f3 100%);
  box-shadow: 0 24px 70px rgba(45,35,50,.35),inset 0 0 0 2px rgba(217,190,226,.5);
}
.home-cabinet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-right: 40px; }
.home-cabinet-heading h2 { margin: 2px 0 4px; font-size: clamp(28px,6vw,44px); }
.home-cabinet-heading p { margin: 0; color: #81736c; font-weight: 700; }
.home-cabinet-coins { display: flex; min-width: 88px; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; border: 2px solid #e5c895; border-radius: 999px; background: #fff8db; font-size: 18px; }
.home-cabinet-section { margin-top: 22px; padding: clamp(14px,3vw,22px); border: 2px solid rgba(194,171,181,.44); border-radius: 24px; background: rgba(255,255,255,.68); }
.home-furniture-shop-section { margin-top: 0; color: #57483f; background: rgba(255,253,249,.96); }
.mc-native-shop-section { color: #57483f; background: linear-gradient(145deg,rgba(247,255,252,.97),rgba(246,244,255,.97)); }
.mc-native-shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 14px; }
.mc-native-search { display: flex; flex: 1 1 320px; min-height: 44px; align-items: center; gap: 8px; padding: 0 13px; border: 2px solid #d9d4e3; border-radius: 14px; background: #fff; }
.mc-native-search:focus-within { border-color: #69c9ac; box-shadow: 0 0 0 3px rgba(105,201,172,.16); }
.mc-native-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #57483f; background: transparent; font: inherit; font-weight: 750; }
.mc-native-kind-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(103,83,94,.08); }
.mc-native-kind-tabs button { min-height: 36px; padding: 7px 14px; border: 0; border-radius: 10px; color: #75646c; background: transparent; font-weight: 900; cursor: pointer; }
.mc-native-kind-tabs button.active { color: #226c57; background: #fff; box-shadow: 0 3px 9px rgba(58,45,51,.12); }
.mc-native-catalog-grid { max-height: min(70dvh,760px); padding: 2px 6px 8px 2px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.mc-native-item.owned { border-color: #8fd6c2; background: #effbf5; }
.mc-native-item-art { position: relative; color: #7f7067; background: linear-gradient(145deg,#fff7df,#f2ecff); box-shadow: inset 0 0 0 3px rgba(255,255,255,.5); }
.mc-native-icon-fallback { font-size: 32px; line-height: 1; opacity: .45; transition: opacity .15s ease; }
.mc-native-item-art canvas { position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; opacity: 0; image-rendering: pixelated; transform: translate(-50%,-50%); transition: opacity .15s ease; }
.mc-native-item-art.icon-ready canvas { opacity: 1; }
.mc-native-item-art.icon-ready .mc-native-icon-fallback { opacity: 0; }
.mc-native-item-art > small { position: absolute; right: 5px; bottom: 3px; z-index: 2; padding: 1px 4px; border-radius: 5px; color: #fff; background: rgba(38,30,35,.6); font-size: 9px; font-weight: 900; }
.home-cabinet-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.home-cabinet-section-heading > div { display: flex; align-items: center; gap: 8px; }
.home-cabinet-section-heading h3 { margin: 0; font-size: clamp(20px,4vw,27px); }
.home-cabinet-section-heading small { color: #897b82; font-weight: 750; }
.home-cabinet-pet-tabs {
  display: flex;
  gap: 9px;
  margin: 0 0 14px;
  padding: 3px 2px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.home-cabinet-pet-tab {
  display: grid;
  flex: 0 0 86px;
  min-width: 86px;
  gap: 4px;
  justify-items: center;
  padding: 7px;
  overflow: hidden;
  border: 2px solid #eadde0;
  border-radius: 17px;
  color: #69575e;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.home-cabinet-pet-tab img { width: 54px; height: 54px; object-fit: contain; }
.home-cabinet-pet-tab span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-cabinet-pet-tab.active { border-color: #83d8c2; background: #e9fbf5; box-shadow: 0 6px 15px rgba(63,152,128,.14); }
.home-cabinet-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 11px; }
.home-cabinet-item { display: grid; grid-template-columns: 64px minmax(0,1fr); grid-template-areas: "art copy" "art action"; align-items: center; gap: 6px 10px; min-width: 0; padding: 10px; border: 2px solid #eadde0; border-radius: 18px; background: rgba(255,255,255,.92); box-shadow: 0 6px 14px rgba(83,65,72,.08); }
.home-cabinet-item.equipped { border-color: #8fd6c2; background: #effbf5; }
.home-cabinet-item.locked { opacity: .88; }
.home-cabinet-item-art { grid-area: art; display: grid; width: 64px; height: 64px; place-items: center; overflow: hidden; border-radius: 16px; background: linear-gradient(145deg,#fff3ce,#f5ecff); font-size: 34px; }
.home-cabinet-item-art img { display: block; width: 92%; height: 92%; object-fit: contain; }
.home-cabinet-item-copy { grid-area: copy; min-width: 0; }
.home-cabinet-item-copy small,.home-cabinet-item-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-cabinet-item-copy small { color: #8d7c84; font-size: 11px; font-weight: 800; }
.home-cabinet-item-copy strong { margin-top: 3px; font-size: 14px; }
.home-cabinet-item .primary-button,.home-cabinet-equipped { grid-area: action; min-height: 34px; padding: 6px 10px; border-radius: 11px; font-size: 12px; }
.home-cabinet-equipped { display: inline-flex; align-items: center; justify-content: center; color: #287b62; background: #d9f5ea; font-weight: 900; }
.home-cabinet-empty { grid-column: 1/-1; padding: 20px; color: #85777e; text-align: center; }
.home-cabinet-empty > span { display: block; font-size: 38px; }
.home-cabinet-empty strong { display: block; margin: 5px 0; color: #62545a; }
.home-cabinet-empty p { margin: 0; }
@media (max-width: 620px) {
  body.companion-home-mode .home-corner-actions { gap: 6px; }
  body.companion-home-mode .home-corner-actions .home-scene-button { width: 46px; height: 46px; }
  body.companion-home-mode .equipped-wearable { width: clamp(42px,14vw,62px); }
  body.companion-home-mode .equipped-wearable-head { top: 31%; }
  body.companion-home-mode .equipped-wearable-body { top: 50%; width: clamp(48px,16vw,72px); }
  body.companion-home-mode .equipped-wearable-weapon { top: 51%; left: 34%; }
  body.companion-home-mode .equipped-wearable-accessory { top: 49%; left: 66%; }
  body.companion-home-mode .equipped-wearable-hands { left: 38%; }
  body.companion-home-mode .equipped-wearable-feet { top: 65%; }
  .home-world-status { top: max(66px,calc(env(safe-area-inset-top) + 58px)); min-height: 40px; padding: 6px 10px; }
  .home-world-status small { max-width: 105px; overflow: hidden; text-overflow: ellipsis; }
  .home-world-hint { top: max(112px,calc(env(safe-area-inset-top) + 104px)); max-width: calc(100% - 190px); text-align: center; }
  .home-world-tools { right: max(10px,env(safe-area-inset-right)); bottom: max(13px,env(safe-area-inset-bottom)); gap: 6px; }
  .home-world-tools button { min-width: 76px; min-height: 42px; padding: 7px 9px; font-size: 12px; }
  .home-world-editor { top: max(112px,calc(env(safe-area-inset-top) + 100px)); bottom: auto; width: calc(100% - 24px); max-height: min(42dvh,300px); padding: 8px; border-radius: 16px; }
  .home-world-editor-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .home-world-editor-controls { grid-template-columns: repeat(5,minmax(34px,1fr)); }
  .home-world-editor-controls button { min-height: 32px; }
  .home-cabinet-card { max-height: 94dvh; padding: 20px 13px 18px; border-radius: 28px; }
  .home-cabinet-heading { display: block; padding-right: 34px; }
  .home-cabinet-coins { position: static; width: max-content; min-width: 74px; margin-top: 12px; padding: 6px 9px; font-size: 14px; }
  .home-cabinet-section { margin-top: 17px; padding: 12px 9px; }
  .home-cabinet-section-heading { display: block; }
  .home-cabinet-section-heading small { display: block; margin-top: 4px; }
  .mc-native-shop-toolbar { align-items: stretch; flex-direction: column; }
  .mc-native-search { flex-basis: auto; }
  .mc-native-kind-tabs { display: grid; grid-template-columns: repeat(3,1fr); }
  .mc-native-kind-tabs button { padding-inline: 7px; }
  .home-cabinet-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .home-cabinet-item { grid-template-columns: 52px minmax(0,1fr); padding: 8px; }
  .home-cabinet-item-art { width: 52px; height: 52px; border-radius: 13px; }
  .mc-native-item-art canvas { width: 44px; height: 44px; }
}

@media (max-width: 390px) {
  .home-cabinet-grid { grid-template-columns: 1fr; }
}

/* Fullscreen mini games use the same island scene as the pet home. */
body.mini-game-fullscreen-mode,
body.mini-game-fullscreen-mode .app-screen,
body.mini-game-fullscreen-mode .page-shell,
body.mini-game-fullscreen-mode #mini-game-embedded-page,
body.mini-game-fullscreen-mode #mini-game-overlay,
#mini-game-overlay:fullscreen {
  background: #93d9d2 url('assets/backgrounds/pet-island-home.png') center / cover no-repeat fixed !important;
}

body.mini-game-fullscreen-mode #mini-game-embedded-page:fullscreen,
body.mini-game-fullscreen-mode #mini-game-embedded-page::backdrop,
body.mini-game-fullscreen-mode .mini-game-page:fullscreen,
body.mini-game-fullscreen-mode .mini-game-page::backdrop,
#mini-game-overlay:fullscreen::backdrop {
  background: #93d9d2 url('assets/backgrounds/pet-island-home.png') center / cover no-repeat !important;
}

body.mini-game-fullscreen-mode .mini-game-page,
body.mini-game-fullscreen-mode .mini-game-page.mini-game-playing-shell,
body.mini-game-fullscreen-mode .mini-game-page.mini-game-h5-shell,
body.mini-game-fullscreen-mode .kuromi-room-panel,
body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-card,
body.mini-game-fullscreen-mode #mini-game-overlay.mini-game-h5-shell .mini-game-card,
#mini-game-overlay:fullscreen .mini-game-card {
  color: #4f443b;
  background: transparent !important;
}

body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-card h2,
body.mini-game-fullscreen-mode #mini-game-overlay .mini-game-status,
body.mini-game-fullscreen-mode #mini-game-overlay .eyebrow,
body.mini-game-fullscreen-mode .mini-game-page-header h3,
body.mini-game-fullscreen-mode .mini-game-page .eyebrow,
body.mini-game-fullscreen-mode .mini-game-status,
body.mini-game-fullscreen-mode .mini-game-keyboard-hint {
  color: #4f443b !important;
}

body.mini-game-fullscreen-mode .mini-game-canvas {
  background: transparent !important;
}

.mini-game-tutorial-shell .mini-game-picker {
  grid-template-columns: minmax(0,1fr) !important;
  align-content: start;
  overflow: auto;
}
.mini-game-tutorial-card {
  display: grid;
  width: min(820px,100%);
  min-width: 0;
  gap: clamp(14px,2.5vw,22px);
  margin: auto;
  padding: clamp(16px,3vw,28px);
  border: 3px solid rgba(255,255,255,.94);
  border-radius: clamp(22px,4vw,34px);
  color: #56483f;
  background: rgba(255,250,240,.96);
  box-shadow: 0 20px 48px rgba(69,53,47,.22);
  backdrop-filter: blur(12px);
}
.mini-game-tutorial-hero {
  display: grid;
  grid-template-columns: 112px minmax(0,1fr);
  align-items: center;
  gap: 18px;
}
.mini-game-tutorial-art {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(119,96,83,.14);
  border-radius: 28px;
  background: linear-gradient(145deg,#fff0c9,#e7f8ff);
  box-shadow: 0 9px 22px rgba(82,65,56,.12);
  font-size: 58px;
}
.mini-game-tutorial-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-game-tutorial-heading { min-width: 0; }
.mini-game-tutorial-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #9a5774;
  background: #ffe5ef;
  font-size: 12px !important;
  font-weight: 950;
}
.mini-game-tutorial-heading h3 {
  margin: 7px 0 3px;
  color: #4a3b34;
  font-size: clamp(25px,4vw,38px);
  line-height: 1.08;
}
.mini-game-tutorial-heading p {
  margin: 0;
  color: #7b6b62;
  font-size: 15px;
  font-weight: 750;
}
.mini-game-tutorial-steps {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}
.mini-game-tutorial-step {
  display: grid;
  min-width: 0;
  grid-template-columns: 32px minmax(0,1fr);
  align-items: start;
  gap: 9px;
  padding: 13px 12px;
  border: 2px solid rgba(129,108,96,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.88);
}
.mini-game-tutorial-step-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #78cdbd;
  font-size: 14px !important;
  font-weight: 1000;
}
.mini-game-tutorial-step strong {
  display: block;
  color: #594a42;
  font-size: 14px;
}
.mini-game-tutorial-step p {
  margin: 5px 0 0;
  color: #75675f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.48;
}
.mini-game-tutorial-tip {
  margin: 0;
  padding: 12px 15px;
  border: 2px solid #efd69a;
  border-radius: 16px;
  color: #705c35;
  background: #fff6d8;
  font-size: 14px;
  line-height: 1.5;
}
.mini-game-tutorial-tip > span { margin-right: 5px; font-size: 18px !important; }
.mini-game-tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.mini-game-tutorial-actions button { min-height: 50px; padding: 10px 20px; }

@media (max-width: 700px) {
  .mini-game-tutorial-card { gap: 12px; padding: 14px 12px; border-radius: 22px; }
  .mini-game-tutorial-hero { grid-template-columns: 78px minmax(0,1fr); gap: 11px; }
  .mini-game-tutorial-art { width: 78px; height: 78px; border-radius: 20px; font-size: 42px; }
  .mini-game-tutorial-heading h3 { margin-top: 5px; font-size: 23px; }
  .mini-game-tutorial-heading p { font-size: 12px; }
  .mini-game-tutorial-steps { grid-template-columns: 1fr; gap: 7px; }
  .mini-game-tutorial-step { grid-template-columns: 29px minmax(0,1fr); gap: 8px; padding: 9px 10px; }
  .mini-game-tutorial-step-number { width: 29px; height: 29px; }
  .mini-game-tutorial-step p { margin-top: 2px; font-size: 12px; line-height: 1.38; }
  .mini-game-tutorial-tip { padding: 9px 11px; font-size: 12px; }
  .mini-game-tutorial-actions { align-items: stretch; flex-direction: column-reverse; }
  .mini-game-tutorial-actions button { width: 100%; min-height: 46px; }
}

/* Student experience: natural game motion with no decorative sparkles. */
.view.active.view-wow-enter:not(#home-view):not(#guide-view) {
  animation: user-view-cinematic-in .34s cubic-bezier(.22,1,.36,1) both;
}

.nav-button.nav-wow-pop { animation: user-nav-pop .26s cubic-bezier(.22,1,.36,1) both; }
.nav-button.active::after {
  box-shadow: 0 2px 8px rgba(67,191,150,.3);
  transition: transform .24s ease, opacity .24s ease;
}

:is(.panel-card,.shop-item,.subject-card,.wall-post-card,.outfit-preset-card,.home-cabinet-item,.mini-game-tutorial-card) {
  transition: transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s ease, border-color .22s ease;
}
@media (hover: hover) and (pointer: fine) {
  :is(.panel-card,.shop-item,.subject-card,.wall-post-card,.outfit-preset-card,.home-cabinet-item,.mini-game-tutorial-card):hover {
    z-index: 2;
    border-color: rgba(92,92,230,.22);
    box-shadow: 0 16px 32px rgba(49,43,119,.13);
    transform: translateY(-3px);
  }
}

.primary-button:not(:disabled),
.secondary-button:not(:disabled),
.scene-button:not(:disabled),
.pet-home-shortcut:not(:disabled) {
  transition: transform .16s cubic-bezier(.22,1,.36,1), box-shadow .18s ease, filter .18s ease;
}
.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.scene-button:hover:not(:disabled),
.pet-home-shortcut:hover:not(:disabled) {
  filter: brightness(1.025);
  transform: translateY(-1px);
}
.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.scene-button:active:not(:disabled),
.pet-home-shortcut:active:not(:disabled) { transform: scale(.97); }

.modal-backdrop:not(.hidden),
.image-viewer-overlay:not(.hidden),
.level-up-overlay:not(.hidden) { animation: user-backdrop-in .2s ease-out both; }
.modal-backdrop:not(.hidden) > :is(div,article,section),
.image-viewer-overlay:not(.hidden) > :is(div,article,section),
.level-up-overlay:not(.hidden) > :is(div,article,section) {
  animation: user-modal-wow-in .3s cubic-bezier(.22,1,.36,1) both;
}
.toast.show.toast-wow { animation: user-toast-wow .28s cubic-bezier(.22,1,.36,1) both; }

body.companion-home-mode .pet-home-scene .pet-stage {
  animation: none;
}
body.companion-home-mode .pet-home-scene .pet-stage::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  content: '';
  pointer-events: none;
  background: linear-gradient(180deg, rgba(24,50,56,.04), transparent 30%, transparent 72%, rgba(28,40,31,.12));
}
body.companion-home-mode .pet-avatar .home-pet-art { animation: none; }
body.companion-home-mode #home-view.view-wow-enter .pet-avatar .home-pet-art { animation: none; }
body.companion-home-mode #home-view.view-wow-enter .pet-shadow { animation: none; }
body.companion-home-mode #home-view.view-wow-enter .pet-home-shortcuts-left { animation: user-shortcuts-left .3s .04s cubic-bezier(.22,1,.36,1) both; }
body.companion-home-mode #home-view.view-wow-enter .pet-home-shortcuts-right { animation: user-shortcuts-right .3s .07s cubic-bezier(.22,1,.36,1) both; }
body.companion-home-mode #home-view.view-wow-enter .home-corner-actions { animation: user-actions-rise .28s .08s cubic-bezier(.22,1,.36,1) both; }
body.companion-home-mode .pet-avatar.home-pet-reacting .home-pet-art { animation: user-pet-tap .36s cubic-bezier(.2,.72,.3,1) both; }
body.companion-home-mode .pet-shadow { animation: none; }

@keyframes user-view-cinematic-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes user-nav-pop { 0% { transform: scale(.94); } 65% { transform: scale(1.035); } 100% { transform: none; } }
@keyframes user-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes user-modal-wow-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes user-toast-wow { from { opacity: 0; transform: translate(-50%,8px) scale(.97); } to { opacity: 1; transform: translate(-50%,0) scale(1); } }
@keyframes user-pet-tap {
  0% { transform: translate(-50%,-50%) scale(1); }
  38% { transform: translate(-50%,-50%) scale(.97); }
  72% { transform: translate(-50%,-50%) scale(1.012); }
  100% { transform: translate(-50%,-50%) scale(1); }
}
@keyframes user-shadow-arrival { from { opacity: 0; transform: translateX(-50%) scale(.78); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes user-shadow-breathe { 0%,100% { opacity: .8; transform: translateX(-50%) scaleX(1); } 50% { opacity: .65; transform: translateX(-50%) scaleX(.94); } }
@keyframes user-shortcuts-left { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes user-shortcuts-right { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@keyframes user-actions-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .view.active.view-wow-enter,
  .nav-button.nav-wow-pop,
  .modal-backdrop:not(.hidden),
  .modal-backdrop:not(.hidden) > *,
  .image-viewer-overlay:not(.hidden),
  .image-viewer-overlay:not(.hidden) > *,
  .level-up-overlay:not(.hidden),
  .level-up-overlay:not(.hidden) > *,
  .toast.show.toast-wow,
  body.companion-home-mode .pet-home-scene .pet-stage,
  body.companion-home-mode .pet-avatar .home-pet-art,
  body.companion-home-mode .pet-shadow,
  body.companion-home-mode #home-view.view-wow-enter .pet-home-shortcuts,
  body.companion-home-mode #home-view.view-wow-enter .home-corner-actions { animation: none !important; }
}

/* Compact comment-feed layout for the message wall. */
body.app-mode:not(.companion-home-mode) .message-wall-list {
  width: min(900px,100%);
  gap: 4px;
}

body.app-mode:not(.companion-home-mode) .message-wall-list .wall-post-card {
  grid-template-columns: 40px minmax(0,1fr);
  gap: 12px;
  padding: 14px 16px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: rgba(255,253,249,.94);
  box-shadow: none;
}

body.app-mode:not(.companion-home-mode) .message-wall-list .wall-post-card:hover {
  border-color: #ded8d0;
  box-shadow: none;
  transform: none;
}

.message-wall-list .wall-post-card::before { display: none; }

.message-wall-list .wall-owner-avatar-column {
  width: 40px;
  height: 40px;
  box-shadow: none;
  font-size: 18px;
}

.message-wall-list .wall-post-body { min-width: 0; }
.message-wall-list .wall-post-header { align-items: start; gap: 10px; margin: 0 0 5px; }
.message-wall-list .wall-post-owner-copy { min-width: 0; }
.message-wall-list .wall-post-header h3 { color: #29231f; font-size: 15px; line-height: 1.25; }
.message-wall-list .wall-post-header p { margin-top: 2px; font-size: 12px; line-height: 1.3; }
.message-wall-list .wall-post-time { padding-top: 1px; color: #7d756e; font-size: 11px; }
.message-wall-list .collection-title-badge { padding: 2px 6px; font-size: 10px; }

.message-wall-list .wall-message-text {
  margin: 0 0 8px;
  padding: 0;
  color: #29231f;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.message-wall-list .wall-music-share { margin-bottom: 8px; padding: 9px; border-width: 1px; border-radius: 10px; }
.message-wall-list .wall-post-pet-row {
  display: grid;
  grid-template-columns: 52px minmax(0,1fr);
  gap: 9px;
  width: min(100%,560px);
  margin: 0 0 7px;
}

.message-wall-list .wall-image-button,
.message-wall-list .wall-pet-thumbnail-fallback {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  align-self: start;
  overflow: hidden;
  border: 1px solid #ded8d0;
  border-radius: 8px;
  background: #f3eee8;
  box-shadow: none;
  font-size: 22px;
}
.message-wall-list .wall-image-button:hover { transform: none; box-shadow: 0 0 0 2px rgba(91,74,61,.13); }
.message-wall-list .wall-image-button img { width: 100%; height: 100%; object-fit: cover; }

.message-wall-list .wall-post-details {
  margin: 0;
  border-color: #ded8d0;
  border-radius: 8px;
  background: rgba(250,248,245,.86);
}
.message-wall-list .wall-post-details summary {
  display: grid;
  min-height: 50px;
  align-content: center;
  gap: 2px;
  padding: 6px 10px;
  color: #51463e;
  font-size: 12px;
  list-style: none;
}
.message-wall-list .wall-post-details summary::-webkit-details-marker { display: none; }
.message-wall-list .wall-post-details summary span { font-weight: 900; }
.message-wall-list .wall-post-details summary b { color: #766b63; font-size: 11px; font-weight: 700; }
.message-wall-list .wall-post-details[open] summary { border-bottom-color: #ded8d0; }
.message-wall-list .wall-post-details .wall-stat-grid,
.message-wall-list .wall-post-details .wall-equipment-list { margin: 8px; }

.message-wall-list .wall-post-actions {
  display: inline-flex;
  width: auto;
  margin: 0 6px 0 0;
  vertical-align: middle;
}
.message-wall-list .wall-like-button {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #51463e;
  background: transparent;
  font-size: 13px;
}
.message-wall-list .wall-like-button:hover { background: #eee9e3; }
.message-wall-list .wall-like-button.liked { color: #b34f65; background: #ffe8ee; }

.message-wall-list .wall-comments-panel {
  display: inline-block;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  vertical-align: middle;
}
.message-wall-list .wall-comments-panel[open] { display: block; width: 100%; margin-top: 7px; }
.message-wall-list .wall-comments-summary {
  display: inline-flex;
  min-height: 32px;
  justify-content: flex-start;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #4a5da6;
  font-size: 13px;
}
.message-wall-list .wall-comments-summary:hover { background: #edf1ff; }
.message-wall-list .wall-comments-summary b {
  display: inline;
  min-width: 0;
  height: auto;
  color: inherit;
  background: transparent;
  font-size: inherit;
}
.message-wall-list .wall-comments-content {
  margin-top: 6px;
  padding: 10px 0 0;
  border-top-color: #e3ddd6;
}
.message-wall-list .wall-comment-row { padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.message-wall-list .wall-comment-moderation-note { margin: 7px 0 0; color: #6e7b73; font-size: 11px; font-weight: 750; }

@media (max-width: 620px) {
  body.app-mode:not(.companion-home-mode) .message-wall-list { gap: 10px; padding: 0 2px; }
  body.app-mode:not(.companion-home-mode) .message-wall-list .wall-post-card {
    grid-template-columns: 36px minmax(0,1fr);
    gap: 9px;
    padding: 12px 10px;
    overflow: hidden;
    border: 1px solid rgba(92,75,61,.36);
    border-radius: 16px;
    background: rgba(255,250,242,.97);
  }
  .message-wall-list .wall-owner-avatar-column { width: 36px; height: 36px; font-size: 16px; }
  .message-wall-list .wall-post-header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 2px 8px; }
  .message-wall-list .wall-post-owner-copy { min-width: 0; flex: 0 1 auto; }
  .message-wall-list .wall-post-time { margin: 0; }
  .message-wall-list .wall-message-text { font-size: 14px; }
  .message-wall-list .wall-post-pet-row { grid-template-columns: 46px minmax(0,1fr); gap: 7px; }
  .message-wall-list .wall-image-button,
  .message-wall-list .wall-pet-thumbnail-fallback { width: 46px; height: 46px; }
  .message-wall-list .wall-post-details summary { min-height: 44px; padding: 5px 8px; }
  .message-wall-list .wall-post-actions { align-items: center; flex-direction: row; }
  .message-wall-list .wall-like-button { width: auto; min-height: 32px; }
}
