:root {
  --font-title: "Hiragino Maru Gothic ProN", "SF Pro Rounded", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Avenir Next", "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: "SF Pro Rounded", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-number: "Quicksand", "Avenir Next", "SF Pro Rounded", "PingFang SC", sans-serif;
  --ocean-bg-1: #eafbfc;
  --ocean-bg-2: #d8f3f7;
  --ocean-bg-3: #bfe8ef;
  --ocean-bg-4: #a9dce6;
  --deep-title: #123849;
  --deep-heading: #16485b;
  --deep-accent: #0f5b6e;
  --deep-line: #195e73;
  --text-main: #385f6c;
  --text-sub: #63818a;
  --text-muted: #7b949b;
  --text-placeholder: #7b949b;
  --text-title: #0e3345;
  --text-heading: #15546a;
  --text-body: #385f6c;
  --text-card: #4d707b;
  --text-accent: #087685;
  --text-treasure: var(--treasure-text);
  --glass-main-top: rgba(255, 255, 255, 0.52);
  --glass-main-mid: rgba(215, 247, 250, 0.76);
  --glass-main-bottom: rgba(190, 235, 242, 0.72);
  --glass-main: rgba(215, 247, 250, 0.76);
  --glass-light: rgba(255, 255, 255, 0.76);
  --section-top: rgba(225, 248, 251, 0.86);
  --section-bottom: rgba(199, 236, 243, 0.68);
  --card-top: rgba(255, 255, 255, 0.94);
  --card-bottom: rgba(235, 250, 252, 0.9);
  --create-top: rgba(232, 250, 252, 0.84);
  --create-bottom: rgba(205, 239, 245, 0.66);
  --border-glass: rgba(255, 255, 255, 0.72);
  --border-inner: rgba(91, 183, 196, 0.22);
  --border-section: rgba(92, 183, 196, 0.25);
  --border-card: rgba(104, 190, 201, 0.36);
  --border-hover: rgba(38, 165, 181, 0.58);
  --treasure-light: #ffe29a;
  --treasure-mid: #ffc163;
  --treasure-coral: #ff8d5e;
  --treasure-border: #e8b24e;
  --treasure-text: #8a5a00;
  --ink: var(--text-title);
  --muted: var(--text-sub);
  --paper: #fffdf7;
  --foam: #e4fafd;
  --reef: #17a2a8;
  --reef-dark: var(--deep-accent);
  --coral: var(--treasure-coral);
  --sun: #f7c86a;
  --kelp: #2f9e61;
  --violet: #6655c8;
  --line: rgba(25, 94, 115, 0.14);
  --shadow: 0 18px 45px rgba(0, 83, 110, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text-body);
  font-family: var(--font-body);
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 226, 154, 0.34), transparent 25%),
    linear-gradient(180deg, var(--ocean-bg-1) 0%, var(--ocean-bg-2) 38%, var(--ocean-bg-3) 72%, var(--ocean-bg-4) 100%);
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  color: var(--text-title);
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 24px;
}

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

.home-screen {
  align-items: center;
  justify-content: center;
}

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

.login-screen.is-active {
  display: grid;
  place-items: center;
}

.login-screen {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(234, 251, 252, 0.18), rgba(191, 232, 239, 0.22)),
    url("assets/ocean-storybook/bg_undersea_world.png") center center / cover no-repeat;
  background-attachment: fixed;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("assets/ocean-storybook/overlay_bubbles_glow.png") center / cover no-repeat;
  opacity: 0.52;
  pointer-events: none;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: min(260px, 32vh);
  background: url("assets/ocean-storybook/decor_coral_corners.png") center bottom / cover no-repeat;
  opacity: 0.22;
  pointer-events: none;
}

.login-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.4vw, 24px);
  width: min(1180px, calc(100vw - 32px));
  min-height: min(660px, calc(100vh - 56px));
  margin: 28px auto;
  padding: clamp(22px, 3.2vw, 36px);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  border-radius: 32px;
  background:
    radial-gradient(circle at 18px 18px, #ffffff 0 4px, #bdeff4 5px 8px, transparent 9px),
    radial-gradient(circle at calc(100% - 18px) 18px, #ffffff 0 4px, #bdeff4 5px 8px, transparent 9px),
    linear-gradient(180deg, var(--glass-main-top) 0%, var(--glass-main-mid) 42%, var(--glass-main-bottom) 100%);
  backdrop-filter: blur(9px);
  box-shadow:
    0 28px 70px rgba(0, 83, 110, 0.22),
    0 0 0 1px rgba(108, 214, 226, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.login-stage::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 0;
  border: 1px solid var(--border-inner);
  border-radius: 26px;
  background:
    radial-gradient(circle at 1px 1px, #ffffff 0 3px, rgba(130, 221, 232, 0.68) 4px 7px, transparent 8px),
    radial-gradient(circle at calc(100% - 1px) 1px, #ffffff 0 3px, rgba(130, 221, 232, 0.68) 4px 7px, transparent 8px),
    radial-gradient(circle at 12% 0%, rgba(255, 232, 154, 0.18), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(38, 165, 181, 0.14), transparent 30%);
  pointer-events: none;
}

.login-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: min(132px, 20%);
  background: url("assets/ocean-storybook/decor_coral_corners.png") center bottom / cover no-repeat;
  opacity: 0.2;
  pointer-events: none;
}

.login-stage > * {
  position: relative;
  z-index: 1;
}

.login-intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 24px;
  margin-bottom: 4px;
  min-height: 176px;
  padding: 24px 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 26px;
  background:
    radial-gradient(circle at 82% 32%, rgba(104, 202, 220, 0.12), rgba(104, 202, 220, 0) 36%),
    linear-gradient(180deg, rgba(236, 253, 254, 0.56), rgba(210, 244, 248, 0.32));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 10px 26px rgba(0, 90, 120, 0.05);
}

.login-intro::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 22px;
  pointer-events: none;
}

.login-title-shell {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
  max-width: none;
  padding: 0;
  background: none;
}

.login-title-shell h1 {
  margin: 0;
  color: var(--text-title);
  font-family: var(--font-title);
  font-size: 2.63rem;
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.56);
}

.login-title-shell .kicker {
  display: block;
  min-height: 0;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-accent);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-compass {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}

.login-title-copy {
  min-width: 0;
}

.hero-mascot-wrap {
  position: relative;
  justify-self: end;
  display: grid;
  place-items: center;
  width: min(190px, 100%);
  min-height: 142px;
  pointer-events: none;
}

.hero-mascot-wrap::before,
.hero-mascot-wrap::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, rgba(186, 242, 250, 0.75) 55%, rgba(98, 201, 219, 0.3));
  box-shadow: 0 0 12px rgba(120, 220, 235, 0.45);
  pointer-events: none;
}

.hero-mascot-wrap::before {
  width: 14px;
  height: 14px;
  right: 16px;
  top: 18px;
}

.hero-mascot-wrap::after {
  width: 8px;
  height: 8px;
  right: 44px;
  top: 4px;
}

.login-mascot {
  width: min(172px, 100%);
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 90, 120, 0.12));
  opacity: 0.88;
  pointer-events: none;
}

.login-intro .home-copy {
  max-width: 430px;
  margin: 12px 0 0;
  padding-left: 0;
  color: var(--text-body);
  font-size: 0.97rem;
  font-weight: 430;
  line-height: 1.6;
}

.student-login-form,
.student-roster,
.student-strip {
  border-radius: 24px;
  box-shadow:
    0 12px 32px rgba(0, 90, 120, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.student-login-form {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  width: min(500px, 100%);
  justify-self: center;
  padding: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--create-top) 0%, var(--create-bottom) 100%);
  border: 1px solid rgba(92, 183, 196, 0.24);
  box-shadow:
    0 12px 32px rgba(0, 90, 120, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.student-login-form::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -34px;
  z-index: 0;
  width: 180px;
  height: 92px;
  background: url("assets/ocean-storybook/decor_coral_corners.png") right bottom / contain no-repeat;
  opacity: 0.14;
  pointer-events: none;
}

.student-login-form > * {
  position: relative;
  z-index: 1;
}

.login-chest-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 8px 12px rgba(8, 68, 86, 0.12));
}

.create-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.create-header strong,
.create-header small {
  display: block;
}

.create-header strong {
  color: var(--text-heading);
  font-family: var(--font-title);
  font-size: 1.22rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
}

.create-header small {
  margin-top: 3px;
  color: var(--text-sub);
  font-size: 0.84rem;
  font-weight: 430;
  line-height: 1.5;
}

.student-login-form label {
  display: grid;
  color: var(--text-sub);
  font-size: 0.84rem;
  font-weight: 560;
  line-height: 1.2;
}

.avatar-current {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 9px 10px;
  border: 1px solid rgba(104, 190, 201, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.avatar-current-art {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.96), rgba(215, 244, 248, 0.72));
  box-shadow: 0 5px 12px rgba(0, 106, 128, 0.08);
}

.avatar-current-art img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.avatar-current-copy strong,
.avatar-current-copy small {
  display: block;
}

.avatar-current-copy strong {
  color: var(--text-heading);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.2;
}

.avatar-current-copy small {
  margin-top: 3px;
  color: var(--text-sub);
  font-size: 0.78rem;
  font-weight: 430;
  line-height: 1.35;
}

.avatar-change {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(8, 118, 133, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-accent);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.avatar-picker[hidden] {
  display: none;
}

.avatar-choice {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid rgba(104, 190, 201, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.avatar-choice img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(8, 68, 86, 0.1));
}

.avatar-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(38, 165, 181, 0.32);
  background: rgba(244, 254, 255, 0.72);
  box-shadow: 0 6px 14px rgba(0, 92, 116, 0.08);
}

.avatar-choice.is-selected {
  border-color: rgba(245, 184, 71, 0.7);
  background: linear-gradient(180deg, rgba(255, 247, 210, 0.92), rgba(246, 218, 138, 0.82));
  box-shadow:
    0 8px 18px rgba(208, 143, 45, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.student-login-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(63, 145, 158, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-body);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 430;
  line-height: 1;
}

.student-login-form input::placeholder {
  color: var(--text-placeholder);
  font-weight: 500;
}

.student-login-form input:focus {
  border-color: #25a6b5;
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 166, 181, 0.14);
}

.student-roster {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  padding: 26px;
  background: linear-gradient(180deg, rgba(226, 249, 251, 0.72) 0%, rgba(203, 239, 245, 0.52) 100%);
  border: 1px solid rgba(92, 183, 196, 0.2);
  box-shadow:
    0 10px 28px rgba(0, 88, 112, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.student-roster-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.student-roster-head::after {
  content: "";
  flex: 1;
  min-width: 42px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 91, 110, 0.2), rgba(247, 200, 106, 0.14), rgba(15, 91, 110, 0));
}

.student-roster-head h2 {
  margin-bottom: 4px;
  color: var(--text-heading);
  font-family: var(--font-title);
  font-size: 1.68rem;
  font-weight: 680;
  line-height: 1.12;
  letter-spacing: 0;
}

.student-roster-head p {
  margin: 0;
  color: var(--text-sub);
  font-size: 0.88rem;
  font-weight: 450;
  line-height: 1.5;
}

.student-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-height: none;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
}

.student-list::-webkit-scrollbar {
  width: 8px;
}

.student-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(15, 91, 110, 0.24);
}

.student-card {
  position: relative;
  display: block;
  min-height: 154px;
  padding: 16px 15px 14px;
  overflow: hidden;
  border: 1px solid rgba(104, 190, 201, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(242, 252, 253, 0.86) 100%),
    rgba(255, 255, 255, 0.42);
  color: var(--ink);
  cursor: default;
  text-align: center;
  box-shadow:
    0 8px 18px rgba(0, 92, 116, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.student-card-open {
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: start;
  gap: 7px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: center;
}

.student-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(179, 99, 86, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: #9f5a50;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 560;
  line-height: 1;
  opacity: 0;
  transition:
    opacity 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.student-card:hover .student-delete,
.student-delete:focus-visible {
  opacity: 0.82;
}

.student-delete:hover {
  opacity: 1;
  border-color: rgba(179, 99, 86, 0.3);
  background: rgba(255, 247, 243, 0.88);
}

.student-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 56%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent 42%);
  opacity: 0.58;
  pointer-events: none;
}

.student-card > * {
  position: relative;
  z-index: 1;
}

.student-avatar-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.92) 0%, rgba(215, 244, 248, 0.6) 100%);
  box-shadow: 0 5px 12px rgba(0, 106, 128, 0.08);
  overflow: hidden;
  flex-shrink: 0;
}

.student-avatar {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(8, 68, 86, 0.1));
}

.student-card:hover {
  transform: translateY(-2px);
  border-color: rgba(38, 165, 181, 0.42);
  box-shadow:
    0 12px 28px rgba(0, 92, 116, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.student-card.is-selected {
  border-color: rgba(245, 184, 71, 0.72);
  box-shadow:
    0 12px 28px rgba(208, 143, 45, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.student-card strong {
  display: block;
  color: var(--text-title);
  font-family: var(--font-title);
  font-size: 1.12rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0;
}

.student-card small {
  color: #55727d;
  font-size: 0.82rem;
  font-weight: 450;
  line-height: 1.45;
}

.student-card-main small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.student-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.student-card-stats span {
  min-width: 0;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid rgba(105, 190, 201, 0.08);
  background: rgba(213, 244, 248, 0.32);
  color: var(--text-accent);
  font-size: 0.78rem;
  font-weight: 520;
  text-align: center;
  box-shadow: none;
}

.student-card:hover .student-card-stats span {
  background: rgba(213, 244, 248, 0.42);
}

.student-card.is-selected .student-card-stats span {
  border-color: rgba(222, 160, 54, 0.35);
  background: linear-gradient(180deg, #fff4ca 0%, #f7d988 100%);
  color: var(--treasure-text);
}

.student-card-stats b,
.student-card-stats small {
  display: block;
}

.student-card-stats b {
  color: var(--text-accent);
  font-family: var(--font-number);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.student-card-stats small {
  margin-top: 3px;
  color: #1a6a7c;
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 430;
  line-height: 1.15;
}

.student-card.is-selected .student-card-stats b,
.student-card.is-selected .student-card-stats small {
  color: var(--treasure-text);
}

.student-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed rgba(15, 91, 110, 0.28);
  border-radius: 8px;
  color: var(--text-sub);
  background: rgba(234, 251, 252, 0.62);
  font-weight: 430;
  line-height: 1.55;
}

.student-card-main {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.student-strip {
  position: relative;
  z-index: 1;
  grid-area: student;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-areas:
    "avatar info"
    "button button";
  align-items: center;
  gap: 16px 18px;
  width: 100%;
  margin: 0;
  padding: 26px 28px;
  overflow: visible;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(245, 254, 255, 0.82), rgba(224, 248, 251, 0.62));
  border: 1px solid rgba(93, 188, 203, 0.22);
  box-shadow:
    0 12px 28px rgba(0, 91, 116, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.student-strip::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 20px;
  width: 46px;
  height: 42px;
  background: url("assets/page2-v3/09_small_bubble_badge.png") center / contain no-repeat;
  opacity: 0.16;
  pointer-events: none;
}

.current-avatar-shell {
  grid-area: avatar;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 38%, rgba(255, 255, 255, 0.92), rgba(211, 246, 250, 0.48) 58%, rgba(89, 196, 213, 0.22) 100%);
  border: 1px solid rgba(224, 184, 103, 0.42);
  box-shadow:
    0 12px 24px rgba(0, 90, 120, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.current-avatar-shell img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.current-student-copy {
  grid-area: info;
  min-width: 0;
}

.current-label,
.current-meta {
  display: block;
  color: #55727d;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.45;
}

.current-label {
  margin-bottom: 4px;
  color: var(--text-accent);
  font-weight: 630;
}

.current-name {
  display: block;
  color: var(--text-title);
  font-family: var(--font-title);
  font-size: clamp(1.45rem, 4vw, 1.95rem);
  font-weight: 780;
  line-height: 1.12;
}

.current-meta {
  margin-top: 6px;
}

.switch-player-btn {
  grid-area: button;
  width: 100%;
  min-height: 42px;
  margin-top: 0;
  padding: 0 18px;
  border-radius: 14px;
  color: var(--deep-accent);
  border: 1px solid rgba(15, 91, 110, 0.2);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  font-size: 0.94rem;
  font-weight: 650;
  white-space: nowrap;
}

.ocean-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "hero"
    "student"
    "actions"
    "progress";
  gap: 18px;
  width: min(820px, calc(100vw - 32px));
  min-height: min(820px, calc(100vh - 48px));
  padding: 24px 28px 112px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 32px;
  background:
    radial-gradient(circle at 16% 0%, rgba(190, 242, 255, 0.48), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(255, 226, 154, 0.16), transparent 28%),
    linear-gradient(180deg, #eefcff 0%, #dcf6fb 45%, #c8ebf2 100%);
  box-shadow:
    0 18px 50px rgba(61, 158, 184, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.ocean-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 76% 31%, rgba(255, 255, 255, 0.42) 0 42px, transparent 43px),
    radial-gradient(circle at 88% 25%, rgba(255, 255, 255, 0.28) 0 18px, transparent 19px);
  pointer-events: none;
}

.ocean-stage::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -42px;
  z-index: 0;
  height: 138px;
  background:
    radial-gradient(ellipse at 24% 36%, rgba(255, 255, 255, 0.34), transparent 34%),
    radial-gradient(ellipse at 72% 22%, rgba(255, 255, 255, 0.26), transparent 30%),
    linear-gradient(180deg, rgba(119, 215, 229, 0), rgba(94, 187, 204, 0.22));
  border-radius: 50% 50% 0 0;
  pointer-events: none;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  grid-area: hero;
  min-height: 214px;
  padding: 54px 72px 42px;
  overflow: visible;
  background: url("assets/page2-v3/10_hero_frame_alt.png") center / 100% 100% no-repeat;
}

.brand-lockup h1 {
  position: relative;
  z-index: 2;
  font-size: clamp(3rem, 4.4vw, 3.72rem);
  line-height: 0.96;
  white-space: nowrap;
}

.brand-lockup .home-copy {
  position: relative;
  z-index: 2;
  max-width: 430px;
  font-size: 1.02rem;
  line-height: 1.65;
}

.brand-lockup .kicker {
  position: relative;
  z-index: 2;
}

.hero-crest,
.hero-corner {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.hero-crest {
  top: -34px;
  left: 50%;
  width: min(220px, 34%);
  transform: translateX(-50%);
  opacity: 0.92;
}

.hero-corner {
  bottom: 8px;
  width: min(132px, 22%);
  opacity: 0.68;
}

.hero-corner-left {
  left: 8px;
}

.hero-corner-right {
  right: 8px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--text-accent);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 620;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: var(--text-title);
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 5.8rem;
  line-height: 0.94;
}

h2 {
  margin-bottom: 4px;
  color: var(--text-heading);
  font-family: var(--font-title);
  font-weight: 760;
  font-size: 2.2rem;
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  color: var(--text-title);
  font-family: var(--font-title);
  font-weight: 740;
  font-size: 1.18rem;
}

.home-copy {
  max-width: 560px;
  color: var(--text-body);
  font-size: 1.12rem;
  font-weight: 430;
  line-height: 1.7;
}

.home-actions,
.modal-actions,
.console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-actions {
  position: relative;
  z-index: 1;
  grid-area: actions;
  display: grid;
  align-content: start;
  gap: 14px;
  margin-top: 0;
  max-width: none;
}

.btn,
.icon-btn {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.btn {
  padding: 0 20px;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  color: #2d3840;
  background: linear-gradient(180deg, var(--treasure-light) 0%, var(--treasure-mid) 52%, var(--treasure-coral) 100%);
  box-shadow:
    0 10px 22px rgba(206, 120, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.btn-primary:hover {
  box-shadow:
    0 16px 32px rgba(206, 120, 42, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.student-login-form .btn-primary {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  color: #34404a;
  font-size: 1.03rem;
  font-family: var(--font-ui);
  font-weight: 730;
  line-height: 1;
  letter-spacing: 0;
}

.primary-start-btn {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  color: #083849;
  font-family: var(--font-title);
  font-size: 1.08rem;
  font-weight: 760;
  background: linear-gradient(180deg, #61ddeb 0%, #27b7c9 100%);
  border: 0;
  box-shadow:
    0 12px 24px rgba(0, 133, 160, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.quick-actions {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(246, 254, 255, 0.72), rgba(226, 248, 251, 0.5));
  border: 1px solid rgba(93, 188, 203, 0.18);
  box-shadow:
    0 10px 22px rgba(0, 91, 116, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.quick-actions::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 42px;
  height: 36px;
  background: url("assets/page2-v3/09_small_bubble_badge.png") center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

.quick-actions .btn {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  color: var(--deep-accent);
  border: 1px solid rgba(72, 173, 190, 0.22);
  background: rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  font-weight: 650;
}

.action-mark {
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-right: 7px;
  place-items: center;
  border-radius: 50%;
  color: #1f8fa6;
  background: rgba(255, 255, 255, 0.64);
  font-size: 0.82rem;
  line-height: 1;
}

.quick-actions .btn-ghost {
  color: #55727d;
  background: rgba(255, 255, 255, 0.48);
}

.btn-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.btn-success {
  color: #fff;
  background: var(--kelp);
  box-shadow: 0 10px 22px rgba(47, 158, 97, 0.24);
}

.btn-ghost {
  color: var(--deep-accent);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(25, 94, 115, 0.22);
}

.compact {
  min-height: 40px;
  padding: 0 14px;
}

.icon-btn {
  display: inline-grid;
  width: 46px;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  font-size: 1.35rem;
}

.icon-btn.small {
  width: 38px;
  min-height: 38px;
}

.progress-panel {
  position: relative;
  z-index: 1;
  grid-area: progress;
  align-self: start;
  width: 100%;
  margin-top: 0;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(245, 254, 255, 0.78), rgba(225, 248, 251, 0.58));
  border: 1px solid rgba(95, 190, 205, 0.2);
  box-shadow:
    0 10px 24px rgba(0, 91, 116, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.progress-panel::before {
  content: "";
  position: absolute;
  right: 18px;
  left: auto;
  top: 16px;
  bottom: auto;
  width: 44px;
  height: 40px;
  background: url("assets/page2-v3/09_small_bubble_badge.png") center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

.progress-panel span,
.bpm-card span,
.star-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.progress-panel strong {
  display: block;
  margin-bottom: 12px;
  color: var(--text-title);
  font-family: var(--font-number);
  font-size: 2.4rem;
  font-weight: 760;
  line-height: 1.05;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 91, 110, 0.16);
}

.progress-track div {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--deep-accent), var(--treasure-mid));
  transition: width 0.3s ease;
}

.progress-panel small {
  display: block;
  margin-top: 12px;
  color: #55727d;
  font-size: 0.82rem;
  font-weight: 430;
  line-height: 1.45;
}

.home-bottom-strip {
  display: none;
}

.topbar,
.challenge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 20px;
  padding: 14px;
  border-radius: 8px;
  background: var(--glass-light);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.topbar > div,
.challenge-title-block {
  flex: 1;
  min-width: 0;
}

.map-worlds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.world-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, var(--card-top), var(--card-bottom)),
    radial-gradient(circle at 18% 22%, rgba(255, 226, 154, 0.32), transparent 26%),
    radial-gradient(circle at 88% 82%, rgba(23, 162, 168, 0.24), transparent 30%);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 26px rgba(8, 68, 86, 0.1);
}

.world-card::before {
  content: "";
  position: absolute;
  inset: auto -20px -34px -20px;
  height: 78px;
  background:
    linear-gradient(90deg, rgba(47, 158, 97, 0.26), transparent 18% 82%, rgba(47, 158, 97, 0.22)),
    radial-gradient(ellipse at 18% 100%, rgba(8, 116, 124, 0.22), transparent 60%);
  pointer-events: none;
}

.world-card.is-locked {
  filter: saturate(0.48);
  opacity: 0.72;
}

.world-card:not(.is-locked) {
  border-color: rgba(8, 116, 124, 0.18);
}

.world-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.world-focus {
  max-width: 320px;
  margin: 7px 0 0;
  color: var(--text-sub);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.world-badge,
.status-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--deep-accent);
  font-size: 0.8rem;
  font-weight: 800;
}

.world-progress {
  position: relative;
  z-index: 1;
  height: 9px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 91, 110, 0.13);
}

.world-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--deep-accent), var(--treasure-mid));
  transition: width 0.28s ease;
}

.level-path {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.level-path::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 36px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(25, 94, 115, 0.22), rgba(255, 193, 99, 0.36));
  z-index: -1;
}

.level-node {
  position: relative;
  min-height: 112px;
  padding: 8px 5px 6px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 83, 110, 0.08);
}

.level-node .node-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 0 auto 8px;
  border-radius: 50%;
  color: #fff;
  background: var(--deep-accent);
  box-shadow: 0 8px 16px rgba(15, 91, 110, 0.22);
  font-size: 1.1rem;
}

.level-node strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.82rem;
}

.level-node small {
  display: block;
  color: var(--text-sub);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.level-node.is-complete {
  background: #e8faef;
  border-color: rgba(47, 158, 97, 0.52);
  box-shadow: inset 0 0 0 1px rgba(47, 158, 97, 0.12);
}

.level-node.is-complete .node-icon {
  background: var(--kelp);
}

.level-node.is-current {
  background: #fff7df;
  border-color: var(--treasure-border);
  box-shadow: 0 0 0 2px rgba(255, 193, 99, 0.24);
}

.level-node.is-current .node-icon {
  color: var(--ink);
  background: var(--treasure-light);
}

.level-node.is-locked {
  background: #edf1f3;
  cursor: not-allowed;
  opacity: 0.62;
  border-color: rgba(83, 104, 120, 0.12);
}

.level-node.is-locked .node-icon {
  color: var(--muted);
  background: #cfd8de;
  box-shadow: none;
}

.level-node.is-boss {
  border-color: rgba(102, 85, 200, 0.34);
}

.level-node.is-boss .node-icon {
  width: 54px;
  height: 54px;
  background: var(--violet);
}

.challenge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.score-zone,
.teacher-console,
.gallery-summary,
.treasure-card {
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(237, 251, 252, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 26px rgba(8, 68, 86, 0.1);
}

.score-zone {
  position: relative;
  min-height: 0;
  padding: clamp(14px, 2.4vw, 22px);
  overflow: hidden;
}

.score-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.score-meta span,
.score-meta strong {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--foam);
  font-size: 0.96rem;
}

.measure-grid {
  display: grid;
  width: 100%;
}

.measure-card {
  min-width: 0;
  min-height: 0;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.measure-card.is-active {
  transform: translateY(-2px);
}

.card-back-mark {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 2rem;
  font-weight: 900;
}

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

.measure-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.measure-subtitle {
  margin-top: 3px;
  color: rgba(83, 104, 120, 0.76);
  font-size: 0.8rem;
  font-weight: 800;
}

.measure-count {
  min-width: 52px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--reef-dark);
  background: var(--foam);
  font-size: 0.84rem;
  font-weight: 900;
  text-align: center;
}

.beat-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.1vw, 10px);
  align-items: stretch;
}

.beat-card {
  position: relative;
  width: 100%;
  min-height: 176px;
  justify-self: center;
  padding: 0;
  perspective: 900px;
}

.beat-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.58s cubic-bezier(0.2, 0.82, 0.2, 1);
  transition-delay: var(--flip-delay, 0ms);
}

.beat-card.is-revealed .beat-card-inner {
  transform: rotateY(180deg);
}

.beat-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  height: 100%;
  min-height: 0;
  padding: 9px 7px;
  border: 1px solid rgba(16, 32, 47, 0.12);
  border-radius: 8px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 10px 22px rgba(16, 32, 47, 0.1);
}

.beat-card-back {
  place-items: center;
  background:
    linear-gradient(135deg, rgba(8, 116, 124, 0.94), rgba(23, 162, 168, 0.9)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 8px, transparent 8px 16px);
  color: #fff;
}

.beat-card-back::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 7px;
}

.beat-card-front {
  grid-template-rows: auto 1fr;
  align-items: stretch;
  gap: 3px;
  background: #fffdf7;
  transform: rotateY(180deg);
}

.beat-card.is-active .beat-card-front {
  border-color: rgba(29, 140, 255, 0.44);
  box-shadow:
    0 0 0 2px rgba(29, 140, 255, 0.12),
    0 10px 22px rgba(16, 32, 47, 0.1);
}

.beat-label {
  color: rgba(83, 104, 120, 0.86);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.card-back-index {
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.28;
  text-align: center;
}

.card-back-index {
  position: relative;
  z-index: 1;
  align-self: end;
  color: rgba(255, 255, 255, 0.82);
}

.card-notation {
  display: grid;
  min-width: 0;
  min-height: 138px;
  overflow: visible;
  place-items: center;
}

.card-notation svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.card-notation svg * {
  stroke: #a72f2a;
  fill: #a72f2a;
}

.teacher-console {
  padding: 16px;
}

.bpm-card,
.star-card {
  padding: 12px 0 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.bpm-control {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
}

.bpm-control strong {
  text-align: center;
  font-size: 1.8rem;
}

.star-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.star-control button {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #b8a45b;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 900;
}

.star-control button strong {
  font-size: 0.95rem;
  line-height: 1;
}

.star-control button small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.star-control button.is-active {
  color: #fff;
  background: var(--sun);
  border-color: var(--sun);
}

.star-control button.is-active small {
  color: rgba(16, 32, 47, 0.72);
}

.result-control button strong {
  font-size: 0.98rem;
}

.result-control button:disabled {
  cursor: default;
  opacity: 0.78;
}

.action-row .action-wide {
  grid-column: 1 / -1;
}

.energy-summary {
  flex: 1;
  margin: 0;
}

.energy-summary strong {
  display: block;
  margin-bottom: 6px;
  color: var(--reef-dark);
  font-size: 0.82rem;
}

.energy-track,
.bonus-energy-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 32, 47, 0.1);
}

.energy-track div,
.bonus-energy-track div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sun), var(--coral));
  transition: width 0.2s ease;
}

.mystery-chest-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
  padding: 9px;
  border: 1px solid rgba(102, 85, 200, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(236, 251, 255, 0.72), rgba(255, 247, 223, 0.78));
}

.mystery-chest-art {
  width: 54px;
  height: 45px;
  object-fit: contain;
  flex: 0 0 auto;
}

.console-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.console-actions .btn {
  width: 100%;
}

.action-wide {
  min-height: 42px;
}

.countdown {
  position: absolute;
  top: 18px;
  right: 18px;
  display: none;
  width: 78px;
  height: 78px;
  place-items: center;
  z-index: 3;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 116, 124, 0.82);
  box-shadow: 0 10px 24px rgba(8, 68, 86, 0.2);
  font-size: 2.8rem;
  font-weight: 900;
  pointer-events: none;
}

.countdown.is-visible {
  display: grid;
}

.countdown.is-start-cue {
  left: 50%;
  right: auto;
  top: 42%;
  width: min(220px, calc(100% - 48px));
  height: 86px;
  border-radius: 8px;
  transform: translate(-50%, -50%);
  background: rgba(255, 107, 95, 0.94);
  box-shadow: 0 18px 34px rgba(255, 107, 95, 0.28);
  font-size: 3.4rem;
}

.gallery-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 18px;
  font-weight: 800;
}

.gallery-summary button {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--foam);
  color: var(--reef-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.gallery-summary button.is-active {
  color: #fff;
  background: var(--reef);
  box-shadow: 0 8px 18px rgba(8, 116, 124, 0.18);
}

.gallery-summary button:not(.is-active):hover {
  border-color: rgba(8, 116, 124, 0.24);
}

.gallery-sections {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.gallery-section {
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 26px rgba(8, 68, 86, 0.1);
}

.gallery-section.is-mystery {
  background: linear-gradient(135deg, rgba(255, 253, 247, 0.92), rgba(236, 251, 255, 0.88));
  border-color: rgba(102, 85, 200, 0.24);
}

.gallery-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.gallery-section-head h3 {
  margin: 0 0 4px;
}

.gallery-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.45;
}

.gallery-section-head strong {
  min-width: 62px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--reef-dark);
  background: var(--foam);
  font-size: 0.84rem;
  text-align: center;
}

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

.treasure-card {
  min-height: 150px;
  padding: 16px;
  text-align: center;
}

.treasure-card.is-missing {
  opacity: 0.48;
  filter: saturate(0.2);
}

.treasure-card.is-mystery {
  border-color: rgba(102, 85, 200, 0.22);
  background: linear-gradient(180deg, #fff, #fff7df);
}

.medal-card.is-missing {
  opacity: 1;
  filter: none;
}

.medal-card .treasure-icon {
  color: var(--violet);
  background: #f2efff;
}

.medal-fragment-track {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 32, 47, 0.1);
}

.medal-fragment-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--reef));
}

.treasure-icon,
.reward-icon {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #fff7df;
  font-size: 2.1rem;
}

.treasure-card strong {
  display: block;
  margin-bottom: 6px;
}

.treasure-card small {
  color: var(--muted);
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 20;
  padding: 20px;
  background: rgba(6, 38, 49, 0.58);
}

.modal.is-open {
  display: grid;
}

.modal-dialog {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
  box-shadow: var(--shadow);
  animation: reward-pop 0.28s ease both;
}

.reward-icon {
  width: 96px;
  height: 96px;
  font-size: 3rem;
  position: relative;
  animation: treasure-bounce 0.62s cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
}

.reward-icon::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.42), transparent 62%);
  opacity: 0;
  animation: reward-glow 0.88s ease-out 0.12s both;
}

.modal.has-mystery-reward .modal-dialog {
  box-shadow:
    var(--shadow),
    0 0 0 3px rgba(255, 209, 102, 0.2);
}

.reward-name {
  margin-bottom: 4px;
  font-size: 1.8rem;
  font-weight: 900;
}

.reward-rarity,
.reward-progress {
  color: var(--muted);
  font-weight: 800;
}

.reward-bonus {
  margin: 18px 0 4px;
  padding: 14px;
  border: 1px solid rgba(255, 209, 102, 0.55);
  border-radius: 8px;
  background: #fff7df;
  text-align: left;
}

.bonus-label {
  margin-bottom: 8px;
  color: #9b6b00;
  font-size: 0.82rem;
  font-weight: 900;
}

.bonus-treasure {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bonus-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.bonus-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.bonus-item span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--coral);
  background: #fff;
  font-size: 1.05rem;
  font-weight: 900;
}

.bonus-item.is-medal span {
  color: var(--violet);
  background: #f2efff;
}

.bonus-item strong,
.bonus-item small {
  display: block;
}

.bonus-item strong {
  font-size: 0.84rem;
}

.bonus-item small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.bonus-chest-art {
  width: 58px;
  height: 48px;
  object-fit: contain;
}

.bonus-treasure span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--coral);
  font-size: 1.5rem;
  font-weight: 900;
}

.bonus-treasure strong,
.bonus-treasure small {
  display: block;
}

.bonus-treasure small,
.reward-bonus p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.reward-bonus p {
  margin: 8px 0 0;
}

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

.modal.is-judge-modal .modal-dialog {
  width: min(520px, 100%);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 238, 151, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(238, 252, 254, 0.96), rgba(220, 245, 250, 0.92));
  border: 1px solid rgba(178, 231, 242, 0.74);
}

.modal.is-judge-modal .reward-icon,
.modal.is-judge-modal .reward-name,
.modal.is-judge-modal .reward-rarity,
.modal.is-judge-modal .reward-progress,
.modal.is-judge-modal .reward-bonus,
.modal.is-judge-modal .modal-actions {
  display: none !important;
}

.judge-control {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.judge-control[hidden] {
  display: none;
}

.judge-control > p {
  margin: 0;
  color: rgba(6, 75, 112, 0.72);
  font-size: 1rem;
  font-weight: 760;
}

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

.judge-star-grid button {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 206, 91, 0.48);
  border-radius: 18px;
  color: #765400;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(180deg, rgba(255, 246, 202, 0.92), rgba(255, 224, 137, 0.74));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    0 10px 22px rgba(194, 137, 0, 0.1);
  cursor: pointer;
}

.judge-star-grid button strong {
  font-size: 1rem;
  font-weight: 900;
}

.judge-star-grid button small {
  color: rgba(118, 84, 0, 0.66);
  font-size: 0.76rem;
  font-weight: 780;
}

.judge-star-grid button.is-active,
.judge-star-grid button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.judge-fail-btn {
  min-height: 48px;
  border-radius: 16px;
  color: #08607c;
  background: rgba(238, 252, 254, 0.7);
  box-shadow: none;
}

@media (max-width: 520px) {
  .judge-star-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  h2 {
    font-size: 1.9rem;
  }

  .home-copy {
    font-size: 1.04rem;
  }

  .ocean-stage {
    width: min(760px, calc(100vw - 28px));
    padding-inline: 20px;
  }

  .quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 16px;
  }

  .hero-mascot-wrap {
    width: 142px;
    min-height: 112px;
  }

  .login-mascot {
    width: 142px;
  }

  .login-intro {
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 14px;
  }

  .login-title-shell h1 {
    font-size: 2.42rem;
  }

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

  .student-card {
    min-height: 148px;
    padding: 15px 11px 12px;
  }

  .student-avatar-box {
    width: 50px;
    height: 50px;
  }

  .student-avatar {
    width: 38px;
    height: 38px;
  }

  .student-card-stats {
    gap: 5px;
  }

  .student-card-stats span {
    padding: 5px 3px;
  }

  .student-card-stats b {
    font-size: 0.78rem;
  }

  .student-card-stats small {
    font-size: 0.6rem;
  }

  .map-worlds,
  .challenge-layout {
    grid-template-columns: 1fr;
  }

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

  .teacher-console {
    position: static;
  }

}

@media (max-width: 720px) {
  .screen {
    padding: 14px;
  }

  .login-stage {
    min-height: calc(100vh - 28px);
    padding: 16px;
    width: min(100%, calc(100vw - 28px));
    margin: 14px auto;
    border-radius: 22px;
  }

  h1 {
    font-size: 3.25rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .home-copy {
    font-size: 1rem;
  }

  .countdown {
    font-size: 2.25rem;
  }

  .countdown.is-start-cue {
    font-size: 2.65rem;
  }

  .hero-mascot-wrap {
    width: 100px;
    min-height: 82px;
  }

  .login-mascot {
    width: 100px;
    justify-self: end;
  }

  .login-title-shell {
    gap: 8px;
  }

  .login-compass {
    width: 44px;
    height: 44px;
  }

  .login-title-shell h1 {
    font-size: 1.9rem;
  }

  .login-intro .home-copy {
    margin-top: 9px;
    line-height: 1.55;
  }

  .student-login-form,
  .student-roster {
    padding: 16px;
  }

  .login-chest-icon {
    width: 46px;
    height: 46px;
  }

  .avatar-picker {
    gap: 6px;
  }

  .avatar-choice {
    min-height: 38px;
    border-radius: 8px;
  }

  .avatar-choice img {
    width: 26px;
    height: 26px;
  }

  .ocean-stage {
    min-height: calc(100vh - 28px);
    padding: 16px 12px 96px;
  }

  .home-actions .btn {
    width: 100%;
  }

  .student-strip {
    grid-template-columns: 62px minmax(0, 1fr);
    grid-template-areas:
      "avatar info"
      "button button";
    padding: 22px;
    gap: 10px 14px;
  }

  .current-avatar-shell {
    width: 56px;
    height: 56px;
  }

  .current-avatar-shell img {
    width: 42px;
    height: 42px;
  }

  .switch-player-btn {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .progress-panel {
    padding: 22px;
  }

  .quick-actions {
    padding: 14px;
  }

  .brand-lockup {
    min-height: 184px;
    padding: 46px 38px 34px;
    background-image: url("assets/page2-v3/01_hero_frame_main.png");
  }

  .brand-lockup h1 {
    font-size: clamp(2.35rem, 11vw, 3rem);
  }

  .hero-crest {
    top: -24px;
    width: 176px;
  }

  .hero-corner {
    width: 94px;
    opacity: 0.5;
  }

  .level-path {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .level-path::before {
    display: none;
  }

  .level-node {
    min-height: 104px;
  }

  .level-node .node-icon {
    width: 44px;
    height: 44px;
  }

  .beat-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .beat-card {
    width: 100%;
    min-height: 160px;
  }

  .beat-card-face {
    padding: 8px 5px;
  }

  .beat-card-back::before {
    inset: 6px;
  }

  .card-notation {
    min-height: 120px;
  }

  .topbar,
  .challenge-header {
    align-items: center;
  }
}

@media (max-width: 520px) {
  .login-intro {
    grid-template-columns: 1fr;
  }

  .avatar-current {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .avatar-change {
    grid-column: 1 / -1;
    width: 100%;
  }

  .hero-mascot-wrap {
    justify-self: center;
    width: 126px;
    min-height: 96px;
  }

  .student-list {
    grid-template-columns: 1fr;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .student-card {
    min-height: 126px;
    padding: 14px 12px 12px;
  }

  .student-delete {
    opacity: 0.82;
  }

  .student-card-open {
    grid-template-columns: 60px minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: stretch;
    min-height: 98px;
    align-items: center;
    text-align: left;
  }

  .student-avatar-box {
    grid-row: 1;
    width: 46px;
    height: 46px;
  }

  .student-avatar {
    width: 35px;
    height: 35px;
  }

  .student-card-main {
    grid-row: 1;
  }

  .student-card-stats {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .quick-actions {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 2.75rem;
  }

  .console-actions {
    grid-template-columns: 1fr;
  }

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

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

  .btn {
    width: 100%;
  }

  .challenge-header,
  .topbar {
    gap: 10px;
    padding: 10px;
  }

  .status-pill {
    display: none;
  }

  .measure-card-head {
    display: block;
  }

  .measure-count {
    display: inline-grid;
    margin-top: 8px;
  }

  .measure-subtitle {
    margin-top: 2px;
    font-size: 0.68rem;
  }
}

@keyframes reward-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes treasure-bounce {
  0% {
    transform: scale(0.72) rotate(-4deg);
  }
  58% {
    transform: scale(1.08) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes reward-glow {
  0% {
    opacity: 0.88;
    transform: scale(0.78);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

/* Ocean fairy-tale art direction layer */
:root {
  --storybook-ink: #07364d;
  --storybook-deep: #064b70;
  --storybook-current: #00a8b8;
  --storybook-lagoon: #77e3df;
  --storybook-foam: #f4ffff;
  --storybook-pearl: #fff7d7;
  --storybook-gold: #ffc65c;
  --storybook-coral: #ff7869;
  --storybook-violet: #7d6cff;
  --storybook-shadow: 0 22px 48px rgba(0, 61, 92, 0.22);
  --storybook-inner: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body {
  background:
    linear-gradient(180deg, rgba(243, 255, 255, 0.88) 0%, rgba(157, 231, 241, 0.42) 41%, rgba(58, 172, 198, 0.38) 100%),
    url("assets/ocean-storybook/bg_undersea_world.png") center / cover fixed no-repeat;
}

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

body::before {
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.42) 0 8%, transparent 8% 16%, rgba(255, 255, 255, 0.2) 16% 24%, transparent 24% 100%),
    url("assets/ocean-storybook/overlay_bubbles_glow.png") center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.72;
}

body::after {
  top: auto;
  height: min(245px, 34vh);
  background: url("assets/ocean-storybook/decor_coral_bottom_border.png") center bottom / cover no-repeat;
  opacity: 0.5;
}

.screen {
  position: relative;
  overflow-x: hidden;
}

.home-screen,
.map-screen,
.challenge-screen,
.gallery-screen {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 210, 0.46), transparent 40%),
    linear-gradient(180deg, rgba(220, 253, 255, 0.68), rgba(85, 195, 214, 0.22));
}

.home-screen::before,
.map-screen::before,
.challenge-screen::before,
.gallery-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    url("assets/ocean-storybook/overlay_bubbles_glow.png") center / cover no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(3, 77, 112, 0.08));
  opacity: 0.56;
  pointer-events: none;
}

.home-screen::after,
.map-screen::after,
.challenge-screen::after,
.gallery-screen::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: min(220px, 30vh);
  background: url("assets/ocean-storybook/decor_coral_bottom_border.png") center bottom / cover no-repeat;
  opacity: 0.44;
  pointer-events: none;
}

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

.login-stage,
.ocean-stage,
.world-card,
.score-zone,
.teacher-console,
.gallery-summary,
.gallery-section,
.modal-dialog {
  border-radius: 28px;
  box-shadow: var(--storybook-shadow), var(--storybook-inner);
}

.login-stage {
  border-color: rgba(255, 255, 255, 0.88);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(196, 242, 248, 0.74)),
    url("assets/ocean-storybook/panel_main_ocean.png") center / 100% 100% no-repeat;
}

.login-intro,
.student-roster,
.student-login-form,
.student-strip,
.quick-actions,
.progress-panel {
  border-color: rgba(255, 255, 255, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(211, 250, 253, 0.52)),
    url("assets/ocean-storybook/panel_soft_dialog.png") center / 100% 100% no-repeat;
}

.login-title-shell h1,
.brand-lockup h1,
.topbar h2,
.challenge-title-block h2 {
  color: var(--storybook-ink);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(0, 97, 130, 0.12);
}

.kicker {
  color: #087f91;
}

.btn,
.icon-btn,
.avatar-change,
.gallery-summary button,
.star-control button,
.level-node {
  border-radius: 14px;
}

.btn-primary {
  color: #113245;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 38%),
    linear-gradient(180deg, #ffe993 0%, #ffc65c 45%, #ff8067 100%);
  border: 1px solid rgba(173, 99, 22, 0.18);
  box-shadow:
    0 14px 28px rgba(227, 117, 48, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.btn-secondary,
.btn-ghost,
.icon-btn {
  color: var(--storybook-deep);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(220, 251, 253, 0.78));
  border: 1px solid rgba(48, 158, 180, 0.28);
  box-shadow:
    0 8px 18px rgba(0, 91, 124, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.primary-start-btn {
  min-height: 62px;
  color: #083349;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent 42%),
    url("assets/page2-v3/08_primary_cta_button.png") center / 100% 100% no-repeat,
    linear-gradient(180deg, #8cf7ef, #16bfd0);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 18px 34px rgba(0, 128, 154, 0.28),
    0 0 0 4px rgba(255, 255, 255, 0.24);
}

.ocean-stage {
  width: min(900px, calc(100vw - 32px));
  background:
    radial-gradient(ellipse at 50% -8%, rgba(255, 247, 190, 0.58), transparent 34%),
    url("assets/page2-frame/05_bottom_undersea_strip.png") center bottom / 100% auto no-repeat,
    linear-gradient(180deg, rgba(238, 254, 255, 0.9) 0%, rgba(177, 236, 244, 0.78) 52%, rgba(78, 183, 205, 0.54) 100%);
}

.ocean-stage::before {
  background:
    url("assets/ocean-storybook/avatar_jellyfish.png") right 36px top 56% / 98px auto no-repeat,
    url("assets/ocean-storybook/avatar_seahorse.png") left 28px bottom 86px / 76px auto no-repeat,
    url("assets/ocean-storybook/overlay_bubbles_glow.png") center / cover no-repeat;
  opacity: 0.36;
}

.brand-lockup {
  min-height: 238px;
  padding-top: 62px;
  background-image: url("assets/page2-v3/01_hero_frame_main.png");
}

.brand-lockup h1 {
  color: #08354d;
}

.student-strip {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(211, 250, 253, 0.58)),
    url("assets/page2-v3/05_current_adventurer_panel.png") center / 100% 100% no-repeat;
}

.quick-actions {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(209, 249, 252, 0.52)),
    url("assets/page2-v3/06_secondary_actions_panel.png") center / 100% 100% no-repeat;
}

.progress-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(206, 247, 251, 0.58)),
    url("assets/page2-v3/07_progress_panel.png") center / 100% 100% no-repeat;
}

.progress-track,
.world-progress,
.energy-track,
.bonus-energy-track,
.medal-fragment-track {
  background: rgba(5, 67, 95, 0.16);
  box-shadow: inset 0 2px 5px rgba(3, 54, 75, 0.14);
}

.progress-track div,
.world-progress div {
  background: linear-gradient(90deg, #00b8c8, #74f2d9 45%, #ffd45e);
  box-shadow: 0 0 14px rgba(116, 242, 217, 0.5);
}

.topbar,
.challenge-header {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(210, 249, 252, 0.6)),
    url("assets/ocean-storybook/frame_title_long.png") center / 100% 100% no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 16px 34px rgba(0, 70, 100, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.map-worlds {
  gap: 22px;
}

.world-card {
  min-height: 292px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(ellipse at 82% 20%, rgba(255, 232, 145, 0.28), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(211, 247, 250, 0.68));
}

.world-card::before {
  height: 112px;
  background:
    url("assets/ocean-storybook/decor_coral_corners.png") center bottom / cover no-repeat,
    linear-gradient(180deg, transparent, rgba(30, 172, 176, 0.18));
  opacity: 0.42;
}

.world-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 74px;
  height: 66px;
  background: url("assets/ocean-storybook/icon_treasure_chest.png") center / contain no-repeat;
  opacity: 0.32;
  pointer-events: none;
}

.world-card:nth-child(2) {
  background:
    radial-gradient(ellipse at 78% 18%, rgba(255, 130, 115, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(207, 249, 240, 0.7));
}

.world-card:nth-child(3) {
  background:
    radial-gradient(ellipse at 76% 16%, rgba(255, 210, 90, 0.25), transparent 28%),
    linear-gradient(180deg, rgba(244, 254, 255, 0.86), rgba(150, 218, 235, 0.75));
}

.world-card:nth-child(4) {
  background:
    radial-gradient(ellipse at 78% 18%, rgba(132, 116, 255, 0.24), transparent 28%),
    linear-gradient(180deg, rgba(236, 252, 255, 0.88), rgba(126, 196, 224, 0.76));
}

.world-badge,
.status-pill {
  color: #07364d;
  background: linear-gradient(180deg, #fff3b4, #ffc65c);
  border: 1px solid rgba(180, 121, 26, 0.18);
  box-shadow: 0 8px 16px rgba(209, 141, 35, 0.18);
}

.level-path::before {
  top: 39px;
  height: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.6) 0 12px, transparent 12px 20px),
    linear-gradient(90deg, #36bfd0, #ffe083, #ff8a70);
  box-shadow: 0 4px 12px rgba(0, 117, 146, 0.14);
}

.level-node {
  min-height: 120px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(229, 253, 255, 0.86));
  border: 1px solid rgba(65, 170, 188, 0.22);
}

.level-node .node-icon {
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.78), transparent 35%),
    linear-gradient(180deg, #23c5d4, #087f98);
}

.level-node.is-complete {
  background: linear-gradient(180deg, #f4fff6, #d9f8e2);
}

.level-node.is-current {
  background: linear-gradient(180deg, #fff9d9, #ffe28c);
}

.level-node.is-current .node-icon {
  background: linear-gradient(180deg, #fff5a8, #ffbd4a);
}

.level-node.is-boss .node-icon {
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.66), transparent 35%),
    linear-gradient(180deg, #9d87ff, #5144bd);
}

.score-zone,
.teacher-console {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(224, 250, 252, 0.76)),
    url("assets/ocean-storybook/panel_main_ocean.png") center / 100% 100% no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.84);
}

.score-zone::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: url("assets/ocean-storybook/decor_coral_corners.png") center bottom / cover no-repeat;
  opacity: 0.16;
  pointer-events: none;
}

.score-meta span,
.score-meta strong {
  background: linear-gradient(180deg, #faffff, #dcfbff);
  border: 1px solid rgba(57, 174, 193, 0.22);
  color: var(--storybook-deep);
}

.measure-card {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(208, 248, 252, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.68);
}

.beat-card-face {
  border-radius: 18px;
}

.beat-card-back {
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 238, 139, 0.42), transparent 28%),
    url("assets/ocean-storybook/icon_compass_badge.png") center 34% / 48px auto no-repeat,
    linear-gradient(135deg, #0a7f9a, #15c4cb 52%, #086987);
}

.beat-card-back::before {
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.48);
}

.card-back-mark {
  opacity: 0;
}

.beat-card-front {
  background:
    linear-gradient(180deg, #fffdf7, #fff4d7);
  border: 1px solid rgba(185, 124, 36, 0.22);
}

.beat-card.is-active .beat-card-front {
  border-color: rgba(255, 120, 105, 0.6);
  box-shadow:
    0 0 0 3px rgba(255, 120, 105, 0.16),
    0 16px 28px rgba(0, 80, 120, 0.16);
}

.card-notation svg * {
  stroke: #bd382e;
  fill: #bd382e;
}

.teacher-console {
  padding: 18px;
}

.mystery-chest-panel {
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 242, 155, 0.5), transparent 45%),
    linear-gradient(135deg, rgba(240, 254, 255, 0.86), rgba(255, 243, 202, 0.82));
}

.star-control button {
  background: linear-gradient(180deg, #ffffff, #e5fbfd);
  color: #927130;
}

.star-control button.is-active {
  color: #173247;
  background: linear-gradient(180deg, #fff1a3, #ffc45a);
}

.countdown {
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, #16bfd0, #076e8d);
}

.countdown.is-start-cue {
  border-radius: 22px;
  background: linear-gradient(180deg, #ff9a78, #ef565c);
}

.gallery-summary,
.gallery-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(221, 250, 252, 0.72)),
    url("assets/ocean-storybook/panel_soft_dialog.png") center / 100% 100% no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.82);
}

.gallery-section-grid {
  gap: 16px;
}

.treasure-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 238, 146, 0.36), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 252, 253, 0.86));
  border: 1px solid rgba(69, 177, 194, 0.24);
}

.treasure-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -26px;
  height: 64px;
  background: url("assets/ocean-storybook/decor_coral_bottom_border.png") center bottom / cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
}

.treasure-icon,
.reward-icon {
  background:
    radial-gradient(circle at 35% 28%, #ffffff, #fff0a3 58%, #ffc65c);
  color: #9c5530;
  box-shadow:
    0 12px 22px rgba(217, 135, 43, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal {
  background:
    linear-gradient(180deg, rgba(5, 39, 60, 0.68), rgba(1, 79, 103, 0.58)),
    url("assets/ocean-storybook/overlay_bubbles_glow.png") center / cover no-repeat;
}

.modal-dialog {
  border: 1px solid rgba(255, 255, 255, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 215, 0.9)),
    url("assets/ocean-storybook/panel_soft_dialog.png") center / 100% 100% no-repeat;
}

@media (max-width: 720px) {
  .brand-lockup {
    min-height: 206px;
    padding: 54px 28px 34px;
  }

  .ocean-stage {
    width: min(100%, calc(100vw - 28px));
  }

  .map-worlds {
    gap: 16px;
  }

  .world-card {
    padding: 18px;
    border-radius: 22px;
  }

  .measure-card {
    padding: 12px;
  }

  .beat-card-face {
    border-radius: 14px;
  }
}

@media (max-width: 460px) {
  .brand-lockup {
    min-height: 190px;
    padding-inline: 22px;
  }

  .world-head {
    display: grid;
  }

  .world-badge {
    justify-self: start;
  }

  .gallery-section-grid {
    grid-template-columns: 1fr;
  }
}

/* Reference-inspired home screen: airy crystal ocean layout */
.home-screen.is-active {
  align-items: flex-start;
  padding: clamp(18px, 3vw, 34px) 18px 46px;
}

.home-screen {
  background:
    radial-gradient(circle at 45% 2%, rgba(255, 255, 255, 0.88), transparent 22%),
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.52), transparent 24%),
    linear-gradient(180deg, #eafffb 0%, #cff7f9 42%, #a8edf5 100%);
}

.home-screen::before {
  opacity: 0.72;
  background:
    url("assets/ocean-storybook/overlay_bubbles_glow.png") center / cover no-repeat,
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.55), transparent 18%);
}

.home-screen::after {
  height: min(250px, 28vh);
  opacity: 0.42;
  background:
    url("assets/page2-frame/05_bottom_undersea_strip.png") center bottom / cover no-repeat;
}

.home-screen .ocean-stage {
  width: min(1060px, calc(100vw - 36px));
  min-height: auto;
  gap: 26px;
  padding: 0 0 18px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-screen .ocean-stage::before,
.home-screen .ocean-stage::after {
  display: none;
}

.home-screen .brand-lockup {
  display: grid;
  align-content: center;
  min-height: clamp(300px, 33vw, 410px);
  padding: clamp(70px, 8vw, 105px) clamp(42px, 8vw, 92px) clamp(54px, 6vw, 74px);
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(250, 255, 255, 0.68), rgba(198, 244, 250, 0.28)),
    url("assets/page2-v3/01_hero_frame_main.png") center / 100% 100% no-repeat;
}

.home-screen .brand-lockup::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  z-index: 0;
  border-radius: 42px;
  background:
    radial-gradient(circle at 72% 48%, rgba(59, 202, 229, 0.22), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.6), rgba(218, 250, 253, 0.08));
  pointer-events: none;
}

.home-screen .brand-lockup .kicker,
.home-screen .brand-lockup h1,
.home-screen .brand-lockup .home-copy {
  max-width: 520px;
}

.home-screen .brand-lockup .kicker {
  margin-bottom: 12px;
  color: #087e94;
  font-size: clamp(1rem, 2.1vw, 1.38rem);
  font-weight: 780;
}

.home-screen .brand-lockup h1 {
  margin-bottom: 18px;
  color: #06445f;
  font-size: clamp(4.2rem, 8.2vw, 6.9rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.88),
    0 12px 24px rgba(0, 84, 120, 0.16);
}

.home-screen .brand-lockup .home-copy {
  color: #2d6377;
  font-size: clamp(1.2rem, 2.4vw, 1.62rem);
  font-weight: 720;
  line-height: 1.38;
}

.hero-whale {
  position: absolute;
  z-index: 2;
  right: clamp(54px, 9vw, 118px);
  top: 23%;
  width: min(310px, 32%);
  filter: drop-shadow(0 24px 26px rgba(0, 112, 162, 0.18));
  pointer-events: none;
}

.home-screen .hero-crest {
  top: 5px;
  width: min(142px, 16%);
  opacity: 0;
}

.home-screen .hero-corner {
  display: none;
}

.home-screen .student-strip,
.home-screen .quick-actions,
.home-screen .progress-panel {
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(229, 253, 255, 0.52));
  box-shadow:
    0 22px 38px rgba(0, 108, 142, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(68, 191, 210, 0.14);
  backdrop-filter: blur(12px);
}

.home-screen .student-strip {
  grid-template-columns: 168px minmax(0, 1fr) 260px;
  grid-template-areas: "avatar info button";
  min-height: 208px;
  padding: 34px 44px;
  gap: 28px;
}

.home-screen .student-strip::before {
  top: 22px;
  right: 34px;
  width: 68px;
  height: 60px;
  opacity: 0.08;
}

.home-screen .current-avatar-shell {
  width: 136px;
  height: 136px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(218, 249, 253, 0.32));
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 15px 28px rgba(0, 107, 143, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.home-screen .current-avatar-shell img {
  width: 98px;
  height: 98px;
}

.home-screen .current-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #087e94;
  font-size: 1.24rem;
  font-weight: 800;
}

.home-screen .current-label::before {
  content: "◉";
  color: #279ab0;
  font-size: 0.88rem;
}

.home-screen .current-name {
  color: #06445f;
  font-family: var(--font-number);
  font-size: clamp(3.2rem, 6.5vw, 4.25rem);
  font-weight: 820;
  line-height: 0.95;
}

.home-screen .current-meta {
  margin-top: 14px;
  color: #315f75;
  font-size: 1.28rem;
  font-weight: 760;
  line-height: 1.3;
}

.current-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(25, 110, 140, 0.14);
  color: #2a7c91;
  font-size: 1.02rem;
  font-weight: 760;
}

.current-stats span {
  white-space: nowrap;
}

.home-screen .switch-player-btn {
  grid-area: button;
  justify-self: end;
  align-self: center;
  width: min(240px, 100%);
  min-height: 64px;
  border-radius: 999px;
  color: #087e94;
  font-size: 1.12rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(224, 250, 253, 0.48));
  border: 1px solid rgba(13, 139, 163, 0.36);
}

.home-screen .home-actions {
  gap: 28px;
}

.home-screen .primary-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 106px;
  padding: 0 44px;
  border-radius: 999px;
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(180deg, #42e6df 0%, #00bfd0 45%, #0799e6 100%);
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 16px 28px rgba(0, 142, 190, 0.24),
    inset 0 2px 0 rgba(255, 255, 255, 0.62),
    inset 0 -4px 0 rgba(0, 76, 165, 0.12);
  font-size: clamp(2rem, 4.2vw, 3rem);
  text-shadow: 0 2px 7px rgba(0, 75, 110, 0.24);
}

.home-screen .primary-start-btn span:first-child {
  flex: 1;
  text-align: center;
}

.home-screen .primary-start-btn span:last-child {
  width: 42px;
  margin-left: 12px;
  font-family: var(--font-body);
  font-size: 3.1rem;
  font-weight: 400;
}

.home-screen .quick-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 38px;
  padding: 34px 40px;
}

.home-screen .quick-actions::before {
  display: none;
}

.home-screen .quick-actions .btn {
  min-height: 76px;
  border-radius: 20px;
  color: #06445f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(226, 250, 253, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 18px rgba(0, 105, 140, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-size: 1.22rem;
  font-weight: 800;
}

.home-screen .action-mark {
  width: 28px;
  height: 28px;
  margin-right: 12px;
  color: #2f9aaf;
  background: transparent;
  font-size: 1.2rem;
}

.home-screen .progress-panel {
  min-height: 210px;
  padding: 36px 48px;
  overflow: hidden;
}

.home-screen .progress-panel::before {
  right: 72px;
  top: auto;
  bottom: 20px;
  width: 170px;
  height: 142px;
  background: url("assets/ocean-storybook/icon_treasure_chest.png") center / contain no-repeat;
  opacity: 0.08;
}

.home-screen .progress-panel::after {
  content: "";
  position: absolute;
  right: 78px;
  bottom: 22px;
  width: 170px;
  height: 146px;
  background: url("assets/shell-avatars/shell_avatar_10_pastel_pearl_shell.png") center / contain no-repeat;
  opacity: 0.24;
  pointer-events: none;
}

.home-screen .progress-panel span {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #087e94;
  font-size: 1.2rem;
  font-weight: 820;
}

.home-screen .progress-panel span::before {
  content: "↗";
  color: #2f9aaf;
}

.home-screen .progress-panel strong {
  margin-bottom: 22px;
  color: #06445f;
  font-size: clamp(3.8rem, 7.2vw, 5rem);
  letter-spacing: 0;
}

.home-screen .progress-track {
  width: min(660px, calc(100% - 230px));
  height: 22px;
  border-radius: 999px;
  background: rgba(49, 130, 157, 0.2);
  box-shadow: inset 0 2px 5px rgba(0, 74, 100, 0.12);
}

.home-screen .progress-track div {
  background: linear-gradient(90deg, #24c6d0, #5fe9dc);
}

.home-screen .progress-panel small {
  margin-top: 22px;
  color: #315f75;
  font-size: 1.14rem;
  font-weight: 660;
}

@media (max-width: 920px) {
  .home-screen .brand-lockup {
    min-height: 280px;
    padding: 68px 54px 48px;
  }

  .hero-whale {
    right: 46px;
    width: min(230px, 31%);
  }

  .home-screen .student-strip {
    grid-template-columns: 130px minmax(0, 1fr);
    grid-template-areas:
      "avatar info"
      "button button";
  }

  .home-screen .switch-player-btn {
    justify-self: stretch;
    width: 100%;
  }

  .home-screen .quick-actions {
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .home-screen.is-active {
    padding: 14px;
  }

  .home-screen .ocean-stage {
    width: 100%;
    gap: 18px;
  }

  .home-screen .brand-lockup {
    min-height: 250px;
    padding: 56px 30px 38px;
  }

  .home-screen .brand-lockup .kicker,
  .home-screen .brand-lockup h1,
  .home-screen .brand-lockup .home-copy {
    max-width: 70%;
  }

  .hero-whale {
    right: 22px;
    top: 32%;
    width: min(170px, 34%);
  }

  .home-screen .student-strip {
    padding: 24px;
  }

  .home-screen .current-avatar-shell {
    width: 104px;
    height: 104px;
  }

  .home-screen .current-avatar-shell img {
    width: 76px;
    height: 76px;
  }

  .home-screen .primary-start-btn {
    min-height: 82px;
    font-size: 1.8rem;
  }

  .home-screen .quick-actions {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .home-screen .progress-track {
    width: 100%;
  }

  .home-screen .progress-panel::after {
    opacity: 0.14;
  }
}

@media (max-width: 520px) {
  .home-screen .brand-lockup {
    min-height: 220px;
    padding: 46px 24px 30px;
  }

  .home-screen .brand-lockup h1 {
    font-size: 3.2rem;
  }

  .home-screen .brand-lockup .home-copy {
    font-size: 1rem;
  }

  .hero-whale {
    top: 38%;
    width: 130px;
  }

  .home-screen .student-strip {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
    border-radius: 26px;
  }

  .home-screen .current-avatar-shell {
    width: 82px;
    height: 82px;
    border-radius: 22px;
  }

  .home-screen .current-avatar-shell img {
    width: 60px;
    height: 60px;
  }

  .home-screen .current-name {
    font-size: 2.45rem;
  }

  .home-screen .current-meta {
    font-size: 0.98rem;
  }

  .current-stats {
    font-size: 0.86rem;
  }

  .home-screen .progress-panel {
    padding: 26px;
  }

  .home-screen .progress-panel strong {
    font-size: 3.4rem;
  }
}

/* Page 2 package refresh: ocean rhythm challenge lobby */
.home-screen.is-active {
  display: block;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  padding: 24px 16px 64px;
  background:
    radial-gradient(circle at 18% -4%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 88% 10%, rgba(214, 255, 255, 0.62), rgba(214, 255, 255, 0) 28%),
    linear-gradient(180deg, #e8fbf8 0%, #cff3f5 52%, #a9dfe9 100%);
}

.home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 10% 18%, rgba(255, 255, 255, 0.34) 0 10px, transparent 12px),
    radial-gradient(circle at 72% 6%, rgba(255, 255, 255, 0.28) 0 13px, transparent 15px),
    radial-gradient(circle at 94% 58%, rgba(255, 255, 255, 0.28) 0 8px, transparent 10px),
    radial-gradient(circle at 12% 72%, rgba(255, 255, 255, 0.24) 0 5px, transparent 7px);
  pointer-events: none;
}

.home-screen::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(260px, 36vh, 330px);
  bottom: 0;
  z-index: 0;
  height: auto;
  background: url("assets/page2-package/bottom-ocean-wide-clean.png") center bottom / 100% auto no-repeat;
  opacity: 0.72;
  pointer-events: none;
}

.home-screen .ocean-stage {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(100%, 760px);
  min-height: auto;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-screen .ocean-stage::before,
.home-screen .ocean-stage::after {
  display: none;
}

.home-screen .brand-lockup {
  position: relative;
  display: grid;
  align-content: center;
  min-height: clamp(292px, 43vw, 360px);
  padding: clamp(74px, 8vw, 92px) clamp(48px, 7vw, 72px) clamp(46px, 6vw, 60px) clamp(66px, 8vw, 86px);
  overflow: visible;
  background: transparent;
  isolation: isolate;
}

.home-screen .brand-lockup::before {
  content: "";
  position: absolute;
  inset: 9% 6% 11%;
  z-index: -1;
  border-radius: 44px;
  background:
    radial-gradient(circle at 70% 48%, rgba(78, 204, 226, 0.2), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.68), rgba(220, 250, 253, 0.16));
  pointer-events: none;
}

.hero-frame-img {
  position: absolute;
  inset: -34px -14px -46px;
  z-index: 0;
  width: calc(100% + 28px);
  height: calc(100% + 80px);
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.home-screen .brand-lockup .kicker,
.home-screen .brand-lockup h1,
.home-screen .brand-lockup .home-copy {
  position: relative;
  z-index: 2;
  max-width: 52%;
  transform: translateY(-12px);
}

.home-screen .brand-lockup .kicker {
  margin: 0 0 10px;
  color: #087e94;
  font-size: clamp(1rem, 2.15vw, 1.25rem);
  font-weight: 760;
  line-height: 1.2;
}

.home-screen .brand-lockup h1 {
  margin: 0 0 14px;
  color: #06445f;
  font-family: var(--font-title);
  font-size: clamp(3.55rem, 7.4vw, 4.85rem);
  font-weight: 840;
  line-height: 0.96;
  white-space: nowrap;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.92),
    0 12px 24px rgba(0, 84, 120, 0.14);
}

.home-screen .brand-lockup .home-copy {
  margin: 0;
  color: #2d6377;
  font-size: clamp(1.03rem, 2.35vw, 1.36rem);
  font-weight: 620;
  line-height: 1.45;
}

.home-screen .hero-whale {
  position: absolute;
  z-index: 2;
  right: clamp(50px, 8vw, 84px);
  top: 16%;
  width: clamp(178px, 31%, 238px);
  filter: drop-shadow(0 22px 22px rgba(0, 112, 162, 0.18));
  pointer-events: none;
  user-select: none;
}

.home-screen .student-strip,
.home-screen .quick-actions,
.home-screen .progress-panel {
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.44), transparent 30%),
    linear-gradient(180deg, rgba(246, 254, 255, 0.58), rgba(206, 241, 247, 0.42));
  box-shadow:
    0 16px 36px rgba(0, 105, 130, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.home-screen .student-strip {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 188px;
  grid-template-areas: "avatar info button";
  align-items: center;
  min-height: 154px;
  padding: 22px 36px;
  gap: 22px;
  margin-top: -6px;
}

.home-screen .current-avatar-shell,
.home-screen .current-student-copy,
.home-screen .switch-player-btn {
  transform: translateY(-8px);
}

.home-screen .student-strip::before {
  display: none;
}

.home-screen .current-avatar-shell {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(218, 249, 253, 0.36));
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 12px 24px rgba(0, 107, 143, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.home-screen .current-avatar-shell img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.home-screen .current-student-copy {
  display: grid;
  align-content: center;
  min-width: 0;
}

.home-screen .current-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: #087e94;
  font-size: 0.96rem;
  font-weight: 780;
  line-height: 1.2;
}

.home-screen .current-label::before {
  content: "◎";
  color: #279ab0;
  font-size: 0.92rem;
}

.home-screen .current-name {
  color: #06445f;
  font-family: var(--font-number);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 820;
  line-height: 0.95;
}

.home-screen .current-meta {
  margin-top: 7px;
  color: #315f75;
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.3;
}

.home-screen .current-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(25, 110, 140, 0.14);
  color: #2a7c91;
  font-size: 0.78rem;
  font-weight: 720;
}

.home-screen .current-stats span {
  white-space: nowrap;
}

.home-screen .switch-player-btn {
  justify-self: end;
  width: min(178px, 100%);
  min-height: 46px;
  border-radius: 999px;
  color: #087e94;
  font-size: 0.86rem;
  font-weight: 760;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(222, 250, 253, 0.62));
  border: 1px solid rgba(13, 139, 163, 0.38);
  box-shadow: none;
}

.home-screen .home-actions {
  display: grid;
  gap: 18px;
  margin: 0;
}

.home-screen .primary-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: 0 32px;
  border-radius: 999px;
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.48), transparent 28%),
    linear-gradient(180deg, #62e0e8 0%, #19b9d8 55%, #158edf 100%);
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 14px 30px rgba(0, 132, 170, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  font-family: var(--font-title);
  font-size: clamp(1.72rem, 4vw, 2.18rem);
  font-weight: 840;
  text-shadow: 0 2px 7px rgba(0, 75, 110, 0.22);
}

.home-screen .primary-start-btn span:first-child {
  flex: 1;
  text-align: center;
}

.home-screen .primary-start-btn span:last-child {
  width: 34px;
  margin-left: 10px;
  font-family: var(--font-body);
  font-size: 2.6rem;
  font-weight: 400;
}

.home-screen .quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding: 22px 28px;
}

.home-screen .quick-actions::before {
  display: none;
}

.home-screen .quick-actions .btn {
  min-height: 56px;
  border-radius: 20px;
  color: #06445f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(229, 252, 254, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 18px rgba(0, 105, 140, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-size: 0.96rem;
  font-weight: 780;
}

.home-screen .quick-actions .btn-ghost {
  color: #06445f;
}

.home-screen .action-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-right: 12px;
  place-items: center;
  color: #2f9aaf;
  background: transparent;
  flex: 0 0 34px;
}

.home-screen .action-mark::before {
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.home-screen .action-lightning::before {
  content: "ϟ";
}

.home-screen .action-map::before {
  content: "▮▮";
  font-size: 1.2rem;
  letter-spacing: -0.12em;
  transform: skewY(-8deg);
}

.home-screen .action-reset::before {
  content: "⟳";
}

.home-screen .btn:hover {
  transform: translateY(-1px);
}

.home-screen .btn:active {
  transform: translateY(1px);
}

.home-screen .progress-panel {
  position: relative;
  min-height: 150px;
  padding: 24px 36px 22px;
  overflow: hidden;
}

.home-screen .progress-panel::before {
  display: none;
}

.home-screen .progress-panel::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 0;
  width: 182px;
  height: 162px;
  background: url("assets/page2-package/progress-shell-reference.png") center / contain no-repeat;
  opacity: 0.82;
  pointer-events: none;
}

.home-screen .progress-panel span {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #087e94;
  font-size: 0.92rem;
  font-weight: 780;
}

.home-screen .progress-panel span::before {
  content: "↗";
  color: #2f9aaf;
}

.home-screen .progress-panel strong {
  margin-bottom: 12px;
  color: #06445f;
  font-family: var(--font-number);
  font-size: clamp(2.6rem, 5.8vw, 3.35rem);
  font-weight: 820;
  line-height: 0.92;
}

.home-screen .progress-track {
  width: min(520px, calc(100% - 175px));
  height: 14px;
  border-radius: 999px;
  background: rgba(49, 130, 157, 0.2);
  box-shadow: inset 0 2px 5px rgba(0, 74, 100, 0.12);
}

.home-screen .progress-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #24c6d0, #5fe9dc);
}

.home-screen .progress-panel small {
  display: block;
  width: min(100%, 500px);
  margin-top: 12px;
  color: #315f75;
  font-size: 0.84rem;
  font-weight: 560;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .home-screen.is-active {
    padding: 16px 12px 52px;
  }

  .home-screen .ocean-stage {
    gap: 16px;
  }

  .home-screen .brand-lockup {
    min-height: 286px;
    padding: 78px 42px 42px 72px;
  }

  .home-screen .brand-lockup .kicker,
  .home-screen .brand-lockup h1,
  .home-screen .brand-lockup .home-copy {
    max-width: 55%;
    transform: translateY(-16px);
  }

  .home-screen .brand-lockup h1 {
    font-size: clamp(3.15rem, 9.2vw, 3.9rem);
  }

  .home-screen .hero-whale {
    right: 54px;
    top: 17%;
    width: clamp(164px, 28vw, 192px);
  }

  .home-screen .student-strip {
    grid-template-columns: 92px minmax(0, 1fr) 168px;
    grid-template-areas: "avatar info button";
    min-height: auto;
    padding: 20px 26px;
    border-radius: 26px;
    gap: 18px;
  }

  .home-screen .current-avatar-shell {
    width: 82px;
    height: 82px;
    border-radius: 18px;
  }

  .home-screen .current-avatar-shell img {
    width: 66px;
    height: 66px;
  }

  .home-screen .current-name {
    font-size: 2.25rem;
  }

  .home-screen .current-meta {
    font-size: 0.78rem;
  }

  .home-screen .current-stats {
    gap: 6px 10px;
    font-size: 0.7rem;
  }

  .home-screen .switch-player-btn {
    justify-self: end;
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .home-screen .current-avatar-shell,
  .home-screen .current-student-copy,
  .home-screen .switch-player-btn {
    transform: translateY(-6px);
  }

  .home-screen .primary-start-btn {
    min-height: 72px;
    font-size: 1.65rem;
  }

  .home-screen .quick-actions {
    gap: 14px;
    padding: 18px;
  }

  .home-screen .quick-actions .btn {
    min-height: 58px;
    font-size: 0.96rem;
  }

  .home-screen .progress-panel {
    min-height: 138px;
    padding: 22px 26px 20px;
  }

  .home-screen .progress-track {
    width: 100%;
  }

  .home-screen .progress-panel::after {
    width: 150px;
    height: 134px;
    right: 0;
    opacity: 0.72;
  }
}

@media (max-width: 520px) {
  .home-screen .brand-lockup {
    min-height: 246px;
    padding: 68px 24px 32px 42px;
  }

  .home-screen .brand-lockup .kicker,
  .home-screen .brand-lockup h1,
  .home-screen .brand-lockup .home-copy {
    max-width: 64%;
    transform: translateY(-14px);
  }

  .home-screen .brand-lockup .home-copy {
    font-size: 0.92rem;
  }

  .home-screen .hero-whale {
    right: 22px;
    top: 27%;
    width: 132px;
  }

  .home-screen .quick-actions {
    grid-template-columns: 1fr;
  }

  .home-screen .student-strip {
    grid-template-columns: 82px minmax(0, 1fr);
    grid-template-areas:
      "avatar info"
      "button button";
  }

  .home-screen .switch-player-btn {
    justify-self: stretch;
  }

  .home-screen .progress-panel strong {
    font-size: 2.75rem;
  }
}

/* Page 3 level select refresh: compact ocean map */
.map-screen.is-active {
  display: block;
  padding: clamp(14px, 2.4vw, 26px) 18px 108px;
  background:
    radial-gradient(ellipse at 50% -12%, rgba(255, 248, 198, 0.5), transparent 36%),
    radial-gradient(circle at 12% 28%, rgba(135, 238, 226, 0.28), transparent 25%),
    linear-gradient(180deg, #dffcff 0%, #aee8f2 48%, #62bdd4 100%);
}

.map-screen::before {
  background:
    url("assets/ocean-storybook/overlay_bubbles_glow.png") center / cover no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(0, 87, 122, 0.06));
  opacity: 0.5;
}

.map-screen::after {
  height: min(210px, 28vh);
  background:
    url("assets/backgrounds/bg_reef_banner_high.png") center bottom / min(100%, 1120px) auto no-repeat,
    radial-gradient(ellipse at 18% 100%, rgba(19, 128, 151, 0.22), transparent 58%),
    radial-gradient(ellipse at 82% 100%, rgba(19, 128, 151, 0.18), transparent 58%);
  opacity: 0.58;
}

.map-screen .map-header {
  position: relative;
  overflow: hidden;
  width: min(1040px, calc(100vw - 32px));
  min-height: 104px;
  margin: 0 auto 14px;
  padding: 22px 32px;
  border: 0;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(202, 248, 252, 0.18)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(214, 250, 253, 0.42));
  box-shadow: 0 16px 36px rgba(0, 92, 126, 0.12);
}

.map-screen .map-header > .icon-btn,
.map-screen .map-header > div,
.map-screen .map-header > .btn {
  position: relative;
  z-index: 3;
}

.header-top-ornament,
.header-bottom-divider {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.header-top-ornament {
  left: 50%;
  top: -6px;
  z-index: 2;
  width: min(48%, 520px);
  transform: translateX(-50%);
}

.header-bottom-divider {
  left: 50%;
  bottom: 12px;
  z-index: 2;
  width: min(22%, 220px);
  transform: translateX(-50%);
}

.map-screen .map-header h2 {
  margin: 0;
  color: #073a54;
  font-size: clamp(2.05rem, 4vw, 3.05rem);
  line-height: 0.95;
}

.map-screen .map-header .kicker {
  margin-bottom: 5px;
  color: #087f91;
  font-size: 0.86rem;
  font-weight: 760;
}

.map-worlds {
  display: flex;
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  margin: 0 auto;
  gap: 12px;
  flex-direction: column;
}

.map-area-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.map-area-card,
.map-level-card {
  font-family: var(--font-ui);
}

.map-area-card,
.map-level-card {
  border: 1px solid rgba(255, 255, 255, 0.68);
  color: #113f55;
  cursor: pointer;
}

.map-area-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  min-height: 84px;
  gap: 10px;
  padding: 12px 12px;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(205, 246, 249, 0.48));
  box-shadow:
    0 12px 26px rgba(0, 92, 126, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  text-align: left;
}

.map-area-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
}

.map-area-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 78, 110, 0.12));
}

.map-area-card.is-locked .map-area-icon::after {
  content: "锁";
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #9fcbe0, #6f9db4);
  box-shadow: 0 5px 10px rgba(29, 93, 123, 0.18);
  font-size: 0.68rem;
  font-weight: 860;
  transform: translate(-50%, -50%);
}

.map-area-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.map-area-card strong {
  overflow: hidden;
  color: #073a54;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-area-card small {
  overflow: hidden;
  color: #4b7583;
  font-size: 0.72rem;
  font-weight: 520;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-area-card em {
  position: absolute;
  right: 10px;
  top: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #087685;
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 680;
}

.map-area-card.is-active {
  border-color: rgba(255, 198, 92, 0.78);
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 224, 128, 0.48), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 226, 0.82), rgba(211, 250, 248, 0.58));
  box-shadow:
    0 15px 32px rgba(0, 102, 133, 0.12),
    0 0 0 3px rgba(255, 210, 108, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.map-area-card.is-active em {
  color: #8a5a00;
  background: linear-gradient(180deg, #fff3b4, #ffc65c);
}

.map-area-card.is-locked {
  opacity: 0.54;
  filter: saturate(0.45);
}

.current-area-panel {
  position: relative;
  overflow: hidden;
  min-height: 336px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.76) 0 47%, rgba(220, 250, 252, 0.62) 47% 100%),
    radial-gradient(ellipse at 92% 10%, rgba(255, 221, 121, 0.28), transparent 32%);
  box-shadow:
    0 20px 46px rgba(0, 91, 124, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.current-area-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.62) 0 49%, rgba(255, 255, 255, 0.18) 72%, transparent);
  pointer-events: none;
}

.current-area-scene {
  position: absolute;
  right: -34px;
  top: 14px;
  width: min(47%, 440px);
  height: 158px;
  object-fit: contain;
  opacity: 0.9;
  pointer-events: none;
}

.current-area-copy,
.current-area-progress,
.map-level-grid {
  position: relative;
  z-index: 1;
}

.current-area-copy {
  max-width: 54%;
}

.map-eyebrow {
  margin: 0 0 6px;
  color: #087f91;
  font-size: 0.8rem;
  font-weight: 760;
}

.current-area-copy h3 {
  margin: 0;
  color: #073a54;
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
  line-height: 1;
}

.current-area-copy p:not(.map-eyebrow) {
  margin: 10px 0 0;
  color: #3f6877;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.current-area-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.current-area-meta span {
  padding: 6px 10px;
  border: 1px solid rgba(48, 158, 180, 0.2);
  border-radius: 999px;
  color: #0a6676;
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
  font-weight: 680;
}

.current-area-progress {
  height: 10px;
  max-width: 54%;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(5, 67, 95, 0.13);
  box-shadow: inset 0 2px 5px rgba(3, 54, 75, 0.12);
}

.current-area-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #21bfd0, #74f2d9 58%, #ffd45e);
  box-shadow: 0 0 14px rgba(116, 242, 217, 0.48);
}

.map-level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.map-level-card {
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  min-height: 92px;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(226, 252, 253, 0.72));
  box-shadow:
    0 10px 22px rgba(0, 91, 124, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  text-align: left;
}

.map-level-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: rgba(40, 177, 195, 0.22);
}

.map-level-icon {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
}

.map-level-icon span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.7), transparent 36%),
    linear-gradient(180deg, #26c6d4, #087e98);
  font-family: var(--font-number);
  font-size: 1.08rem;
  font-weight: 860;
  box-shadow: 0 8px 15px rgba(0, 104, 135, 0.18);
}

.map-level-icon img {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(80, 56, 130, 0.16));
}

.map-level-card.is-current .map-level-icon::before {
  content: "";
  position: absolute;
  display: none;
  inset: -14px;
  background:
    radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.94), rgba(255, 229, 146, 0.76) 42%, rgba(255, 190, 74, 0.92) 100%);
  opacity: 0.86;
}

.map-level-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.map-level-copy strong {
  color: #083a54;
  font-size: 1rem;
  font-weight: 780;
}

.map-level-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: #557987;
  font-size: 0.74rem;
  font-weight: 520;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-level-card.is-current {
  border-color: rgba(255, 198, 92, 0.74);
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 226, 132, 0.34), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 226, 0.9), rgba(222, 250, 249, 0.78));
  box-shadow:
    0 13px 28px rgba(0, 102, 133, 0.12),
    0 0 0 3px rgba(255, 210, 108, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.map-level-card.is-current::before {
  background: linear-gradient(90deg, #ffd45e, #ff9e73);
}

.map-level-card.is-complete .map-level-icon span {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(180deg, #60d98a, #2f9e61);
}

.map-level-card.is-locked {
  opacity: 0.56;
  filter: saturate(0.38);
}

.map-level-card.is-locked .map-level-icon span {
  background: linear-gradient(180deg, #c9d7dc, #9db1ba);
  box-shadow: none;
}

.map-level-card.is-boss {
  border-color: rgba(117, 96, 200, 0.26);
  background:
    radial-gradient(circle at 18% 22%, rgba(154, 136, 255, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(226, 244, 253, 0.72));
}

.current-area-panel.is-preview-locked .map-level-card:not(.is-current) {
  opacity: 0.5;
}

@media (max-width: 900px) {
  .current-area-copy,
  .current-area-progress {
    max-width: 60%;
  }

  .current-area-scene {
    width: 42%;
  }
}

@media (max-width: 680px) {
  .map-screen.is-active {
    padding-inline: 12px;
  }

  .map-screen .map-header,
  .map-worlds {
    width: min(100%, calc(100vw - 24px));
  }

  .map-screen .map-header {
    min-height: 96px;
    padding: 20px;
  }

  .current-area-panel {
    padding: 22px;
  }

  .current-area-scene {
    top: 12px;
    right: -26px;
    width: 45%;
    height: 132px;
    opacity: 0.58;
  }

  .current-area-copy,
  .current-area-progress {
    max-width: 100%;
  }

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

  .map-level-card {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 98px;
    padding: 12px;
  }

  .map-level-icon {
    width: 52px;
    height: 52px;
  }

  .map-level-icon span {
    width: 38px;
    height: 38px;
  }

  .map-level-icon img {
    width: 52px;
  }

}

@media (max-width: 460px) {
  .map-area-selector {
    grid-template-columns: 1fr;
  }

  .map-area-card {
    min-height: 82px;
  }

  .map-level-grid {
    grid-template-columns: 1fr;
  }
}

/* Page 3 model image pass: shell-map composition */
.map-screen.is-active {
  padding: 30px 32px 104px;
  background:
    radial-gradient(ellipse at 50% -6%, rgba(255, 255, 255, 0.68), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(160, 241, 250, 0.5), transparent 24%),
    radial-gradient(circle at 12% 52%, rgba(74, 190, 215, 0.16), transparent 28%),
    linear-gradient(180deg, #dbfbfe 0%, #a4e7f0 35%, #70ccdc 70%, #42aac1 100%);
}

.map-screen::before {
  background:
    radial-gradient(circle at 70% 22%, rgba(255, 255, 255, 0.76), transparent 9%),
    url("assets/ocean-storybook/overlay_bubbles_glow.png") center / cover no-repeat;
  opacity: 0.68;
}

.map-screen::after {
  bottom: -64px;
  height: min(280px, 24vh);
  background:
    linear-gradient(180deg, transparent 0%, rgba(79, 187, 211, 0.08) 38%, rgba(38, 147, 178, 0.14) 100%),
    url("assets/backgrounds/bg_reef_banner_high.png") center bottom / min(100%, 1080px) auto no-repeat,
    radial-gradient(ellipse at 16% 100%, rgba(10, 112, 142, 0.18), transparent 58%),
    radial-gradient(ellipse at 86% 100%, rgba(10, 112, 142, 0.16), transparent 58%);
  opacity: 0.48;
}

.map-screen .map-header,
.map-worlds {
  width: min(1180px, calc(100vw - 48px));
}

.map-screen .map-header {
  min-height: 116px;
  margin-bottom: 20px;
  padding: 24px 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.5), transparent 28%),
    linear-gradient(180deg, rgba(226, 253, 255, 0.84), rgba(171, 236, 245, 0.72)),
    linear-gradient(135deg, rgba(96, 204, 226, 0.18), rgba(29, 143, 180, 0.1));
  box-shadow:
    0 18px 36px rgba(0, 93, 125, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 0 0 1px rgba(71, 181, 205, 0.14);
}

.map-screen .map-header .icon-btn {
  width: 66px;
  height: 66px;
  border: 1px solid rgba(118, 218, 235, 0.48);
  border-radius: 18px;
  color: #07527e;
  background:
    radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.5), transparent 42%),
    linear-gradient(180deg, rgba(223, 252, 255, 0.78), rgba(157, 232, 243, 0.62));
  box-shadow:
    0 8px 18px rgba(0, 91, 124, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  font-size: 2.2rem;
  font-weight: 820;
}

.map-screen .map-header .btn {
  min-height: 66px;
  padding-inline: 24px;
  border: 1px solid rgba(118, 218, 235, 0.48);
  border-radius: 18px;
  color: #08436c;
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.5), transparent 42%),
    linear-gradient(180deg, rgba(224, 253, 255, 0.78), rgba(157, 232, 243, 0.62));
  box-shadow:
    0 8px 18px rgba(0, 91, 124, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  font-size: 1.32rem;
  font-weight: 820;
}

.map-screen .header-top-ornament {
  top: -12px;
  width: min(46%, 500px);
}

.map-screen .header-bottom-divider {
  bottom: 8px;
  width: min(18%, 180px);
}

.map-screen .map-header > div {
  padding-left: 8px;
}

.map-screen .map-header .kicker {
  margin: 0 0 4px;
  color: #087fb0;
  font-size: 0.96rem;
  font-weight: 780;
}

.map-screen .map-header h2 {
  color: #07365f;
  font-size: clamp(2.45rem, 4.4vw, 3.3rem);
  font-weight: 860;
  line-height: 0.96;
}

.map-worlds {
  gap: 16px;
}

.map-area-selector {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.map-area-card {
  grid-template-columns: 90px minmax(0, 1fr);
  min-height: 124px;
  gap: 8px;
  padding: 16px 12px 14px;
  border-radius: 20px;
  border-color: rgba(188, 239, 247, 0.76);
  background:
    radial-gradient(circle at 26% 0%, rgba(255, 255, 255, 0.46), transparent 42%),
    linear-gradient(180deg, rgba(222, 252, 255, 0.82), rgba(159, 231, 243, 0.66));
  box-shadow:
    0 10px 26px rgba(0, 86, 118, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 0 0 1px rgba(72, 184, 208, 0.12);
}

.map-area-icon {
  width: 88px;
  height: 88px;
}

.map-area-card img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  object-position: center;
}

.map-area-card strong {
  color: #07548b;
  font-size: 1.14rem;
  font-weight: 820;
  line-height: 1.18;
}

.map-area-card small {
  color: #79a9c2;
  font-size: 0.84rem;
  font-weight: 760;
}

.map-area-card em {
  top: 8px;
  right: 8px;
  padding: 5px 10px;
  color: #e27a00;
  background: #fff2ba;
  font-size: 0.82rem;
  box-shadow: 0 4px 10px rgba(224, 144, 15, 0.15);
}

.map-area-card.is-active {
  border-color: #49d4e2;
  background:
    radial-gradient(circle at 22% 26%, rgba(255, 234, 142, 0.5), transparent 38%),
    linear-gradient(180deg, rgba(245, 254, 239, 0.88), rgba(162, 236, 241, 0.7));
  box-shadow:
    0 14px 30px rgba(0, 112, 147, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 0 0 1px rgba(38, 184, 205, 0.18);
}

.map-area-card.is-locked {
  opacity: 1;
  filter: none;
}

.map-area-card.is-locked img {
  opacity: 0.68;
  filter: saturate(0.7) contrast(0.96);
}

.map-area-card.is-locked .map-area-icon::after {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

.map-area-card.is-locked strong {
  color: #246e97;
}

.map-area-card.is-active em {
  color: #b96500;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 50%),
    #ffd766;
}

.current-area-panel {
  min-height: 610px;
  padding: 30px 34px 38px;
  border-radius: 34px;
  border: 2px solid rgba(190, 241, 248, 0.78);
  background:
    radial-gradient(circle at 84% 12%, rgba(255, 255, 255, 0.38), transparent 28%),
    linear-gradient(180deg, rgba(220, 252, 255, 0.84), rgba(142, 224, 238, 0.66)),
    linear-gradient(135deg, rgba(100, 205, 226, 0.16), rgba(25, 143, 178, 0.08));
  box-shadow:
    0 22px 46px rgba(0, 91, 124, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 0 0 1px rgba(63, 177, 203, 0.14);
}

.current-area-panel::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  height: 196px;
  border-radius: 24px 24px 12px 12px;
  background:
    linear-gradient(90deg, rgba(226, 253, 255, 0.86) 0 38%, rgba(201, 246, 252, 0.52) 56%, rgba(116, 206, 226, 0.12)),
    url("assets/backgrounds/bg_reef_banner_high.png") right center / cover no-repeat;
  pointer-events: none;
}

.current-area-panel::after {
  background: linear-gradient(180deg, transparent 0 35%, rgba(180, 238, 247, 0.28) 45%, transparent 100%);
}

.current-area-scene {
  display: none;
}

.current-area-status {
  position: absolute;
  right: 34px;
  top: 50px;
  z-index: 2;
  display: inline-flex;
  width: 118px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: #c76500;
  background: transparent;
  filter: drop-shadow(0 10px 16px rgba(225, 139, 18, 0.14));
  font-size: 1.08rem;
  font-weight: 820;
}

.current-area-status span {
  position: relative;
  z-index: 1;
}

.current-area-copy {
  max-width: 58%;
  min-height: 174px;
}

.current-area-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.current-area-title-row h3 {
  margin: 0;
  color: #07548b;
  font-size: clamp(2.15rem, 4.0vw, 2.9rem);
  font-weight: 860;
  line-height: 1;
}

.map-eyebrow {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  color: #0689b4;
  background: rgba(193, 244, 250, 0.78);
  font-size: 0.92rem;
  font-weight: 780;
  white-space: nowrap;
}

.current-area-chest {
  display: inline-grid;
  grid-template-columns: 34px auto minmax(92px, 132px);
  align-items: center;
  gap: 10px;
  width: min(100%, 390px);
  margin: 22px 0 0;
  padding: 8px 12px 8px 9px;
  border: 1px solid rgba(184, 239, 247, 0.72);
  border-radius: 999px;
  color: #084879;
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.48), transparent 42%),
    linear-gradient(180deg, rgba(224, 252, 255, 0.82), rgba(164, 234, 244, 0.66));
  box-shadow:
    0 8px 18px rgba(0, 100, 140, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.current-area-chest::before {
  content: none;
}

.treasure-progress-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(180deg, #2fd0dc, #0d89b4);
  box-shadow: 0 6px 12px rgba(0, 118, 158, 0.18);
  font-size: 1rem;
  font-weight: 900;
}

.treasure-progress-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.treasure-progress-copy strong {
  overflow: hidden;
  color: #07548b;
  font-size: 0.98rem;
  font-weight: 830;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treasure-progress-copy small {
  color: #0b7aa7;
  font-family: var(--font-number);
  font-size: 0.9rem;
  font-weight: 820;
  line-height: 1;
}

.treasure-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(5, 75, 106, 0.14);
  box-shadow: inset 0 1px 3px rgba(0, 58, 86, 0.14);
}

.treasure-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #23c4da, #6ff2da 62%, #ffd35c);
  box-shadow: 0 0 12px rgba(111, 242, 218, 0.46);
}

.current-area-goal,
.current-area-copy p:not(.map-eyebrow):not(.current-area-chest) {
  margin-top: 18px;
  color: #07548b;
  font-size: 1.05rem;
  font-weight: 720;
}

.current-area-meta,
.current-area-progress {
  display: none;
}

.map-level-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.map-level-card {
  display: flex;
  min-height: 176px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 22px 18px 28px;
  border-radius: 20px;
  border-color: rgba(177, 234, 244, 0.72);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.42), transparent 38%),
    linear-gradient(180deg, rgba(219, 250, 254, 0.8), rgba(153, 224, 237, 0.62));
  box-shadow:
    0 10px 22px rgba(0, 84, 114, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 0 0 1px rgba(35, 155, 187, 0.1);
  text-align: center;
}

.map-level-card::before {
  display: none;
}

.map-level-icon {
  position: absolute;
  left: 22px;
  top: 22px;
  width: 46px;
  height: 46px;
}

.map-level-icon span {
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(180deg, #9bc3d4, #6d99ad);
  font-size: 0.98rem;
}

.map-level-stars {
  position: absolute;
  left: 84px;
  top: 28px;
  display: flex;
  gap: 8px;
  color: #bde4f6;
  font-size: 1.48rem;
  letter-spacing: 0;
}

.map-level-stars i {
  display: block;
  width: 22px;
  height: 22px;
  background: url("assets/ui_components/star_empty.svg") center / contain no-repeat;
  font-style: normal;
  opacity: 0.58;
  filter: drop-shadow(0 2px 3px rgba(21, 108, 145, 0.08));
}

.map-level-stars i.is-lit {
  background-image: url("assets/ui_components/star_filled.svg");
  opacity: 1;
}

.map-level-lock-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.62), transparent 38%),
    linear-gradient(180deg, #b7e7f1, #6c9fb9);
  box-shadow:
    0 7px 13px rgba(26, 99, 130, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 860;
}

.map-level-lock-mark.is-boss-lock {
  position: absolute;
  right: -6px;
  bottom: -2px;
  z-index: 2;
  width: 30px;
  height: 30px;
  font-size: 0.68rem;
}

.map-level-copy {
  gap: 10px;
  width: 100%;
}

.map-level-copy strong {
  color: #074572;
  font-size: 1.28rem;
  font-weight: 840;
}

.map-level-copy small {
  color: #5d7890;
  font-size: 0.92rem;
  font-weight: 680;
  -webkit-line-clamp: 1;
}

.map-level-card.is-current {
  border-color: #ffc33d;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 157, 104, 0.24), transparent 22%),
    linear-gradient(180deg, rgba(255, 246, 203, 0.86), rgba(187, 237, 229, 0.66));
  box-shadow:
    0 14px 28px rgba(222, 139, 18, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 0 0 1px rgba(255, 200, 70, 0.18);
}

.map-level-card.is-current::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 16px;
  width: 34px;
  height: 34px;
  background: url("assets/rewards/reward_starfish_high.png") center / contain no-repeat;
  filter: drop-shadow(0 3px 6px rgba(201, 92, 42, 0.18));
}

.map-level-card.is-current .map-level-icon {
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
}

.map-level-card.is-current .map-level-icon::before {
  inset: -7px;
  opacity: 1;
  background:
    radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.92), rgba(255, 227, 140, 0.75) 42%, rgba(255, 189, 75, 0.92) 100%);
}

.map-level-card.is-current .map-level-icon span {
  width: 54px;
  height: 54px;
  color: #064371;
  position: relative;
  z-index: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.95), rgba(255, 235, 154, 0.92) 48%, rgba(255, 196, 74, 0.95) 100%);
  box-shadow:
    0 5px 10px rgba(219, 143, 22, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-size: 1.32rem;
}

.map-level-card.is-current .map-level-stars {
  display: none;
}

.map-level-card.is-complete:not(.is-current) {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.36), transparent 38%),
    linear-gradient(180deg, rgba(219, 253, 235, 0.76), rgba(153, 224, 206, 0.58));
}

.map-level-card.is-locked {
  opacity: 1;
  filter: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.36), transparent 38%),
    linear-gradient(180deg, rgba(212, 244, 249, 0.76), rgba(154, 213, 227, 0.56));
}

.map-level-card.is-locked .map-level-icon span {
  color: #fff;
  background: linear-gradient(180deg, #a8c2d0, #7798aa);
}

.map-level-card.is-locked .map-level-copy strong {
  color: #0b4773;
}

.map-level-card.is-locked .map-level-copy small {
  color: #6d92aa;
}

.map-level-card.is-boss .map-level-icon {
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  width: 92px;
  height: 82px;
}

.map-level-card.is-boss .map-level-icon img {
  width: 92px;
  height: 82px;
  filter: drop-shadow(0 9px 15px rgba(110, 80, 210, 0.24));
}

.map-level-card.is-boss .map-level-stars {
  left: 24px;
  top: 24px;
}

.map-level-card.is-boss {
  border-color: rgba(165, 135, 255, 0.48);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 221, 118, 0.22), transparent 24%),
    linear-gradient(135deg, rgba(232, 232, 255, 0.78), rgba(165, 232, 244, 0.62));
  box-shadow:
    0 0 0 1px rgba(255, 214, 92, 0.16),
    0 12px 24px rgba(102, 85, 200, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.current-area-panel.is-preview-locked .map-level-card {
  opacity: 0.72;
}

.collapsed-area-list {
  display: grid;
  gap: 14px;
}

.collapsed-area {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto 54px;
  align-items: center;
  gap: 12px;
  min-height: 90px;
  padding: 12px 16px;
  border: 1px solid rgba(181, 237, 246, 0.72);
  border-radius: 22px;
  color: #07548b;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.42), transparent 40%),
    linear-gradient(180deg, rgba(216, 250, 254, 0.82), rgba(148, 224, 238, 0.64));
  box-shadow:
    0 10px 22px rgba(0, 84, 114, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 0 0 1px rgba(35, 155, 187, 0.1);
  text-align: left;
  cursor: pointer;
}

.collapsed-area img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.collapsed-area span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.collapsed-area strong {
  color: #07548b;
  font-size: 1.55rem;
  font-weight: 850;
  white-space: nowrap;
}

.collapsed-area small {
  padding: 6px 12px;
  border-radius: 999px;
  color: #0689b4;
  background: rgba(186, 244, 250, 0.68);
  font-size: 0.88rem;
  font-weight: 760;
  white-space: nowrap;
}

.collapsed-area em {
  color: #07548b;
  font-size: 1rem;
  font-style: normal;
  font-weight: 820;
  white-space: nowrap;
}

.collapsed-area em::before {
  content: "锁";
  margin-right: 8px;
  color: #8aabba;
}

.collapsed-area:not(.is-locked) em::before {
  content: "";
  margin: 0;
}

.collapsed-area b {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: #07548b;
  background: rgba(220, 252, 255, 0.66);
  box-shadow: 0 6px 14px rgba(0, 84, 114, 0.08);
  font-size: 1.4rem;
}

@media (max-width: 760px) {
  .map-screen.is-active {
    padding: 18px 14px 104px;
  }

  .map-screen .map-header,
  .map-worlds {
    width: min(100%, calc(100vw - 28px));
  }

  .map-screen .map-header {
    min-height: 96px;
    padding: 18px 16px;
  }

  .map-screen .map-header .icon-btn,
  .map-screen .map-header .btn {
    width: auto;
    min-height: 52px;
    height: 52px;
    padding-inline: 14px;
    font-size: 1.05rem;
  }

  .map-screen .map-header h2 {
    font-size: 2.15rem;
  }

  .map-area-selector {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 540px);
    margin-inline: auto;
    gap: 9px;
  }

  .map-area-card {
    grid-template-columns: 49px minmax(0, 1fr);
    min-height: 74px;
    gap: 6px;
    padding: 8px 8px 7px 9px;
    border-radius: 12px;
  }

  .map-area-icon {
    justify-self: center;
    width: 47px;
    height: 40px;
    transform: translateY(3px);
  }

  .map-area-card img {
    justify-self: center;
    width: 47px;
    height: 40px;
    object-fit: contain;
    transform: none;
  }

  .map-area-card.is-locked .map-area-icon::after {
    width: 21px;
    height: 21px;
    font-size: 0.58rem;
  }

  .map-area-card span {
    gap: 3px;
    transform: translateY(3px);
  }

  .map-area-card strong {
    font-size: 0.82rem;
    line-height: 1.18;
  }

  .map-area-card small {
    color: #0f6f95;
    font-size: 0.66rem;
    font-weight: 720;
    line-height: 1;
  }

  .map-area-card small.is-locked-progress {
    display: grid;
    gap: 3px;
    color: #9fc6d7;
    font-size: 0.62rem;
    font-weight: 720;
  }

  .map-area-card small.is-locked-progress span:first-child {
    color: #9fc7d8;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
  }

  .map-area-card small.is-locked-progress span:last-child {
    color: #8eb8cb;
    font-size: 0.63rem;
    line-height: 1;
  }

  .map-area-card.is-locked span {
    gap: 3px;
    transform: translateY(2px);
  }

  .map-area-card em {
    top: 4px;
    right: 6px;
    padding: 3px 6px;
    font-size: 0.62rem;
  }

  .current-area-panel {
    min-height: 0;
    padding: 24px 20px 28px;
  }

  .current-area-panel::before {
    left: 12px;
    right: 12px;
    top: 12px;
    height: 186px;
    opacity: 0.78;
  }

  .current-area-status {
    right: 22px;
    top: 42px;
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .current-area-copy {
    max-width: 78%;
    min-height: 172px;
  }

  .current-area-title-row h3 {
    font-size: 2.25rem;
  }

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

  .map-level-card {
    min-height: 156px;
  }

  .collapsed-area {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    min-height: 78px;
  }

  .collapsed-area img {
    width: 58px;
    height: 58px;
  }

  .collapsed-area span {
    display: grid;
    gap: 4px;
  }

  .collapsed-area strong {
    font-size: 1.26rem;
  }

  .collapsed-area b {
    display: none;
  }

}

@media (max-width: 500px) {
  .map-screen .header-top-ornament {
    top: 0;
    width: 220px;
  }

  .map-screen .header-bottom-divider {
    bottom: 8px;
    width: 92px;
  }

  .map-level-grid {
    grid-template-columns: 1fr;
  }

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

  .current-area-copy {
    max-width: 100%;
  }

  .current-area-status {
    position: relative;
    right: auto;
    top: auto;
    z-index: 2;
    display: inline-block;
    margin-bottom: 12px;
  }

}

/* Page 3 compact map panel: match the provided 3x2 template frame */
@media (min-width: 501px) and (max-width: 760px) {
  .map-screen .map-header {
    background:
      radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.48), transparent 28%),
      linear-gradient(180deg, rgba(226, 253, 255, 0.84), rgba(171, 236, 245, 0.72)),
      linear-gradient(135deg, rgba(96, 204, 226, 0.18), rgba(29, 143, 180, 0.1));
  }

  .map-screen .header-top-ornament {
    top: -6px;
    width: 250px;
  }

  .map-screen .header-bottom-divider {
    bottom: 8px;
    width: 110px;
  }

  .current-area-panel {
    min-height: 0;
    padding: 18px 20px 26px;
    border-radius: 24px;
  }

  .current-area-panel::before {
    left: 12px;
    right: 12px;
    top: 12px;
    height: 132px;
    border-radius: 18px 18px 10px 10px;
    opacity: 1;
    background:
      linear-gradient(90deg, rgba(226, 253, 255, 0.84) 0 38%, rgba(201, 246, 252, 0.52) 56%, rgba(116, 206, 226, 0.12)),
      url("assets/backgrounds/bg_reef_banner_high.png") right center / auto 100% no-repeat;
  }

  .current-area-status {
    right: 18px;
    top: 18px;
    width: 78px;
    height: 28px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .current-area-copy {
    max-width: 64%;
    min-height: 126px;
  }

  .current-area-title-row {
    gap: 10px;
  }

  .current-area-title-row h3 {
    font-size: 1.9rem;
  }

  .map-eyebrow {
    padding: 4px 9px;
    font-size: 0.72rem;
  }

  .current-area-chest {
    grid-template-columns: 28px minmax(0, 1fr);
    margin-top: 16px;
    padding: 6px 9px 7px 7px;
    border-radius: 18px;
  }

  .treasure-progress-icon {
    width: 28px;
    height: 28px;
    font-size: 0.82rem;
  }

  .treasure-progress-copy strong {
    font-size: 0.82rem;
  }

  .treasure-progress-copy small {
    font-size: 0.72rem;
  }

  .treasure-progress-track {
    grid-column: 1 / -1;
    height: 7px;
  }

  .current-area-goal,
  .current-area-copy p:not(.map-eyebrow):not(.current-area-chest) {
    margin-top: 10px;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .map-level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
  }

  .map-level-card {
    min-height: 108px;
    padding: 30px 10px 14px;
    border-radius: 14px;
  }

  .map-level-icon {
    left: 12px;
    top: 12px;
    width: 30px;
    height: 30px;
  }

  .map-level-icon span {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }

  .map-level-stars {
    left: 12px;
    top: 11px;
    gap: 4px;
    font-size: 0.98rem;
  }

  .map-level-stars i {
    width: 15px;
    height: 15px;
  }

  .map-level-card.is-locked:not(.is-boss) .map-level-icon {
    display: none;
  }

  .map-level-lock-mark {
    width: 22px;
    height: 22px;
    font-size: 0.56rem;
  }

  .map-level-copy {
    gap: 5px;
  }

  .map-level-copy strong {
    font-size: 0.98rem;
  }

  .map-level-copy small {
    font-size: 0.72rem;
  }

  .map-level-card.is-current::after {
    left: 13px;
    top: 7px;
    width: 26px;
    height: 26px;
  }

  .map-level-card.is-current .map-level-icon {
    top: 5px;
    width: 44px;
    height: 44px;
  }

  .map-level-card.is-current .map-level-icon::before {
    inset: -3px;
  }

  .map-level-card.is-current .map-level-icon span {
    width: 28px;
    height: 28px;
    font-size: 0.86rem;
  }

  .map-level-card.is-current .map-level-copy {
    transform: translateY(2px);
  }

  .map-level-card.is-boss .map-level-icon {
    top: 14px;
    width: 58px;
    height: 50px;
  }

  .map-level-card.is-boss .map-level-icon img {
    width: 58px;
    height: 50px;
  }
}

/* Homepage refinement pass: reduce nested frame weight */
.login-stage {
  gap: clamp(14px, 2vw, 20px);
  padding: clamp(20px, 2.8vw, 30px);
  border-color: rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(171, 230, 240, 0.48)),
    url("assets/ocean-storybook/panel_main_ocean.png") center / 100% 100% no-repeat;
  box-shadow:
    0 24px 58px rgba(0, 83, 110, 0.18),
    0 0 0 1px rgba(108, 214, 226, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.login-stage::before {
  inset: 12px;
  border-color: rgba(89, 190, 204, 0.16);
  opacity: 0.44;
}

.login-stage::after {
  height: min(112px, 16%);
  opacity: 0.12;
}

.student-roster {
  padding: 20px 22px 22px;
  border-color: rgba(115, 205, 218, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(216, 250, 254, 0.28), rgba(129, 216, 230, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.student-roster-head {
  margin-bottom: 14px;
}

.student-roster-head::after {
  opacity: 0.48;
}

.student-roster-head h2 {
  font-size: 1.56rem;
  font-weight: 640;
}

.student-roster-head p {
  color: rgba(56, 95, 108, 0.82);
  font-size: 0.84rem;
}

.student-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
}

.student-card {
  min-height: 122px;
  padding: 12px 13px 11px;
  border-color: rgba(111, 196, 208, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.42), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(225, 249, 252, 0.56));
  box-shadow:
    0 8px 18px rgba(0, 92, 116, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.student-card::before {
  opacity: 0.34;
}

.student-card-open {
  gap: 5px;
}

.student-avatar-box {
  width: 42px;
  height: 42px;
}

.student-avatar {
  width: 31px;
  height: 31px;
}

.student-card strong {
  font-size: 1.18rem;
  font-weight: 760;
}

.student-card small {
  color: rgba(85, 114, 125, 0.82);
  font-size: 0.82rem;
}

.student-card-stats {
  gap: 5px;
}

.student-card-stats span {
  padding: 5px 4px;
  border-color: rgba(105, 190, 201, 0.06);
  border-radius: 7px;
  background: rgba(215, 245, 249, 0.28);
}

.student-card-stats b {
  font-size: 0.86rem;
}

.student-card-stats small {
  font-size: 0.64rem;
}

.student-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(0, 92, 116, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.student-card.is-selected {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 243, 185, 0.34), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(232, 251, 246, 0.6));
}

.student-login-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "header avatar avatar"
    "field field submit"
    "picker picker picker";
  align-items: center;
  width: 100%;
  gap: 12px 18px;
  margin-top: -2px;
  padding: 18px 24px;
  border-color: rgba(111, 196, 208, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.3), transparent 42%),
    linear-gradient(180deg, rgba(219, 251, 254, 0.46), rgba(145, 224, 237, 0.26));
  box-shadow:
    0 10px 24px rgba(0, 90, 120, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.student-login-form::after {
  right: -24px;
  bottom: -44px;
  width: 172px;
  height: 88px;
  opacity: 0.06;
}

.login-chest-icon {
  width: 44px;
  height: 44px;
  opacity: 0.78;
}

.create-header {
  grid-area: header;
  gap: 12px;
}

.create-header strong {
  font-size: 1.1rem;
  font-weight: 610;
}

.create-header small {
  color: rgba(99, 129, 138, 0.86);
  font-size: 0.8rem;
}

.avatar-current {
  grid-area: avatar;
  min-height: 58px;
  padding: 8px 10px;
  border-color: rgba(104, 190, 201, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.26);
}

.avatar-current-art {
  width: 44px;
  height: 44px;
}

.avatar-current-art img {
  width: 31px;
  height: 31px;
}

.avatar-current-copy strong {
  font-size: 0.9rem;
  font-weight: 610;
}

.avatar-current-copy small {
  color: rgba(99, 129, 138, 0.84);
  font-size: 0.74rem;
}

.avatar-change {
  min-height: 32px;
  border-color: rgba(8, 118, 133, 0.14);
  background: rgba(255, 255, 255, 0.52);
  font-weight: 560;
}

.student-login-form input {
  min-height: 48px;
  background: rgba(255, 255, 255, 0.68);
}

.student-name-field {
  grid-area: field;
}

.student-login-form .btn-primary {
  grid-area: submit;
  min-height: 52px;
  width: 100%;
}

.avatar-picker {
  grid-area: picker;
}

@media (max-width: 920px) {
  .student-roster {
    padding: 18px;
  }

  .student-list {
    gap: 10px;
  }

  .student-card {
    min-height: 120px;
    padding: 13px 11px 11px;
  }

  .student-login-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "avatar"
      "field"
      "submit"
      "picker";
    width: min(640px, 100%);
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .login-stage {
    padding: 16px;
  }

  .student-login-form,
  .student-roster {
    padding: 15px;
  }

  .student-login-form {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .student-card {
    min-height: 126px;
  }

  .student-card-open {
    grid-template-columns: 60px minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: stretch;
    align-items: center;
    text-align: left;
  }

  .student-avatar-box {
    grid-row: 1;
    width: 46px;
    height: 46px;
  }

  .student-card-main {
    grid-row: 1;
  }

  .student-card-stats {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Homepage alignment correction: roster and create panel share one width system */
.student-roster,
.student-login-form {
  width: 100%;
  max-width: none;
  justify-self: stretch;
}

.student-roster {
  padding: 18px 18px 19px;
}

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

.student-card {
  min-height: 112px;
  padding: 10px 12px 10px;
}

.student-card-open {
  gap: 4px;
}

.student-avatar-box {
  width: 38px;
  height: 38px;
}

.student-avatar {
  width: 29px;
  height: 29px;
}

.student-card strong {
  font-size: 1.2rem;
  line-height: 1.08;
}

.student-card small {
  font-size: 0.84rem;
  line-height: 1.28;
}

.student-card-stats {
  gap: 4px;
  margin-top: 1px;
}

.student-card-stats span {
  padding: 4px 4px;
}

.student-card-stats b {
  font-size: 0.9rem;
}

.student-card-stats small {
  font-size: 0.65rem;
}

.student-login-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "header avatar avatar"
    "field field field"
    "submit submit submit"
    "picker picker picker";
  gap: 10px 12px;
  padding: 16px 18px 18px;
}

.student-name-field,
.student-login-form .btn-primary {
  width: 100%;
}

.student-login-form .btn-primary {
  min-height: 54px;
}

@media (min-width: 521px) and (max-width: 920px) {
  .student-login-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "header avatar avatar"
      "field field field"
      "submit submit submit"
      "picker picker picker";
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 520px) {
  .student-login-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "avatar"
      "field"
      "submit"
      "picker";
  }
}

/* Homepage spacing and typography correction: larger text, taller composition */
.login-stage {
  gap: clamp(20px, 2.6vw, 28px);
  min-height: min(780px, calc(100vh - 44px));
  padding: clamp(28px, 3.4vw, 40px);
}

.login-intro {
  min-height: 192px;
  padding: 30px 36px;
}

.login-title-shell h1 {
  font-size: clamp(2.7rem, 4.4vw, 3.25rem);
}

.login-title-shell .kicker {
  font-size: 0.98rem;
}

.login-intro .home-copy {
  max-width: 520px;
  font-size: 1.08rem;
}

.hero-mascot-wrap {
  width: min(210px, 100%);
  min-height: 158px;
}

.login-mascot {
  width: min(190px, 100%);
}

.student-roster {
  padding: 24px 24px 26px;
}

.student-roster-head {
  margin-bottom: 18px;
}

.student-roster-head h2 {
  font-size: 1.86rem;
}

.student-roster-head p {
  font-size: 0.98rem;
}

.student-list {
  gap: 15px;
}

.student-card {
  min-height: 140px;
  padding: 15px 14px 13px;
}

.student-card-open {
  gap: 7px;
}

.student-avatar-box {
  width: 48px;
  height: 48px;
}

.student-avatar {
  width: 36px;
  height: 36px;
}

.student-card strong {
  font-size: 1.34rem;
}

.student-card small {
  font-size: 0.94rem;
  line-height: 1.34;
}

.student-card-stats {
  gap: 6px;
  margin-top: 3px;
}

.student-card-stats span {
  padding: 6px 5px;
}

.student-card-stats b {
  font-size: 1rem;
}

.student-card-stats small {
  font-size: 0.72rem;
}

.student-login-form {
  gap: 14px 16px;
  padding: 22px 24px 24px;
}

.create-header strong {
  font-size: 1.26rem;
}

.create-header small {
  font-size: 0.9rem;
}

.avatar-current {
  min-height: 66px;
  padding: 10px 12px;
}

.avatar-current-art {
  width: 50px;
  height: 50px;
}

.avatar-current-art img {
  width: 36px;
  height: 36px;
}

.avatar-current-copy strong {
  font-size: 1rem;
}

.avatar-current-copy small {
  font-size: 0.82rem;
}

.avatar-change {
  min-height: 36px;
  padding-inline: 14px;
  font-size: 0.9rem;
}

.student-login-form input {
  min-height: 56px;
  font-size: 1.02rem;
}

.student-login-form .btn-primary {
  min-height: 60px;
  font-size: 1.08rem;
}

@media (max-width: 920px) {
  .login-stage {
    min-height: min(760px, calc(100vh - 36px));
    padding: 24px;
  }

  .login-intro {
    min-height: 170px;
    padding: 24px 26px;
  }

  .student-card {
    min-height: 132px;
  }
}

@media (max-width: 720px) {
  .login-stage {
    min-height: calc(100vh - 28px);
    padding: 18px;
  }

  .login-intro {
    min-height: 0;
    padding: 20px;
  }

  .student-roster {
    padding: 18px;
  }

  .student-login-form {
    padding: 18px;
  }
}

/* Page 2 hero proportion refinement: give the top stage more breathing room */
.home-screen .ocean-stage {
  gap: 17px;
}

.home-screen .brand-lockup {
  min-height: clamp(326px, 45vw, 410px);
  padding: clamp(88px, 9vw, 112px) clamp(50px, 7vw, 74px) clamp(58px, 7vw, 76px) clamp(68px, 8vw, 90px);
}

.home-screen .brand-lockup::before {
  inset: 8% 5.5% 10%;
}

.hero-frame-img {
  inset: -44px -20px -58px;
  width: calc(100% + 40px);
  height: calc(100% + 102px);
}

.home-screen .brand-lockup .kicker,
.home-screen .brand-lockup h1,
.home-screen .brand-lockup .home-copy {
  transform: translateY(-18px);
}

.home-screen .brand-lockup .kicker {
  margin-bottom: 12px;
  font-size: clamp(1.06rem, 2.25vw, 1.34rem);
}

.home-screen .brand-lockup h1 {
  margin-bottom: 16px;
  font-size: clamp(3.75rem, 7.8vw, 5.12rem);
}

.home-screen .brand-lockup .home-copy {
  font-size: clamp(1.08rem, 2.45vw, 1.42rem);
}

.home-screen .hero-whale {
  right: clamp(48px, 7.2vw, 82px);
  top: 13%;
  width: clamp(190px, 32%, 252px);
}

@media (max-width: 720px) {
  .home-screen .brand-lockup {
    min-height: 318px;
    padding: 88px 42px 50px 72px;
  }

  .home-screen .brand-lockup .kicker,
  .home-screen .brand-lockup h1,
  .home-screen .brand-lockup .home-copy {
    transform: translateY(-18px);
  }

  .home-screen .brand-lockup h1 {
    font-size: clamp(3.25rem, 9.4vw, 4.05rem);
  }

  .home-screen .hero-whale {
    right: 48px;
    top: 15%;
    width: clamp(174px, 30vw, 204px);
  }
}

@media (max-width: 520px) {
  .home-screen .brand-lockup {
    min-height: 270px;
    padding: 74px 24px 38px 42px;
  }

  .home-screen .brand-lockup .kicker,
  .home-screen .brand-lockup h1,
  .home-screen .brand-lockup .home-copy {
    max-width: 62%;
    transform: translateY(-16px);
  }

  .home-screen .brand-lockup h1 {
    font-size: clamp(2.75rem, 12vw, 3.45rem);
  }

  .home-screen .hero-whale {
    right: 18px;
    top: 24%;
    width: 142px;
  }
}

/* Challenge page vertical composition: use the full viewport instead of crowding the top */
.challenge-screen.is-active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  row-gap: clamp(16px, 2.2vh, 24px);
  min-height: 100vh;
  padding: clamp(18px, 2.2vw, 28px);
  overflow: hidden;
}

.challenge-screen .challenge-header {
  width: min(100%, 1180px);
  min-height: clamp(76px, 9vh, 96px);
  margin: 0 auto;
  padding: clamp(14px, 1.8vw, 18px) clamp(16px, 2.2vw, 22px);
}

.challenge-screen .challenge-title-block h2 {
  font-size: clamp(2.05rem, 3.7vw, 3.05rem);
  line-height: 1.05;
}

.challenge-screen .challenge-layout {
  width: min(100%, 1180px);
  height: clamp(570px, calc(100vh - 138px), 760px);
  min-height: 0;
  margin: 0 auto;
  align-items: stretch;
  gap: clamp(20px, 2.3vw, 30px);
}

.challenge-screen .score-zone,
.challenge-screen .teacher-console {
  min-height: 100%;
}

.challenge-screen .score-zone {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: clamp(20px, 2.5vw, 30px);
}

.challenge-screen .score-zone::before {
  height: clamp(150px, 24vh, 220px);
  opacity: 0.2;
}

.challenge-screen .score-meta {
  margin-bottom: clamp(18px, 2.2vh, 28px);
}

.challenge-screen .measure-grid {
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.challenge-screen .measure-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100%;
  padding: clamp(20px, 2.4vw, 30px);
}

.challenge-screen .measure-card-head {
  margin-bottom: clamp(18px, 2.5vh, 30px);
}

.challenge-screen .beat-card-grid {
  height: 100%;
  align-items: stretch;
  gap: clamp(10px, 1.4vw, 16px);
}

.challenge-screen .beat-card {
  height: 100%;
  min-height: clamp(230px, calc(100vh - 455px), 380px);
}

.challenge-screen .card-notation {
  min-height: clamp(160px, calc(100vh - 520px), 280px);
}

.challenge-screen .teacher-console {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vh, 22px);
  padding: clamp(20px, 2.3vw, 28px);
}

.challenge-screen .bpm-card,
.challenge-screen .star-card {
  margin: 0;
  padding: 0 0 clamp(14px, 2vh, 20px);
}

.challenge-screen .star-card {
  flex: 1;
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
}

.challenge-screen .mystery-chest-panel {
  margin: clamp(12px, 2vh, 18px) 0 clamp(14px, 2vh, 20px);
  padding: clamp(10px, 1.6vw, 14px);
}

.challenge-screen .star-control button {
  min-height: clamp(62px, 8vh, 78px);
}

.challenge-screen .console-actions {
  margin-top: auto;
  gap: clamp(12px, 1.8vh, 18px);
}

.challenge-screen .console-actions .btn {
  min-height: clamp(46px, 6vh, 58px);
}

@media (max-width: 920px) {
  .challenge-screen.is-active {
    overflow-y: auto;
  }

  .challenge-screen .challenge-layout {
    height: auto;
    min-height: 0;
  }

  .challenge-screen .score-zone,
  .challenge-screen .teacher-console {
    min-height: auto;
  }

  .challenge-screen .score-zone {
    min-height: min(620px, calc(100vh - 138px));
  }

  .challenge-screen .beat-card {
    min-height: clamp(188px, 28vh, 260px);
  }

  .challenge-screen .card-notation {
    min-height: clamp(132px, 21vh, 190px);
  }

  .challenge-screen .star-card {
    flex: initial;
  }
}

@media (max-width: 620px) {
  .challenge-screen.is-active {
    padding: 14px;
    row-gap: 14px;
  }

  .challenge-screen .challenge-header {
    min-height: 68px;
  }

  .challenge-screen .challenge-title-block h2 {
    font-size: clamp(1.46rem, 7vw, 2.1rem);
  }

  .challenge-screen .score-zone {
    min-height: auto;
    padding: 18px;
  }

  .challenge-screen .measure-card {
    padding: 16px;
  }

  .challenge-screen .beat-card {
    min-height: 164px;
  }

  .challenge-screen .card-notation {
    min-height: 122px;
  }
}

/* Login page pearl-glass background refinement: reduce white fog and blend with the ocean */
:root {
  --login-text-deep: #064b70;
  --login-text-main: #0a668c;
  --login-text-soft: rgba(6, 75, 112, 0.68);
  --login-glass-ocean-1: rgba(226, 248, 252, 0.72);
  --login-glass-ocean-2: rgba(203, 236, 245, 0.64);
  --login-glass-ocean-3: rgba(183, 225, 237, 0.54);
  --login-panel-ocean-1: rgba(216, 244, 250, 0.58);
  --login-panel-ocean-2: rgba(192, 231, 242, 0.46);
  --login-card-ocean-1: rgba(240, 252, 254, 0.72);
  --login-card-ocean-2: rgba(218, 243, 249, 0.62);
  --login-border-blue: rgba(190, 235, 245, 0.72);
  --login-border-soft: rgba(176, 229, 242, 0.54);
  --login-inner-light: rgba(255, 255, 255, 0.45);
  --login-shadow-soft: rgba(0, 126, 170, 0.14);
  --login-shadow-mid: rgba(0, 96, 145, 0.2);
}

.login-screen {
  background:
    linear-gradient(180deg, rgba(220, 253, 255, 0.08), rgba(69, 190, 212, 0.16)),
    url("assets/ocean-storybook/bg_undersea_world.png") center center / cover no-repeat;
  background-attachment: fixed;
}

.login-screen::before {
  opacity: 0.42;
}

.login-screen::after {
  opacity: 0.18;
}

.login-stage {
  border: 1.5px solid var(--login-border-blue);
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, 0.72) 0 4px, rgba(123, 219, 235, 0.64) 5px 8px, transparent 9px),
    radial-gradient(circle at calc(100% - 18px) 18px, rgba(255, 255, 255, 0.72) 0 4px, rgba(123, 219, 235, 0.64) 5px 8px, transparent 9px),
    radial-gradient(circle at 50% 12%, rgba(105, 222, 240, 0.18), transparent 54%),
    linear-gradient(180deg, var(--login-glass-ocean-1) 0%, var(--login-glass-ocean-2) 48%, var(--login-glass-ocean-3) 100%),
    url("assets/ocean-storybook/panel_main_ocean.png") center / 100% 100% no-repeat;
  backdrop-filter: blur(12px) saturate(1.08);
  box-shadow:
    0 18px 42px var(--login-shadow-mid),
    0 0 0 1px rgba(104, 211, 230, 0.16),
    inset 0 1px 0 var(--login-inner-light),
    inset 0 -18px 38px rgba(48, 178, 210, 0.08);
}

.login-stage::before {
  inset: 12px;
  border-color: rgba(160, 226, 240, 0.34);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.7) 0 3px, rgba(130, 221, 232, 0.56) 4px 7px, transparent 8px),
    radial-gradient(circle at calc(100% - 1px) 1px, rgba(255, 255, 255, 0.7) 0 3px, rgba(130, 221, 232, 0.56) 4px 7px, transparent 8px),
    radial-gradient(circle at 15% 0%, rgba(255, 232, 154, 0.14), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(38, 165, 181, 0.18), transparent 34%);
  opacity: 0.62;
}

.login-stage::after {
  opacity: 0.11;
}

.login-intro {
  border-color: rgba(205, 238, 246, 0.78);
  background:
    radial-gradient(circle at 76% 45%, rgba(91, 210, 235, 0.18), transparent 42%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(160, 225, 240, 0.12)),
    linear-gradient(180deg, rgba(236, 250, 252, 0.7) 0%, rgba(218, 242, 248, 0.56) 100%),
    url("assets/ocean-storybook/frame_title_long.png") center / 100% 100% no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 26px rgba(0, 115, 160, 0.1);
}

.login-intro::after {
  border-color: rgba(180, 230, 242, 0.34);
}

.login-title-shell h1,
.student-roster-head h2,
.create-header strong,
.avatar-current-copy strong,
.student-card strong {
  color: var(--login-text-deep);
}

.login-title-shell .kicker,
.student-card-stats b {
  color: var(--login-text-main);
}

.login-intro .home-copy,
.student-roster-head p,
.create-header small,
.avatar-current-copy small,
.student-card small,
.student-card-stats small {
  color: var(--login-text-soft);
}

.student-roster {
  border: 1px solid rgba(188, 232, 244, 0.58);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.14), transparent 42%),
    linear-gradient(180deg, var(--login-panel-ocean-1) 0%, var(--login-panel-ocean-2) 100%);
  box-shadow:
    0 12px 28px rgba(0, 112, 150, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.student-roster-head::after {
  background: linear-gradient(90deg, rgba(6, 75, 112, 0.22), rgba(116, 211, 230, 0.24), rgba(6, 75, 112, 0));
  opacity: 0.72;
}

.student-card {
  border: 1px solid rgba(255, 255, 255, 0.56);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.34), transparent 54%),
    linear-gradient(180deg, var(--login-card-ocean-1) 0%, var(--login-card-ocean-2) 100%);
  box-shadow:
    0 10px 24px rgba(0, 112, 150, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.student-card::before {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 46%);
  opacity: 0.42;
}

.student-card:hover {
  border-color: rgba(114, 220, 236, 0.64);
  box-shadow:
    0 14px 28px rgba(0, 112, 150, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.student-card.is-selected {
  border-color: rgba(255, 205, 76, 0.88);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 235, 154, 0.24), transparent 56%),
    linear-gradient(180deg, rgba(237, 252, 253, 0.76), rgba(210, 242, 239, 0.66));
  box-shadow:
    0 0 0 2px rgba(255, 218, 92, 0.4),
    0 12px 28px rgba(0, 120, 170, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.student-card-stats span {
  border-color: rgba(148, 220, 235, 0.24);
  background: rgba(203, 238, 246, 0.38);
}

.student-card.is-selected .student-card-stats span {
  border-color: rgba(222, 160, 54, 0.38);
  background: linear-gradient(180deg, rgba(255, 244, 202, 0.76), rgba(247, 217, 136, 0.66));
}

.student-login-form {
  border: 1px solid rgba(190, 235, 245, 0.56);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(210, 239, 247, 0.54), rgba(188, 229, 240, 0.44));
  box-shadow:
    0 12px 28px rgba(0, 112, 150, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.student-login-form::after {
  opacity: 0.05;
}

.avatar-current {
  border-color: rgba(188, 232, 244, 0.48);
  background: rgba(210, 242, 248, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 4px 12px rgba(0, 120, 160, 0.05);
}

.avatar-current-art,
.student-avatar-box {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.82), rgba(194, 232, 241, 0.62));
  box-shadow: 0 5px 12px rgba(0, 106, 128, 0.08);
}

.avatar-change {
  border-color: rgba(176, 229, 242, 0.54);
  background: rgba(225, 246, 250, 0.62);
  color: var(--login-text-main);
}

.avatar-choice {
  border-color: rgba(176, 229, 242, 0.38);
  background: rgba(210, 242, 248, 0.32);
}

.avatar-choice:hover {
  background: rgba(225, 248, 252, 0.62);
}

.student-login-form input {
  border: 1px solid rgba(188, 232, 244, 0.7);
  background: rgba(245, 253, 255, 0.78);
  color: var(--login-text-deep);
  box-shadow:
    inset 0 1px 2px rgba(0, 90, 130, 0.06),
    0 4px 12px rgba(0, 120, 160, 0.07);
}

.student-login-form input::placeholder {
  color: rgba(6, 75, 112, 0.46);
}

.student-login-form input:focus {
  border-color: rgba(37, 166, 181, 0.62);
  box-shadow:
    inset 0 1px 2px rgba(0, 90, 130, 0.04),
    0 0 0 4px rgba(37, 166, 181, 0.14);
}

.student-login-form .btn-primary {
  color: #5a3b00;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 36%),
    linear-gradient(180deg, #ffe985 0%, #ffc65a 48%, #ff9b48 100%);
  border: 1px solid rgba(255, 245, 185, 0.86);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 10px 24px rgba(255, 144, 52, 0.22);
}

.student-login-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    0 14px 28px rgba(255, 144, 52, 0.28);
}

.student-login-form .btn-primary:active {
  transform: translateY(1px);
}

@media (max-width: 720px) {
  .login-stage {
    backdrop-filter: blur(10px) saturate(1.06);
  }
}

/* Rhythm home refinement: clearer hierarchy, safer secondary actions, route-like progress */
.home-screen .ocean-stage {
  gap: clamp(14px, 2vh, 18px);
}

.home-screen .brand-lockup {
  min-height: clamp(286px, 39vw, 354px);
  padding: clamp(76px, 7.8vw, 96px) clamp(50px, 7vw, 74px) clamp(46px, 5.5vw, 62px) clamp(68px, 8vw, 90px);
}

.hero-frame-img {
  inset: -36px -18px -48px;
  width: calc(100% + 36px);
  height: calc(100% + 84px);
}

.home-screen .brand-lockup .kicker,
.home-screen .brand-lockup h1,
.home-screen .brand-lockup .home-copy {
  transform: translateY(-14px);
}

.home-screen .brand-lockup h1 {
  font-size: clamp(3.58rem, 7.15vw, 4.82rem);
  letter-spacing: 0;
}

.home-screen .brand-lockup .home-copy {
  color: rgba(6, 63, 93, 0.78);
  font-size: clamp(1.04rem, 2.2vw, 1.28rem);
  font-weight: 680;
}

.home-screen .hero-whale {
  right: clamp(52px, 7.5vw, 88px);
  top: 11%;
  width: clamp(176px, 28%, 224px);
  opacity: 0.95;
}

.home-screen .student-strip,
.home-screen .quick-actions,
.home-screen .progress-panel {
  border-color: rgba(192, 235, 245, 0.7);
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(232, 249, 252, 0.72), rgba(206, 239, 246, 0.6));
  box-shadow:
    0 14px 32px rgba(0, 105, 145, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(12px) saturate(1.08);
}

.home-screen .student-strip {
  grid-template-columns: 104px minmax(0, 1fr) 160px;
  min-height: 158px;
  padding: 22px 34px;
}

.home-screen .current-avatar-shell,
.home-screen .current-student-copy,
.home-screen .switch-player-btn {
  transform: none;
}

.home-screen .current-label {
  justify-self: start;
  gap: 6px;
  width: fit-content;
  margin-bottom: 8px;
  padding: 5px 12px;
  border: 1px solid rgba(92, 197, 218, 0.24);
  border-radius: 999px;
  background: rgba(198, 239, 248, 0.58);
  color: #047199;
  font-size: 0.82rem;
  font-weight: 820;
}

.home-screen .current-name {
  font-size: clamp(2.45rem, 5vw, 3.1rem);
  font-weight: 860;
}

.home-screen .current-meta {
  color: rgba(6, 63, 93, 0.76);
  font-size: 0.94rem;
  font-weight: 760;
}

.home-screen .current-stats {
  gap: 10px 18px;
  margin-top: 10px;
  padding-top: 10px;
  color: #075f82;
  font-size: 0.86rem;
}

.home-screen .current-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.home-screen .current-stats small {
  color: rgba(6, 75, 112, 0.62);
  font-size: 0.78rem;
  font-weight: 720;
}

.home-screen .current-stats b {
  color: #046c91;
  font-family: var(--font-number);
  font-size: 0.96rem;
  font-weight: 900;
}

.home-screen .switch-player-btn {
  width: min(150px, 100%);
  min-height: 42px;
  border-color: rgba(66, 178, 205, 0.56);
  background: rgba(240, 253, 255, 0.56);
  color: #047199;
  font-size: 0.86rem;
  font-weight: 820;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.home-screen .switch-player-btn:hover {
  transform: translateY(-1px);
  background: rgba(246, 254, 255, 0.8);
  box-shadow: 0 8px 18px rgba(0, 125, 170, 0.14);
}

.home-screen .primary-start-btn {
  position: relative;
  overflow: hidden;
  min-height: 78px;
  padding-inline: 34px 28px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.home-screen .primary-start-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: skewX(-18deg);
  animation: homeButtonShine 3.8s ease-in-out infinite;
  pointer-events: none;
}

.home-screen .primary-start-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 32px rgba(0, 132, 190, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.58);
}

.home-screen .primary-start-btn:active {
  transform: translateY(1px);
}

.home-screen .primary-start-btn span:first-child,
.home-screen .primary-start-btn span:last-child {
  position: relative;
  z-index: 1;
}

.home-screen .primary-start-btn span:last-child {
  margin-left: 0;
  text-align: right;
}

.home-screen .quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  padding: 18px 24px 14px;
}

.home-screen .quick-actions .btn {
  min-height: 54px;
  border-color: rgba(80, 200, 225, 0.42);
  background: rgba(240, 253, 255, 0.62);
  box-shadow:
    0 8px 16px rgba(0, 105, 140, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.home-screen .quick-actions .btn[data-action="continue"] {
  border-color: rgba(80, 200, 225, 0.68);
  background: rgba(240, 253, 255, 0.82);
}

.home-screen .quick-actions .btn[data-action="reset"] {
  grid-column: 1 / -1;
  justify-self: center;
  width: auto;
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(6, 75, 112, 0.5);
  font-size: 0.82rem;
  font-weight: 680;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-screen .quick-actions .btn[data-action="reset"] .action-mark {
  display: none;
}

.home-screen .quick-actions .btn[data-action="reset"]:hover {
  color: rgba(154, 78, 62, 0.78);
  background: transparent;
  box-shadow: none;
}

.home-screen .progress-panel {
  min-height: 154px;
  border-color: rgba(190, 235, 245, 0.7);
  background:
    radial-gradient(circle at 82% 25%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(225, 247, 252, 0.7), rgba(195, 232, 242, 0.58));
}

.home-screen .progress-panel::after {
  width: 192px;
  height: 170px;
  opacity: 0.38;
  filter: saturate(0.9);
}

.home-screen .progress-panel span {
  color: #047199;
}

.home-screen .progress-panel strong {
  color: #063f5d;
  font-size: clamp(2.78rem, 5.8vw, 3.48rem);
  font-weight: 900;
}

.home-screen .progress-track {
  height: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.38) 0 2px, transparent 2px 36px),
    rgba(125, 205, 220, 0.3);
  box-shadow:
    inset 0 1px 2px rgba(0, 90, 130, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.55);
}

.home-screen .progress-track div {
  background: linear-gradient(90deg, #42dce4, #139ddb);
  box-shadow: 0 0 12px rgba(50, 210, 230, 0.42);
}

.home-screen .progress-panel small {
  color: rgba(6, 63, 93, 0.7);
  font-size: 0.88rem;
  font-weight: 700;
}

@keyframes homeButtonShine {
  0% {
    left: -60%;
  }
  45% {
    left: 125%;
  }
  100% {
    left: 125%;
  }
}

@media (max-width: 720px) {
  .home-screen .brand-lockup {
    min-height: 286px;
    padding: 78px 40px 42px 70px;
  }

  .home-screen .hero-whale {
    right: 48px;
    top: 15%;
    width: clamp(160px, 27vw, 190px);
  }

  .home-screen .student-strip {
    grid-template-columns: 88px minmax(0, 1fr) 148px;
    gap: 16px;
    padding: 20px 24px;
  }

  .home-screen .current-name {
    font-size: 2.32rem;
  }

  .home-screen .current-stats {
    gap: 7px 12px;
  }

  .home-screen .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
  }
}

@media (max-width: 520px) {
  .home-screen .brand-lockup {
    min-height: 242px;
    padding: 66px 24px 34px 42px;
  }

  .home-screen .brand-lockup h1 {
    font-size: clamp(2.65rem, 11.5vw, 3.35rem);
  }

  .home-screen .hero-whale {
    right: 18px;
    top: 25%;
    width: 132px;
  }

  .home-screen .student-strip {
    grid-template-columns: 78px minmax(0, 1fr);
    grid-template-areas:
      "avatar info"
      "button button";
  }

  .home-screen .switch-player-btn {
    justify-self: stretch;
    width: 100%;
  }
}

/* Challenge page layout refinement: balanced question area and teacher controls */
.challenge-screen.is-active {
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: clamp(16px, 2vh, 22px);
  padding: clamp(18px, 2vw, 24px) clamp(18px, 2.2vw, 28px) clamp(26px, 3vh, 34px);
}

.challenge-screen .challenge-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 86px;
  padding: 16px 22px;
  gap: 16px;
  border-radius: 24px;
}

.challenge-screen .challenge-title-block .kicker {
  color: rgba(6, 75, 112, 0.72);
  font-size: 0.88rem;
  font-weight: 820;
}

.challenge-screen .challenge-title-block h2 {
  color: #063f5d;
  font-size: clamp(2rem, 3.05vw, 2.5rem);
  font-weight: 900;
  line-height: 1.1;
}

.challenge-screen .status-pill {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 900;
}

.challenge-screen .challenge-layout {
  grid-template-columns: minmax(0, 1.42fr) minmax(330px, 1fr);
  height: clamp(500px, calc(100vh - 150px), 640px);
  gap: clamp(18px, 2vw, 24px);
  margin-bottom: clamp(18px, 2.4vh, 28px);
}

.challenge-screen .score-zone,
.challenge-screen .teacher-console {
  min-height: 0;
  border-color: rgba(192, 235, 245, 0.76);
  background:
    radial-gradient(circle at 76% 12%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(232, 249, 252, 0.72), rgba(206, 239, 246, 0.62)),
    url("assets/ocean-storybook/panel_main_ocean.png") center / 100% 100% no-repeat;
  box-shadow:
    0 14px 32px rgba(0, 105, 145, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(12px) saturate(1.08);
}

.challenge-screen .score-zone {
  padding: clamp(20px, 2.1vw, 26px);
}

.challenge-screen .score-zone::before {
  height: clamp(118px, 18vh, 160px);
  opacity: 0.14;
}

.challenge-screen .score-meta {
  margin-bottom: clamp(14px, 1.8vh, 20px);
}

.challenge-screen .score-meta span,
.challenge-screen .score-meta strong {
  border: 1px solid rgba(95, 202, 220, 0.28);
  background: rgba(235, 251, 254, 0.66);
  color: #075f82;
  font-size: 0.9rem;
  font-weight: 820;
}

.challenge-screen .measure-card {
  align-self: start;
  min-height: auto;
  max-height: 100%;
  padding: clamp(18px, 2vw, 24px);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(226, 249, 252, 0.54), rgba(184, 231, 242, 0.34));
}

.challenge-screen .measure-card-head {
  margin-bottom: clamp(14px, 1.8vh, 20px);
}

.challenge-screen .measure-label {
  color: #064b70;
  font-size: 1.08rem;
  font-weight: 900;
}

.challenge-screen .measure-subtitle {
  color: rgba(6, 75, 112, 0.68);
  font-size: 0.82rem;
  font-weight: 720;
}

.challenge-screen .measure-count {
  border: 1px solid rgba(95, 202, 220, 0.28);
  background: rgba(235, 251, 254, 0.72);
}

.challenge-screen .beat-card-grid {
  height: auto;
  align-items: end;
  gap: clamp(10px, 1.2vw, 14px);
}

.challenge-screen .beat-card {
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 2.45;
  max-height: 320px;
}

.challenge-screen .beat-card-face {
  border-radius: 18px;
}

.challenge-screen .beat-card-back {
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 238, 139, 0.38), transparent 28%),
    url("assets/ocean-storybook/icon_compass_badge.png") center 40% / 46px auto no-repeat,
    linear-gradient(135deg, #0a7f9a, #15c4cb 52%, #086987);
}

.challenge-screen .card-back-index {
  padding-bottom: 3px;
  font-size: 0.72rem;
}

.challenge-screen .card-notation {
  min-height: 0;
}

.challenge-screen .teacher-console {
  gap: 14px;
  padding: clamp(18px, 2vw, 22px);
}

.challenge-screen .control-module {
  border: 1px solid rgba(190, 235, 245, 0.66);
  border-radius: 22px;
  background: rgba(235, 251, 254, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 8px 18px rgba(0, 105, 145, 0.06);
}

.challenge-screen .bpm-card,
.challenge-screen .star-card {
  padding: 16px;
  border-bottom: 0;
}

.challenge-screen .bpm-card > span,
.challenge-screen .star-card > span,
.challenge-screen .control-module-title {
  display: block;
  margin-bottom: 10px;
  color: rgba(6, 75, 112, 0.72);
  font-size: 0.84rem;
  font-weight: 900;
}

.challenge-screen .bpm-control {
  grid-template-columns: 42px 1fr 42px;
  gap: 12px;
}

.challenge-screen .bpm-control strong {
  color: #064b70;
  font-family: var(--font-number);
  font-size: 2.35rem;
  font-weight: 900;
}

.challenge-screen .bpm-control .icon-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
}

.challenge-screen .reward-module {
  flex: 0 1 auto;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 242, 155, 0.34), transparent 44%),
    linear-gradient(180deg, rgba(255, 247, 209, 0.66), rgba(229, 248, 250, 0.56));
  border-color: rgba(255, 220, 120, 0.5);
}

.challenge-screen .mystery-chest-panel {
  margin: 0 0 12px;
  border-color: rgba(255, 220, 120, 0.42);
  background: rgba(255, 250, 226, 0.48);
}

.challenge-screen .mystery-chest-art {
  width: 50px;
  height: 42px;
}

.challenge-screen .energy-summary strong {
  color: #7b5a00;
  font-size: 0.86rem;
  font-weight: 900;
}

.challenge-screen .energy-track {
  height: 9px;
  background: rgba(100, 160, 160, 0.22);
}

.challenge-screen .energy-track div {
  background: linear-gradient(90deg, #ffd76a, #40d6dc);
}

.challenge-screen .star-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.challenge-screen .star-control button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.challenge-screen .star-control button strong {
  font-size: 0.94rem;
}

.challenge-screen .star-control button small {
  font-size: 0.76rem;
}

.challenge-screen .console-actions {
  gap: 10px;
  margin-top: auto;
  padding: 16px;
}

.challenge-screen .action-row {
  grid-template-columns: 1fr;
  gap: 10px;
}

.challenge-screen .action-row-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.challenge-screen .action-row-secondary .action-wide {
  grid-column: auto;
}

.challenge-screen .console-actions .btn {
  min-height: 48px;
  border-radius: 16px;
  font-weight: 860;
}

.challenge-screen .console-actions [data-action="start"] {
  min-height: 56px;
  color: #5a3500;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 36%),
    linear-gradient(180deg, #ffe37b, #ff9e48);
  border-color: rgba(255, 245, 185, 0.84);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 10px 22px rgba(255, 144, 52, 0.22);
  font-size: 1.08rem;
}

.challenge-screen .console-actions [data-action="start"]:disabled {
  opacity: 0.72;
}

.challenge-screen .console-actions [data-action="stop"]:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.challenge-screen .action-row-secondary .btn {
  min-height: 44px;
  background: rgba(245, 253, 255, 0.58);
  box-shadow: none;
}

.challenge-screen .countdown.is-start-cue {
  top: 46%;
}

@media (max-width: 920px) {
  .challenge-screen .challenge-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .challenge-screen .teacher-console {
    order: -1;
  }

  .challenge-screen .score-zone {
    min-height: auto;
  }

  .challenge-screen .beat-card {
    max-height: 260px;
  }

  .challenge-screen .star-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-header {
    min-height: 78px;
    padding: 12px 14px;
  }

  .challenge-screen .challenge-title-block h2 {
    font-size: clamp(1.5rem, 6.5vw, 2rem);
  }

  .challenge-screen .beat-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .challenge-screen .beat-card {
    aspect-ratio: 1 / 1.8;
    max-height: 220px;
  }

  .challenge-screen .star-control,
  .challenge-screen .action-row-secondary {
    grid-template-columns: 1fr;
  }
}

/* Challenge page horizontal measure cards: 2x2 rhythm-reading layout */
.challenge-screen .challenge-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  height: clamp(520px, calc(100vh - 148px), 650px);
  align-items: start;
}

.challenge-screen .score-zone {
  align-self: start;
  min-height: 0;
}

.challenge-screen .measure-card {
  min-height: 0;
  padding: 22px;
  align-self: start;
}

.challenge-screen .measure-card-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.challenge-screen .measure-label {
  font-size: 1.22rem;
}

.challenge-screen .measure-subtitle {
  margin-top: 5px;
  font-size: 0.88rem;
}

.challenge-screen .measure-count {
  padding: 7px 13px;
  color: #05799f;
  background: rgba(218, 248, 252, 0.72);
}

.challenge-screen .beat-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  height: auto;
}

.challenge-screen .beat-card {
  aspect-ratio: 2.2 / 1;
  width: 100%;
  min-height: 128px;
  max-height: 150px;
  height: auto;
}

.challenge-screen .beat-card-inner,
.challenge-screen .beat-card-face {
  border-radius: 20px;
}

.challenge-screen .beat-card-face {
  padding: 12px 14px;
  box-shadow:
    0 10px 22px rgba(0, 110, 145, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.challenge-screen .beat-card-back {
  grid-template-rows: 1fr auto;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 238, 139, 0.3), transparent 28%),
    url("assets/ocean-storybook/icon_compass_badge.png") center 50% / 48px auto no-repeat,
    linear-gradient(180deg, rgba(255, 250, 232, 0.86), rgba(218, 247, 252, 0.74)),
    linear-gradient(135deg, #0a7f9a, #15c4cb 52%, #086987);
  border: 1.5px solid rgba(232, 204, 145, 0.56);
  color: rgba(6, 75, 112, 0.72);
}

.challenge-screen .beat-card-back::before {
  inset: 9px;
  border-radius: 16px;
  border-color: rgba(120, 210, 230, 0.34);
}

.challenge-screen .card-back-mark {
  display: none;
}

.challenge-screen .card-back-index {
  align-self: end;
  color: rgba(6, 75, 112, 0.64);
  font-size: 0.78rem;
  font-weight: 900;
}

.challenge-screen .beat-card-front {
  grid-template-rows: auto 1fr auto;
  gap: 4px;
  background: linear-gradient(180deg, rgba(255, 250, 232, 0.9), rgba(245, 238, 210, 0.82));
  border: 1.5px solid rgba(232, 204, 145, 0.64);
}

.challenge-screen .beat-card.is-revealed .beat-card-front {
  border-color: rgba(120, 210, 230, 0.58);
  background: linear-gradient(180deg, rgba(255, 253, 244, 0.94), rgba(232, 249, 252, 0.78));
}

.challenge-screen .beat-card.is-active .beat-card-front {
  border-color: rgba(255, 198, 70, 0.92);
  box-shadow:
    0 0 0 2px rgba(255, 218, 92, 0.46),
    0 12px 26px rgba(0, 130, 170, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.challenge-screen .beat-label {
  color: rgba(6, 75, 112, 0.72);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: left;
}

.challenge-screen .card-notation {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  overflow: visible;
}

.challenge-screen .card-notation svg {
  width: min(100%, 260px) !important;
  max-width: 100%;
  height: auto;
}

.challenge-screen .measure-status {
  min-height: 18px;
  color: rgba(6, 75, 112, 0.55);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: right;
}

.challenge-screen .beat-card:not(.is-revealed) .measure-status {
  display: none;
}

.challenge-screen .measure-footer-hint {
  margin-top: 14px;
  color: rgba(6, 75, 112, 0.62);
  font-size: 0.82rem;
  font-weight: 720;
}

@media (max-width: 920px) {
  .challenge-screen .challenge-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .challenge-screen .beat-card {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .challenge-screen .beat-card-grid {
    grid-template-columns: 1fr;
  }

  .challenge-screen .beat-card {
    aspect-ratio: auto;
    min-height: 120px;
  }
}

/* Challenge page vertical flow: title -> info -> cards -> actions -> reward goals */
.challenge-screen.is-active {
  overflow-y: auto;
  padding: clamp(16px, 2vw, 22px) clamp(16px, 2.2vw, 24px) clamp(26px, 3vh, 34px);
}

.challenge-screen .challenge-header {
  width: min(100%, 960px);
  min-height: 82px;
  padding: 14px 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(238, 252, 254, 0.74), rgba(214, 242, 248, 0.62)),
    url("assets/ocean-storybook/frame_title_long.png") center / 100% 100% no-repeat;
}

.challenge-screen .challenge-title-block h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.42rem);
}

.challenge-screen .challenge-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: min(100%, 960px);
  height: auto;
  min-height: 0;
  margin: 0 auto 28px;
  align-items: stretch;
}

.challenge-screen .challenge-info-bar,
.challenge-screen .score-zone,
.challenge-screen .challenge-actions {
  border: 1px solid rgba(192, 235, 245, 0.76);
  border-radius: 26px;
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 255, 255, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(232, 249, 252, 0.72), rgba(207, 239, 247, 0.62));
  box-shadow:
    0 12px 28px rgba(0, 105, 145, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(12px) saturate(1.08);
}

.challenge-screen .challenge-info-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto minmax(230px, 0.9fr);
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
}

.challenge-screen .score-meta {
  margin: 0;
}

.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.challenge-screen .bpm-card > span {
  margin: 0 0 4px;
  font-size: 0.76rem;
}

.challenge-screen .bpm-control {
  grid-template-columns: 34px 58px 34px;
  gap: 8px;
}

.challenge-screen .bpm-control strong {
  font-size: 1.78rem;
}

.challenge-screen .bpm-control .icon-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
}

.challenge-screen .challenge-info-bar .mystery-chest-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: stretch;
}

.challenge-screen .challenge-info-bar .mystery-chest-art {
  width: 42px;
  height: 36px;
}

.challenge-screen .challenge-info-bar .energy-summary strong {
  margin-bottom: 5px;
}

.challenge-screen .score-zone {
  padding: 22px;
  min-height: 0;
}

.challenge-screen .score-zone::before {
  height: 128px;
  opacity: 0.12;
}

.challenge-screen .measure-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.challenge-screen .measure-card-head {
  margin-bottom: 16px;
}

.challenge-screen .measure-label {
  font-size: clamp(1.28rem, 2.4vw, 1.52rem);
}

.challenge-screen .beat-card-grid {
  gap: 16px;
}

.challenge-screen .beat-card {
  min-height: 136px;
  max-height: 156px;
}

.challenge-screen .card-notation {
  min-height: 74px;
}

.challenge-screen .card-notation svg {
  width: min(100%, 300px) !important;
}

.challenge-screen .challenge-actions {
  display: grid;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.challenge-screen .challenge-actions .action-row-start {
  display: grid;
  grid-template-columns: 1fr;
}

.challenge-screen .challenge-actions [data-action="start"] {
  min-height: 60px;
  border-radius: 18px;
  font-size: 1.18rem;
}

.challenge-screen .challenge-actions .action-row-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.challenge-screen .challenge-actions .action-row-secondary .action-wide {
  grid-column: auto;
}

.challenge-screen .challenge-actions .action-row-secondary .btn {
  min-height: 46px;
  border-radius: 16px;
  background: rgba(245, 253, 255, 0.62);
  color: #075f82;
  box-shadow: none;
}

.challenge-screen .challenge-actions [data-action="stop"]:disabled {
  opacity: 0.46;
}

.challenge-screen .countdown {
  top: 24px;
  right: 24px;
}

@media (max-width: 760px) {
  .challenge-screen .challenge-info-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .challenge-screen .bpm-card.control-module {
    width: fit-content;
  }
}

@media (max-width: 620px) {
  .challenge-screen .beat-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .challenge-screen .beat-card {
    min-height: 118px;
    max-height: none;
  }

  .challenge-screen .challenge-actions .action-row-secondary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .challenge-screen .beat-card-grid {
    grid-template-columns: 1fr;
  }

  .challenge-screen .beat-card {
    aspect-ratio: auto;
    min-height: 112px;
  }
}

/* Challenge teacher flow: clear fail/retry and pass/next actions */
.challenge-screen .challenge-actions .action-row-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.challenge-screen .challenge-actions [data-action="retry-challenge"] {
  color: #7a4f00;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 42%),
    linear-gradient(180deg, rgba(255, 245, 191, 0.78), rgba(255, 222, 139, 0.58));
  border-color: rgba(255, 212, 94, 0.48);
}

.challenge-screen .challenge-actions [data-action="retry-challenge"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 620px) {
  .challenge-screen .challenge-actions .action-row-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Challenge page polish: clearer bottom controls and unified ocean-glass panels */
.challenge-screen.is-active {
  --challenge-text-deep: #064b70;
  --challenge-text-main: #0a668c;
  --challenge-text-soft: rgba(6, 75, 112, 0.68);
  --challenge-glass-1: rgba(226, 248, 252, 0.84);
  --challenge-glass-2: rgba(198, 235, 244, 0.74);
  --challenge-glass-inner: rgba(238, 253, 255, 0.56);
  --challenge-border: rgba(192, 235, 245, 0.84);
  --challenge-border-soft: rgba(190, 235, 245, 0.62);
  --challenge-gold: rgba(226, 202, 135, 0.74);
  --challenge-shadow: rgba(0, 105, 145, 0.16);
  position: relative;
  padding-bottom: clamp(30px, 4vh, 48px);
}

.challenge-screen.is-active::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(210, 244, 250, 0) 0%, rgba(210, 244, 250, 0.2) 38%, rgba(196, 235, 245, 0.52) 100%),
    url("assets/ocean-storybook/decor_coral_bottom_border.png") center bottom / cover no-repeat;
  opacity: 0.9;
}

.challenge-screen .challenge-header,
.challenge-screen .challenge-layout {
  position: relative;
  z-index: 1;
}

.challenge-screen .challenge-header {
  border: 1.5px solid var(--challenge-border);
  background:
    linear-gradient(180deg, rgba(238, 252, 254, 0.82), rgba(214, 242, 248, 0.72)),
    url("assets/ocean-storybook/frame_title_long.png") center / 100% 100% no-repeat;
  box-shadow:
    0 12px 26px rgba(0, 105, 145, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.challenge-screen .status-pill {
  color: #7a5200;
  border: 1px solid rgba(255, 230, 150, 0.8);
  background: linear-gradient(180deg, #fff2a8, #ffc84d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 6px 12px rgba(255, 190, 60, 0.2);
}

.challenge-screen .challenge-layout {
  gap: 16px;
}

.challenge-screen .challenge-info-bar,
.challenge-screen .score-zone,
.challenge-screen .bottom-action-panel {
  border: 1.5px solid var(--challenge-border);
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(180deg, var(--challenge-glass-1), var(--challenge-glass-2));
  box-shadow:
    0 14px 32px var(--challenge-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    inset 0 -14px 28px rgba(64, 186, 212, 0.08);
  backdrop-filter: blur(16px) saturate(1.08);
}

.challenge-screen .challenge-info-bar {
  grid-template-columns: minmax(0, 1.15fr) minmax(210px, auto) minmax(240px, 0.95fr);
  gap: 18px;
  padding: 16px 18px;
  border-radius: 28px;
}

.challenge-screen .info-module {
  min-height: 58px;
  border: 1px solid var(--challenge-border-soft);
  border-radius: 20px;
  background: var(--challenge-glass-inner);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 6px 14px rgba(0, 105, 145, 0.06);
}

.challenge-screen .info-tags-module {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
}

.challenge-screen .score-meta span,
.challenge-screen .score-meta strong {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(120, 210, 230, 0.58);
  border-radius: 999px;
  color: var(--challenge-text-main);
  background: rgba(218, 247, 252, 0.78);
  font-size: 0.88rem;
  font-weight: 850;
}

.challenge-screen .bpm-card.control-module {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  white-space: nowrap;
}

.challenge-screen .bpm-card > span {
  margin: 0;
  color: var(--challenge-text-soft);
  font-size: 0.76rem;
  font-weight: 900;
}

.challenge-screen .bpm-control {
  grid-template-columns: 34px 62px 34px;
  gap: 8px;
}

.challenge-screen .bpm-control strong {
  color: var(--challenge-text-deep);
  font-size: 1.9rem;
  font-weight: 950;
}

.challenge-screen .bpm-control .icon-btn {
  border: 1px solid rgba(100, 200, 225, 0.7);
  background: rgba(242, 254, 255, 0.9);
  color: #06789f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 10px 14px;
  border: 1px solid rgba(255, 220, 120, 0.42);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 236, 158, 0.28), transparent 42%),
    rgba(255, 250, 226, 0.48);
}

.challenge-screen .challenge-info-bar .mystery-chest-art {
  width: 42px;
  height: 38px;
  filter: drop-shadow(0 5px 9px rgba(0, 120, 165, 0.16));
}

.challenge-screen .energy-summary strong {
  color: #7a5a00;
  font-size: 0.88rem;
  font-weight: 900;
}

.challenge-screen .energy-track {
  height: 8px;
  background: rgba(100, 160, 160, 0.24);
}

.challenge-screen .energy-track div {
  background: linear-gradient(90deg, #ffd76a, #38d4dc);
}

.challenge-screen .score-zone {
  padding: 22px;
  border-radius: 30px;
}

.challenge-screen .measure-card-head {
  margin-bottom: 14px;
}

.challenge-screen .measure-label {
  color: var(--challenge-text-deep);
  font-size: clamp(1.24rem, 2vw, 1.44rem);
  font-weight: 900;
}

.challenge-screen .measure-subtitle {
  color: var(--challenge-text-soft);
}

.challenge-screen .measure-count {
  border: 1px solid rgba(120, 210, 230, 0.52);
  background: rgba(218, 247, 252, 0.76);
  color: var(--challenge-text-main);
}

.challenge-screen .beat-card {
  min-height: 138px;
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

.challenge-screen .beat-card:hover {
  transform: translateY(-2px);
}

.challenge-screen .beat-card-face {
  border: 1.5px solid var(--challenge-gold);
  border-radius: 20px;
  box-shadow:
    0 10px 22px rgba(0, 110, 145, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    inset 0 -10px 18px rgba(40, 170, 190, 0.06);
}

.challenge-screen .beat-card-back {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 238, 139, 0.34), transparent 28%),
    url("assets/ocean-storybook/icon_compass_badge.png") center 50% / 52px auto no-repeat,
    linear-gradient(180deg, rgba(240, 253, 250, 0.88), rgba(213, 241, 238, 0.78));
  color: rgba(6, 75, 112, 0.72);
}

.challenge-screen .beat-card-back::before {
  border-color: rgba(120, 210, 230, 0.34);
}

.challenge-screen .beat-card-front,
.challenge-screen .beat-card.is-revealed .beat-card-front {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.38), transparent 46%),
    linear-gradient(180deg, rgba(255, 253, 244, 0.96), rgba(231, 249, 252, 0.82));
}

.challenge-screen .beat-card.is-active .beat-card-front {
  border-color: rgba(255, 198, 70, 0.94);
  box-shadow:
    0 0 0 2px rgba(255, 218, 92, 0.48),
    0 14px 26px rgba(0, 125, 165, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.challenge-screen .beat-label {
  color: rgba(6, 75, 112, 0.78);
  font-size: 0.82rem;
}

.challenge-screen .measure-status {
  color: rgba(6, 75, 112, 0.62);
  font-size: 0.75rem;
}

.challenge-screen .bottom-action-panel {
  display: grid;
  gap: 14px;
  margin-top: 2px;
  margin-bottom: 22px;
  padding: 18px;
  border-radius: 28px;
}

.challenge-screen .bottom-action-panel .action-row-start {
  display: grid;
  grid-template-columns: 1fr;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  width: 100%;
  min-height: 64px;
  border: 1px solid rgba(255, 235, 165, 0.92);
  border-radius: 18px;
  color: #5a3500;
  background: linear-gradient(180deg, #ffe68a 0%, #ffc65a 46%, #ff9f4a 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.58),
    0 10px 22px rgba(255, 144, 52, 0.26);
  font-size: 1.22rem;
  font-weight: 900;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.challenge-screen .bottom-action-panel [data-action="start"]:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.68),
    0 14px 28px rgba(255, 144, 52, 0.32);
}

.challenge-screen .bottom-action-panel [data-action="start"]:active {
  transform: translateY(1px);
}

.challenge-screen .bottom-action-panel .action-row-secondary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 48px;
  border: 1px solid rgba(176, 223, 236, 0.92);
  border-radius: 16px;
  color: #0a6487;
  background: rgba(245, 253, 255, 0.84);
  box-shadow:
    0 6px 14px rgba(0, 105, 145, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  font-weight: 850;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn:hover {
  transform: translateY(-1px);
  background: rgba(250, 254, 255, 0.94);
  box-shadow:
    0 8px 18px rgba(0, 105, 145, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn:active {
  transform: translateY(1px);
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.challenge-screen .bottom-action-panel [data-action="retry-challenge"] {
  color: #7a4f00;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 42%),
    linear-gradient(180deg, rgba(255, 245, 191, 0.86), rgba(255, 222, 139, 0.7));
  border-color: rgba(255, 212, 94, 0.62);
}

@media (max-width: 760px) {
  .challenge-screen .challenge-info-bar {
    grid-template-columns: 1fr;
  }

  .challenge-screen .info-module {
    justify-content: center;
  }

  .challenge-screen .bpm-card.control-module {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .challenge-screen .bottom-action-panel .action-row-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .challenge-screen .bottom-action-panel .action-row-secondary {
    grid-template-columns: 1fr;
  }
}

/* Challenge vertical rhythm refinement: balanced spacing and lighter bottom panel */
.challenge-screen.is-active {
  --section-gap: 16px;
  padding: 16px 20px 22px;
}

.challenge-screen.is-active::after {
  height: 32%;
}

.challenge-screen .challenge-header {
  min-height: 78px;
  padding: 12px 18px;
}

.challenge-screen .challenge-title-block h2 {
  font-size: clamp(1.82rem, 3vw, 2.18rem);
  line-height: 1.1;
}

.challenge-screen .challenge-layout {
  gap: var(--section-gap);
  margin-bottom: 18px;
}

.challenge-screen .challenge-info-bar {
  padding: 14px 16px;
  border-radius: 24px;
}

.challenge-screen .info-module {
  min-height: 52px;
  border-radius: 18px;
}

.challenge-screen .info-tags-module,
.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 8px 12px;
}

.challenge-screen .score-meta span,
.challenge-screen .score-meta strong {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.challenge-screen .bpm-card > span {
  font-size: 0.72rem;
}

.challenge-screen .bpm-control strong {
  font-size: 1.72rem;
}

.challenge-screen .bpm-control .icon-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
}

.challenge-screen .challenge-info-bar .mystery-chest-art {
  width: 38px;
  height: 34px;
}

.challenge-screen .score-zone {
  padding: 20px;
  border-radius: 28px;
}

.challenge-screen .measure-card-head {
  margin-bottom: 12px;
}

.challenge-screen .measure-label {
  font-size: clamp(1.18rem, 1.8vw, 1.34rem);
}

.challenge-screen .measure-subtitle {
  margin-top: 3px;
  font-size: 0.8rem;
}

.challenge-screen .beat-card-grid {
  gap: 14px;
}

.challenge-screen .beat-card {
  min-height: 128px;
  max-height: 145px;
}

.challenge-screen .beat-card-face {
  position: relative;
  grid-template-rows: auto 1fr auto;
  padding: 12px 16px;
}

.challenge-screen .beat-card-face::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(8, 120, 155, 0.18), transparent);
  pointer-events: none;
}

.challenge-screen .beat-card-back {
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 238, 139, 0.32), transparent 25%),
    url("assets/ocean-storybook/icon_compass_badge.png") center 52% / 46px auto no-repeat,
    linear-gradient(180deg, rgba(240, 253, 250, 0.88), rgba(213, 241, 238, 0.78));
}

.challenge-screen .card-back-index,
.challenge-screen .beat-label {
  align-self: start;
  color: rgba(6, 75, 112, 0.78);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: left;
}

.challenge-screen .card-back-mark {
  display: block;
  align-self: center;
  justify-self: center;
  color: rgba(7, 111, 145, 0.5);
  font-size: 1.4rem;
  filter:
    drop-shadow(0 4px 8px rgba(0, 120, 165, 0.18))
    drop-shadow(0 0 10px rgba(255, 220, 120, 0.18));
}

.challenge-screen .card-notation {
  min-height: 58px;
}

.challenge-screen .measure-status {
  align-self: end;
  min-height: 16px;
  font-size: 0.72rem;
  text-align: right;
}

.challenge-screen .beat-card:not(.is-revealed) .measure-status {
  display: block;
}

.challenge-screen .measure-footer-hint {
  margin-top: 10px;
  font-size: 0.78rem;
}

.challenge-screen .bottom-action-panel {
  gap: 12px;
  margin-top: 0;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 24px;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 58px;
  font-size: 1.12rem;
}

.challenge-screen .bottom-action-panel .action-row-secondary {
  gap: 10px;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 44px;
  border-radius: 15px;
  font-size: 0.88rem;
  font-weight: 800;
}

@media (max-width: 620px) {
  .challenge-screen.is-active {
    padding: 14px 14px 20px;
  }

  .challenge-screen .beat-card {
    min-height: 118px;
    max-height: none;
  }
}

/* Challenge compact ratio: turn the bottom block into a slim action bar */
.challenge-screen.is-active {
  --section-gap: 12px;
  --section-gap-tight: 10px;
  padding: 14px 20px 16px;
}

.challenge-screen.is-active::after {
  height: 28%;
  background:
    linear-gradient(180deg, rgba(210, 244, 250, 0) 0%, rgba(210, 244, 250, 0.18) 45%, rgba(205, 238, 246, 0.46) 100%),
    url("assets/ocean-storybook/decor_coral_bottom_border.png") center bottom / cover no-repeat;
}

.challenge-screen .challenge-header {
  min-height: 72px;
  padding: 10px 18px;
  border-radius: 22px;
}

.challenge-screen .challenge-title-block h2 {
  font-size: clamp(1.72rem, 2.7vw, 2.02rem);
}

.challenge-screen .challenge-layout {
  gap: var(--section-gap);
  margin-bottom: 12px;
}

.challenge-screen .challenge-info-bar {
  padding: 12px 14px;
  border-radius: 22px;
}

.challenge-screen .info-module {
  min-height: 46px;
  border-radius: 16px;
}

.challenge-screen .info-tags-module,
.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 6px 10px;
}

.challenge-screen .score-meta span,
.challenge-screen .score-meta strong {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.challenge-screen .bpm-card > span {
  font-size: 0.7rem;
}

.challenge-screen .bpm-control {
  grid-template-columns: 30px 54px 30px;
  gap: 7px;
}

.challenge-screen .bpm-control strong {
  font-size: 1.56rem;
}

.challenge-screen .bpm-control .icon-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
}

.challenge-screen .challenge-info-bar .mystery-chest-art {
  width: 34px;
  height: 30px;
}

.challenge-screen .energy-summary strong {
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.challenge-screen .energy-track {
  height: 7px;
}

.challenge-screen .score-zone {
  padding: 18px 20px;
  border-radius: 26px;
}

.challenge-screen .measure-card-head {
  margin-bottom: 10px;
}

.challenge-screen .measure-label {
  font-size: clamp(1.12rem, 1.65vw, 1.26rem);
}

.challenge-screen .measure-subtitle {
  font-size: 0.76rem;
}

.challenge-screen .measure-count {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.challenge-screen .beat-card-grid {
  gap: 12px;
}

.challenge-screen .beat-card {
  min-height: 124px;
  max-height: 134px;
}

.challenge-screen .beat-card-face {
  padding: 10px 14px;
  border-radius: 18px;
}

.challenge-screen .card-back-mark {
  font-size: 1.28rem;
}

.challenge-screen .card-notation {
  min-height: 52px;
}

.challenge-screen .measure-footer-hint {
  margin-top: 8px;
}

.challenge-screen .bottom-action-panel {
  gap: 8px;
  margin-top: var(--section-gap-tight);
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 20px;
  border-width: 1.2px;
  box-shadow:
    0 10px 22px rgba(0, 105, 145, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(14px) saturate(1.05);
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 48px;
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 6px 14px rgba(255, 144, 52, 0.22);
  font-size: 1rem;
}

.challenge-screen .bottom-action-panel [data-action="start"]:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 8px 18px rgba(255, 144, 52, 0.26);
}

.challenge-screen .bottom-action-panel .action-row-secondary {
  gap: 8px;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 36px;
  border-radius: 12px;
  background: rgba(245, 253, 255, 0.78);
  box-shadow:
    0 4px 10px rgba(0, 105, 145, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 620px) {
  .challenge-screen.is-active {
    padding: 12px 12px 16px;
  }

  .challenge-screen .bottom-action-panel {
    padding: 10px 12px;
  }

  .challenge-screen .beat-card {
    min-height: 116px;
    max-height: none;
  }
}

/* Challenge card-to-action whitespace fix: keep the main flow naturally stacked */
.challenge-screen.is-active {
  padding-bottom: 12px;
}

.challenge-screen .challenge-layout {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start !important;
  gap: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 12px auto 10px !important;
}

.challenge-screen .challenge-info-bar {
  flex: 0 0 auto;
  margin: 0 0 12px;
}

.challenge-screen .score-zone {
  flex: 0 0 auto;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 0 10px;
  padding: 16px 18px;
}

.challenge-screen .measure-grid,
.challenge-screen .measure-card {
  height: auto !important;
  min-height: 0 !important;
}

.challenge-screen .measure-card {
  margin: 0;
}

.challenge-screen .measure-card-head {
  margin-bottom: 8px;
}

.challenge-screen .beat-card-grid {
  margin: 0;
  gap: 10px;
}

.challenge-screen .measure-footer-hint {
  margin: 6px 0 0;
  line-height: 1.25;
}

.challenge-screen .bottom-action-panel {
  position: relative;
  flex: 0 0 auto;
  margin: 0 0 10px !important;
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout {
    margin-top: 10px !important;
  }

  .challenge-screen .score-zone {
    margin-bottom: 8px;
    padding: 14px 14px;
  }
}

/* Challenge full-width vertical flow: remove legacy split-column influence */
.challenge-screen.is-active {
  display: block !important;
  overflow-y: auto;
}

.challenge-screen .challenge-flow,
.challenge-screen .challenge-layout {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  width: min(100%, 960px) !important;
  max-width: 960px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto 10px !important;
  gap: 0 !important;
}

.challenge-screen .challenge-header,
.challenge-screen .challenge-info-bar,
.challenge-screen .score-zone,
.challenge-screen .bottom-action-panel {
  width: 100% !important;
  max-width: none !important;
  grid-column: 1 / -1 !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  box-sizing: border-box;
}

.challenge-screen .challenge-header {
  margin: 0 0 12px !important;
}

.challenge-screen .challenge-info-bar {
  margin: 0 0 12px !important;
}

.challenge-screen .score-zone {
  margin: 0 0 10px !important;
}

.challenge-screen .bottom-action-panel {
  margin: 0 0 10px !important;
}

.challenge-screen .teacher-console {
  display: none !important;
}

/* Challenge final vertical layout lock: header, info, rhythm cards, actions use one shared width */
.challenge-screen.is-active {
  display: block !important;
  overflow-x: hidden !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  grid-template-areas: none !important;
  align-items: stretch !important;
  width: min(100%, 960px) !important;
  max-width: 960px !important;
  min-width: 0 !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header,
.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar,
.challenge-screen .challenge-layout.challenge-flow > .score-zone,
.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  display: flex;
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  grid-column: 1 / -1 !important;
  box-sizing: border-box;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  display: grid !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  display: block !important;
  margin-bottom: 10px !important;
}

.challenge-screen #measure-grid,
.challenge-screen .measure-grid,
.challenge-screen .measure-card,
.challenge-screen .beat-card-grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  grid-column: 1 / -1 !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  box-sizing: border-box;
}

.challenge-screen .measure-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

.challenge-screen .measure-card {
  display: grid !important;
  grid-template-rows: auto auto auto !important;
}

.challenge-screen .beat-card-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  display: grid !important;
  margin-top: 0 !important;
}

/* Challenge subject ratio restore: keep actions slim, let rhythm cards lead the page */
.challenge-screen.is-active {
  padding: 14px 20px 16px !important;
}

.challenge-screen.is-active::after {
  height: 26% !important;
  background:
    linear-gradient(180deg, rgba(210, 244, 250, 0) 0%, rgba(210, 244, 250, 0.16) 45%, rgba(205, 238, 246, 0.42) 100%),
    url("assets/ocean-storybook/decor_coral_bottom_border.png") center bottom / cover no-repeat !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  justify-content: flex-start !important;
  margin: 0 auto 12px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 72px !important;
  padding: 10px 18px !important;
  border-radius: 22px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  padding: 12px 14px !important;
  border-radius: 22px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .info-module {
  min-height: 46px !important;
  border-radius: 16px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  min-height: clamp(340px, 44vh, 420px) !important;
  padding: 22px !important;
  border-radius: 28px !important;
  margin-bottom: 10px !important;
}

.challenge-screen .measure-grid {
  height: 100% !important;
}

.challenge-screen .measure-card {
  min-height: 100% !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.challenge-screen .measure-card-head {
  margin-bottom: 12px !important;
}

.challenge-screen .beat-card-grid {
  gap: 14px !important;
  align-items: stretch !important;
}

.challenge-screen .beat-card {
  height: clamp(145px, 17vh, 160px) !important;
  min-height: 145px !important;
  max-height: 165px !important;
  aspect-ratio: auto !important;
}

.challenge-screen .beat-card-face {
  grid-template-rows: auto 1fr auto !important;
  padding: 14px 16px !important;
}

.challenge-screen .card-notation {
  min-height: 70px !important;
}

.challenge-screen .measure-footer-hint {
  margin-top: 8px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  gap: 8px !important;
  margin: 0 0 12px !important;
  padding: 10px 14px !important;
  border-radius: 20px !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 48px !important;
  border-radius: 14px !important;
  font-size: 1rem !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary {
  gap: 8px !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 36px !important;
  border-radius: 12px !important;
  font-size: 0.82rem !important;
}

@media (max-width: 620px) {
  .challenge-screen.is-active {
    padding: 12px 12px 16px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 330px !important;
    padding: 18px !important;
  }

  .challenge-screen .beat-card {
    height: 142px !important;
    min-height: 142px !important;
  }
}

/* Challenge viewport fill rebalance: reduce empty seabed, restore button touch weight */
.challenge-screen.is-active {
  padding: 12px 20px 14px !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  margin: 0 auto 8px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 74px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  min-height: clamp(430px, 52vh, 510px) !important;
  padding: 24px !important;
  margin-bottom: 10px !important;
}

.challenge-screen .measure-card-head {
  margin-bottom: 14px !important;
}

.challenge-screen .beat-card-grid {
  gap: 16px !important;
}

.challenge-screen .beat-card {
  height: clamp(170px, 20vh, 190px) !important;
  min-height: 170px !important;
  max-height: 200px !important;
}

.challenge-screen .card-notation {
  min-height: 88px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  gap: 10px !important;
  margin: 0 0 10px !important;
  padding: 14px 16px !important;
  border-radius: 22px !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 60px !important;
  border-radius: 16px !important;
  font-size: 1.08rem !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary {
  gap: 10px !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 42px !important;
  border-radius: 13px !important;
  font-size: 0.86rem !important;
}

@media (max-width: 760px) {
  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: clamp(400px, 50vh, 470px) !important;
  }

  .challenge-screen .beat-card {
    height: clamp(158px, 19vh, 178px) !important;
    min-height: 158px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 380px !important;
    padding: 18px !important;
  }

  .challenge-screen .beat-card {
    height: 150px !important;
    min-height: 150px !important;
  }

  .challenge-screen .bottom-action-panel [data-action="start"] {
    min-height: 56px !important;
  }

  .challenge-screen .bottom-action-panel .action-row-secondary .btn {
    min-height: 40px !important;
  }
}

/* Challenge bottom balance: make the control frame feel intentional on narrow desktop/tablet widths */
.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  min-height: clamp(480px, 58vh, 560px) !important;
}

.challenge-screen .beat-card {
  height: clamp(185px, 22vh, 210px) !important;
  min-height: 185px !important;
  max-height: 220px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  min-height: 132px !important;
  padding: 18px 18px 20px !important;
  border-radius: 24px !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 64px !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 44px !important;
}

@media (max-width: 760px) {
  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: clamp(470px, 56vh, 530px) !important;
  }

  .challenge-screen .beat-card {
    height: clamp(178px, 21vh, 200px) !important;
    min-height: 178px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 420px !important;
  }

  .challenge-screen .beat-card {
    height: 164px !important;
    min-height: 164px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
    min-height: 124px !important;
    padding: 16px !important;
  }
}

/* Challenge vertical occupancy: expand real content before showing decorative seabed */
.challenge-screen.is-active {
  padding: 10px 16px 10px !important;
}

.challenge-screen.is-active::after {
  height: 20% !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  margin: 0 auto 6px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 88px !important;
  padding: 14px 22px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .challenge-title-block h2 {
  font-size: clamp(2rem, 3.3vw, 2.38rem) !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  min-height: 82px !important;
  padding: 16px 18px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .info-module {
  min-height: 58px !important;
}

.challenge-screen .info-tags-module,
.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 10px 14px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  min-height: clamp(520px, 61vh, 590px) !important;
}

.challenge-screen .beat-card {
  height: clamp(198px, 23vh, 220px) !important;
  min-height: 198px !important;
  max-height: 230px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  min-height: 140px !important;
  padding: 18px 18px 20px !important;
}

@media (max-width: 760px) {
  .challenge-screen.is-active {
    padding: 10px 15px 10px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 88px !important;
    padding: 14px 20px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 82px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: clamp(510px, 59vh, 570px) !important;
  }

  .challenge-screen .beat-card {
    height: clamp(192px, 22vh, 212px) !important;
    min-height: 192px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 78px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 76px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 440px !important;
  }

  .challenge-screen .beat-card {
    height: 170px !important;
    min-height: 170px !important;
  }
}

/* Challenge top breathing room: keep the first frame away from the viewport edge */
.challenge-screen.is-active {
  padding-top: 18px !important;
  padding-bottom: 8px !important;
}

@media (max-width: 760px) {
  .challenge-screen.is-active {
    padding-top: 18px !important;
    padding-bottom: 8px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen.is-active {
    padding-top: 14px !important;
  }
}

/* Challenge info bar breathing: avoid the top status frame looking squeezed */
.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  min-height: 94px !important;
  padding: 18px 20px !important;
}

.challenge-screen .info-module {
  min-height: 66px !important;
}

.challenge-screen .info-tags-module,
.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 12px 16px !important;
}

@media (max-width: 760px) {
  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 90px !important;
    padding: 16px 18px !important;
  }

  .challenge-screen .info-module {
    min-height: 62px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 82px !important;
    padding: 14px 16px !important;
  }

  .challenge-screen .info-module {
    min-height: 56px !important;
  }
}

/* Challenge full-height proportion: make the top two frames and main flow use the page */
.challenge-screen.is-active {
  padding-top: 16px !important;
  padding-bottom: 6px !important;
}

.challenge-screen.is-active::after {
  height: 16% !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  min-height: calc(100vh - 28px) !important;
  margin-bottom: 4px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 108px !important;
  padding: 18px 24px !important;
  margin-bottom: 14px !important;
}

.challenge-screen .challenge-title-block h2 {
  font-size: clamp(2.08rem, 3.55vw, 2.5rem) !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  min-height: 112px !important;
  padding: 20px 22px !important;
  margin-bottom: 14px !important;
}

.challenge-screen .info-module {
  min-height: 74px !important;
}

.challenge-screen .info-tags-module,
.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 14px 18px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  flex: 1 1 auto !important;
  min-height: clamp(480px, 52vh, 560px) !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  flex: 0 0 auto !important;
  min-height: 142px !important;
}

@media (max-width: 760px) {
  .challenge-screen .challenge-layout.challenge-flow {
    min-height: calc(100vh - 26px) !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 104px !important;
    padding: 17px 22px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 108px !important;
    padding: 18px 20px !important;
  }

  .challenge-screen .info-module {
    min-height: 70px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: clamp(470px, 51vh, 540px) !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 90px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 92px !important;
  }

  .challenge-screen .info-module {
    min-height: 62px !important;
  }
}

/* Challenge rhythm panel trim: give vertical space to cards, not empty decoration */
.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) !important;
  padding: 22px 24px 16px !important;
}

.challenge-screen .score-zone::before {
  height: 82px !important;
  opacity: 0.08 !important;
}

.challenge-screen #measure-grid,
.challenge-screen .measure-grid {
  height: 100% !important;
}

.challenge-screen .measure-card {
  height: 100% !important;
  min-height: 0 !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.challenge-screen .beat-card-grid {
  height: 100% !important;
  grid-template-rows: repeat(2, minmax(178px, 1fr)) !important;
  align-content: stretch !important;
}

.challenge-screen .beat-card {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  align-self: stretch !important;
}

.challenge-screen .measure-footer-hint {
  margin: 6px 0 0 !important;
}

@media (max-width: 760px) {
  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, minmax(170px, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    padding: 18px 18px 14px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, minmax(150px, 1fr)) !important;
  }
}

/* Challenge rhythm card proportion restore: keep cards readable, not stretched tall */
.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  display: block !important;
  flex: 0 0 auto !important;
  min-height: auto !important;
  padding: 22px 24px 18px !important;
}

.challenge-screen #measure-grid,
.challenge-screen .measure-grid {
  height: auto !important;
}

.challenge-screen .measure-card {
  height: auto !important;
  min-height: 0 !important;
  grid-template-rows: auto auto auto !important;
}

.challenge-screen .beat-card-grid {
  height: auto !important;
  grid-template-rows: repeat(2, 150px) !important;
  align-content: start !important;
}

.challenge-screen .beat-card {
  height: 150px !important;
  min-height: 150px !important;
  max-height: 160px !important;
  align-self: stretch !important;
}

.challenge-screen .card-notation {
  min-height: 64px !important;
}

@media (max-width: 760px) {
  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 146px) !important;
  }

  .challenge-screen .beat-card {
    height: 146px !important;
    min-height: 146px !important;
    max-height: 156px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 136px) !important;
  }

  .challenge-screen .beat-card {
    height: 136px !important;
    min-height: 136px !important;
    max-height: none !important;
  }
}

/* Challenge page proportion reset: distribute height across all modules, not bottom blank */
.challenge-screen.is-active {
  padding: 16px 16px 10px !important;
}

.challenge-screen.is-active::after {
  height: 14% !important;
  opacity: 0.72 !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  min-height: auto !important;
  margin: 0 auto 8px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 104px !important;
  padding: 18px 24px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  min-height: 108px !important;
  padding: 18px 22px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .info-module {
  min-height: 70px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  display: block !important;
  flex: 0 0 auto !important;
  min-height: auto !important;
  padding: 24px 24px 18px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .score-zone::before {
  height: 58px !important;
  opacity: 0.06 !important;
}

.challenge-screen .measure-card-head {
  margin-bottom: 14px !important;
}

.challenge-screen .beat-card-grid {
  height: auto !important;
  grid-template-rows: repeat(2, 156px) !important;
  gap: 16px !important;
}

.challenge-screen .beat-card {
  height: 156px !important;
  min-height: 156px !important;
  max-height: 166px !important;
}

.challenge-screen .measure-footer-hint {
  margin: 8px 0 0 !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  min-height: 156px !important;
  padding: 20px 18px !important;
  margin: 0 0 8px !important;
  gap: 12px !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 68px !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 46px !important;
}

@media (max-width: 760px) {
  .challenge-screen.is-active {
    padding: 14px 14px 8px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 98px !important;
    padding: 16px 22px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 104px !important;
    padding: 17px 20px !important;
  }

  .challenge-screen .info-module {
    min-height: 66px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 150px) !important;
  }

  .challenge-screen .beat-card {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 160px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
    min-height: 150px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 88px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 92px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 138px) !important;
  }

  .challenge-screen .beat-card {
    height: 138px !important;
    min-height: 138px !important;
  }
}

/* Challenge whole-page balance: reduce bottom blank by sharing height across modules */
.challenge-screen.is-active {
  padding: 14px 16px 6px !important;
}

.challenge-screen.is-active::after {
  height: 10% !important;
  opacity: 0.58 !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  min-height: auto !important;
  margin: 0 auto 4px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 116px !important;
  padding: 20px 24px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  min-height: 120px !important;
  padding: 22px 22px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .info-module {
  min-height: 78px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  padding: 26px 24px 22px !important;
  margin-bottom: 12px !important;
}

.challenge-screen .beat-card-grid {
  grid-template-rows: repeat(2, 164px) !important;
  gap: 18px !important;
}

.challenge-screen .beat-card {
  height: 164px !important;
  min-height: 164px !important;
  max-height: 174px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  min-height: 168px !important;
  padding: 22px 18px !important;
  gap: 14px !important;
  margin-bottom: 4px !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 72px !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 48px !important;
}

@media (max-width: 760px) {
  .challenge-screen.is-active {
    padding: 12px 14px 6px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 110px !important;
    padding: 19px 22px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 116px !important;
    padding: 20px 20px !important;
  }

  .challenge-screen .info-module {
    min-height: 74px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 158px) !important;
    gap: 16px !important;
  }

  .challenge-screen .beat-card {
    height: 158px !important;
    min-height: 158px !important;
    max-height: 168px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
    min-height: 162px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 96px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 100px !important;
  }

  .challenge-screen .info-module {
    min-height: 66px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 142px) !important;
  }

  .challenge-screen .beat-card {
    height: 142px !important;
    min-height: 142px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
    min-height: 146px !important;
  }
}

/* Challenge viewport distribution: prevent all remaining space from falling below actions */
body:has(.challenge-screen.is-active)::after {
  height: min(90px, 12vh) !important;
  opacity: 0.3 !important;
}

.challenge-screen.is-active {
  padding: 16px 16px 6px !important;
}

.challenge-screen.is-active::after {
  height: 8% !important;
  opacity: 0.34 !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  min-height: calc(100vh - 28px) !important;
  justify-content: space-between !important;
  gap: clamp(12px, 1.5vh, 18px) !important;
  margin: 0 auto !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header,
.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar,
.challenge-screen .challenge-layout.challenge-flow > .score-zone,
.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  flex: 0 0 auto !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  flex: 0 0 auto !important;
}

@media (max-width: 760px) {
  .challenge-screen.is-active {
    padding: 14px 14px 6px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow {
    min-height: calc(100vh - 24px) !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow {
    min-height: auto !important;
    justify-content: flex-start !important;
  }
}

/* Challenge final flow spacing: title -> info -> rhythm -> actions as one continuous path */
.challenge-screen.is-active {
  --gap-header-info: 14px;
  --gap-info-rhythm: 16px;
  --gap-rhythm-actions: 12px;
  padding: 14px 20px 16px !important;
}

body:has(.challenge-screen.is-active)::after {
  height: min(120px, 14vh) !important;
  opacity: 0.38 !important;
}

.challenge-screen.is-active::after {
  height: 24% !important;
  opacity: 0.28 !important;
  background:
    linear-gradient(180deg, rgba(210, 244, 250, 0) 0%, rgba(210, 244, 250, 0.14) 45%, rgba(205, 238, 246, 0.38) 100%),
    url("assets/ocean-storybook/decor_coral_bottom_border.png") center bottom / cover no-repeat !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  min-height: auto !important;
  max-width: 960px !important;
  margin: 0 auto !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 72px !important;
  padding: 10px 18px !important;
  border-radius: 22px !important;
  margin: 0 0 var(--gap-header-info) !important;
}

.challenge-screen .challenge-title-block h2 {
  font-size: clamp(1.82rem, 3vw, 2.08rem) !important;
  line-height: 1.1 !important;
}

.challenge-screen .challenge-title-block .kicker {
  font-size: 0.82rem !important;
}

.challenge-screen .status-pill {
  padding: 7px 12px !important;
  font-size: 0.82rem !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  min-height: 78px !important;
  padding: 12px 14px !important;
  border-radius: 22px !important;
  gap: 14px !important;
  margin: 0 0 var(--gap-info-rhythm) !important;
}

.challenge-screen .info-module {
  min-height: 46px !important;
  border-radius: 16px !important;
}

.challenge-screen .info-tags-module,
.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 0 10px !important;
}

.challenge-screen .bpm-control strong {
  font-size: 1.62rem !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  display: block !important;
  flex: 0 0 auto !important;
  min-height: 340px !important;
  padding: 22px !important;
  border-radius: 28px !important;
  margin: 0 0 var(--gap-rhythm-actions) !important;
}

.challenge-screen .score-zone::before {
  height: 90px !important;
  opacity: 0.1 !important;
}

.challenge-screen .measure-card-head {
  margin-bottom: 14px !important;
}

.challenge-screen .measure-label {
  font-size: clamp(1.16rem, 1.8vw, 1.32rem) !important;
}

.challenge-screen .measure-subtitle {
  margin-top: 4px !important;
  font-size: 0.82rem !important;
}

.challenge-screen .measure-count {
  padding: 6px 12px !important;
  font-size: 0.82rem !important;
}

.challenge-screen .beat-card-grid {
  height: auto !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, 150px) !important;
  gap: 14px !important;
  align-content: start !important;
}

.challenge-screen .beat-card {
  height: 150px !important;
  min-height: 150px !important;
  max-height: 160px !important;
}

.challenge-screen .beat-card-face {
  grid-template-rows: auto 1fr auto !important;
  padding: 14px 16px !important;
}

.challenge-screen .beat-card-face::after {
  background: linear-gradient(90deg, transparent, rgba(8, 120, 155, 0.22), transparent) !important;
}

.challenge-screen .beat-card-back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 238, 139, 0.34), transparent 28%),
    url("assets/ocean-storybook/icon_compass_badge.png") center 52% / 52px auto no-repeat,
    linear-gradient(180deg, rgba(240, 253, 250, 0.88), rgba(213, 241, 238, 0.78)) !important;
}

.challenge-screen .measure-status {
  color: rgba(6, 75, 112, 0.72) !important;
  font-size: 0.75rem !important;
  font-weight: 850 !important;
}

.challenge-screen .measure-footer-hint {
  margin: 8px 0 0 !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  min-height: 0 !important;
  padding: 10px 14px !important;
  border-radius: 20px !important;
  gap: 8px !important;
  margin: 0 0 12px !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 48px !important;
  border-radius: 14px !important;
  font-size: 1rem !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary {
  gap: 8px !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 36px !important;
  border-radius: 12px !important;
  font-size: 0.82rem !important;
}

@media (max-width: 760px) {
  .challenge-screen.is-active {
    padding: 14px 14px 16px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto) minmax(190px, 0.95fr) !important;
    gap: 12px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 330px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 146px) !important;
  }

  .challenge-screen .beat-card {
    height: 146px !important;
    min-height: 146px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 68px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 320px !important;
    padding: 18px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 136px) !important;
  }

  .challenge-screen .beat-card {
    height: 136px !important;
    min-height: 136px !important;
  }
}

/* Challenge final viewport fill: keep flow tight while making modules occupy the screen */
.challenge-screen.is-active {
  --gap-header-info: 12px;
  --gap-info-rhythm: 14px;
  --gap-rhythm-actions: 12px;
  padding: 14px 16px 8px !important;
}

body:has(.challenge-screen.is-active)::after {
  height: min(78px, 9vh) !important;
  opacity: 0.22 !important;
}

.challenge-screen.is-active::after {
  height: 10% !important;
  opacity: 0.22 !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  min-height: auto !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  margin: 0 auto !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 96px !important;
  padding: 16px 22px !important;
  margin: 0 0 var(--gap-header-info) !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  min-height: 96px !important;
  padding: 16px 20px !important;
  margin: 0 0 var(--gap-info-rhythm) !important;
}

.challenge-screen .info-module {
  min-height: 62px !important;
}

.challenge-screen .info-tags-module,
.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 10px 14px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  min-height: 400px !important;
  padding: 24px 24px 18px !important;
  margin: 0 0 var(--gap-rhythm-actions) !important;
}

.challenge-screen .score-zone::before {
  height: 64px !important;
  opacity: 0.06 !important;
}

.challenge-screen .beat-card-grid {
  grid-template-rows: repeat(2, 160px) !important;
  gap: 16px !important;
}

.challenge-screen .beat-card {
  height: 160px !important;
  min-height: 160px !important;
  max-height: 170px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  min-height: 150px !important;
  padding: 20px 18px !important;
  gap: 12px !important;
  margin: 0 !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 64px !important;
  font-size: 1.04rem !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 44px !important;
}

@media (max-width: 760px) {
  .challenge-screen.is-active {
    padding: 12px 14px 8px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 92px !important;
    padding: 15px 20px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 92px !important;
    padding: 15px 18px !important;
  }

  .challenge-screen .info-module {
    min-height: 58px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 390px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 156px) !important;
  }

  .challenge-screen .beat-card {
    height: 156px !important;
    min-height: 156px !important;
    max-height: 166px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
    min-height: 146px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 82px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
    min-height: 86px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 340px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 140px) !important;
  }

  .challenge-screen .beat-card {
    height: 140px !important;
    min-height: 140px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
    min-height: 132px !important;
  }
}

/* Challenge content-dominant final pass: rhythm panel leads, seabed is only atmosphere */
.challenge-screen.is-active {
  --gap-header-info: 12px;
  --gap-info-rhythm: 14px;
  --gap-rhythm-actions: 12px;
  --gap-actions-goal: 10px;
  padding: 14px 18px 12px !important;
}

body:has(.challenge-screen.is-active)::after {
  height: min(110px, 12vh) !important;
  opacity: 0.3 !important;
}

.challenge-screen.is-active::after {
  height: 12% !important;
  opacity: 0.26 !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  min-height: auto !important;
  margin: 0 auto !important;
  max-width: 960px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 86px !important;
  padding: 14px 20px !important;
  margin: 0 0 var(--gap-header-info) !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  min-height: 84px !important;
  padding: 14px 18px !important;
  margin: 0 0 var(--gap-info-rhythm) !important;
}

.challenge-screen .info-module {
  min-height: 54px !important;
}

.challenge-screen .info-tags-module,
.challenge-screen .bpm-card.control-module,
.challenge-screen .challenge-info-bar .mystery-chest-panel {
  padding: 8px 12px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  display: block !important;
  flex: 0 0 auto !important;
  min-height: 420px !important;
  padding: 24px 24px 18px !important;
  margin: 0 0 var(--gap-rhythm-actions) !important;
}

.challenge-screen .score-zone::before {
  height: 72px !important;
  opacity: 0.08 !important;
}

.challenge-screen .beat-card-grid {
  grid-template-rows: repeat(2, 175px) !important;
  gap: 16px !important;
}

.challenge-screen .beat-card {
  height: 175px !important;
  min-height: 175px !important;
  max-height: 190px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  min-height: 0 !important;
  padding: 10px 14px !important;
  gap: 8px !important;
  margin: 0 0 var(--gap-actions-goal) !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  min-height: 48px !important;
  border-radius: 14px !important;
  font-size: 1rem !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  min-height: 36px !important;
  border-radius: 12px !important;
  font-size: 0.82rem !important;
}

.challenge-screen .challenge-goal-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 1px solid rgba(192, 235, 245, 0.68);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(226, 248, 252, 0.62), rgba(198, 235, 244, 0.46));
  box-shadow:
    0 8px 18px rgba(0, 105, 145, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  color: rgba(6, 75, 112, 0.74);
  backdrop-filter: blur(12px) saturate(1.05);
}

.challenge-screen .challenge-goal-strip strong {
  color: #075f82;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.challenge-screen .challenge-goal-strip span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(120, 210, 230, 0.46);
  border-radius: 999px;
  background: rgba(235, 251, 254, 0.58);
  font-size: 0.78rem;
  font-weight: 820;
}

@media (max-width: 760px) {
  .challenge-screen.is-active {
    padding: 12px 14px 10px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 410px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 170px) !important;
  }

  .challenge-screen .beat-card {
    height: 170px !important;
    min-height: 170px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 360px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 145px) !important;
  }

  .challenge-screen .beat-card {
    height: 145px !important;
    min-height: 145px !important;
  }

  .challenge-screen .challenge-goal-strip {
    grid-template-columns: 1fr;
  }
}

/* Challenge centered console pass: keep the ocean background as atmosphere, not layout filler */
.challenge-screen.is-active {
  padding-inline: clamp(18px, 4vw, 36px) !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  width: min(92%, 900px) !important;
  max-width: 900px !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
  align-items: center !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header,
.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  width: 100% !important;
  box-sizing: border-box !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar,
.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  width: min(100%, 860px) !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar {
  padding-inline: 16px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  min-height: 420px !important;
  padding-inline: clamp(18px, 3vw, 28px) !important;
}

.challenge-screen #measure-grid,
.challenge-screen .measure-grid {
  width: min(100%, 800px) !important;
  max-width: 800px !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

.challenge-screen .measure-card {
  width: 100% !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

.challenge-screen .beat-card-grid {
  width: 100% !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, 175px) !important;
  gap: 16px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  margin-bottom: 8px !important;
}

.challenge-screen .bottom-action-panel .action-goal-row {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  margin: 0;
  padding: 0 2px 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: rgba(9, 80, 113, 0.68);
}

.challenge-screen .bottom-action-panel .action-goal-row strong {
  font-size: 0.78rem;
  font-weight: 850;
  color: rgba(6, 83, 119, 0.78);
  white-space: nowrap;
}

.challenge-screen .bottom-action-panel .action-goal-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(100, 194, 216, 0.34);
  border-radius: 999px;
  background: rgba(231, 249, 253, 0.36);
  font-size: 0.75rem;
  font-weight: 760;
  color: rgba(6, 83, 119, 0.7);
  white-space: nowrap;
}

.challenge-screen .challenge-goal-strip {
  display: none !important;
}

@media (max-width: 760px) {
  .challenge-screen .challenge-layout.challenge-flow {
    width: min(92%, 900px) !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-info-bar,
  .challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
    width: 100% !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 410px !important;
  }

  .challenge-screen #measure-grid,
  .challenge-screen .measure-grid {
    max-width: 760px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 170px) !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen.is-active {
    padding-inline: 14px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow {
    width: min(92%, 900px) !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 380px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 150px) !important;
    gap: 12px !important;
  }

  .challenge-screen .bottom-action-panel .action-goal-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Challenge visibility fix: keep all four measure cards visible after the challenge starts */
.challenge-screen .challenge-layout.challenge-flow > .score-zone {
  display: block !important;
  height: auto !important;
  min-height: 500px !important;
  overflow: visible !important;
  padding-block: 20px 18px !important;
}

.challenge-screen #measure-grid,
.challenge-screen .measure-grid {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.challenge-screen .measure-card {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.challenge-screen .measure-card-head {
  margin-bottom: 14px !important;
}

.challenge-screen .beat-card-grid {
  height: auto !important;
  min-height: 0 !important;
  grid-template-rows: repeat(2, 168px) !important;
  align-content: start !important;
  overflow: visible !important;
}

.challenge-screen .beat-card {
  height: 168px !important;
  min-height: 168px !important;
  max-height: none !important;
}

.challenge-screen .measure-footer-hint {
  margin-top: 10px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .bottom-action-panel {
  position: relative !important;
  z-index: 2 !important;
  margin-top: 0 !important;
}

@media (max-width: 760px) {
  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 475px !important;
    padding-block: 18px 16px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 154px) !important;
    gap: 14px !important;
  }

  .challenge-screen .beat-card {
    height: 154px !important;
    min-height: 154px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .challenge-layout.challenge-flow > .score-zone {
    min-height: 425px !important;
  }

  .challenge-screen .beat-card-grid {
    grid-template-rows: repeat(2, 132px) !important;
    gap: 12px !important;
  }

  .challenge-screen .beat-card {
    height: 132px !important;
    min-height: 132px !important;
  }
}

/* Challenge obstruction repair: normal document flow, shrink cards before anything can overlap */
.challenge-screen.is-active {
  display: block !important;
  align-content: initial !important;
  row-gap: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding-block: clamp(12px, 2vh, 18px) 14px !important;
}

.challenge-screen .challenge-layout.challenge-flow {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: min(92%, 900px) !important;
  max-width: 900px !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 auto !important;
  overflow: visible !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 12px !important;
  flex: 0 0 auto !important;
}

.challenge-screen .challenge-main-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto;
  gap: 12px;
  width: min(100%, 860px);
  max-width: 860px;
  min-height: 0;
  height: auto;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid rgba(167, 222, 232, 0.5);
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.44), transparent 34%),
    linear-gradient(180deg, rgba(219, 248, 252, 0.68), rgba(185, 234, 245, 0.48));
  box-shadow:
    0 16px 34px rgba(0, 102, 145, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
  box-sizing: border-box;
  overflow: visible;
  backdrop-filter: blur(12px) saturate(1.05);
}

.challenge-screen .challenge-main-panel > .challenge-info-bar,
.challenge-screen .challenge-main-panel > .rhythm-panel,
.challenge-screen .challenge-main-panel > .bottom-action-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.challenge-screen .challenge-main-panel > .challenge-info-bar {
  position: relative !important;
  min-height: 58px !important;
  padding: 8px 10px !important;
  overflow: visible !important;
}

.challenge-screen .challenge-main-panel .info-module {
  min-height: 42px !important;
}

.challenge-screen .challenge-main-panel .info-tags-module,
.challenge-screen .challenge-main-panel .bpm-card.control-module,
.challenge-screen .challenge-main-panel .mystery-chest-panel {
  padding: 6px 10px !important;
}

.challenge-screen .challenge-main-panel > .rhythm-panel {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 14px 16px 12px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel::before {
  height: 58px !important;
  opacity: 0.06 !important;
}

.challenge-screen .rhythm-panel #measure-grid,
.challenge-screen .rhythm-panel .measure-grid {
  display: block !important;
  flex: 0 0 auto !important;
  width: min(100%, 780px) !important;
  max-width: 780px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel .measure-card {
  display: grid !important;
  grid-template-rows: auto auto auto !important;
  gap: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 14px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel .measure-card-head {
  margin: 0 0 12px !important;
}

.challenge-screen .rhythm-panel .beat-card-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, clamp(135px, 18vh, 170px)) !important;
  gap: 14px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  align-content: start !important;
}

.challenge-screen .rhythm-panel .beat-card {
  height: clamp(135px, 18vh, 170px) !important;
  min-height: 125px !important;
  max-height: 170px !important;
  align-self: stretch !important;
}

.challenge-screen .rhythm-panel .measure-footer-hint {
  margin: 8px 0 0 !important;
  line-height: 1.25 !important;
}

.challenge-screen .challenge-main-panel > .bottom-action-panel {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  z-index: 1 !important;
  display: grid !important;
  gap: 8px !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 14px !important;
  overflow: visible !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  height: 48px !important;
  min-height: 48px !important;
  border-radius: 14px !important;
  font-size: 1rem !important;
  font-weight: 900 !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  border-radius: 12px !important;
  font-size: 0.8rem !important;
}

.challenge-screen .bottom-action-panel .reward-summary {
  margin: 0 !important;
  min-height: 28px !important;
  line-height: 1.2 !important;
}

@media (max-height: 780px) {
  .challenge-screen.is-active {
    padding-block: 10px !important;
  }

  .challenge-screen .challenge-layout.challenge-flow > .challenge-header {
    min-height: 64px !important;
    padding: 8px 16px !important;
    margin-bottom: 10px !important;
  }

  .challenge-screen .challenge-main-panel {
    gap: 10px;
    padding: 12px 14px;
  }

  .challenge-screen .challenge-main-panel > .challenge-info-bar {
    min-height: 52px !important;
    padding: 6px 8px !important;
  }

  .challenge-screen .challenge-main-panel > .rhythm-panel {
    padding: 12px 14px 10px !important;
  }

  .challenge-screen .rhythm-panel .measure-card {
    padding: 12px !important;
  }

  .challenge-screen .rhythm-panel .beat-card-grid {
    grid-template-rows: repeat(2, clamp(115px, 16vh, 145px)) !important;
    gap: 10px !important;
  }

  .challenge-screen .rhythm-panel .beat-card {
    height: clamp(115px, 16vh, 145px) !important;
    min-height: 110px !important;
    max-height: 145px !important;
  }

  .challenge-screen .bottom-action-panel [data-action="start"] {
    height: 44px !important;
    min-height: 44px !important;
  }

  .challenge-screen .bottom-action-panel .action-row-secondary .btn {
    height: 32px !important;
    min-height: 32px !important;
  }

  .challenge-screen .bottom-action-panel .reward-summary {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .challenge-screen .challenge-main-panel {
    width: 100%;
    padding-inline: 12px;
  }

  .challenge-screen .rhythm-panel .beat-card-grid {
    grid-template-rows: repeat(2, clamp(120px, 17vh, 150px)) !important;
    gap: 12px !important;
  }

  .challenge-screen .rhythm-panel .beat-card {
    height: clamp(120px, 17vh, 150px) !important;
    max-height: 150px !important;
  }
}

@media (max-width: 620px) {
  .challenge-screen .bottom-action-panel .action-row-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .challenge-screen .rhythm-panel .beat-card-grid {
    grid-template-rows: repeat(2, clamp(112px, 16vh, 138px)) !important;
    gap: 10px !important;
  }

  .challenge-screen .rhythm-panel .beat-card {
    height: clamp(112px, 16vh, 138px) !important;
    max-height: 138px !important;
  }
}

/* Challenge hard visibility pass: the 2x2 rhythm cards must fit before actions render */
.challenge-screen .challenge-main-panel {
  gap: 8px !important;
  padding: 12px 14px !important;
}

.challenge-screen .challenge-main-panel > .challenge-info-bar {
  min-height: 50px !important;
  padding: 6px 8px !important;
}

.challenge-screen .challenge-main-panel > .rhythm-panel {
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 12px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel #measure-grid,
.challenge-screen .rhythm-panel .measure-grid {
  display: block !important;
  height: auto !important;
  max-width: 760px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel .measure-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-content: flex-start !important;
  gap: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 10px 12px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel .measure-card-head {
  flex: 0 0 auto !important;
  margin: 0 0 10px !important;
}

.challenge-screen .rhythm-panel .beat-card-grid {
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, 124px) !important;
  gap: 10px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  align-items: stretch !important;
  align-content: start !important;
  justify-content: stretch !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel .beat-card {
  height: 124px !important;
  min-height: 0 !important;
  max-height: 124px !important;
  align-self: stretch !important;
}

.challenge-screen .rhythm-panel .beat-card-face {
  padding: 9px 12px !important;
}

.challenge-screen .rhythm-panel .card-notation {
  min-height: 58px !important;
}

.challenge-screen .rhythm-panel .measure-footer-hint {
  display: none !important;
}

.challenge-screen .challenge-main-panel > .bottom-action-panel {
  z-index: 0 !important;
  gap: 6px !important;
  padding: 8px 12px !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  height: 42px !important;
  min-height: 42px !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  height: 30px !important;
  min-height: 30px !important;
}

.challenge-screen .bottom-action-panel .reward-summary {
  min-height: 24px !important;
}

@media (min-height: 920px) and (min-width: 760px) {
  .challenge-screen .rhythm-panel .beat-card-grid {
    grid-template-rows: repeat(2, 136px) !important;
  }

  .challenge-screen .rhythm-panel .beat-card {
    height: 136px !important;
    max-height: 136px !important;
  }
}

@media (max-height: 820px), (max-width: 760px) {
  .challenge-screen .rhythm-panel .beat-card-grid {
    grid-template-rows: repeat(2, 112px) !important;
    gap: 9px !important;
  }

  .challenge-screen .rhythm-panel .beat-card {
    height: 112px !important;
    max-height: 112px !important;
  }

  .challenge-screen .rhythm-panel .measure-card-head {
    margin-bottom: 8px !important;
  }

  .challenge-screen .bottom-action-panel .reward-summary {
    display: none !important;
  }
}

/* Challenge structural repair: measure-grid owns the four cards directly */
.challenge-screen .challenge-main-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 14px !important;
  overflow: visible !important;
}

.challenge-screen .challenge-main-panel > .challenge-info-bar {
  grid-row: 1 !important;
}

.challenge-screen .challenge-main-panel > .rhythm-panel {
  grid-row: 2 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

.challenge-screen .challenge-main-panel > .bottom-action-panel {
  grid-row: 3 !important;
  position: relative !important;
  inset: auto !important;
  bottom: auto !important;
  margin-top: 12px !important;
  transform: none !important;
  z-index: auto !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel-head {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid {
  grid-row: 2;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: min(100%, 780px) !important;
  max-width: 780px !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  overflow: visible !important;
  align-items: stretch !important;
  align-content: stretch !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: clamp(120px, 15vh, 150px) !important;
  min-height: 0 !important;
  max-height: 150px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  transform: none;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card.is-active {
  transform: none !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card .beat-card-inner,
.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card .beat-card-face {
  width: 100%;
  height: 100%;
}

.challenge-screen .rhythm-panel .measure-footer-hint {
  grid-row: 3;
  display: block !important;
  margin: 10px 0 0 !important;
}

@media (max-height: 820px), (max-width: 760px) {
  .challenge-screen .challenge-main-panel {
    gap: 10px !important;
  }

  .challenge-screen .rhythm-panel #measure-grid.measure-grid {
    gap: 10px !important;
  }

  .challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card {
    height: clamp(108px, 14vh, 128px) !important;
    max-height: 128px !important;
  }

  .challenge-screen .rhythm-panel .measure-footer-hint {
    display: none !important;
  }
}

/* Challenge final 2x2 lock: structure first, no overlap tricks */
.challenge-screen .challenge-main-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 14px !important;
  overflow: visible !important;
}

.challenge-screen .challenge-main-panel > .challenge-info-bar {
  grid-row: 1 !important;
}

.challenge-screen .challenge-main-panel > .rhythm-panel {
  grid-row: 2 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 12px !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel-header {
  grid-row: 1 !important;
  margin: 0 !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid {
  grid-row: 2 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: min(100%, 780px) !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card {
  display: block !important;
  height: clamp(125px, 16vh, 155px) !important;
  min-height: 0 !important;
  max-height: 155px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card,
.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card:hover,
.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card:active,
.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card.is-active {
  transform: none !important;
}

.challenge-screen .rhythm-panel .rhythm-tip {
  grid-row: 3 !important;
  display: block !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.challenge-screen .challenge-main-panel > .bottom-action-panel {
  grid-row: 3 !important;
  position: relative !important;
  inset: auto !important;
  bottom: auto !important;
  margin-top: 0 !important;
  transform: none !important;
  overflow: visible !important;
}

.challenge-screen .bottom-action-panel [data-action="start"] {
  height: 46px !important;
  min-height: 46px !important;
}

.challenge-screen .bottom-action-panel .action-row-secondary .btn {
  height: 34px !important;
  min-height: 34px !important;
}

@media (max-height: 780px) {
  .challenge-screen .challenge-main-panel {
    gap: 10px !important;
    padding: 14px 18px !important;
  }

  .challenge-screen .challenge-main-panel > .rhythm-panel {
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  .challenge-screen .rhythm-panel #measure-grid.measure-grid {
    gap: 10px !important;
  }

  .challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card {
    height: clamp(110px, 14vh, 140px) !important;
    max-height: 140px !important;
  }

  .challenge-screen .bottom-action-panel [data-action="start"] {
    height: 42px !important;
    min-height: 42px !important;
  }

  .challenge-screen .bottom-action-panel .action-row-secondary .btn {
    height: 30px !important;
    min-height: 30px !important;
  }

  .challenge-screen .bottom-action-panel .reward-summary,
  .challenge-screen .rhythm-panel .rhythm-tip {
    display: none !important;
  }
}

/* Challenge document-compliance lock: match the provided 2x2 repair spec */
.challenge-screen .challenge-main-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 14px !important;
  padding: 18px 22px !important;
  border-radius: 28px !important;
  overflow: visible !important;
}

.challenge-screen .challenge-main-panel > .rhythm-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 12px !important;
  min-height: 0 !important;
  padding: 16px 18px !important;
  border-radius: 24px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card {
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
  height: clamp(125px, 16vh, 155px) !important;
  min-height: 120px !important;
  max-height: 155px !important;
  padding: 12px 14px !important;
  border-radius: 18px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card .beat-card-inner {
  position: absolute !important;
  inset: 0 !important;
}

.challenge-screen .challenge-main-panel > .bottom-action-panel {
  position: relative !important;
  margin-top: 0 !important;
  padding: 10px 14px !important;
  border-radius: 20px !important;
  overflow: visible !important;
  transform: none !important;
}

.challenge-screen .bottom-action-panel .start-challenge-button {
  height: 46px !important;
  min-height: 46px !important;
  border-radius: 14px !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}

.challenge-screen .bottom-action-panel .secondary-action-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 8px !important;
}

.challenge-screen .bottom-action-panel .secondary-action-row .btn {
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
}

.challenge-screen .bottom-action-panel .reward-summary {
  margin-top: 6px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

@media (max-height: 780px) {
  .challenge-screen .challenge-main-panel {
    gap: 10px !important;
    padding: 14px 18px !important;
  }

  .challenge-screen .challenge-main-panel > .rhythm-panel {
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  .challenge-screen .rhythm-panel #measure-grid.measure-grid {
    gap: 10px !important;
  }

  .challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card {
    height: clamp(110px, 14vh, 140px) !important;
    min-height: 0 !important;
    max-height: 140px !important;
  }

  .challenge-screen .bottom-action-panel .start-challenge-button {
    height: 42px !important;
    min-height: 42px !important;
  }

  .challenge-screen .bottom-action-panel .secondary-action-row .btn {
    height: 30px !important;
    min-height: 30px !important;
  }

  .challenge-screen .bottom-action-panel .reward-summary {
    display: none !important;
  }
}

/* Challenge final compliance correction: measure-card follows the provided spec */
.challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card {
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
  height: clamp(125px, 16vh, 155px) !important;
  min-height: 120px !important;
  max-height: 155px !important;
  padding: 12px 14px !important;
  border-radius: 18px !important;
}

@media (max-height: 780px) {
  .challenge-screen .rhythm-panel #measure-grid.measure-grid > .measure-card {
    height: clamp(110px, 14vh, 140px) !important;
    min-height: 0 !important;
    max-height: 140px !important;
  }
}

/* Challenge clean-card implementation: new classes isolated from legacy measure/beat rules */
.challenge-screen .challenge-main-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 14px !important;
  overflow: visible !important;
}

.challenge-screen .challenge-main-panel > .rhythm-panel {
  display: grid !important;
  grid-template-rows: auto auto auto !important;
  gap: 12px !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, clamp(125px, 16vh, 155px)) !important;
  gap: 14px !important;
  width: min(100%, 780px) !important;
  height: auto !important;
  min-height: clamp(264px, calc(32vh + 14px), 324px) !important;
  margin: 0 auto !important;
  overflow: visible !important;
  align-items: stretch !important;
  align-content: start !important;
}

.challenge-screen .rhythm-measure-card {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: clamp(125px, 16vh, 155px) !important;
  min-height: 120px !important;
  max-height: 155px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: transparent !important;
  overflow: visible !important;
  perspective: 900px !important;
  transform: none !important;
}

.challenge-screen .rhythm-measure-card,
.challenge-screen .rhythm-measure-card:hover,
.challenge-screen .rhythm-measure-card:active,
.challenge-screen .rhythm-measure-card.is-active {
  transform: none !important;
}

.challenge-screen .rhythm-card-inner {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  transform-style: preserve-3d !important;
  transition: transform 0.58s cubic-bezier(0.2, 0.82, 0.2, 1) !important;
  transition-delay: var(--flip-delay, 0ms) !important;
}

.challenge-screen .rhythm-measure-card.is-revealed .rhythm-card-inner {
  transform: rotateY(180deg) !important;
}

.challenge-screen .rhythm-card-face {
  position: absolute !important;
  inset: 0 !important;
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
  gap: 4px !important;
  height: 100% !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(120, 210, 230, 0.58) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(255, 253, 244, 0.94), rgba(232, 249, 252, 0.8)) !important;
  box-shadow: 0 10px 20px rgba(0, 120, 165, 0.1) !important;
  overflow: hidden !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

.challenge-screen .rhythm-card-back {
  place-items: center !important;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 238, 139, 0.26), transparent 28%),
    linear-gradient(180deg, rgba(240, 253, 250, 0.9), rgba(213, 241, 238, 0.78)) !important;
}

.challenge-screen .rhythm-card-front {
  transform: rotateY(180deg) !important;
}

.challenge-screen .rhythm-measure-card.is-active .rhythm-card-front {
  border-color: rgba(255, 198, 70, 0.95) !important;
  box-shadow:
    0 0 0 2px rgba(255, 218, 92, 0.42),
    0 10px 22px rgba(0, 130, 170, 0.12) !important;
}

.challenge-screen .rhythm-beat-label,
.challenge-screen .rhythm-card-back .card-back-index {
  justify-self: start !important;
  color: rgba(6, 75, 112, 0.78) !important;
  font-size: 0.8rem !important;
  font-weight: 900 !important;
}

.challenge-screen .rhythm-card-back .card-back-mark {
  align-self: center !important;
  justify-self: center !important;
  color: rgba(7, 111, 145, 0.5) !important;
  font-size: 1.45rem !important;
}

.challenge-screen .rhythm-card-notation {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 58px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-card-notation svg {
  width: min(100%, 260px) !important;
  max-width: 100% !important;
  height: auto !important;
}

.challenge-screen .rhythm-measure-status {
  align-self: end !important;
  min-height: 16px !important;
  color: rgba(6, 75, 112, 0.55) !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-align: right !important;
}

.challenge-screen .rhythm-panel .rhythm-tip {
  margin: 0 !important;
}

.challenge-screen .challenge-main-panel > .bottom-action-panel {
  position: relative !important;
  inset: auto !important;
  margin-top: 0 !important;
  transform: none !important;
  z-index: 1 !important;
}

@media (max-height: 780px), (max-width: 760px) {
  .challenge-screen .rhythm-panel #measure-grid.measure-grid {
    grid-template-rows: repeat(2, clamp(108px, 14vh, 140px)) !important;
    gap: 10px !important;
    min-height: clamp(226px, calc(28vh + 10px), 290px) !important;
  }

  .challenge-screen .rhythm-measure-card {
    height: clamp(108px, 14vh, 140px) !important;
    min-height: 0 !important;
    max-height: 140px !important;
  }

  .challenge-screen .rhythm-card-face {
    padding: 9px 12px !important;
  }

  .challenge-screen .rhythm-panel .rhythm-tip,
  .challenge-screen .bottom-action-panel .reward-summary {
    display: none !important;
  }
}

/* Challenge notation visibility fix: keep the 2x2 structure, but show the score face without 3D clipping. */
.challenge-screen .rhythm-measure-card .rhythm-card-inner,
.challenge-screen .rhythm-measure-card.is-revealed .rhythm-card-inner {
  transform: none !important;
  transform-style: flat !important;
}

.challenge-screen .rhythm-measure-card .rhythm-card-face {
  backface-visibility: visible !important;
  -webkit-backface-visibility: visible !important;
}

.challenge-screen .rhythm-measure-card .rhythm-card-front {
  z-index: 2 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: none !important;
  pointer-events: none !important;
}

.challenge-screen .rhythm-measure-card .rhythm-card-back {
  z-index: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 238, 139, 0.34), transparent 30%),
    url("assets/ocean-storybook/icon_compass_badge.png") center 50% / 54px auto no-repeat,
    linear-gradient(180deg, rgba(240, 253, 250, 0.9), rgba(213, 241, 238, 0.78)) !important;
  border-color: rgba(120, 210, 230, 0.58) !important;
  color: rgba(6, 75, 112, 0.72) !important;
}

.challenge-screen .rhythm-card-back .card-back-mark {
  opacity: 0 !important;
  visibility: hidden !important;
}

.challenge-screen .rhythm-measure-card.is-revealed .rhythm-card-front,
.challenge-screen .rhythm-measure-card .rhythm-card-front[aria-hidden="false"] {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.challenge-screen .rhythm-measure-card.is-revealed .rhythm-card-back,
.challenge-screen .rhythm-measure-card .rhythm-card-back[aria-hidden="true"] {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.challenge-screen .rhythm-card-notation {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 3 !important;
  width: calc(100% - 54px) !important;
  height: clamp(72px, 7.6vh, 90px) !important;
  min-height: 72px !important;
  max-height: 90px !important;
  overflow: visible !important;
}

.challenge-screen .rhythm-card-notation svg {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1.38) !important;
  transform-origin: center center !important;
}

.challenge-screen .rhythm-card-notation svg * {
  opacity: 1 !important;
  visibility: visible !important;
  stroke: #a72f2a !important;
  fill: #a72f2a !important;
}

.challenge-screen .rhythm-card-front .rhythm-beat-label {
  position: relative !important;
  z-index: 4 !important;
  grid-row: 1 !important;
}

.challenge-screen .rhythm-card-front .rhythm-measure-status {
  position: relative !important;
  z-index: 4 !important;
  grid-row: 3 !important;
  justify-self: end !important;
}

.challenge-screen .text-notation {
  color: #a72f2a !important;
  font-family: "Arial Rounded MT Bold", "Nunito", "Arial", sans-serif !important;
  font-size: clamp(1.75rem, 3.8vw, 2.55rem) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: 0.04em !important;
  text-align: center !important;
}

@media (max-height: 780px), (max-width: 760px) {
  .challenge-screen .rhythm-card-notation {
    height: clamp(56px, 7vh, 68px) !important;
    min-height: 56px !important;
    max-height: 68px !important;
  }
}

/* Challenge frame scale polish: make the console slightly larger without returning to edge-to-edge layout. */
.challenge-screen .challenge-layout.challenge-flow {
  width: min(94vw, 980px) !important;
  max-width: 980px !important;
}

.challenge-screen .challenge-layout.challenge-flow > .challenge-header {
  min-height: 92px !important;
  padding: 16px 24px !important;
}

.challenge-screen .challenge-main-panel {
  width: 100% !important;
  padding: 22px 26px !important;
  gap: 16px !important;
}

.challenge-screen .challenge-main-panel > .challenge-info-bar {
  min-height: 76px !important;
  padding: 10px 14px !important;
}

.challenge-screen .challenge-main-panel > .rhythm-panel {
  padding: 20px 22px !important;
  gap: 14px !important;
}

.challenge-screen .rhythm-panel #measure-grid.measure-grid {
  width: min(100%, 860px) !important;
  max-width: 860px !important;
  grid-template-rows: repeat(2, clamp(138px, 17vh, 172px)) !important;
  min-height: clamp(290px, calc(34vh + 16px), 360px) !important;
  gap: 16px !important;
}

.challenge-screen .rhythm-measure-card {
  height: clamp(138px, 17vh, 172px) !important;
  min-height: 132px !important;
  max-height: 172px !important;
}

.challenge-screen .challenge-main-panel > .bottom-action-panel {
  padding: 12px 16px !important;
}

@media (max-height: 780px), (max-width: 760px) {
  .challenge-screen .challenge-layout.challenge-flow {
    width: min(94vw, 940px) !important;
  }

  .challenge-screen .challenge-main-panel {
    padding: 18px 20px !important;
    gap: 12px !important;
  }

  .challenge-screen .challenge-main-panel > .rhythm-panel {
    padding: 16px 18px !important;
  }

  .challenge-screen .rhythm-panel #measure-grid.measure-grid {
    grid-template-rows: repeat(2, clamp(118px, 15vh, 148px)) !important;
    min-height: clamp(250px, calc(30vh + 12px), 310px) !important;
    gap: 12px !important;
  }

  .challenge-screen .rhythm-measure-card {
    height: clamp(118px, 15vh, 148px) !important;
    min-height: 112px !important;
    max-height: 148px !important;
  }
}

/* Challenge action panel scale polish: make the bottom controls easier to read. */
.challenge-screen .challenge-main-panel > .bottom-action-panel {
  padding: 16px 18px !important;
  gap: 12px !important;
  border-radius: 22px !important;
}

.challenge-screen .bottom-action-panel .start-challenge-button,
.challenge-screen .bottom-action-panel [data-action="start"] {
  height: 56px !important;
  min-height: 56px !important;
  border-radius: 16px !important;
  font-size: 1.08rem !important;
  font-weight: 900 !important;
}

.challenge-screen .bottom-action-panel .secondary-action-row {
  gap: 10px !important;
  margin-top: 10px !important;
}

.challenge-screen .bottom-action-panel .secondary-action-row .btn {
  height: 42px !important;
  min-height: 42px !important;
  border-radius: 14px !important;
  font-size: 0.92rem !important;
  font-weight: 850 !important;
}

.challenge-screen .bottom-action-panel .action-goal-row,
.challenge-screen .bottom-action-panel .reward-summary {
  min-height: 40px !important;
  gap: 10px !important;
  padding-top: 2px !important;
}

.challenge-screen .bottom-action-panel .action-goal-row strong,
.challenge-screen .bottom-action-panel .reward-summary strong {
  font-size: 0.9rem !important;
  font-weight: 900 !important;
}

.challenge-screen .bottom-action-panel .action-goal-row span,
.challenge-screen .bottom-action-panel .reward-summary span {
  min-height: 34px !important;
  padding: 0 14px !important;
  font-size: 0.86rem !important;
  font-weight: 820 !important;
}

@media (max-height: 780px), (max-width: 760px) {
  .challenge-screen .challenge-main-panel > .bottom-action-panel {
    padding: 13px 16px !important;
    gap: 9px !important;
  }

  .challenge-screen .bottom-action-panel .start-challenge-button,
  .challenge-screen .bottom-action-panel [data-action="start"] {
    height: 50px !important;
    min-height: 50px !important;
    font-size: 1rem !important;
  }

  .challenge-screen .bottom-action-panel .secondary-action-row .btn {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 0.86rem !important;
  }
}

/* Tablet/touch safety pass: keep interactive targets comfortable on coarse pointers. */
@media (pointer: coarse) {
  button,
  .btn,
  .icon-btn,
  .avatar-change,
  .avatar-choice {
    min-height: 44px !important;
  }

  .icon-btn,
  .icon-btn.small {
    width: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .avatar-choice {
    border-radius: 10px !important;
  }

  .challenge-screen .bottom-action-panel .secondary-action-row .btn {
    height: 44px !important;
    min-height: 44px !important;
  }

  .map-level-card,
  .student-card,
  .collapsed-area {
    min-height: 72px !important;
  }
}

/* Ocean treasure asset pass: replace plain symbols with polished underwater SVG icons. */
.treasure-icon,
.reward-icon {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(141, 214, 228, 0.42);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.96), transparent 28%),
    radial-gradient(circle at 70% 72%, rgba(135, 220, 232, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 235, 0.9), rgba(221, 249, 252, 0.76));
  box-shadow:
    0 10px 22px rgba(0, 120, 160, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.treasure-icon::before,
.reward-icon::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 232, 136, 0.5), transparent 58%),
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.58), transparent 36%);
  pointer-events: none;
}

.ocean-treasure-icon {
  --treasure-fill: #f5c9a3;
  --treasure-highlight: #fff1c7;
  --treasure-stroke: #a7643c;
  position: relative;
  z-index: 1;
  display: grid;
  width: 74%;
  height: 74%;
  place-items: center;
  color: var(--treasure-stroke);
}

.ocean-treasure-icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter:
    drop-shadow(0 5px 8px rgba(95, 76, 39, 0.16))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6));
}

.ocean-treasure-icon .fill-main {
  fill: var(--treasure-fill);
}

.ocean-treasure-icon .fill-soft {
  fill: var(--treasure-highlight);
}

.ocean-treasure-icon .cutout {
  fill: rgba(239, 253, 255, 0.9);
  stroke: none;
}

.ocean-treasure-icon.rarity-common {
  --treasure-fill: #f0d5bd;
  --treasure-highlight: #fff4d6;
  --treasure-stroke: #9d6d4a;
}

.ocean-treasure-icon.rarity-fine {
  --treasure-fill: #f3a78f;
  --treasure-highlight: #ffe7c0;
  --treasure-stroke: #a65c4a;
}

.ocean-treasure-icon.rarity-gold {
  --treasure-fill: #f7c64d;
  --treasure-highlight: #fff3b2;
  --treasure-stroke: #946019;
}

.ocean-treasure-icon.rarity-legend {
  --treasure-fill: #7fd4e6;
  --treasure-highlight: #fff0a8;
  --treasure-stroke: #7457b8;
}

.ocean-treasure-icon.rarity-medal {
  --treasure-fill: #bfa7ff;
  --treasure-highlight: #f3edff;
  --treasure-stroke: #6950b6;
}

.treasure-card.is-missing .ocean-treasure-icon {
  --treasure-fill: #d7e3e8;
  --treasure-highlight: #f5fbfc;
  --treasure-stroke: #8ca5ae;
  opacity: 0.62;
  filter: grayscale(0.55);
}

.reward-icon .ocean-treasure-icon {
  width: 80%;
  height: 80%;
}

.bonus-item .ocean-treasure-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(180deg, rgba(255, 248, 218, 0.94), rgba(226, 250, 252, 0.82));
  box-shadow: inset 0 0 0 1px rgba(132, 211, 226, 0.3);
  font-size: initial;
}

.bonus-item .ocean-treasure-icon svg {
  width: 78%;
  height: 78%;
}

.type-pearl .treasure-svg,
.type-coin .treasure-svg,
.type-orb .treasure-svg,
.type-sand-dollar .treasure-svg {
  stroke-width: 2.6;
}

.type-coral .treasure-svg,
.type-coral-crown .treasure-svg,
.type-trident .treasure-svg,
.type-harp .treasure-svg {
  stroke-width: 3.4;
}

/* Ocean treasure material refresh: object-like assets instead of generic gold badges. */
.treasure-icon,
.reward-icon {
  overflow: visible;
  border: 1px solid rgba(128, 211, 226, 0.36);
  background:
    radial-gradient(circle at 32% 20%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.34) 24%, transparent 44%),
    radial-gradient(circle at 70% 80%, rgba(96, 211, 222, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(239, 254, 255, 0.88), rgba(213, 245, 247, 0.56));
  box-shadow:
    0 12px 22px rgba(0, 121, 150, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.treasure-icon::before,
.reward-icon::before {
  inset: 10%;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 54%, var(--treasure-aura, rgba(119, 218, 226, 0.26)), transparent 66%),
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.7), transparent 32%);
  opacity: 0.88;
}

.reward-icon::after {
  background:
    radial-gradient(circle, rgba(116, 228, 235, 0.36), transparent 62%),
    radial-gradient(circle, rgba(255, 221, 128, 0.22), transparent 48%);
}

.ocean-treasure-icon {
  --treasure-fill: #f7d1be;
  --treasure-highlight: #fff5df;
  --treasure-stroke: #986552;
  --treasure-aura: rgba(116, 218, 228, 0.24);
  isolation: isolate;
  width: 90%;
  height: 90%;
}

.ocean-treasure-icon::before {
  content: "";
  position: absolute;
  inset: 15%;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(circle, var(--treasure-aura), transparent 70%);
  filter: blur(1px);
}

.ocean-treasure-icon svg {
  filter:
    drop-shadow(0 7px 8px rgba(47, 91, 96, 0.18))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.72));
}

.ocean-treasure-icon.rarity-common {
  --treasure-aura: rgba(142, 221, 226, 0.28);
}

.ocean-treasure-icon.rarity-fine {
  --treasure-aura: rgba(255, 153, 118, 0.28);
}

.ocean-treasure-icon.rarity-gold {
  --treasure-aura: rgba(255, 202, 80, 0.32);
}

.ocean-treasure-icon.rarity-legend {
  --treasure-aura: rgba(133, 111, 238, 0.28);
}

.ocean-treasure-icon.rarity-medal {
  --treasure-aura: rgba(151, 126, 238, 0.28);
}

.ocean-treasure-icon.type-shell {
  --treasure-fill: #f4cdbd;
  --treasure-highlight: #fff3df;
  --treasure-stroke: #a36a5d;
}

.ocean-treasure-icon.type-spiral-shell,
.ocean-treasure-icon.type-conch {
  --treasure-fill: #f0b58e;
  --treasure-highlight: #fff0c8;
  --treasure-stroke: #9a5c4b;
}

.ocean-treasure-icon.type-starfish {
  --treasure-fill: #ff9f74;
  --treasure-highlight: #ffd99d;
  --treasure-stroke: #a9553b;
}

.ocean-treasure-icon.type-fish {
  --treasure-fill: #65cddd;
  --treasure-highlight: #d7fbff;
  --treasure-stroke: #1b7892;
}

.ocean-treasure-icon.type-coral,
.ocean-treasure-icon.type-coral-crown {
  --treasure-fill: #ff8f8b;
  --treasure-highlight: #ffd5bd;
  --treasure-stroke: #b3455b;
}

.ocean-treasure-icon.type-gem,
.ocean-treasure-icon.type-deep-gem {
  --treasure-fill: #78d8ef;
  --treasure-highlight: #e6fbff;
  --treasure-stroke: #3769b0;
}

.ocean-treasure-icon.type-plank {
  --treasure-fill: #c8905b;
  --treasure-highlight: #f6d4a4;
  --treasure-stroke: #785337;
}

.ocean-treasure-icon.type-kelp-ring {
  --treasure-fill: #7bd491;
  --treasure-highlight: #d8f7b9;
  --treasure-stroke: #2d8564;
}

.ocean-treasure-icon.type-sand-dollar {
  --treasure-fill: #f4dfbd;
  --treasure-highlight: #fff8dd;
  --treasure-stroke: #a97d4e;
}

.ocean-treasure-icon.type-pearl,
.ocean-treasure-icon.type-orb {
  --treasure-fill: #eaf8ff;
  --treasure-highlight: #ffffff;
  --treasure-stroke: #5d99b3;
}

.ocean-treasure-icon.type-crab {
  --treasure-fill: #ff8b68;
  --treasure-highlight: #ffd2a8;
  --treasure-stroke: #a54237;
}

.ocean-treasure-icon.type-octopus {
  --treasure-fill: #c2a4ff;
  --treasure-highlight: #f0dfff;
  --treasure-stroke: #7450a6;
}

.ocean-treasure-icon.type-anchor {
  --treasure-fill: #d5e4ec;
  --treasure-highlight: #ffffff;
  --treasure-stroke: #5f7886;
}

.ocean-treasure-icon.type-moon {
  --treasure-fill: #d7c6ff;
  --treasure-highlight: #fff0c8;
  --treasure-stroke: #7055a7;
}

.ocean-treasure-icon.type-compass,
.ocean-treasure-icon.type-coin {
  --treasure-fill: #f3c45d;
  --treasure-highlight: #fff4bc;
  --treasure-stroke: #93651e;
}

.ocean-treasure-icon.type-bottle {
  --treasure-fill: #8ed6c9;
  --treasure-highlight: #ecfff8;
  --treasure-stroke: #39786f;
}

.ocean-treasure-icon.type-crown,
.ocean-treasure-icon.type-trident {
  --treasure-fill: #f8c85d;
  --treasure-highlight: #fff3a7;
  --treasure-stroke: #925b24;
}

.ocean-treasure-icon.type-badge {
  --treasure-fill: #9fdce9;
  --treasure-highlight: #fff2a5;
  --treasure-stroke: #5f53a6;
}

.ocean-treasure-icon.type-harp {
  --treasure-fill: #d8b1ff;
  --treasure-highlight: #fff1b8;
  --treasure-stroke: #7550a6;
}

.treasure-card.is-missing .ocean-treasure-icon {
  --treasure-fill: #d5e4e9;
  --treasure-highlight: #f8fcfd;
  --treasure-stroke: #829ca6;
  --treasure-aura: rgba(151, 178, 188, 0.18);
  opacity: 0.62;
  filter: grayscale(0.48);
}

.reward-icon .ocean-treasure-icon {
  width: 88%;
  height: 88%;
}

.bonus-item .ocean-treasure-icon,
.bonus-treasure .ocean-treasure-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(180deg, rgba(236, 253, 255, 0.96), rgba(213, 245, 247, 0.78));
  box-shadow:
    inset 0 0 0 1px rgba(127, 211, 225, 0.32),
    0 4px 8px rgba(0, 110, 140, 0.08);
}

.bonus-treasure .ocean-treasure-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.bonus-item .ocean-treasure-icon svg,
.bonus-treasure .ocean-treasure-icon svg {
  width: 84%;
  height: 84%;
}

/* First common treasure PNG batch. */
.treasure-card .treasure-icon {
  width: 86px;
  height: 86px;
  margin-bottom: 8px;
}

.reward-icon {
  width: 132px;
  height: 132px;
}

.ocean-treasure-icon.has-image {
  width: 108%;
  height: 108%;
  color: inherit;
}

.ocean-treasure-icon.has-image::before {
  inset: 18%;
  opacity: 0.46;
}

.treasure-image-asset {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 8px 10px rgba(34, 99, 120, 0.16))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.68));
}

.reward-icon .ocean-treasure-icon.has-image {
  width: 116%;
  height: 116%;
}

.bonus-item .ocean-treasure-icon.has-image,
.bonus-treasure .ocean-treasure-icon.has-image {
  width: 42px;
  height: 42px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, rgba(238, 253, 255, 0.82), rgba(214, 245, 248, 0.56));
}

.bonus-treasure .ocean-treasure-icon.has-image {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}

.treasure-card.is-missing .treasure-image-asset {
  filter:
    grayscale(0.52)
    saturate(0.36)
    opacity(0.78)
    drop-shadow(0 5px 8px rgba(57, 91, 104, 0.12));
}

/* Gallery large-image preview. */
.treasure-card-button {
  appearance: none;
  display: block;
  width: 100%;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.treasure-card-button:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 176, 198, 0.44);
  box-shadow:
    0 16px 28px rgba(0, 106, 139, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.treasure-card-button:focus-visible {
  outline: 3px solid rgba(18, 178, 199, 0.34);
  outline-offset: 3px;
}

.treasure-preview-modal {
  z-index: 24;
}

.treasure-preview-dialog {
  position: relative;
  width: min(560px, 94vw);
  padding: 28px 28px 24px;
  overflow: visible;
  background:
    radial-gradient(circle at 50% 24%, var(--preview-glow, rgba(116, 228, 235, 0.22)), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(226, 250, 253, 0.9)),
    url("assets/ocean-storybook/panel_soft_dialog.png") center / 100% 100% no-repeat;
}

.treasure-preview-modal[data-rarity="gold"] .treasure-preview-dialog {
  --preview-glow: rgba(255, 205, 88, 0.38);
}

.treasure-preview-modal[data-rarity="legend"] .treasure-preview-dialog {
  --preview-glow: rgba(151, 117, 255, 0.34);
}

.treasure-preview-modal[data-rarity="fine"] .treasure-preview-dialog {
  --preview-glow: rgba(255, 153, 137, 0.28);
}

.treasure-preview-modal[data-rarity="medal"] .treasure-preview-dialog {
  --preview-glow: rgba(144, 122, 235, 0.3);
}

.treasure-preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  font-size: 1.35rem;
  line-height: 1;
}

.treasure-preview-dialog h2 {
  margin: 4px 44px 10px;
  color: var(--storybook-ink);
  font-size: clamp(1.75rem, 4vw, 2.45rem);
  letter-spacing: 0;
}

.treasure-preview-art {
  display: grid;
  width: min(360px, 72vw);
  height: min(360px, 72vw);
  place-items: center;
  margin: 4px auto 12px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.9), transparent 32%),
    radial-gradient(circle at 50% 60%, var(--preview-glow, rgba(116, 228, 235, 0.24)), transparent 60%);
}

.treasure-preview-art .ocean-treasure-icon {
  width: 100%;
  height: 100%;
}

.treasure-preview-art .ocean-treasure-icon.has-image {
  width: 112%;
  height: 112%;
}

.treasure-preview-art .treasure-image-asset {
  filter:
    drop-shadow(0 18px 24px rgba(16, 89, 112, 0.18))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.74));
}

.treasure-preview-rarity {
  display: inline-grid;
  min-width: 86px;
  place-items: center;
  margin: 0 auto 8px;
  padding: 7px 14px;
  border-radius: 999px;
  color: #0b6677;
  background: rgba(219, 249, 253, 0.82);
  font-weight: 900;
}

.treasure-preview-modal[data-rarity="gold"] .treasure-preview-rarity {
  color: #8a5a00;
  background: rgba(255, 239, 177, 0.9);
}

.treasure-preview-modal[data-rarity="legend"] .treasure-preview-rarity,
.treasure-preview-modal[data-rarity="medal"] .treasure-preview-rarity {
  color: #5945a6;
  background: rgba(235, 229, 255, 0.92);
}

.treasure-preview-note {
  max-width: 360px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .treasure-preview-dialog {
    padding: 24px 18px 22px;
  }

  .treasure-preview-dialog h2 {
    margin-inline: 36px;
  }

  .treasure-preview-art {
    width: min(310px, 78vw);
    height: min(310px, 78vw);
  }
}

.map-screen.is-active {
  padding-bottom: clamp(24px, 4vw, 42px);
}

@media (max-width: 760px) {
  .map-screen.is-active {
    padding-bottom: 28px;
  }
}

/* Keep reward dialogs usable on tablet and phone heights. */
#reward-modal.modal {
  padding:
    max(12px, env(safe-area-inset-top))
    12px
    max(12px, env(safe-area-inset-bottom));
}

#reward-modal .modal-dialog {
  display: flex;
  width: min(500px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#reward-modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -8px -8px;
  padding:
    10px 8px
    max(8px, env(safe-area-inset-bottom));
  border-radius: 0 0 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 250, 226, 0), rgba(255, 250, 226, 0.94) 18%, rgba(232, 250, 252, 0.98));
  backdrop-filter: blur(8px);
}

#reward-modal .modal-actions .btn {
  min-height: 46px;
}

@media (max-width: 560px), (max-height: 760px) {
  #reward-modal .modal-dialog {
    width: min(456px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    padding: 18px 18px 12px;
  }

  #reward-modal .kicker {
    margin-bottom: 2px;
    font-size: 0.82rem;
  }

  #reward-modal .modal-dialog h2 {
    margin: 2px 0 8px;
    font-size: clamp(1.72rem, 7vw, 2.35rem);
    line-height: 1.05;
  }

  #reward-modal .reward-icon {
    width: 106px;
    height: 106px;
    margin: 0 auto 6px;
  }

  #reward-modal .reward-name {
    margin: 0 0 2px;
    font-size: 1.48rem;
    line-height: 1.12;
  }

  #reward-modal .reward-rarity,
  #reward-modal .reward-progress {
    margin: 2px 0;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  #reward-modal .reward-bonus {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
  }

  #reward-modal .bonus-list {
    gap: 6px;
    margin: 6px 0 9px;
  }

  #reward-modal .bonus-item {
    grid-template-columns: 36px 1fr auto;
    min-height: 48px;
    padding: 5px 8px;
  }

  #reward-modal .bonus-label {
    margin-bottom: 6px;
    font-size: 0.78rem;
  }

  #reward-modal .bonus-treasure {
    gap: 8px;
  }

  #reward-modal .bonus-chest-art {
    width: 48px;
    height: 40px;
  }

  #reward-modal .reward-bonus p {
    margin-top: 6px;
    font-size: 0.76rem;
    line-height: 1.35;
  }

  #reward-modal .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin: 10px -8px -6px;
  }

  #reward-modal .modal-actions .btn {
    min-width: 0;
    min-height: 44px;
    padding-inline: 8px;
    border-radius: 12px;
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

@media (max-width: 390px) {
  #reward-modal .modal-actions {
    grid-template-columns: 1fr;
  }
}

body.access-pending,
body.is-access-locked {
  min-height: 100vh;
}

body.access-pending .app-shell,
body.is-access-locked .app-shell {
  display: none !important;
}

.license-gate {
  display: none;
  width: 100%;
  min-height: 100vh;
  padding: 28px 16px;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 238, 174, 0.36), transparent 25%),
    radial-gradient(circle at 84% 18%, rgba(93, 207, 225, 0.28), transparent 28%),
    linear-gradient(180deg, #f7feff 0%, #d7f3f7 48%, #8ed3df 100%);
}

body.access-pending .license-gate,
body.is-access-locked .license-gate {
  display: flex;
}

body.is-access-ready .license-gate {
  display: none;
}

.license-card {
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid rgba(125, 202, 214, 0.56);
  border-radius: 28px;
  color: #164d63;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 230, 153, 0.28), transparent 24%),
    rgba(248, 255, 255, 0.96);
  box-shadow: 0 24px 56px rgba(7, 94, 122, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.license-kicker {
  width: fit-content;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #08778e;
  background: rgba(202, 244, 249, 0.86);
  font-size: 0.82rem;
  font-weight: 800;
}

.license-title {
  margin: 0;
  color: #07566d;
  font-family: var(--font-ui);
  font-size: clamp(2rem, 7vw, 2.8rem);
  line-height: 1.08;
}

.license-subtitle {
  margin: 12px 0 0;
  color: rgba(43, 91, 105, 0.82);
  font-size: 0.96rem;
  line-height: 1.7;
}

.license-form {
  display: grid;
  gap: 13px;
  margin-top: 24px;
}

.license-field {
  display: grid;
  gap: 7px;
}

.license-field span {
  color: #2a6575;
  font-size: 0.82rem;
  font-weight: 750;
}

.license-input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(89, 178, 192, 0.46);
  border-radius: 15px;
  outline: 0;
  color: #164d63;
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-weight: 650;
}

.license-code-input {
  text-transform: uppercase;
}

.license-input:focus {
  border-color: rgba(25, 151, 171, 0.8);
  box-shadow: 0 0 0 4px rgba(25, 151, 171, 0.12);
}

.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.license-submit,
.license-secondary {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.license-submit {
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, #21a8be, #087c96);
  box-shadow: 0 10px 22px rgba(7, 124, 150, 0.22);
}

.license-submit:disabled {
  opacity: 0.66;
  cursor: wait;
}

.license-secondary {
  border: 1px solid rgba(89, 178, 192, 0.42);
  color: #176678;
  background: rgba(232, 249, 252, 0.9);
}

.license-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: rgba(43, 91, 105, 0.82);
  font-size: 0.82rem;
  line-height: 1.6;
  font-weight: 650;
}

.license-message.error {
  color: #b75555;
}

.license-message.success {
  color: #28845b;
}

.license-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(89, 178, 192, 0.22);
  color: rgba(43, 91, 105, 0.68);
  font-size: 0.76rem;
  line-height: 1.7;
}

@media (max-width: 520px) {
  .license-card {
    padding: 24px 20px;
    border-radius: 22px;
  }

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