:root {
  --bg: #0f1419;
  --bg-elevated: #1a222d;
  --bg-soft: #232d3a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf4;
  --text-muted: #8b9aaf;
  --accent: #7dd3c0;
  --accent-2: #a78bfa;
  --gold: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --font: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: radial-gradient(1200px 800px at 10% -10%, #1e3a4a 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 0%, #2d1f4a 0%, transparent 50%), var(--bg);
  color: var(--text);
}

body {
  padding: 1.25rem;
}

body.body--cinema-open {
  overflow: hidden;
}

.app {
  max-width: 1480px;
  margin: 0 auto;
  transition: filter 0.28s ease, opacity 0.28s ease;
}

.app--locked {
  filter: blur(18px);
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-gate__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 540px at 15% 10%, rgba(125, 211, 192, 0.12), transparent 52%),
    radial-gradient(900px 540px at 100% 0%, rgba(167, 139, 250, 0.14), transparent 48%),
    rgba(7, 10, 15, 0.84);
  backdrop-filter: blur(18px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 1.5rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(37, 48, 62, 0.96), rgba(17, 22, 30, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.auth-card__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.auth-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.28rem;
  margin-bottom: 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-switch__btn {
  border: 0;
  border-radius: 999px;
  padding: 0.56rem 1rem;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.auth-switch__btn.is-active {
  background: linear-gradient(135deg, rgba(125, 211, 192, 0.3), rgba(96, 165, 250, 0.22));
  color: var(--text);
  transform: translateY(-1px);
}

.auth-card h2 {
  margin: 0;
  font-size: 1.4rem;
}

.auth-card__hint {
  margin: 0.4rem 0 1.2rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.auth-form {
  display: grid;
  gap: 0.8rem;
}

.auth-form label {
  display: grid;
  gap: 0.36rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-form input {
  width: 100%;
  padding: 0.78rem 0.88rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 11, 16, 0.75);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input:focus {
  border-color: rgba(125, 211, 192, 0.6);
  box-shadow: 0 0 0 3px rgba(125, 211, 192, 0.12);
}

.auth-error {
  margin: 0;
  color: #ffb4b4;
  font-size: 0.82rem;
}

.auth-notice {
  margin: 0;
  color: #b3f5de;
  font-size: 0.82rem;
  line-height: 1.5;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
}

.auth-code-btn {
  align-self: stretch;
  white-space: nowrap;
}

.auth-submit {
  margin-top: 0.2rem;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  display: block;
  width: min(460px, 52vw);
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 32px rgba(120, 80, 32, 0.14));
}

.brand-copy {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 4px 12px rgba(125, 211, 192, 0.35));
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pill {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

@media (max-width: 880px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.panel--main {
  min-height: calc(100vh - 142px);
}

.panel--kids {
  position: sticky;
  top: 1rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #5eb8a8);
  color: #0a1210;
  box-shadow: 0 8px 24px rgba(125, 211, 192, 0.25);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn--sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.kid-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.kid-row {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}

.kid-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--bg-soft);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border 0.15s ease, transform 0.15s ease;
  flex: 1;
}

.kid-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.kid-item--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(125, 211, 192, 0.25);
}

.kid-item__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--kid-avatar-color, #6c9cff) 70%, #ffffff 30%);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.kid-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kid-item__copy {
  flex: 1;
  display: grid;
  gap: 0.12rem;
}

.kid-item__copy strong {
  font-size: 0.92rem;
}

.kid-item__copy small {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.kid-item__delete {
  width: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.kid-item__delete:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.18);
}

.kid-form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.kid-form__head h3 {
  margin: 0;
  font-size: 0.96rem;
}

.kid-form__head p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.kid-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kid-form input[type="text"] {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.kid-form input[type="color"] {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.kid-avatar-editor {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.kid-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--kid-avatar-color, #6c9cff) 72%, #ffffff 28%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.kid-avatar-preview__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kid-avatar-preview__fallback {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
}

.kid-avatar-editor__controls {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.kid-avatar-upload {
  position: relative;
  overflow: hidden;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-actions--kid {
  justify-content: space-between;
}

.form-actions__main {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.btn--danger {
  background: linear-gradient(180deg, #fff6f3, #ffdcd2);
  color: #bf5d4d;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(213, 123, 94, 0.12);
}

.hidden {
  display: none !important;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kid-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 15% 20%, rgba(125, 211, 192, 0.12), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(9, 13, 19, 0.22));
}

.kid-profile-card__media {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.kid-profile-avatar {
  width: 86px;
  height: 86px;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--kid-avatar-color, #6c9cff) 72%, #ffffff 28%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 34px rgba(0, 0, 0, 0.25);
}

.kid-profile-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kid-profile-avatar__fallback {
  color: #fff;
  font-size: 1.9rem;
  font-weight: 800;
}

.kid-profile-copy__eyebrow {
  margin: 0 0 0.18rem;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.kid-profile-copy h2 {
  margin: 0;
  font-size: 1.3rem;
}

.kid-profile-copy p:last-child {
  margin: 0.24rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.score-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.score-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(251, 191, 36, 0.35);
  font-variant-numeric: tabular-nums;
}

.score-value.pop {
  animation: scorePop 0.45s ease;
}

@keyframes scorePop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.45;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: var(--bg-soft);
  border-radius: 12px;
  width: fit-content;
}

.tab {
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab--active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.task-groups {
  display: grid;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.task-group h3 {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.task-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.task-group__head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.task-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.task-chip:hover {
  border-color: rgba(125, 211, 192, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.task-chip:active {
  transform: scale(0.97);
}

.task-chip .pts {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
}

.task-chip--custom {
  border-color: rgba(125, 211, 192, 0.24);
  background: rgba(125, 211, 192, 0.08);
}

.custom-task-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 96px 72px auto;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.custom-task-form input {
  min-width: 0;
  padding: 0.6rem 0.72rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
}

.custom-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.custom-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.custom-task-item__text {
  font-size: 0.82rem;
  color: var(--text);
}

.custom-task-list__empty {
  padding: 0.7rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.log-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.activity-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.activity-log li {
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.activity-log li:last-child {
  border-bottom: none;
}

.activity-log .time {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.pet-intro {
  margin-bottom: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pet-intro p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 760px;
}

.pet-stage {
  min-height: 620px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 248, 235, 0.18), transparent 24%),
    radial-gradient(circle at 18% 20%, rgba(125, 211, 192, 0.18), transparent 30%),
    radial-gradient(circle at 82% 14%, rgba(167, 139, 250, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(38, 48, 66, 0.96), rgba(15, 20, 28, 0.98));
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pet-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 42% at 50% 100%, rgba(125, 211, 192, 0.16), transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.12) 100%);
  pointer-events: none;
}

.pet-stage::after {
  content: "";
  position: absolute;
  inset: auto 8% 18px;
  height: 72px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 72%);
  filter: blur(18px);
  pointer-events: none;
}

.pet-slots {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  padding: 1.2rem;
  min-height: 560px;
  align-items: stretch;
}

@media (max-width: 700px) {
  .pet-slots {
    grid-template-columns: 1fr;
  }
}

.pet-slot {
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
}

.pet-slot--empty {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.pet-card {
  width: 100%;
  cursor: pointer;
  user-select: none;
  perspective: 600px;
}

.pet-card__inner {
  position: relative;
  border-radius: 14px;
  padding: 1.15rem 0.95rem 0.95rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(145deg, color-mix(in srgb, var(--pet-tint, #2a3544) 78%, #ffffff 22%), #17202a 78%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  overflow: hidden;
}

.pet-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 12;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 20, 25, 0.65);
  backdrop-filter: blur(6px);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.pet-remove:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(80, 20, 30, 0.55);
}

.pet-remove:active {
  transform: scale(0.94);
}

.pet-card:hover .pet-card__inner {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.pet-card--bounce .pet-card__inner {
  animation: petBounce 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes petBounce {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-14px) rotate(-4deg) scale(1.03);
  }
  50% {
    transform: translateY(4px) rotate(3deg) scale(0.98);
  }
  75% {
    transform: translateY(-6px) rotate(-2deg) scale(1.02);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

.pet-viewport {
  display: block;
  width: 100%;
  height: 290px;
  min-height: 250px;
  margin: 0 auto;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 250, 240, 0.18), transparent 30%),
    radial-gradient(ellipse 76% 54% at 50% 85%, rgba(0, 0, 0, 0.38), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(8, 12, 18, 0.22));
  transform-origin: center bottom;
  border: 1px solid rgba(255, 255, 255, 0.08);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.pet-viewport--has-portrait {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 248, 234, 0.14), transparent 34%),
    radial-gradient(ellipse 60% 34% at 50% 84%, rgba(255, 241, 218, 0.16), transparent 68%),
    radial-gradient(ellipse 78% 58% at 50% 88%, rgba(0, 0, 0, 0.34), transparent 72%),
    linear-gradient(180deg, rgba(17, 23, 31, 0.16), rgba(8, 12, 18, 0.28));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -16px 28px rgba(0, 0, 0, 0.16);
}

.pet-viewport--has-portrait::before {
  content: "";
  position: absolute;
  inset: 10px 12px 18px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.08), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  pointer-events: none;
}

.pet-viewport canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  vertical-align: middle;
  outline: none;
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.pet-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 62%;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.94);
  transform-origin: center bottom;
  transition: opacity 0.32s ease, transform 0.32s ease, filter 0.32s ease;
  filter:
    drop-shadow(0 18px 24px rgba(0, 0, 0, 0.24))
    drop-shadow(0 0 12px rgba(255, 248, 234, 0.16));
  z-index: 1;
}

.pet-viewport--has-portrait .pet-portrait.is-ready {
  opacity: 0.98;
  transform: translateY(0) scale(1);
}

.pet-viewport--has-portrait canvas {
  opacity: 0.12;
  transform: scale(0.97);
  filter: blur(1.8px) saturate(0.9);
}

.pet-interaction-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
  z-index: 2;
}

.pet-video-overlay {
  object-fit: cover;
  filter: saturate(1.04) contrast(1.02);
}

.pet-gif-overlay {
  object-fit: contain;
  object-position: center 62%;
  filter:
    drop-shadow(0 18px 24px rgba(0, 0, 0, 0.24))
    drop-shadow(0 0 12px rgba(255, 248, 234, 0.16));
}

.pet-card--video-active .pet-interaction-overlay {
  opacity: 0;
  transform: scale(1);
}

.pet-card--video-active .pet-viewport::before {
  opacity: 0;
}

.pet-card--video-active .pet-viewport {
  background: rgba(8, 12, 18, 0.16);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  filter: none;
}

.pet-card--video-active .pet-portrait {
  opacity: 0.06;
  transform: scale(0.98);
  filter: blur(0);
}

.pet-card--video-active .pet-viewport canvas {
  opacity: 0;
  transform: scale(0.98);
  filter: blur(0);
}

.pet-card--video-active .pet-glow,
.pet-card--video-active .pet-aura {
  opacity: 0;
  animation: none;
}

.pet-card--bounce .pet-viewport {
  animation: emojiWiggle 0.65s ease;
}

@keyframes emojiWiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  20% {
    transform: rotate(-12deg) scale(1.08);
  }
  40% {
    transform: rotate(10deg) scale(1.05);
  }
  60% {
    transform: rotate(-6deg);
  }
}

.pet-name {
  margin: 0.85rem 0 0.2rem;
  font-size: 1.08rem;
  font-weight: 700;
  text-align: center;
}

.pet-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.pet-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.12), transparent 45%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pet-card:hover .pet-glow {
  opacity: 1;
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.pet-cinema {
  position: fixed;
  inset: 0;
  z-index: 1300;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.pet-cinema--active {
  opacity: 1;
  pointer-events: auto;
}

.pet-cinema__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(4, 8, 14, 0.86), rgba(3, 5, 10, 0.94));
  backdrop-filter: blur(18px);
}

.pet-cinema__backdrop,
.pet-cinema__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pet-cinema__backdrop {
  object-fit: cover;
  filter: blur(32px) saturate(1.08) brightness(0.45);
  transform: scale(1.08);
  opacity: 0.9;
}

.pet-cinema__media {
  object-fit: contain;
  object-position: center center;
  padding: 2rem;
  filter:
    drop-shadow(0 30px 80px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 28px rgba(255, 255, 255, 0.14));
}

.pet-cinema__caption {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 18, 0.38);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.pet-cinema__eyebrow {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(125, 211, 192, 0.88);
}

.pet-cinema__title {
  display: block;
  margin-top: 0.18rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.96);
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 4px var(--accent);
  animation: sparkleFly 0.9s ease forwards;
  opacity: 0;
}

@keyframes sparkleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.4);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(1.2);
  }
}

.heart-pop {
  position: absolute;
  font-size: 1.4rem;
  animation: heartRise 1s ease forwards;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes heartRise {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.2);
  }
}

.ring-burst {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0.9;
  animation: ringExpand 0.75s ease-out forwards;
}

@keyframes ringExpand {
  0% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.3);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
  }
}

.ring-burst--mega {
  width: 200px;
  height: 200px;
  border-width: 4px;
  animation: ringExpandMega 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  mix-blend-mode: screen;
}

.ring-burst--task {
  width: 96px;
  height: 96px;
  border-width: 4px;
  border-color: rgba(255, 206, 96, 0.9);
  animation-duration: 0.82s;
}

@keyframes ringExpandMega {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.15);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.8);
    filter: blur(1px);
  }
}

.fx-vignette-pulse {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 45%,
    hsla(var(--vhue, 180), 85%, 60%, 0.22) 0%,
    transparent 42%
  );
  animation: vignettePulse 0.85s ease-out forwards;
  mix-blend-mode: screen;
  z-index: 999;
}

@keyframes vignettePulse {
  0% {
    opacity: 0;
    transform: scale(1.1);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.fx-nova {
  position: absolute;
  width: 280px;
  height: 280px;
  margin-left: -140px;
  margin-top: -140px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    hsla(var(--nhue, 200), 95%, 72%, 0.55) 0%,
    hsla(var(--nhue, 200), 80%, 55%, 0.15) 35%,
    transparent 65%
  );
  animation: novaPop 1s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  mix-blend-mode: screen;
  filter: blur(2px);
}

@keyframes novaPop {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-8deg);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.35) rotate(8deg);
  }
}

.fx-beam {
  position: absolute;
  width: 4px;
  height: 140px;
  margin-left: -2px;
  margin-top: -70px;
  background: linear-gradient(
    180deg,
    hsla(280, 90%, 75%, 0.9),
    transparent
  );
  transform-origin: 50% 100%;
  animation: beamSweep 0.75s ease-out forwards;
  mix-blend-mode: screen;
  filter: blur(1px);
}

@keyframes beamSweep {
  0% {
    opacity: 0;
    transform: rotate(0deg) scaleY(0.2);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(0deg) scaleY(1.4);
  }
}

.fx-action-caption {
  position: absolute;
  z-index: 1001;
  transform: translate(-50%, -100%);
  text-align: center;
  pointer-events: none;
  animation: captionFloat 1.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-action-caption__main {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 0 24px rgba(125, 211, 192, 0.8), 0 4px 16px rgba(0, 0, 0, 0.5);
  background: linear-gradient(90deg, #fff, #a5f3fc, #e9d5ff);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.fx-action-caption__sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

@keyframes captionFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.85);
    filter: blur(4px);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -108%) scale(1.05);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -160%) scale(1);
  }
}

.fx-reward-tip {
  position: absolute;
  z-index: 1002;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 14px 24px rgba(118, 82, 35, 0.14);
  transform: translate(-50%, -30%);
  animation: rewardTipFloat 1.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-reward-tip--score {
  background: linear-gradient(180deg, rgba(255, 250, 234, 0.98), rgba(255, 228, 164, 0.96));
  color: #b16e18;
}

.fx-reward-tip--exp {
  background: linear-gradient(180deg, rgba(246, 255, 238, 0.98), rgba(202, 242, 170, 0.96));
  color: #4f8a2e;
}

@keyframes rewardTipFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -12%) scale(0.78);
    filter: blur(4px);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -48%) scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -148%) scale(1);
  }
}

.heart-pop--burst {
  font-size: 1.55rem;
  animation: heartBurstOut 1.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes heartBurstOut {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.35) rotate(-18deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--drift-x, 0), var(--drift-y, -90px)) scale(1.15) rotate(12deg);
  }
}

.sparkle--fat {
  width: 12px;
  height: 12px;
  animation-duration: 1.05s;
}

.sparkle--reward {
  width: 9px;
  height: 9px;
  background: radial-gradient(circle, #fffdf6 0%, #ffd56a 55%, #ff9e4a 100%);
  box-shadow: 0 0 12px 3px rgba(255, 201, 94, 0.55);
}

.pet-aura {
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.06),
    transparent,
    rgba(167, 139, 250, 0.12),
    transparent,
    rgba(125, 211, 192, 0.1),
    transparent
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.pet-card:hover .pet-aura,
.pet-card--animating .pet-aura {
  opacity: 1;
  animation: auraSpin 2.8s linear infinite;
}

@keyframes auraSpin {
  to {
    transform: rotate(360deg);
  }
}

.pet-card--animating {
  pointer-events: none;
}

.pet-card--pat .pet-card__inner {
  animation: petActPat var(--pet-act-dur, 1.15s) cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 0 1px rgba(249, 168, 212, 0.35), 0 18px 48px rgba(249, 168, 212, 0.15);
}

.pet-card--pat .pet-viewport {
  animation: emojiPat var(--pet-act-dur, 1.15s) ease;
}

@keyframes petActPat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  20% {
    transform: translateY(-8px) rotate(-3deg) scale(1.04);
  }
  45% {
    transform: translateY(2px) rotate(2deg) scale(0.99);
  }
  70% {
    transform: translateY(-5px) rotate(-2deg) scale(1.02);
  }
}

@keyframes emojiPat {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-10deg) scale(1.12);
  }
  50% {
    transform: rotate(8deg) scale(1.08);
  }
  75% {
    transform: rotate(-5deg) scale(1.1);
  }
}

.pet-card--feed .pet-card__inner {
  animation: petActFeed var(--pet-act-dur, 1.25s) cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.4), 0 18px 48px rgba(251, 146, 60, 0.2);
}

.pet-card--feed .pet-viewport {
  animation: emojiFeed var(--pet-act-dur, 1.25s) ease;
}

@keyframes petActFeed {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  15% {
    transform: translateY(-22px) scale(1.06, 0.94);
  }
  35% {
    transform: translateY(4px) scale(0.96, 1.05);
  }
  55% {
    transform: translateY(-12px) scale(1.04);
  }
  75% {
    transform: translateY(2px) scale(0.99);
  }
}

@keyframes emojiFeed {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  30% {
    transform: rotate(-6deg) translateY(-4px) scale(1.15);
  }
  60% {
    transform: rotate(5deg) translateY(2px) scale(1.08);
  }
}

.pet-card--play .pet-card__inner {
  animation: petActPlay var(--pet-act-dur, 1.1s) cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45), 0 18px 48px rgba(56, 189, 248, 0.18);
}

.pet-card--play .pet-viewport {
  animation: emojiPlay var(--pet-act-dur, 1.1s) ease-in-out;
}

@keyframes petActPlay {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  12% {
    transform: translateX(-10px) rotate(-5deg) scale(1.03);
  }
  28% {
    transform: translateX(12px) rotate(6deg) scale(1.05);
  }
  44% {
    transform: translateX(-8px) rotate(-4deg);
  }
  60% {
    transform: translateX(10px) rotate(4deg) scale(1.02);
  }
  78% {
    transform: translateX(-4px) rotate(-2deg);
  }
}

@keyframes emojiPlay {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(-18deg) translateY(-6px) scale(1.12);
  }
  50% {
    transform: rotate(16deg) translateY(4px) scale(1.1);
  }
  75% {
    transform: rotate(-10deg) translateY(-3px);
  }
}

.pet-card--dance .pet-card__inner {
  animation: petActDance var(--pet-act-dur, 1.45s) cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.5), 0 22px 56px rgba(192, 132, 252, 0.25);
}

.pet-card--dance .pet-viewport {
  animation: emojiDance var(--pet-act-dur, 1.45s) ease-in-out;
}

@keyframes petActDance {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  15% {
    transform: rotate(-8deg) scale(1.05) translateY(-6px);
  }
  35% {
    transform: rotate(12deg) scale(1.06) translateY(-10px);
  }
  55% {
    transform: rotate(-10deg) scale(1.04) translateY(-4px);
  }
  75% {
    transform: rotate(14deg) scale(1.07) translateY(-12px);
  }
}

@keyframes emojiDance {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  20% {
    transform: rotate(-25deg) scale(1.18) translateY(-8px);
  }
  40% {
    transform: rotate(22deg) scale(1.14) translateY(-4px);
  }
  60% {
    transform: rotate(-18deg) scale(1.16) translateY(-10px);
  }
  80% {
    transform: rotate(12deg) scale(1.1);
  }
}

.pet-stage--shake {
  animation: stageShake 0.52s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes stageShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  15% {
    transform: translate(-3px, 2px) rotate(-0.5deg);
  }
  30% {
    transform: translate(4px, -2px) rotate(0.6deg);
  }
  45% {
    transform: translate(-3px, -3px) rotate(-0.4deg);
  }
  60% {
    transform: translate(3px, 2px) rotate(0.3deg);
  }
}

.app--shake {
  animation: appShake 0.42s ease-out;
}

@keyframes appShake {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(-2px, 1px, 0);
  }
  50% {
    transform: translate3d(3px, -1px, 0);
  }
  75% {
    transform: translate3d(-1px, -2px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-vignette-pulse,
  .fx-nova,
  .fx-beam,
  .ring-burst--mega,
  .heart-pop--burst,
  .sparkle--fat,
  .pet-card--pat .pet-card__inner,
  .pet-card--feed .pet-card__inner,
  .pet-card--play .pet-card__inner,
  .pet-card--dance .pet-card__inner,
  .pet-card--pat .pet-viewport,
  .pet-card--feed .pet-viewport,
  .pet-card--play .pet-viewport,
  .pet-card--dance .pet-viewport,
  .pet-stage--shake,
  .app--shake,
  .fx-action-caption,
  .pet-cinema {
    animation: none !important;
    opacity: 0.85;
  }
}

@media (max-width: 960px) {
  .app {
    max-width: none;
  }

  .panel--main {
    min-height: auto;
  }

  .kid-profile-card {
    flex-wrap: wrap;
  }

  .pet-stage {
    min-height: 0;
  }

  .pet-viewport {
    height: 240px;
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 0.85rem;
  }

  .panel {
    padding: 0.9rem;
  }

  .pet-stage {
    border-radius: 18px;
  }

  .kid-avatar-editor,
  .kid-profile-card__media {
    align-items: flex-start;
  }

  .custom-task-form {
    grid-template-columns: 1fr 92px;
  }

  .pet-slots {
    padding: 0.85rem;
  }

  .pet-viewport {
    height: 220px;
    min-height: 200px;
  }

  .pet-cinema__media {
    padding: 1rem;
  }

  .pet-cinema__caption {
    bottom: 1rem;
    width: calc(100% - 1.5rem);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.modal__card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  overflow: hidden auto;
}

.modal__card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.modal__sub {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.modal__card--announcement {
  width: min(560px, 100%);
  max-height: min(76vh, 640px);
}

.announcement-popup__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.announcement-popup__content {
  margin: 1rem 0 1.15rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
}

.announcement-popup__optout {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  cursor: pointer;
}

.announcement-popup__optout input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.announcement-popup__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.2rem;
}

.modal__card--feedback {
  width: min(560px, 100%);
}

.feedback-modal__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.feedback-field {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.9rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.feedback-field select,
.feedback-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  outline: none;
}

.feedback-field select {
  padding: 0.72rem 0.85rem;
}

.feedback-field textarea {
  min-height: 150px;
  padding: 0.85rem;
  resize: vertical;
  line-height: 1.7;
}

.feedback-status {
  margin: 0.85rem 0 0;
  color: #b3f5de;
  font-size: 0.86rem;
}

.feedback-status--error {
  color: #ffb4b4;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.adopt-options {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.adopt-group {
  padding: 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.adopt-group__head {
  margin-bottom: 0.75rem;
}

.adopt-group__head strong {
  font-size: 0.96rem;
}

.adopt-group__head p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.adopt-group__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}

.adopt-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border 0.15s ease, transform 0.15s ease;
  position: relative;
  text-align: center;
}

.adopt-opt:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.adopt-opt:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

.adopt-opt--common {
  border-color: rgba(125, 211, 192, 0.25);
}

.adopt-opt--rare {
  border-color: rgba(251, 191, 36, 0.25);
}

.adopt-opt--epic {
  border-color: rgba(244, 114, 182, 0.25);
}

.adopt-opt__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}

.adopt-opt .emoji {
  font-size: 2.25rem;
}

.adopt-opt .lbl {
  font-size: 0.85rem;
  font-weight: 600;
}

.adopt-opt__meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  z-index: 1100;
  opacity: 0;
  animation: toastIn 0.35s ease forwards;
}

@keyframes toastIn {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast--err {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

/* Product UI Refresh */
:root {
  --bg: #f6efe7;
  --bg-elevated: rgba(255, 251, 246, 0.84);
  --bg-soft: #fff8f1;
  --border: rgba(117, 89, 54, 0.12);
  --text: #2b2118;
  --text-muted: #7f6f61;
  --accent: #44c8b1;
  --accent-2: #ff9e80;
  --gold: #f6a84d;
  --danger: #ef6b6b;
  --shadow: 0 24px 60px rgba(154, 113, 64, 0.12);
}

html,
body {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(255, 209, 174, 0.34), transparent 56%),
    radial-gradient(720px 420px at 100% 0%, rgba(68, 200, 177, 0.18), transparent 48%),
    radial-gradient(960px 600px at 50% 100%, rgba(255, 179, 119, 0.14), transparent 60%),
    linear-gradient(180deg, #fff9f3 0%, #f7efe6 100%);
  color: var(--text);
}

body {
  padding: 1.1rem;
}

.app {
  position: relative;
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
  opacity: 0.35;
}

.top-bar {
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 247, 240, 0.78)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 40px rgba(124, 88, 46, 0.08);
  backdrop-filter: blur(20px);
}

.brand-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  background: linear-gradient(135deg, rgba(68, 200, 177, 0.16), rgba(255, 179, 119, 0.2));
  filter: none;
}

.brand h1 {
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.tagline {
  margin-top: 0.2rem;
  font-size: 0.88rem;
}

.pill {
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(110, 82, 48, 0.08);
}

.btn {
  border-radius: 14px;
}

.btn--primary {
  background: linear-gradient(135deg, #48d5bc 0%, #ffae6d 100%);
  color: #2d2319;
  box-shadow: 0 16px 30px rgba(255, 158, 128, 0.22);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.58);
  color: #6e5b49;
  border-color: rgba(117, 89, 54, 0.12);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 249, 242, 0.7)),
    rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 28px 70px rgba(149, 107, 61, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px);
}

.panel--kids {
  background:
    linear-gradient(180deg, rgba(255, 251, 247, 0.92), rgba(255, 244, 234, 0.84)),
    rgba(255, 255, 255, 0.82);
}

.panel--main {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 198, 157, 0.18), transparent 26%),
    radial-gradient(circle at 0% 14%, rgba(68, 200, 177, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255, 251, 247, 0.9), rgba(255, 247, 240, 0.86));
}

.panel-head {
  margin-bottom: 1rem;
}

.panel-head h2 {
  color: #8a7157;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
}

.kid-list {
  gap: 0.6rem;
}

.kid-item {
  padding: 0.75rem 0.8rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(126, 94, 55, 0.08);
  box-shadow: 0 10px 24px rgba(134, 98, 54, 0.06);
}

.kid-item:hover {
  transform: translateY(-1px);
  border-color: rgba(68, 200, 177, 0.24);
}

.kid-item--active {
  border-color: rgba(68, 200, 177, 0.42);
  background: linear-gradient(135deg, rgba(68, 200, 177, 0.14), rgba(255, 255, 255, 0.86));
  box-shadow:
    0 16px 34px rgba(68, 200, 177, 0.12),
    0 0 0 1px rgba(68, 200, 177, 0.12);
}

.kid-item__avatar,
.kid-profile-avatar,
.kid-avatar-preview {
  border: 3px solid rgba(255, 255, 255, 0.72);
}

.kid-profile-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 186, 140, 0.24), transparent 32%),
    radial-gradient(circle at 0% 100%, rgba(68, 200, 177, 0.18), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 249, 242, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 50px rgba(146, 104, 56, 0.1);
}

.kid-profile-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -55px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 175, 120, 0.18), transparent 70%);
  pointer-events: none;
}

.kid-profile-copy h2 {
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.score-row {
  align-items: stretch;
  gap: 1rem;
}

.score-card {
  min-width: 220px;
  padding: 1rem 1.15rem;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 190, 120, 0.2), rgba(255, 255, 255, 0.9)),
    rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 36px rgba(150, 103, 49, 0.08);
}

.score-label {
  color: #9c805f;
}

.score-value {
  font-size: 3rem;
  letter-spacing: -0.04em;
  text-shadow: none;
}

.hint {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(117, 89, 54, 0.08);
  max-width: none;
  flex: 1;
}

.tabs {
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(117, 89, 54, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.tab {
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
}

.tab--active {
  background: linear-gradient(135deg, rgba(68, 200, 177, 0.18), rgba(255, 174, 109, 0.18));
  box-shadow: none;
  color: #372b20;
}

#panelTasks {
  display: grid;
  gap: 1rem;
}

.task-groups {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.task-group,
.log-section {
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(117, 89, 54, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 32px rgba(140, 98, 49, 0.06);
}

.task-group h3,
.log-section h3 {
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
  color: #8d7258;
}

.task-chip {
  padding: 0.65rem 0.9rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 232, 0.84));
  border: 1px solid rgba(117, 89, 54, 0.08);
  box-shadow: 0 10px 20px rgba(125, 84, 39, 0.05);
}

.task-chip:hover {
  border-color: rgba(68, 200, 177, 0.26);
  transform: translateY(-1px);
}

.activity-log {
  max-height: 320px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.activity-log li {
  padding: 0.78rem 0.9rem;
}

.pet-intro {
  padding: 1rem 1.15rem;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 246, 236, 0.76));
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: 0 16px 34px rgba(140, 98, 49, 0.06);
}

.pet-stage {
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.74), transparent 20%),
    radial-gradient(circle at 12% 20%, rgba(68, 200, 177, 0.14), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(255, 181, 120, 0.18), transparent 24%),
    linear-gradient(180deg, #fffaf5 0%, #fdf5eb 45%, #f8ecdf 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 26px 60px rgba(146, 104, 56, 0.1);
}

.pet-stage::before {
  background:
    radial-gradient(ellipse 80% 42% at 50% 100%, rgba(255, 179, 119, 0.18), transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.14) 100%);
}

.pet-stage::after {
  background: radial-gradient(circle, rgba(255, 198, 139, 0.28), transparent 72%);
}

.pet-card__inner {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 246, 235, 0.84)),
    rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 18px 40px rgba(146, 104, 56, 0.09);
}

.pet-card:hover .pet-card__inner {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 24px 48px rgba(146, 104, 56, 0.14);
}

.pet-viewport {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.78), transparent 28%),
    radial-gradient(ellipse 70% 44% at 50% 90%, rgba(255, 192, 137, 0.24), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 246, 235, 0.2));
  border-color: rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0 16px 30px rgba(146, 104, 56, 0.12));
}

.pet-viewport--has-portrait {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.9), transparent 30%),
    radial-gradient(ellipse 66% 38% at 50% 86%, rgba(255, 186, 130, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 247, 238, 0.22));
}

.pet-name {
  color: #31261b;
}

.pet-meta {
  color: #8b7766;
}

.pet-remove {
  background: rgba(255, 255, 255, 0.74);
  color: #8c7969;
  border-color: rgba(117, 89, 54, 0.08);
}

.pet-remove:hover {
  background: rgba(255, 239, 239, 0.96);
}

.pet-cinema__scrim {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(33, 22, 12, 0.76), rgba(20, 14, 11, 0.94));
}

.pet-cinema__caption {
  background: rgba(40, 26, 19, 0.42);
  border-color: rgba(255, 255, 255, 0.18);
}

.modal__card {
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(255, 246, 237, 0.88)),
    rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 30px 80px rgba(90, 61, 29, 0.16);
}

.modal__card h2 {
  color: #34281d;
  font-size: 1.28rem;
}

.modal__sub {
  font-size: 0.92rem;
}

.adopt-group {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 247, 239, 0.72));
}

.adopt-opt {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 242, 0.86));
  border-width: 1.5px;
}

.adopt-opt:hover:not(:disabled) {
  box-shadow: 0 18px 30px rgba(129, 92, 48, 0.1);
}

.adopt-opt .lbl {
  color: #31261b;
}

.toast {
  background: rgba(49, 37, 27, 0.9);
  color: #fff8f1;
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1080px) {
  .task-groups {
    grid-template-columns: 1fr;
  }

  .score-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  .top-bar {
    padding: 0.9rem;
    border-radius: 22px;
  }

  .brand {
    width: 100%;
  }

  .brand-logo {
    width: min(320px, 100%);
  }

  .brand h1 {
    font-size: 1.42rem;
  }

  .kid-row {
    gap: 0.35rem;
  }

  .kid-item__delete {
    width: 38px;
  }
}

/* Child-first Product Theme */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(circle at 15% 16%, rgba(255, 255, 255, 0.96) 0 42px, transparent 44px),
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.9) 0 30px, transparent 32px),
    radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.95) 0 36px, transparent 38px),
    radial-gradient(circle at 72% 14%, rgba(255, 255, 255, 0.95) 0 38px, transparent 40px),
    radial-gradient(circle at 79% 16%, rgba(255, 255, 255, 0.92) 0 28px, transparent 30px),
    radial-gradient(circle at 86% 14%, rgba(255, 255, 255, 0.96) 0 34px, transparent 36px);
  opacity: 0.58;
}

body::after {
  background:
    radial-gradient(ellipse 120% 34% at 50% 100%, rgba(157, 221, 120, 0.36), transparent 48%),
    linear-gradient(180deg, rgba(141, 218, 255, 0) 58%, rgba(192, 237, 153, 0.42) 100%);
}

.top-bar {
  align-items: flex-start;
  padding: 1.1rem 1.25rem 0.95rem;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.92), rgba(255, 246, 230, 0.86)),
    rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(255, 246, 220, 0.86);
}

.brand {
  flex: 1;
}

.brand-logo {
  width: min(460px, 58vw);
  filter: drop-shadow(0 18px 30px rgba(154, 104, 35, 0.16));
}

.header-meta {
  padding: 0.55rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(155, 123, 76, 0.08);
}

.layout {
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 1.25rem;
}

.panel--kids {
  border-radius: 28px;
}

.panel--main {
  border-radius: 30px;
  padding: 1.15rem 1.25rem 1.3rem;
}

.kid-profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr) auto;
  align-items: center;
  gap: 1rem;
  border-radius: 28px;
  padding: 1.15rem 1.2rem;
  background:
    radial-gradient(circle at 0% 100%, rgba(152, 225, 123, 0.16), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(255, 191, 122, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(255, 246, 229, 0.92));
}

.kid-profile-card__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.kid-profile-card__media {
  gap: 1rem;
}

.kid-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 30px;
}

.kid-profile-copy__eyebrow {
  color: #ff9b4b;
  letter-spacing: 0.14em;
}

.kid-profile-copy h2 {
  font-size: 2rem;
}

.kid-profile-copy p:last-child {
  max-width: 420px;
}

.kid-profile-stats {
  display: grid;
  gap: 0.55rem;
  justify-items: end;
}

.kid-level-pill,
.kid-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  color: #6a4c1f;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.kid-level-pill {
  background: linear-gradient(135deg, #ffb54f, #ff8d53);
  color: #fffaf1;
}

.kid-score-badge {
  background: linear-gradient(135deg, #fff2b7, #ffd36f);
}

.kid-score-badge strong {
  font-size: 1.15rem;
}

.kid-progress-card {
  padding: 0.9rem 1rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 251, 244, 0.82));
  border: 1px solid rgba(255, 222, 171, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.kid-progress-card__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
}

.kid-progress-track {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(191, 161, 103, 0.22), rgba(194, 162, 107, 0.34));
  padding: 2px;
  overflow: hidden;
}

.kid-progress-track__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7bdd56 0%, #44ca68 60%, #ffd84e 100%);
  box-shadow: 0 0 12px rgba(123, 221, 86, 0.34);
}

.kid-progress-card__hint {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.kid-profile-card__actions {
  align-self: start;
}

.score-card {
  border-radius: 24px;
  min-width: 240px;
}

.task-groups {
  grid-template-columns: 1fr;
}

.task-group {
  position: relative;
  overflow: hidden;
  padding: 1rem 1rem 1.05rem;
}

.task-group::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 60px;
  background: linear-gradient(90deg, rgba(122, 212, 86, 0.92), rgba(139, 222, 92, 0.86));
  opacity: 0.92;
}

.task-group:nth-child(2)::before {
  background: linear-gradient(90deg, rgba(255, 192, 90, 0.92), rgba(255, 166, 82, 0.88));
}

.task-group:nth-child(3)::before {
  background: linear-gradient(90deg, rgba(135, 213, 255, 0.92), rgba(103, 183, 255, 0.88));
}

.task-group > * {
  position: relative;
  z-index: 1;
}

.task-group h3 {
  margin: 0 0 1rem;
  padding-top: 0.05rem;
  color: #fffef9;
  font-size: 1rem;
  text-shadow: 0 2px 10px rgba(60, 40, 18, 0.18);
}

.task-group__head {
  margin-bottom: 1rem;
}

.task-group__head p {
  color: rgba(255, 255, 255, 0.88);
}

.task-chips {
  display: grid;
  gap: 0.75rem;
}

.task-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border-radius: 20px;
}

.task-chip__main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.task-chip__emoji {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: linear-gradient(135deg, rgba(255, 241, 202, 0.92), rgba(255, 226, 163, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.task-chip__label {
  font-size: 1rem;
  font-weight: 700;
  color: #32261b;
}

.task-chip__reward {
  font-size: 1rem;
  font-weight: 800;
  color: #6dbc2f;
}

.task-chip__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 0.62rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #6edc50, #39b948);
  color: #fffef9;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(57, 185, 72, 0.18);
}

.task-chip--custom .task-chip__cta {
  background: linear-gradient(135deg, #4fd3ff, #4fb6ff);
}

.pet-intro {
  border-radius: 24px;
}

.pet-stage {
  border-radius: 28px;
}

.pet-slots {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pet-card__inner {
  border-radius: 24px;
}

.pet-name {
  font-size: 1.16rem;
}

.modal__card {
  border-radius: 32px;
}

@media (max-width: 1080px) {
  .kid-profile-card {
    grid-template-columns: 1fr;
  }

  .kid-profile-card__hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .kid-profile-stats {
    justify-items: start;
  }
}

@media (max-width: 700px) {
  .brand-logo {
    width: min(300px, 100%);
  }

  .kid-profile-copy h2 {
    font-size: 1.58rem;
  }

  .task-chip {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .task-chip__cta {
    width: 100%;
  }
}

/* Reference UI Refresh */
:root {
  --bg: #a8da7f;
  --bg-elevated: #fffaf0;
  --bg-soft: #fff5da;
  --border: rgba(176, 139, 74, 0.16);
  --text: #5d4037;
  --text-muted: #9a7b5f;
  --accent: #6dc34f;
  --accent-2: #ff9f43;
  --gold: #ffb300;
  --danger: #ef6c63;
  --shadow: 0 28px 64px rgba(137, 99, 42, 0.16);
}

html,
body {
  background:
    radial-gradient(520px 220px at 14% 8%, rgba(255, 255, 255, 0.72), transparent 70%),
    radial-gradient(420px 240px at 88% 10%, rgba(255, 245, 194, 0.55), transparent 68%),
    linear-gradient(180deg, #c9f0ff 0%, #c8f1bf 18%, #a7db79 42%, #98cb67 100%);
  color: var(--text);
}

body {
  padding: 1rem;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  left: -3rem;
  bottom: -4rem;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.48), transparent 70%);
  filter: blur(12px);
}

body::after {
  right: 1rem;
  top: 1rem;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 177, 0.55), transparent 72%);
  filter: blur(16px);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1420px;
}

.top-bar {
  margin-bottom: 1rem;
  padding: 0.7rem 0.2rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  padding: 0.85rem 1.15rem;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 252, 243, 0.96), rgba(255, 244, 214, 0.92));
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(141, 106, 56, 0.14);
}

.brand-copy {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-icon {
  width: 4.3rem;
  height: 4.3rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 1.55rem;
  background: linear-gradient(180deg, #fffefb, #ffe8ac);
  border: 4px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 10px 24px rgba(255, 189, 86, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.76);
  font-size: 2rem;
}

.brand-icon__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  color: #2f7c34;
  line-height: 1.08;
}

.tagline {
  margin: 0.28rem 0 0;
  color: #b9751f;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.brand-logo,
.kid-item__avatar img,
.kid-profile-avatar__image,
.kid-avatar-preview__image,
.pet-cinema__backdrop,
.pet-cinema__media {
  display: block;
}

.brand-logo {
  width: auto;
  max-width: min(430px, 52vw);
  max-height: 86px;
  height: auto;
  object-fit: contain;
}

.pill {
  background: linear-gradient(180deg, #fffefc, #fff1d2);
  border: 2px solid rgba(255, 255, 255, 0.92);
  color: #8f6f4c;
  box-shadow: 0 10px 24px rgba(155, 126, 84, 0.12);
}

.header-meta {
  justify-content: flex-end;
  gap: 0.75rem;
}

.layout {
  grid-template-columns: minmax(250px, 280px) minmax(0, 1fr);
  gap: 1rem;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 251, 243, 0.96), rgba(255, 245, 226, 0.94));
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 34px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.panel--main {
  min-height: calc(100vh - 132px);
  padding: 1.2rem;
}

.panel--kids {
  top: 0.75rem;
  padding: 1rem;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.72), transparent 32%),
    linear-gradient(180deg, rgba(255, 252, 241, 0.95), rgba(244, 255, 228, 0.92));
}

.panel-head {
  margin-bottom: 0.9rem;
}

.panel-head h2 {
  font-size: 1.1rem;
  color: #418a33;
  letter-spacing: 0.02em;
  text-transform: none;
}

.btn {
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.btn--primary {
  background: linear-gradient(180deg, #86d85c, #41b346);
  color: #fffef9;
  box-shadow: 0 10px 0 #3b9536, 0 16px 24px rgba(60, 161, 60, 0.16);
}

.btn--primary:hover {
  filter: brightness(1.02);
}

.btn--ghost {
  background: linear-gradient(180deg, #fffdf8, #fff1cf);
  color: #8f714b;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(183, 150, 78, 0.12);
}

.kid-list {
  gap: 0.65rem;
}

.kid-row {
  gap: 0.55rem;
}

.kid-item {
  padding: 0.8rem 0.9rem;
  min-height: 68px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: linear-gradient(180deg, #fff8dc, #ffe88d);
  box-shadow: 0 8px 18px rgba(191, 151, 75, 0.12);
}

.kid-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.98);
}

.kid-item--active {
  background: linear-gradient(180deg, #8ae36d, #53bf4e);
  color: #fffef8;
  box-shadow: 0 10px 0 #42963b, 0 18px 26px rgba(70, 155, 66, 0.18);
}

.kid-item--active .kid-item__copy small {
  color: rgba(255, 255, 255, 0.88);
}

.kid-item__avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.kid-item__copy strong {
  font-size: 1rem;
  line-height: 1.1;
}

.kid-item__copy small {
  color: #987452;
  font-weight: 700;
  line-height: 1.2;
}

.kid-item__delete {
  width: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: linear-gradient(180deg, #fff7f0, #ffe0d7);
  color: #d46b57;
  box-shadow: 0 8px 18px rgba(213, 123, 94, 0.12);
}

.kid-form {
  margin-top: 1rem;
  padding: 1rem;
  border-top: none;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
}

.kid-form__head p,
.kid-form label,
.kid-form input::placeholder {
  color: #9c7b57;
}

.kid-form input[type="text"],
.custom-task-form input {
  background: #fffdfa;
  border: 2px solid rgba(236, 211, 163, 0.7);
  color: #694d35;
}

.main-content {
  display: grid;
  /* PC: left col = companion+pets  |  right col = tasks+log */
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

/* Full-width rows */
.kid-profile-card,
.score-row {
  grid-column: 1 / -1;
}

/* Hide the tab bar on desktop – panels always visible */
.tabs {
  display: none;
}

/* Left column: companion cards + pets */
.companion-dashboard {
  grid-column: 1;
}

#panelPets {
  grid-column: 1;
  display: block !important;
  margin: 0;
  min-width: 0;
}

/* Right column: tasks + activity log — spans from row 3 downward */
#panelTasks {
  grid-column: 2;
  grid-row: 3 / span 20;
  display: block !important;
  margin: 0;
  min-width: 0;
}

/* Tabs div also in col1 (mobile only, hidden on PC) */
.tabs {
  grid-column: 1;
  display: none;
}

/* pet-stage: remove min-height on PC so it doesn't create extra whitespace */
@media (min-width: 881px) {
  .pet-slots {
    min-height: 0;
  }
}

.kid-profile-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1.35rem;
  border-radius: 36px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.58), transparent 26%),
    linear-gradient(180deg, #fff6d4 0%, #ffe49a 100%);
  box-shadow: 0 20px 48px rgba(205, 156, 54, 0.16);
}

.kid-profile-card::after {
  content: "";
  position: absolute;
  right: -2rem;
  top: -2rem;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45), transparent 70%);
}

.kid-profile-card__hero {
  align-items: center;
}

.kid-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 30px;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 30px rgba(198, 134, 58, 0.18);
}

.kid-profile-copy__eyebrow {
  color: #f39a29;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.kid-profile-copy h2 {
  font-size: 2rem;
  color: #5f4332;
  line-height: 1.08;
}

.kid-profile-copy__title {
  display: inline-flex;
  align-items: center;
  max-width: fit-content;
  margin: 0.45rem 0 0;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 251, 239, 0.96), rgba(248, 232, 184, 0.94));
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #976120;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(195, 145, 54, 0.12);
}

.kid-profile-copy p:last-child {
  color: #8c6f54;
  font-size: 0.94rem;
  max-width: 46rem;
  line-height: 1.45;
}

.kid-profile-stats {
  display: grid;
  justify-items: end;
  gap: 0.65rem;
}

.kid-level-pill,
.kid-score-badge {
  min-width: 110px;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 18px rgba(188, 134, 46, 0.12);
}

.kid-level-pill {
  background: linear-gradient(180deg, #ffbe5a, #f08a1c);
  color: #fffef7;
  min-width: 88px;
  justify-content: center;
  white-space: nowrap;
}

.kid-score-badge {
  background: linear-gradient(180deg, #fff4bf, #ffd55f);
  color: #6d4d22;
}

.kid-score-badge strong {
  color: #7c560d;
  font-size: 1.2rem;
}

.kid-score-badge span {
  white-space: nowrap;
}

.kid-progress-card {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 28px;
  background: rgba(255, 252, 244, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.kid-progress-card__row {
  color: #7c5f41;
  font-size: 0.98rem;
}

.kid-progress-track {
  height: 22px;
  background: linear-gradient(180deg, #d5c08e, #c3a55e);
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.kid-progress-track__fill {
  background: linear-gradient(90deg, #79d85f, #3fbb48);
}

.kid-progress-card__hint {
  color: #8d6e55;
  font-weight: 700;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  align-items: stretch;
  gap: 1rem;
}

.score-card {
  padding: 1rem 1.2rem;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffdfa, #fff0ce);
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 30px rgba(176, 136, 72, 0.12);
}

.score-label {
  color: #9b7651;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 800;
}

.score-value {
  color: #ff9800;
  text-shadow: none;
}

.hint {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 1rem 1.2rem;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 246, 221, 0.9));
  border: 3px solid rgba(255, 255, 255, 0.92);
  color: #88684d;
  max-width: none;
  box-shadow: 0 14px 28px rgba(169, 132, 71, 0.1);
}

.task-groups {
  gap: 1rem;
  margin-bottom: 0;
}

.task-group,
.log-section,
.pet-intro,
.pet-stage {
  position: relative;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 246, 228, 0.92));
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 30px rgba(156, 120, 59, 0.1);
}

.task-group {
  padding: 1.1rem;
}

.task-group::before {
  content: none;
}

.task-group > * {
  position: relative;
  z-index: 1;
}

.task-group h3 {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  margin: 0 0 0.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  color: #fffef8;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1;
}

.task-group:nth-child(1) h3 {
  background: linear-gradient(180deg, #77d85b, #43ac43);
  box-shadow: 0 8px 0 #36963b;
}

.task-group:nth-child(2) h3 {
  background: linear-gradient(180deg, #ffc046, #ff9714);
  box-shadow: 0 8px 0 #df7e00;
}

.task-group:nth-child(3) h3 {
  background: linear-gradient(180deg, #67cdf9, #399bf0);
  box-shadow: 0 8px 0 #297fcb;
}

.log-section h3 {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  margin: 0 0 0.9rem;
  padding: 0 1rem;
  border-radius: 999px;
  color: #fffef8;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #ffb95c, #f28c1d);
  box-shadow: 0 8px 0 #d87a14;
}

.task-group__head {
  display: block;
  margin-bottom: 0.75rem;
}

.task-group__head p {
  margin: 0;
  color: #9d7d5d;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.task-chips {
  display: grid;
  gap: 0.85rem;
}

.task-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 92px;
  padding: 0.95rem 1rem;
  border-radius: 24px;
  background: #fffdf8;
  border: 2px solid #f4ead6;
  box-shadow: 0 10px 18px rgba(163, 127, 69, 0.08);
}

.task-chip:hover {
  transform: translateY(-1px);
  border-color: #ffd46f;
  box-shadow: 0 14px 24px rgba(163, 127, 69, 0.12);
}

.task-chip__main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.task-chip__emoji {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8dc, #fff0b2);
  border: 2px solid #ffe49f;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.75);
  font-size: 1.8rem;
}

.task-chip__label {
  color: #5e4032;
  font-size: 1rem;
  line-height: 1.35;
  text-align: left;
}

.task-chip__reward {
  font-size: 1.35rem;
  color: #ef8a10;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.task-chip__cta {
  min-width: 122px;
  padding: 0.72rem 1rem;
  background: linear-gradient(180deg, #7fd95f, #43b348);
  box-shadow: 0 8px 0 #39963b;
  white-space: nowrap;
  line-height: 1;
  justify-self: end;
}

.task-chip--custom .task-chip__cta {
  background: linear-gradient(180deg, #ffc14f, #ff9a17);
  box-shadow: 0 8px 0 #dd7f00;
}

.custom-task-form {
  grid-template-columns: minmax(180px, 1.8fr) 90px 74px auto;
  gap: 0.65rem;
}

.custom-task-form input {
  min-height: 48px;
  border-radius: 18px;
}

.custom-task-list {
  gap: 0.65rem;
}

.custom-task-item {
  padding: 0.8rem 0.9rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid #f4ead6;
  align-items: center;
}

.custom-task-item__text,
.custom-task-list__empty {
  color: #7f6347;
  line-height: 1.35;
}

.log-section {
  margin-top: 1rem;
  padding: 1rem;
}

.activity-log {
  max-height: 300px;
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid #f3e7cf;
  border-radius: 22px;
}

.activity-log li {
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  border-bottom-color: rgba(233, 214, 184, 0.7);
  align-items: center;
}

.activity-log li > :first-child {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.activity-log .time {
  color: #9d7e60;
}

.pet-intro {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
}

.pet-intro p {
  color: #86684d;
  font-weight: 700;
  max-width: none;
}

.pet-stage {
  min-height: 760px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.66), transparent 26%),
    linear-gradient(180deg, #dff5ff 0%, #ddf7fb 18%, #c7f0d0 46%, #fff2db 100%);
  overflow: hidden;
}

.pet-stage::before {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.34), transparent 30%),
    radial-gradient(ellipse 65% 24% at 50% 100%, rgba(255, 207, 122, 0.22), transparent 70%);
}

.pet-stage::after {
  inset: auto 14% 24px;
  height: 86px;
  background: radial-gradient(circle, rgba(255, 230, 179, 0.58), transparent 72%);
}

.pet-slots {
  padding: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  min-height: 700px;
}

.pet-slot {
  min-height: 250px;
  border: 3px dashed rgba(214, 192, 149, 0.7);
  background: rgba(255, 255, 255, 0.4);
  color: #9f7e5e;
}

.pet-card__inner {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.95rem 0.9rem;
  min-height: 100%;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 244, 219, 0.92));
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 34px rgba(166, 126, 68, 0.12);
}

.pet-card:hover .pet-card__inner {
  transform: translateY(-2px);
}

.pet-remove {
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  background: linear-gradient(180deg, rgba(60, 66, 72, 0.95), rgba(45, 50, 55, 0.92));
  color: #d7dfeb;
  border: 2px solid rgba(255, 255, 255, 0.22);
}

.pet-viewport {
  height: 340px;
  min-height: 300px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.88), transparent 36%),
    radial-gradient(ellipse 72% 22% at 50% 92%, rgba(255, 216, 154, 0.42), transparent 68%),
    linear-gradient(180deg, rgba(248, 253, 255, 0.82), rgba(222, 244, 232, 0.88));
  border: 2px solid rgba(255, 255, 255, 0.9);
  filter: none;
}

.pet-viewport--has-portrait {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.92), transparent 34%),
    radial-gradient(ellipse 60% 20% at 50% 92%, rgba(254, 217, 147, 0.4), transparent 70%),
    linear-gradient(180deg, rgba(248, 253, 255, 0.86), rgba(221, 246, 232, 0.9));
  box-shadow: inset 0 -18px 30px rgba(255, 229, 185, 0.22);
  border-color: rgba(255, 255, 255, 0.96);
}

.pet-viewport--has-portrait::before {
  inset: 14px 14px 18px;
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.28), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.02));
}

.pet-portrait,
.pet-gif-overlay {
  width: 100%;
  height: 100%;
  object-position: center 60%;
  filter:
    drop-shadow(0 18px 22px rgba(126, 90, 41, 0.12))
    drop-shadow(0 8px 12px rgba(255, 255, 255, 0.18));
}

.pet-name {
  margin-top: 1rem;
  color: #5e4032;
  font-size: 1.12rem;
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  text-align: center;
}

.pet-meta {
  color: #9a7959;
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 2.6em;
  line-height: 1.3;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
}

.modal__card {
  border-radius: 36px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, #fffdf7, #fff4db);
  box-shadow: 0 28px 68px rgba(145, 108, 55, 0.18);
}

.modal__card h2 {
  color: #5d4037;
}

.modal__sub {
  color: #916d4f;
}

.adopt-group {
  border-radius: 26px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(244, 229, 197, 0.88);
}

.adopt-group__head strong {
  color: #6f532f;
}

.adopt-group__head p {
  color: #a07f5d;
}

.adopt-opt {
  border-radius: 22px;
  border-width: 2px;
  background: linear-gradient(180deg, #fffef9, #fff5de);
  color: #684c34;
  min-height: 176px;
  justify-content: center;
}

.adopt-opt__badge {
  border-radius: 999px;
  white-space: nowrap;
}

.adopt-opt .emoji {
  line-height: 1;
}

.adopt-opt .lbl,
.adopt-opt__meta {
  line-height: 1.3;
}

.pet-cinema__scrim {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 250, 228, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(34, 28, 24, 0.76), rgba(17, 14, 11, 0.9));
}

.pet-cinema__caption {
  background: rgba(255, 248, 234, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.24);
}

.pet-cinema__eyebrow {
  color: rgba(255, 210, 104, 0.92);
}

@media (max-width: 1100px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .pet-stage {
    min-height: 520px;
  }
}

@media (max-width: 760px) {
  body {
    padding: 0.65rem;
  }

  .top-bar {
    padding: 0.45rem 0;
  }

  .header-meta {
    width: 100%;
    justify-content: space-between;
  }

  .brand h1 {
    font-size: 1.36rem;
  }

  .brand {
    width: 100%;
    padding: 0.8rem 0.95rem;
  }

  .brand-icon {
    width: 3.7rem;
    height: 3.7rem;
    border-radius: 1.35rem;
    font-size: 1.7rem;
  }

  .brand-logo {
    max-width: min(280px, 100%);
    max-height: 70px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .panel--kids {
    position: static;
    padding: 0.85rem;
    order: 1;
  }

  .panel--main {
    order: 2;
    padding: 0.9rem;
  }

  .kid-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 78vw);
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scroll-snap-type: x proximity;
  }

  .kid-row {
    min-width: 0;
    scroll-snap-align: start;
  }

  .kid-form {
    margin-top: 0.85rem;
    padding: 0.9rem;
  }

  .main-content {
    gap: 0.75rem;
  }

  .kid-profile-card {
    padding: 1rem;
  }

  .kid-profile-card__hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .kid-profile-stats {
    justify-items: start;
  }

  .score-row {
    gap: 0.75rem;
  }

  .tabs {
    position: sticky;
    top: 0.35rem;
    z-index: 6;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.3rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.96), rgba(243, 235, 216, 0.96));
    border: 2px solid rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 20px rgba(139, 111, 73, 0.1);
  }

  .tab {
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    color: #7c6a57;
    font-weight: 800;
  }

  .tab--active {
    background: linear-gradient(180deg, #f7f3e7, #ffffff);
    color: #4f4338;
    box-shadow: 0 6px 14px rgba(136, 109, 72, 0.1);
  }

  #panelTasks,
  #panelPets {
    display: none !important;
  }

  #panelTasks:not(.hidden),
  #panelPets:not(.hidden) {
    display: block !important;
  }

  .task-chip {
    grid-template-columns: 1fr;
    justify-items: start;
    min-height: 0;
  }

  .task-chip__cta {
    width: 100%;
  }

  .custom-task-form {
    grid-template-columns: 1fr;
  }

  .log-section {
    margin-top: 0.75rem;
  }

  .pet-intro {
    padding: 0.9rem;
  }

  .pet-stage {
    min-height: 0;
    border-radius: 24px;
  }

  .pet-slots {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }

  .pet-viewport {
    height: 280px;
    min-height: 240px;
  }
}

/* Palette Soften Pass */
:root {
  --bg: #d5dfbc;
  --bg-elevated: #fffaf1;
  --bg-soft: #f6eddc;
  --border: rgba(144, 122, 90, 0.14);
  --text: #4f4338;
  --text-muted: #7f6f5f;
  --accent: #73aa73;
  --accent-2: #d59a58;
  --gold: #d99a33;
  --shadow: 0 24px 56px rgba(132, 108, 73, 0.12);
}

html,
body {
  background:
    radial-gradient(520px 220px at 14% 8%, rgba(255, 255, 255, 0.62), transparent 70%),
    radial-gradient(420px 240px at 88% 10%, rgba(248, 236, 190, 0.34), transparent 68%),
    linear-gradient(180deg, #eef7fb 0%, #edf2df 20%, #dfe8c6 48%, #d4ddb4 100%);
}

.brand {
  background: linear-gradient(180deg, rgba(255, 251, 243, 0.96), rgba(248, 239, 216, 0.94));
  box-shadow: 0 16px 34px rgba(136, 108, 70, 0.12);
}

.brand-icon {
  background: linear-gradient(180deg, #fffefb, #f4dfaa);
  box-shadow:
    0 8px 18px rgba(186, 150, 88, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.76);
}

.brand h1 {
  color: #406a3c;
}

.tagline {
  color: #9b764d;
}

.pill {
  background: linear-gradient(180deg, #fffefb, #f8efdb);
  color: #85705b;
}

.panel,
.panel--kids,
.task-group,
.log-section,
.pet-intro,
.pet-stage,
.score-card,
.hint,
.kid-progress-card,
.modal__card,
.adopt-group {
  box-shadow: 0 14px 30px rgba(141, 115, 77, 0.08);
}

.panel--kids {
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.62), transparent 32%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.95), rgba(241, 245, 226, 0.93));
}

.panel-head h2 {
  color: #567448;
}

.btn--primary {
  background: linear-gradient(180deg, #83bb76, #5f9a5f);
  box-shadow: 0 8px 0 #5a8d57, 0 14px 22px rgba(95, 154, 95, 0.14);
}

.btn--ghost {
  background: linear-gradient(180deg, #fffdf8, #f5ecd7);
  color: #7d6953;
  box-shadow: 0 6px 14px rgba(170, 142, 93, 0.09);
}

.kid-item {
  background: linear-gradient(180deg, #fbf4df, #f1dfb4);
  box-shadow: 0 6px 14px rgba(177, 145, 89, 0.1);
}

.kid-item--active {
  background: linear-gradient(180deg, #8dbe84, #6ca266);
  box-shadow: 0 8px 0 #628d5f, 0 14px 20px rgba(103, 152, 94, 0.14);
}

.kid-item__copy small {
  color: #866f58;
}

.kid-profile-card {
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.48), transparent 26%),
    linear-gradient(180deg, #f8edcd 0%, #efdba7 100%);
}

.kid-profile-copy__eyebrow {
  color: #c48a4a;
}

.kid-profile-copy h2 {
  color: #564337;
}

.kid-profile-copy p:last-child,
.kid-progress-card__hint,
.hint,
.pet-intro p,
.modal__sub,
.adopt-group__head p,
.task-group__head p,
.custom-task-item__text,
.custom-task-list__empty,
.activity-log .time,
.pet-meta {
  color: #806d5a;
}

.kid-level-pill {
  background: linear-gradient(180deg, #e1af66, #c98543);
  box-shadow: 0 8px 0 #b67639;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
  justify-content: center;
}

.kid-score-badge {
  background: linear-gradient(180deg, #f8efcf, #ecd38c);
  color: #6d5635;
}

.kid-score-badge strong,
.score-value,
.task-chip__reward {
  color: #cc8a2c;
}

.kid-progress-track {
  background: linear-gradient(180deg, #d7c8a4, #c5b184);
}

.kid-progress-track__fill {
  background: linear-gradient(90deg, #87bd7a, #6aa362);
}

.score-card {
  background: linear-gradient(180deg, #fffdf9, #f6ebd2);
}

.hint {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 236, 214, 0.9));
}

.task-group,
.log-section,
.pet-intro {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(247, 239, 223, 0.93));
}

.task-group:nth-child(1) h3 {
  background: linear-gradient(180deg, #8cb98a, #6f9d71);
  box-shadow: 0 8px 0 #648b65;
}

.task-group:nth-child(2) h3 {
  background: linear-gradient(180deg, #ddb57a, #c89253);
  box-shadow: 0 8px 0 #b17f45;
}

.task-group:nth-child(3) h3 {
  background: linear-gradient(180deg, #95b9c8, #789fb1);
  box-shadow: 0 8px 0 #678b9c;
}

.log-section h3 {
  background: linear-gradient(180deg, #d9ab74, #be8751);
  box-shadow: 0 8px 0 #ab7645;
}

.task-chip {
  background: #fffdfa;
  border-color: #ece1cb;
  box-shadow: 0 8px 14px rgba(158, 128, 84, 0.07);
}

.task-chip:hover {
  border-color: #d7c29b;
  box-shadow: 0 10px 18px rgba(158, 128, 84, 0.1);
}

.task-chip__emoji {
  background: linear-gradient(180deg, #fdf4dd, #f4e5b8);
  border-color: #ead7a2;
}

.task-chip__cta {
  background: linear-gradient(180deg, #85ba7b, #699e61);
  box-shadow: 0 8px 0 #5e8e58;
}

.task-chip--custom .task-chip__cta {
  background: linear-gradient(180deg, #dfb26f, #c78d4b);
  box-shadow: 0 8px 0 #b27a3e;
}

.custom-task-item,
.activity-log {
  background: rgba(255, 255, 255, 0.8);
  border-color: #ece1cb;
}

.pet-stage {
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.56), transparent 26%),
    linear-gradient(180deg, #e8f4f8 0%, #e7f0ec 18%, #d9e8d1 46%, #f3eadb 100%);
}

.pet-stage::after {
  background: radial-gradient(circle, rgba(232, 209, 165, 0.42), transparent 72%);
}

.pet-card__inner {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 235, 214, 0.94));
  box-shadow: 0 14px 24px rgba(152, 118, 73, 0.09);
}

.pet-viewport {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.86), transparent 36%),
    radial-gradient(ellipse 72% 22% at 50% 92%, rgba(225, 199, 156, 0.28), transparent 68%),
    linear-gradient(180deg, rgba(248, 251, 249, 0.84), rgba(231, 241, 232, 0.9));
}

.pet-viewport--has-portrait {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.9), transparent 34%),
    radial-gradient(ellipse 60% 20% at 50% 92%, rgba(231, 204, 162, 0.3), transparent 70%),
    linear-gradient(180deg, rgba(248, 251, 249, 0.88), rgba(231, 240, 231, 0.92));
}

.modal__card {
  background: linear-gradient(180deg, #fffdf8, #f5ecd6);
}

.adopt-opt {
  background: linear-gradient(180deg, #fffefb, #f7efdd);
}

.pet-cinema__scrim {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 247, 228, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(43, 37, 31, 0.72), rgba(22, 18, 15, 0.88));
}

/* Mobile Rescue */
@media (max-width: 760px) {
  .top-bar {
    margin-bottom: 0.7rem;
  }

  .header-meta {
    width: 100%;
    justify-content: space-between;
  }

  .header-meta .btn {
    min-height: 42px;
    padding: 0.65rem 0.85rem;
  }

  .panel {
    border-radius: 24px;
  }

  .panel--kids,
  .panel--main {
    padding: 0.85rem;
  }

  .kid-list {
    grid-auto-columns: minmax(186px, 76vw);
    gap: 0.55rem;
    margin-bottom: 0;
  }

  .kid-row {
    gap: 0.4rem;
  }

  .kid-item {
    min-height: 58px;
    padding: 0.65rem 0.75rem;
  }

  .kid-item__avatar {
    width: 40px;
    height: 40px;
  }

  .kid-item__copy strong {
    font-size: 0.92rem;
  }

  .kid-item__copy small {
    font-size: 0.72rem;
  }

  .kid-item__delete {
    width: 38px;
  }

  .kid-form {
    padding: 0.85rem;
    border-radius: 18px;
  }

  .kid-avatar-editor {
    align-items: flex-start;
  }

  .kid-avatar-preview {
    width: 62px;
    height: 62px;
    border-radius: 18px;
  }

  .main-content {
    gap: 0.75rem;
  }

  .kid-profile-card {
    padding: 0.9rem;
    border-radius: 24px;
  }

  .kid-profile-card__hero {
    gap: 0.75rem;
  }

  .kid-profile-card__media {
    width: 100%;
    gap: 0.75rem;
  }

  .kid-profile-avatar {
    width: 74px;
    height: 74px;
    border-radius: 22px;
  }

  .kid-profile-copy__eyebrow {
    font-size: 0.68rem;
  }

  .kid-profile-copy h2 {
    font-size: 1.34rem;
  }

  .kid-profile-copy__title {
    margin-top: 0.38rem;
    font-size: 0.74rem;
    padding: 0.36rem 0.68rem;
  }

  .kid-profile-copy p:last-child {
    font-size: 0.82rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .kid-profile-stats {
    display: flex;
    width: 100%;
    gap: 0.5rem;
  }

  .kid-level-pill,
  .kid-score-badge {
    flex: 1;
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 0.6rem 0.7rem;
  }

  .kid-level-pill {
    font-size: 0.84rem;
  }

  .kid-progress-card {
    margin-top: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: 18px;
  }

  .kid-progress-card__row {
    font-size: 0.88rem;
  }

  .kid-progress-card__hint {
    font-size: 0.76rem;
    line-height: 1.3;
  }

  .score-row {
    gap: 0.65rem;
  }

  .score-card {
    padding: 0.85rem 0.95rem;
    border-radius: 20px;
  }

  .score-value {
    font-size: 1.9rem;
  }

  .hint {
    display: none;
  }

  .tabs {
    top: 0.2rem;
    margin-bottom: 0.7rem;
  }

  .task-group,
  .log-section,
  .pet-intro {
    padding: 0.85rem;
    border-radius: 22px;
  }

  .task-group h3,
  .log-section h3 {
    min-height: 2rem;
    margin-bottom: 0.7rem;
    padding: 0 0.85rem;
    font-size: 0.94rem;
  }

  .task-group__head p {
    display: none;
  }

  .task-chips {
    gap: 0.65rem;
  }

  .task-chip {
    gap: 0.65rem;
    padding: 0.8rem 0.85rem;
    border-radius: 18px;
  }

  .task-chip__main {
    gap: 0.7rem;
  }

  .task-chip__emoji {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.45rem;
  }

  .task-chip__label {
    font-size: 0.92rem;
  }

  .task-chip__reward {
    font-size: 1.08rem;
  }

  .task-chip__cta {
    min-width: 0;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
  }

  .custom-task-form {
    gap: 0.55rem;
  }

  .custom-task-form input,
  .custom-task-form .btn {
    min-height: 44px;
  }

  .custom-task-item {
    padding: 0.7rem 0.8rem;
    border-radius: 16px;
  }

  .log-section {
    margin-top: 0.75rem;
  }

  .activity-log {
    max-height: 176px;
    border-radius: 18px;
  }

  .activity-log li {
    padding: 0.68rem 0.8rem;
    font-size: 0.82rem;
  }

  .pet-intro {
    gap: 0.7rem;
  }

  .pet-intro p {
    font-size: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .pet-stage {
    min-height: 0;
    border-radius: 22px;
  }

  .pet-slots {
    min-height: 0;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .pet-card__inner {
    padding: 0.82rem 0.78rem 0.78rem;
    border-radius: 20px;
  }

  .pet-remove {
    width: 36px;
    height: 36px;
  }

  .pet-viewport {
    height: 224px;
    min-height: 206px;
    border-radius: 16px;
  }

  .pet-name {
    margin-top: 0.75rem;
    font-size: 1rem;
    min-height: auto;
  }

  .pet-meta {
    font-size: 0.74rem;
    min-height: auto;
  }

  .modal__card {
    width: min(100%, 100%);
    max-height: 82vh;
    padding: 1rem;
    border-radius: 24px;
    overflow-y: auto;
  }

  .adopt-options {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .adopt-group {
    padding: 0.8rem;
    border-radius: 18px;
  }

  .adopt-group__grid {
    grid-template-columns: 1fr;
  }

  .adopt-opt {
    min-height: 138px;
    padding: 0.75rem;
  }

  .pet-cinema__media {
    padding: 1rem;
  }

  .pet-cinema__caption {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    transform: none;
  }
}

@media (max-width: 520px) {
  .brand {
    padding: 0.72rem 0.78rem;
    border-radius: 24px;
  }

  .brand-copy {
    gap: 0.65rem;
  }

  .brand-icon {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 1.15rem;
    font-size: 1.45rem;
  }

  .brand h1 {
    font-size: 1.12rem;
  }

  .tagline {
    font-size: 0.78rem;
  }

  .pill {
    font-size: 0.72rem;
    padding: 0.32rem 0.62rem;
  }

  .header-meta .btn {
    font-size: 0.76rem;
  }

  .kid-list {
    grid-auto-columns: minmax(170px, 82vw);
  }

  .tabs {
    padding: 0.24rem;
  }

  .tab {
    padding: 0.68rem 0.6rem;
    font-size: 0.84rem;
  }

  .pet-viewport {
    height: 200px;
    min-height: 188px;
  }

  .fx-reward-tip {
    font-size: 0.78rem;
    padding: 0.42rem 0.66rem;
  }
}

html,
body {
  overflow-x: hidden;
}

.app,
.top-bar,
.layout,
.panel,
.main-content,
.kid-profile-card,
.kid-profile-card__hero,
.kid-profile-card__media,
.score-row,
.task-group,
.log-section,
.pet-intro,
.pet-stage,
.pet-slots,
.modal__card {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 760px) {
  .brand,
  .header-meta,
  .panel--kids,
  .panel--main,
  .kid-profile-stats,
  .task-chip,
  .custom-task-item,
  .activity-log li {
    min-width: 0;
    max-width: 100%;
  }

  .form-actions--kid {
    align-items: stretch;
  }

  .form-actions__main {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .form-actions__main .btn,
  .form-actions--kid > .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ============================================================
   V1.2 宠物属性面板 + 互动按钮
   ============================================================ */

/* 属性面板 */
.pet-stats-panel {
  padding: 6px 8px 4px;
  background: rgba(0,0,0,.06);
  border-radius: 10px;
  margin: 6px 4px 4px;
}
.pstat-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0;
}
.pstat-lbl {
  width: 1.3rem;
  font-size: .7rem;
  text-align: center;
  flex-shrink: 0;
}
.pstat-bar {
  flex: 1;
  height: 5px;
  background: rgba(0,0,0,.12);
  border-radius: 99px;
  overflow: hidden;
}
.pstat-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}
.pstat-val {
  width: 2.2rem;
  font-size: .65rem;
  text-align: right;
  color: rgba(0,0,0,.5);
  flex-shrink: 0;
}

/* 互动按钮区 */
.pet-interact-btns {
  display: flex;
  gap: 4px;
  padding: 4px 4px 6px;
  justify-content: center;
}
.pet-iact-btn {
  flex: 1;
  padding: 5px 2px;
  font-size: .7rem;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.7);
  cursor: pointer;
  font-weight: 600;
  color: #4a3728;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.pet-iact-btn:hover {
  background: rgba(255,255,255,.95);
  transform: translateY(-1px);
}
.pet-iact-btn:active {
  transform: scale(.96);
}

/* ============================================================
   stat-floater: 属性飘字动画（从宠物中心飞向属性条）
   ============================================================ */
.stat-floater {
  font-size: .9rem;
  font-weight: 900;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 14px rgba(0,0,0,.22), 0 0 0 2px currentColor;
  letter-spacing: .04em;
  transform: translate(-50%, -50%);
  text-shadow: 0 1px 3px rgba(0,0,0,.15);

  /* 飞行动画：贝塞尔曲线飞向目标，出现时淡入，抵达前淡出 */
  animation: stat-fly 0.90s cubic-bezier(0.25, 0.8, 0.3, 1) forwards;
}

@keyframes stat-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  10% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 12px)) scale(1.2);
  }
  70% {
    opacity: 1;
    transform: translate(calc(-50% + var(--tx) * 0.75), calc(-50% + var(--ty) * 0.75 - 12px)) scale(1.0);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.75);
  }
}

.focus-shell {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.focus-shell.hidden {
  display: none;
}

.focus-shell__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 244, 180, 0.24), transparent 32%),
    radial-gradient(circle at 80% 18%, rgba(147, 197, 253, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(28, 37, 54, 0.84), rgba(17, 24, 39, 0.94));
  backdrop-filter: blur(18px);
}

.focus-shell__card {
  position: relative;
  width: min(100%, 860px);
  max-height: min(92vh, 920px);
  overflow: auto;
  padding: 1.5rem;
  border-radius: 36px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), rgba(255, 252, 241, 0.92) 38%, rgba(255, 248, 224, 0.9) 100%);
  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.24);
}

.focus-shell__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(92, 69, 38, 0.08);
  color: #6e5237;
  font-size: 1.6rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.focus-shell__close:hover {
  transform: scale(1.04);
  background: rgba(92, 69, 38, 0.14);
}

.focus-shell__panel {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.focus-shell__eyebrow {
  color: #d38f2e;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.focus-shell__panel h2 {
  margin: 0;
  color: #4f3a2b;
  font-size: clamp(1.9rem, 2.8vw, 2.8rem);
  line-height: 1.08;
}

.focus-shell__desc {
  margin: 0;
  color: #8a7058;
  font-size: 1rem;
  line-height: 1.6;
}

.focus-overview,
.focus-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.focus-overview__card,
.focus-result-card {
  padding: 1rem 1.1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(232, 206, 155, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.focus-overview__card span,
.focus-result-card span,
.focus-reward-card__label,
.focus-config__label {
  display: block;
  color: #9d7b59;
  font-size: 0.82rem;
  font-weight: 700;
}

.focus-overview__card strong,
.focus-result-card strong,
.focus-reward-card strong {
  display: block;
  margin-top: 0.3rem;
  color: #58412f;
  font-size: 1.32rem;
  line-height: 1.2;
}

.focus-config {
  display: grid;
  gap: 1rem;
}

.focus-mode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.focus-mode-btn {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  min-height: 110px;
  padding: 0.95rem 1rem;
  text-align: left;
  border: 2px solid rgba(234, 215, 177, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  color: #73543b;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.focus-mode-btn strong {
  color: #54402e;
  font-size: 1rem;
}

.focus-mode-btn span {
  color: #8b7055;
  font-size: 0.86rem;
  line-height: 1.45;
}

.focus-mode-btn:hover,
.focus-mode-btn.is-active {
  transform: translateY(-1px);
  border-color: rgba(127, 217, 95, 0.82);
  background: linear-gradient(180deg, #fffef7, #eefadc);
  box-shadow: 0 12px 20px rgba(129, 170, 88, 0.14);
}

.focus-config__block {
  display: grid;
  gap: 0.65rem;
}

.focus-duration-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.focus-duration-btn {
  min-height: 58px;
  border: 2px solid rgba(234, 215, 177, 0.8);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  color: #73543b;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.focus-duration-btn:hover,
.focus-duration-btn.is-active {
  transform: translateY(-1px);
  border-color: rgba(127, 217, 95, 0.82);
  background: linear-gradient(180deg, #fffef7, #eefadc);
  box-shadow: 0 12px 20px rgba(129, 170, 88, 0.14);
}

.focus-config input {
  min-height: 54px;
  padding: 0.85rem 1rem;
  border-radius: 20px;
  border: 2px solid rgba(234, 215, 177, 0.8);
  background: rgba(255, 255, 255, 0.86);
  color: #5d4331;
  font: inherit;
}

.focus-reward-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 250, 237, 0.94), rgba(239, 252, 229, 0.92));
  border: 1px solid rgba(194, 223, 153, 0.72);
}

.focus-reward-card p {
  margin: 0;
  color: #7d6a54;
  line-height: 1.5;
}

.focus-shell__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

.btn--xl {
  min-height: 56px;
  padding-inline: 1.5rem;
  font-size: 1rem;
}

.focus-timer {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  padding: 1.4rem 1rem;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 245, 214, 0.9));
  border: 2px solid rgba(255, 255, 255, 0.92);
}

.focus-timer strong {
  color: #4b3829;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: 0.04em;
}

.focus-timer span {
  color: #9a7654;
  font-weight: 700;
}

.focus-progress {
  height: 18px;
  border-radius: 999px;
  background: rgba(213, 197, 154, 0.56);
  overflow: hidden;
}

.focus-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fdd63, #52ba52);
  box-shadow: 0 0 18px rgba(110, 199, 85, 0.28);
  transition: width 0.8s ease;
}

.focus-cheer {
  padding: 1rem 1.1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  color: #7f6448;
  font-weight: 700;
  line-height: 1.5;
}

.focus-reward-card--active {
  justify-content: center;
}

body.body--focus-open {
  overflow: hidden;
}

@media (max-width: 880px) {
  .focus-shell {
    padding: 0;
    align-items: stretch;
  }

  .focus-shell__card {
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    padding: calc(env(safe-area-inset-top) + 0.95rem) 0.95rem calc(env(safe-area-inset-bottom) + 1rem);
    border-radius: 0;
    border-width: 0;
  }

  .focus-overview,
  .focus-result-grid,
  .focus-mode-list,
  .focus-duration-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .focus-shell__actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .focus-shell__actions .btn {
    width: 100%;
  }

  .focus-shell__close {
    top: calc(env(safe-area-inset-top) + 0.7rem);
    right: 0.7rem;
  }
}

@media (max-width: 560px) {
  .focus-overview,
  .focus-result-grid,
  .focus-mode-list,
  .focus-duration-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .focus-shell__panel h2 {
    font-size: 1.7rem;
  }

  .focus-shell__desc,
  .focus-reward-card p,
  .focus-cheer {
    font-size: 0.92rem;
  }
}
