.screen {
  display: none;
  min-height: calc(100vh - 60px);
  align-items: center;
  justify-content: center;
}

.screen.is-active { display: flex; }

.screen[data-screen="playing"] {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.screen[data-screen="records"] {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.screen[data-screen="road-map"],
.screen[data-screen="collection"],
.screen[data-screen="weak-practice"],
.screen[data-screen="boss"],
.screen[data-screen="boss-results"] {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.hero-panel,
.settings-panel,
.results-panel,
.modal-panel {
  width: min(960px, 100%);
  padding: 28px;
}

.hero-panel {
  text-align: center;
  padding: 56px 32px;
}

.hero-panel h1 {
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  margin-top: 10px;
}

.lead {
  margin-top: 16px;
  font-size: 1.1rem;
  line-height: 1.5;
}

.menu-actions,
.settings-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.menu-actions { justify-content: center; }

.record-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.road-menu-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.menu-meta-card {
  min-height: 108px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 8px;
}

.menu-meta-card strong {
  font-size: 1.2rem;
}

.menu-meta-card small {
  color: var(--muted);
}

.record-strip div,
.summary-card,
.results-grid article,
.weak-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 18px;
}

.record-strip strong,
.results-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.records-panel {
  width: min(1100px, 100%);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.profile-panel {
  width: min(1100px, 100%);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.records-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.records-auth,
.records-dashboard {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.records-auth .child-area {
  display: none;
}

.records-auth.is-authenticated .child-area {
  display: grid;
}

.records-auth.is-authenticated .records-form,
.records-auth.is-authenticated .records-switches,
.records-auth.is-authenticated .auth-note,
.records-auth.is-authenticated .auth-note-button {
  display: none;
}

.records-switches,
.children-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.child-chip-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.child-chip-name {
  min-width: 0;
}

.child-chip-edit {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.child-area {
  display: grid;
  gap: 14px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.child-area-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.records-form,
.child-form {
  display: grid;
  gap: 12px;
}

.records-form label,
.child-form label {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.records-form label span,
.child-form label span {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted);
}

.records-form input,
.child-form input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 10, 30, 0.5);
  color: var(--text);
  padding: 12px 14px;
}

.records-form input::placeholder,
.child-form input::placeholder {
  color: rgba(246, 243, 255, 0.55);
}

.records-form .primary-button {
  width: 100%;
  justify-content: center;
}

.records-dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.profile-link-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-link h3 {
  margin-top: 2px;
}

.profile-edit-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  flex: 0 0 auto;
}

.profile-edit-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.profile-link:hover .profile-edit-icon,
.profile-link:focus-visible .profile-edit-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.profile-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-summary,
.profile-details {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-meta {
  color: var(--muted);
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.child-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.child-edit-field {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.child-edit-field span {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted);
}

.child-edit-input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 10, 30, 0.5);
  color: var(--text);
  padding: 12px 14px;
}

.child-edit-input::placeholder {
  color: rgba(246, 243, 255, 0.55);
}

.child-edit-save {
  min-height: 48px;
}

.profile-edit-form {
  display: grid;
  gap: 12px;
}

.profile-edit-form label {
  display: grid;
  gap: 6px;
}

.profile-edit-form input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 10, 30, 0.5);
  color: var(--text);
  padding: 12px 14px;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stats-summary-grid article,
.table-stat {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-summary-grid span,
.table-stat span,
.table-stat small {
  color: var(--muted);
}

.stats-summary-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.stats-block {
  display: grid;
  gap: 10px;
}

.stats-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.table-stat {
  display: grid;
  gap: 4px;
}

.empty-state,
.form-error {
  color: var(--muted);
  min-height: 24px;
}

.screen-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr;
  gap: 18px;
}

.settings-block {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 20px;
}

.settings-block h3 { margin-bottom: 16px; }

.chip-group,
.preset-list,
.table-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-list { margin-bottom: 14px; }
.table-grid .chip { min-width: 54px; }

.summary-card {
  display: grid;
  gap: 14px;
}

.summary-card p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.summary-card strong {
  text-align: right;
}

.duration-row {
  align-items: center;
}

.duration-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.duration-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
  font-size: 1.4rem;
  line-height: 1;
}

.duration-button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.duration-value {
  min-width: 64px;
  text-align: center;
}

.modal-panel {
  max-width: 520px;
  text-align: center;
}

.results-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-panel .screen-head,
.results-panel .results-hero,
.results-panel .results-grid,
.results-panel .weak-panel,
.results-panel .menu-actions {
  margin: 0;
}

.results-hero {
  display: flex;
  align-items: center;
  gap: 20px;
}

.grade-badge {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  background: linear-gradient(140deg, rgba(255, 216, 107, 0.24), rgba(255, 109, 131, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  font-weight: 800;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
}

.results-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.results-progress-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.results-progress-block .road-stage-track {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.results-progress-block p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.stage-progress-summary,
.stage-progress-next {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stage-progress-summary strong,
.stage-progress-next strong {
  font-size: 1.05rem;
}

.stage-progress-summary.is-unlocked {
  background: rgba(255, 215, 108, 0.14);
  border-color: rgba(255, 215, 108, 0.3);
}

.stage-progress-next-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.stage-progress-next-percent {
  font-size: 1.6rem;
  font-weight: 800;
}

.stage-progress-requirements {
  display: grid;
  gap: 8px;
}

.stage-progress-requirement {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(7, 12, 32, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-progress-requirement.is-done {
  border-color: rgba(133, 239, 181, 0.3);
  background: rgba(74, 165, 112, 0.16);
}

.weak-practice-card {
  display: grid;
  gap: 14px;
}

.weak-practice-card > p:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.weak-practice-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.weak-practice-meta article {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.weak-practice-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.road-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.road-summary-strip article,
.road-stage-card,
.collection-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.road-summary-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 1.3rem;
}

.road-intro-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.road-intro-card strong {
  font-size: 1.05rem;
}

.road-intro-card span {
  color: var(--muted);
  line-height: 1.45;
}

.road-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 14px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.road-stage-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.road-stage-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.road-stage-step {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 10px 8px;
  border-radius: 16px;
  background: rgba(7, 12, 32, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.road-stage-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.road-stage-step-label {
  font-size: 0.74rem;
  color: var(--muted);
}

.road-stage-step.is-done {
  background: rgba(74, 165, 112, 0.16);
  border-color: rgba(133, 239, 181, 0.28);
}

.road-stage-step.is-done .road-stage-step-dot {
  background: #85efb5;
}

.road-stage-step.is-current {
  border-color: rgba(255, 215, 108, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 215, 108, 0.18);
}

.road-stage-step.is-current .road-stage-step-dot {
  background: #ffd76c;
}

.road-stage-card.is-locked {
  opacity: 0.65;
}

.road-stage-card.is-current {
  border-color: rgba(255, 215, 106, 0.44);
  box-shadow: 0 0 0 1px rgba(255, 215, 106, 0.22), 0 18px 34px rgba(11, 17, 40, 0.24);
}

.road-stage-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.road-stage-badge {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  color: var(--muted);
}

.road-stage-stats,
.road-stage-progress {
  display: grid;
  gap: 8px;
}

.road-stage-progress p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.road-stage-progress p span {
  color: var(--muted);
  line-height: 1.35;
}

.road-stage-progress p strong {
  text-align: right;
}

.road-stage-visual {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.animal-figure {
  position: relative;
  display: grid;
  place-items: center;
  align-self: start;
  padding: 10px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(8, 17, 33, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.animal-figure::after {
  content: '';
  position: absolute;
  inset: auto -20% -38% -20%;
  height: 58%;
  background: radial-gradient(circle, rgba(255, 228, 162, 0.18), transparent 68%);
  pointer-events: none;
}

.animal-figure img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.24));
}

.animal-figure.is-hidden {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 48%),
    linear-gradient(180deg, rgba(124, 137, 194, 0.18), rgba(21, 28, 54, 0.24));
  border-color: rgba(173, 186, 246, 0.22);
}

.animal-figure.is-hidden::after {
  background: radial-gradient(circle, rgba(191, 203, 255, 0.18), transparent 72%);
}

.animal-figure.is-hidden img {
  width: 84%;
  filter: drop-shadow(0 14px 20px rgba(6, 10, 24, 0.22));
}

.animal-figure--road {
  min-height: 148px;
}

.animal-figure--collection {
  min-height: 240px;
  max-width: 220px;
  padding: 8px;
  border-radius: 20px;
}

.animal-figure--collection img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.collection-card {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px 18px;
  align-items: start;
  min-height: 280px;
}

.collection-card > .eyebrow {
  grid-column: 1 / -1;
}

.collection-card > .animal-figure {
  grid-column: 1;
  grid-row: 2 / span 6;
  justify-self: start;
  align-self: center;
}

.collection-card > h3,
.collection-card > .collection-status-copy,
.collection-card > .zoo-progress,
.collection-card > .collection-stage-meta,
.collection-card > .zoo-slots,
.collection-card > .secondary-button {
  grid-column: 2;
}

.road-stage-stats span,
.collection-card p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.road-stage-progress small {
  color: var(--muted);
}

.road-stage-progress {
  min-width: 0;
  align-content: start;
}

.road-stage-copy {
  display: grid;
  gap: 6px;
}

.road-stage-animal,
.road-stage-status,
.road-stage-note {
  display: block;
  margin: 0;
}

.road-stage-animal {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}

.road-stage-status {
  color: var(--muted);
  line-height: 1.35;
}

.road-stage-detail-grid {
  display: grid;
  gap: 8px;
}

.road-stage-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.road-stage-detail span {
  color: var(--muted);
  line-height: 1.35;
}

.road-stage-detail strong {
  text-align: right;
  white-space: nowrap;
}

.road-stage-detail--boss-record strong {
  color: #ffd76c;
}

.road-stage-actions {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  gap: 10px;
}

.road-stage-actions > * {
  width: 100%;
}

.road-stage-actions .secondary-button[disabled] {
  opacity: 0.78;
}

.collection-card {
  display: grid;
  gap: 10px;
  min-height: 280px;
}

.zoo-progress {
  display: grid;
  gap: 6px;
}

.zoo-progress small {
  color: var(--muted);
  line-height: 1.35;
}

.zoo-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.zoo-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd76c, #ffab66);
}

.zoo-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.zoo-slots span {
  min-height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

.collection-status-copy {
  color: var(--muted);
  display: block;
}

.collection-story {
  color: var(--text);
  line-height: 1.5;
  display: block;
}

.collection-stage-meta {
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.collection-stage-meta p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.collection-card--gold,
.collection-card--boss {
  background: rgba(255, 215, 108, 0.12);
  border-color: rgba(255, 215, 108, 0.3);
}

.collection-card--bronze {
  border-color: rgba(230, 170, 90, 0.35);
}

.collection-card--silver {
  border-color: rgba(190, 204, 225, 0.35);
}

.collection-card--legendary {
  background: rgba(255, 215, 108, 0.14);
  border-color: rgba(255, 215, 108, 0.38);
  box-shadow: 0 0 0 1px rgba(255, 215, 108, 0.18), 0 18px 34px rgba(11, 17, 40, 0.24);
}

.rescue-panel {
  width: min(1040px, 100%);
}

.rescue-layout {
  display: grid;
  gap: 16px;
}

.rescue-story-head {
  display: grid;
  gap: 6px;
}

.rescue-story-head p:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.rescue-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.rescue-meta-strip article {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rescue-meta-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.rescue-meta-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.rescue-field {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #8dd0ff 0%, #bde6ff 55%, #eaf7ff 100%);
}

.rescue-sky,
.rescue-cloud,
.rescue-ground,
.rescue-track,
.rescue-forest,
.rescue-character,
.rescue-danger-zone {
  position: absolute;
}

.rescue-sky {
  inset: 0;
}

.rescue-cloud {
  width: 140px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  filter: blur(1px);
}

.rescue-cloud::before,
.rescue-cloud::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.rescue-cloud::before {
  inset: -16px 40px auto 18px;
  height: 42px;
}

.rescue-cloud::after {
  inset: auto 18px -12px 56px;
  height: 28px;
}

.rescue-cloud--one {
  top: 24px;
  left: 12%;
}

.rescue-cloud--two {
  top: 54px;
  left: 56%;
  transform: scale(0.88);
}

.rescue-ground {
  inset: auto 0 0 0;
  height: 42%;
  background:
    linear-gradient(180deg, rgba(97, 171, 91, 0.1), rgba(48, 117, 41, 0.35)),
    linear-gradient(180deg, #76c970 0%, #4d9e49 100%);
}

.rescue-track {
  left: 6%;
  right: 6%;
  bottom: 20%;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c6955d, #9f6d3e);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12);
}

.rescue-forest {
  right: 4%;
  bottom: 25%;
  padding: 10px 16px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, #2f6940, #1e4529);
  color: #eef7eb;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.rescue-character {
  bottom: 18%;
  width: 86px;
  position: relative;
  transform: translateX(-50%);
}

.rescue-character img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 16px 22px rgba(9, 17, 28, 0.24));
}

.rescue-character img[data-role="fallback"] {
  position: relative;
  z-index: 1;
  transition: opacity 0.18s ease;
}

.rescue-sprite-sheet {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.rescue-character[data-sprite-ready="1"] img[data-role="fallback"] {
  opacity: 0;
}

.rescue-character[data-sprite-ready="1"] .rescue-sprite-sheet {
  opacity: 1;
}

.rescue-character--animal {
  z-index: 3;
}

.rescue-animal-emoji {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 78px;
  line-height: 1;
  filter: drop-shadow(0 16px 22px rgba(9, 17, 28, 0.24));
  user-select: none;
}

.rescue-character--predator {
  z-index: 2;
}

.rescue-danger-zone {
  bottom: 19%;
  width: 72px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 110, 110, 0.4), transparent 70%);
  transform: translateX(-50%);
}

.rescue-problem-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rescue-question {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
}

.rescue-feedback {
  min-height: 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.rescue-feedback.is-success {
  color: #9cf0a9;
}

.rescue-feedback.is-danger {
  color: #ffb3b3;
}

.rescue-input-panel {
  width: min(680px, 100%);
  justify-self: center;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 16, 34, 0.12)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.rescue-input-panel .answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 12px;
  margin-top: 0;
}

.rescue-input-panel [data-rescue-input] {
  width: 100%;
  min-width: 0;
  min-height: 84px;
  padding: 18px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 17, 40, 0.78);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rescue-input-panel [data-rescue-input]::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.rescue-input-panel .primary-button.compact {
  min-height: 84px;
  border-radius: 22px;
  font-size: 1.15rem;
  font-weight: 800;
}

.rescue-input-panel .rescue-keypad {
  margin-top: 14px;
  gap: 10px;
}

.rescue-input-panel .keypad-key {
  min-height: 56px;
  border-radius: 18px;
  font-size: 1.35rem;
  font-weight: 800;
}

.rescue-input-panel .secondary-button.keypad-key {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.rescue-input-panel .primary-button.keypad-key {
  background: linear-gradient(180deg, #ffd36d, #f9a95e);
  color: #2c225c;
}

.firefly-guide {
  position: sticky;
  bottom: 14px;
  margin: 0 auto 12px;
  width: min(520px, calc(100% - 24px));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  z-index: 30;
}

.firefly-root {
  position: relative;
  z-index: 30;
}

.firefly-guide.is-docked {
  position: relative;
  bottom: auto;
  width: 100%;
  min-height: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 16, 34, 0.18)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.firefly-guide.is-docked .firefly-avatar {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.2), transparent 24%),
    radial-gradient(circle at 50% 78%, rgba(255, 233, 118, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 245, 170, 0.14), rgba(255, 255, 255, 0.04));
}

.firefly-guide.is-docked .firefly-bubble {
  position: static;
  min-height: 72px;
  border-radius: 18px;
  font-size: 0.92rem;
  text-align: left;
  display: flex;
  align-items: center;
  z-index: 4;
}

.firefly-avatar {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), transparent 32%),
    radial-gradient(circle, rgba(255, 245, 170, 0.52), rgba(255, 230, 112, 0.08));
  border: 1px solid rgba(255, 245, 170, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 30px rgba(8, 12, 28, 0.28),
    0 0 22px rgba(255, 230, 112, 0.24);
  overflow: hidden;
}

.firefly-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  object-fit: contain;
  padding: 8px;
  filter: drop-shadow(0 0 18px rgba(255, 233, 118, 0.55));
}

.firefly-avatar img[data-role="fallback"] {
  transition: opacity 0.18s ease;
}

.firefly-sprite-sheet {
  position: absolute;
  inset: 6px;
  z-index: 2;
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.firefly-sprite-sheet img,
.rescue-sprite-sheet img {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 400% !important;
  height: 200% !important;
  max-width: none !important;
  transform: translate(0%, 0%);
  animation: sprite-sheet-pan 1.1s steps(1) infinite;
}

.firefly-avatar[data-sprite-ready="1"] img[data-role="fallback"] {
  opacity: 0;
}

.firefly-avatar[data-sprite-ready="1"] .firefly-sprite-sheet {
  opacity: 1;
}

.firefly-guide.is-docked .firefly-avatar img[data-role="fallback"] {
  width: 100%;
  height: 100%;
  max-height: none;
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  padding: 14px;
  z-index: 2;
}

.firefly-guide.is-docked .firefly-sprite-sheet {
  inset: 0;
  border-radius: inherit;
}

.firefly-guide.is-docked .firefly-sprite-sheet img {
  width: 400% !important;
  height: 200% !important;
  max-width: none !important;
}

.rescue-sprite-sheet img {
  animation-duration: 0.95s;
}

.firefly-bubble {
  flex: 1;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 20px 20px 20px 8px;
  background: rgba(22, 31, 51, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff8d9;
  line-height: 1.4;
  box-shadow: 0 18px 32px rgba(7, 12, 28, 0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.firefly-guide.is-visible .firefly-bubble {
  opacity: 1;
  transform: translateY(0);
}

.firefly-bubble.is-hidden {
  opacity: 0;
}

@keyframes sprite-sheet-pan {
  0%, 12.49% { transform: translate(0%, 0%); }
  12.5%, 24.99% { transform: translate(-25%, 0%); }
  25%, 37.49% { transform: translate(-50%, 0%); }
  37.5%, 49.99% { transform: translate(-75%, 0%); }
  50%, 62.49% { transform: translate(0%, -50%); }
  62.5%, 74.99% { transform: translate(-25%, -50%); }
  75%, 87.49% { transform: translate(-50%, -50%); }
  87.5%, 100% { transform: translate(-75%, -50%); }
}

@media (min-width: 980px) {
  .firefly-guide {
    position: fixed;
    right: 26px;
    bottom: 18px;
    left: auto;
    width: min(360px, calc(100vw - 40px));
    margin: 0;
    flex-direction: row-reverse;
    align-items: flex-end;
  }

  .firefly-avatar {
    width: 108px;
    height: 108px;
  }

  .firefly-avatar img {
    width: 100%;
    height: 100%;
  }

  .firefly-sprite-sheet {
    inset: 9px;
  }

  .firefly-bubble {
    max-width: 240px;
    min-height: 66px;
    border-radius: 20px 20px 8px 20px;
  }

  .firefly-guide.is-docked {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
    border-radius: 24px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 16, 34, 0.18)),
      rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  .firefly-guide.is-docked .firefly-avatar {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    margin: 0;
    overflow: hidden;
    border-radius: 22px;
    background:
      radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.2), transparent 24%),
      radial-gradient(circle at 50% 78%, rgba(255, 233, 118, 0.18), transparent 34%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 16, 34, 0.12));
  }

  .firefly-guide.is-docked .firefly-avatar img[data-role="fallback"] {
    width: 100%;
    height: 100%;
    max-height: none;
  }

  .firefly-guide.is-docked .firefly-sprite-sheet {
    inset: 0;
  }

  .firefly-guide.is-docked .firefly-bubble {
    position: static;
    max-width: none;
    min-height: 72px;
    border-radius: 18px;
    padding: 14px 16px;
    background: rgba(7, 12, 28, 0.72);
  }
}

.boss-record-line {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.boss-record-line--tier {
  color: #f6e7b6;
}

.boss-record-line--overall {
  color: #b9d6ff;
}

.boss-panel {
  width: min(1040px, 100%);
}

.boss-stage-head {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.boss-portrait,
.boss-stats article,
.boss-question-block,
.boss-option {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
}

.boss-portrait {
  min-height: 210px;
  padding: 20px;
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.boss-portrait::before {
  content: '';
  position: absolute;
  inset: -20% 20% auto;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 214, 120, 0.26), transparent 68%);
  pointer-events: none;
}

.boss-portrait[data-status="unlocked"] {
  border-color: rgba(255, 186, 95, 0.38);
}

.boss-portrait[data-status="in_progress"] {
  border-color: rgba(120, 200, 255, 0.38);
}

.boss-portrait.is-cleared,
.boss-portrait[data-status="victory"] {
  border-color: rgba(159, 255, 188, 0.38);
  background: rgba(127, 255, 178, 0.08);
}

.boss-portrait strong {
  font-size: 2rem;
}

.boss-portrait span {
  color: var(--muted);
}

.boss-figure {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(8, 17, 33, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.boss-figure::after {
  content: '';
  position: absolute;
  inset: auto -12% -28% -12%;
  height: 52%;
  background: radial-gradient(circle, rgba(255, 210, 110, 0.2), transparent 68%);
  pointer-events: none;
}

.boss-figure img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.28));
}

.boss-figure.is-defeated::before,
.boss-figure.is-defeated::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 136%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 110, 110, 0.15), rgba(255, 68, 68, 0.95), rgba(255, 110, 110, 0.15));
  box-shadow: 0 0 18px rgba(255, 82, 82, 0.35);
  transform-origin: center;
  z-index: 3;
  pointer-events: none;
}

.boss-figure.is-defeated::before {
  transform: translate(-50%, -50%) rotate(28deg);
}

.boss-figure.is-defeated::after {
  transform: translate(-50%, -50%) rotate(-28deg);
}

.boss-figure.is-defeated img {
  filter: grayscale(0.75) saturate(0.75) brightness(0.82) drop-shadow(0 16px 20px rgba(0, 0, 0, 0.22));
  opacity: 0.86;
}

.boss-figure--portrait {
  max-width: 230px;
  min-height: 166px;
}

.boss-figure--results {
  max-width: 220px;
  min-height: 150px;
  margin: 0 auto 14px;
}

.boss-health {
  position: relative;
  z-index: 1;
  width: min(100%, 240px);
  display: grid;
  gap: 8px;
}

.boss-health-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
}

.boss-health-head span {
  color: var(--muted);
}

.boss-health-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.boss-health-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7df0a5 0%, #f0d76e 58%, #ff8b7a 100%);
  box-shadow: 0 0 16px rgba(255, 215, 108, 0.22);
  transition: width 160ms ease;
}

.boss-health[data-state="warning"] .boss-health-fill {
  background: linear-gradient(90deg, #f0d76e 0%, #f7ab63 100%);
}

.boss-health[data-state="danger"] .boss-health-fill {
  background: linear-gradient(90deg, #ff8b7a 0%, #ff5f79 100%);
}

.boss-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.boss-stat-card {
  padding: 16px;
  display: grid;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 16, 34, 0.16)),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.boss-stat-card--player {
  grid-column: 1 / -1;
  border-color: rgba(132, 239, 181, 0.18);
}

.boss-stat-card--timer {
  text-align: center;
  justify-items: center;
  border-color: rgba(255, 214, 108, 0.18);
}

.boss-stat-card--timer > strong {
  font-size: 2.4rem;
  line-height: 1;
}

.boss-stat-card--goal {
  border-color: rgba(145, 216, 255, 0.18);
}

.boss-stat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.boss-stat-head span,
.boss-stat-card > span,
.boss-stat-card small {
  color: var(--muted);
}

.boss-stat-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.boss-stat-head strong,
.boss-stat-card > strong {
  font-size: 1.6rem;
}

.boss-mini-health {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.boss-mini-health-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #79e59b 0%, #f0d76e 55%, #ff8f76 100%);
  transition: width 160ms ease;
}

.boss-stat-card--player[data-state="warning"] .boss-mini-health-fill {
  background: linear-gradient(90deg, #f0d76e 0%, #f7ab63 100%);
}

.boss-stat-card--player[data-state="danger"] .boss-mini-health-fill {
  background: linear-gradient(90deg, #ff8b7a 0%, #ff5f79 100%);
}

.boss-question-block {
  padding: 20px;
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(13, 19, 38, 0.12)),
    rgba(255, 255, 255, 0.05);
}

.boss-question {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  text-align: center;
  line-height: 1;
}

.boss-question-hint {
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.boss-feedback {
  min-height: 24px;
  text-align: center;
  color: var(--muted);
}

.boss-feedback[data-kind="success"] {
  color: #bff2cf;
}

.boss-feedback[data-kind="danger"] {
  color: #ffd4d4;
}

.boss-feedback[data-kind="neutral"] {
  color: var(--muted);
}

.boss-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.boss-options-grid[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.boss-options-grid[data-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.boss-options-grid[data-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.boss-option {
  min-height: 88px;
  font-size: 1.6rem;
  font-weight: 800;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(10, 16, 34, 0.04)),
    rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 24px rgba(10, 16, 34, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.boss-option:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 214, 108, 0.3);
  box-shadow: 0 18px 28px rgba(10, 16, 34, 0.18), 0 0 0 1px rgba(255, 214, 108, 0.16);
}

.boss-option:active {
  transform: translateY(0);
}

.boss-input-panel {
  margin-top: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(10, 16, 34, 0.1)),
    rgba(255, 255, 255, 0.04);
}

.boss-input-panel[hidden] {
  display: none !important;
}

.road-stage-note {
  color: var(--muted);
  line-height: 1.45;
  display: block;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.results-grid article {
  min-height: 96px;
  display: grid;
  align-content: center;
}

.weak-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.weak-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 980px) {
  .settings-grid,
  .results-grid { grid-template-columns: 1fr 1fr; }

  .road-map-grid,
  .collection-grid,
  .weak-practice-meta,
  .road-summary-strip,
  .results-meta-grid,
  .boss-stage-head {
    grid-template-columns: 1fr 1fr;
  }

  .road-stage-track,
  .results-progress-block .road-stage-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .road-stage-visual {
    grid-template-columns: 132px minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .hero-panel,
  .settings-panel,
  .results-panel,
  .records-panel,
  .modal-panel { padding: 20px; }

  .screen { min-height: auto; }

  .screen[data-screen="menu"],
  .screen[data-screen="settings"],
  .screen[data-screen="records"],
  .screen[data-screen="profile"],
  .screen[data-screen="road-map"],
  .screen[data-screen="collection"],
  .screen[data-screen="weak-practice"],
  .screen[data-screen="boss"],
  .screen[data-screen="boss-results"] {
    align-items: stretch;
    justify-content: flex-start;
  }

  .screen[data-screen="results"] {
    align-items: stretch;
    justify-content: flex-start;
  }

  .settings-grid,
  .record-strip,
  .road-menu-meta,
  .results-meta-grid,
  .road-summary-strip,
  .road-map-grid,
  .collection-grid,
  .weak-practice-meta { grid-template-columns: 1fr; }

  .road-stage-track,
  .results-progress-block .road-stage-track {
    grid-template-columns: 1fr 1fr;
  }

  .road-stage-visual {
    grid-template-columns: 1fr;
  }

  .rescue-input-panel {
    width: 100%;
    padding: 16px;
  }

  .rescue-input-panel .answer-row {
    grid-template-columns: 1fr;
  }

  .rescue-input-panel .primary-button.compact {
    width: 100%;
  }

  .rescue-animal-emoji {
    font-size: 62px;
  }

  .animal-figure--road {
    min-height: 156px;
  }

  .animal-figure--collection {
    min-height: 220px;
    max-width: none;
  }

  .records-layout {
    grid-template-columns: 1fr;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

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

  .records-dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .screen-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .screen-head .menu-actions {
    width: 100%;
    justify-content: stretch;
  }

  .screen-head .menu-actions > * {
    flex: 1 1 100%;
  }

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

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

  .results-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-panel {
    width: 100%;
    min-height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    padding: 14px;
    gap: 12px;
    overflow-y: auto;
    border-radius: 22px;
  }

  .results-panel .screen-head {
    margin-bottom: 0;
    align-items: flex-start;
  }

  .results-panel .screen-head h2 {
    font-size: 1.25rem;
    line-height: 1.1;
  }

  .results-panel .screen-head .ghost-button {
    min-height: 40px;
    padding-inline: 14px;
    border-radius: 14px;
  }

  .results-hero {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
  }

  .results-hero .lead {
    margin-top: 0;
    font-size: 0.98rem;
    line-height: 1.25;
  }

  .results-hero p:last-child {
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .grade-badge {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    font-size: 2.4rem;
  }

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

  .boss-stage-head,
  .boss-stats,
  .boss-options-grid {
    grid-template-columns: 1fr;
  }

  .results-grid article {
    min-height: 66px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .results-grid span {
    font-size: 0.68rem;
  }

  .results-grid strong {
    margin-top: 4px;
    font-size: 1.1rem;
  }

  .weak-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .weak-panel h3 {
    font-size: 1rem;
  }

  .stage-progress-next-head,
  .stage-progress-requirement {
    flex-direction: column;
    align-items: flex-start;
  }

  .weak-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .weak-item {
    flex: 0 0 176px;
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.8rem;
    line-height: 1.25;
  }

  .results-panel .menu-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
  }

  .results-panel .menu-actions .primary-button,
  .results-panel .menu-actions .secondary-button {
    width: 100%;
    min-height: 46px;
    padding: 12px 10px;
    border-radius: 16px;
    font-size: 0.9rem;
  }

  .records-auth,
  .records-dashboard {
    padding: 16px;
    border-radius: 20px;
  }

  .records-panel .menu-actions {
    margin-top: 0;
  }

  .children-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .children-list .chip,
  .children-list .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .road-stage-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .road-stage-actions > * {
    width: 100%;
  }

  .boss-question {
    font-size: clamp(1.8rem, 9vw, 2.6rem);
  }

  .boss-stats article {
    min-height: 0;
  }

}

@media (max-width: 480px) {
  .app {
    width: calc(100vw - 12px);
    padding-top: 10px;
    padding-bottom: 20px;
  }

  .hero-panel,
  .settings-panel,
  .results-panel,
  .records-panel,
  .profile-panel,
  .modal-panel {
    padding: 14px;
    border-radius: 20px;
  }

  .menu-actions,
  .settings-actions {
    gap: 10px;
  }

  .menu-actions > * ,
  .settings-actions > * {
    width: 100%;
    justify-content: center;
  }

  .stats-bars {
    grid-template-columns: 1fr;
  }

  .stats-summary-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .results-panel .menu-actions {
    grid-template-columns: 1fr;
  }

  .boss-option {
    min-height: 70px;
    font-size: 1.3rem;
  }
}
