:root {
  color-scheme: light;
  --ink: #10201e;
  --muted: #62716e;
  --line: #d8e2df;
  --line-strong: #b9cbc6;
  --paper: #f7faf8;
  --surface: #ffffff;
  --surface-warm: #fffdf8;
  --teal: #0f6f68;
  --teal-soft: #dff4f0;
  --blue: #2d6cdf;
  --blue-soft: #e7edff;
  --coral: #e45745;
  --coral-soft: #ffe7e2;
  --amber: #f3b23e;
  --amber-soft: #fff1cf;
  --green: #1f9d68;
  --indigo: #263f78;
  --lotus: #f26351;
  --cream: #fff8e8;
  --radius: 8px;
  --shadow-soft: 0 12px 32px rgba(16, 32, 30, 0.09);
  --shadow-strong: 0 22px 54px rgba(16, 32, 30, 0.18);
  --shadow-media: 0 18px 44px rgba(8, 30, 28, 0.24);
  font-family: "Segoe UI", Roboto, "Noto Sans", Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(118deg, rgba(15, 111, 104, 0.11) 0 18%, transparent 18% 100%),
    linear-gradient(64deg, transparent 0 62%, rgba(242, 99, 81, 0.1) 62% 100%),
    linear-gradient(180deg, rgba(255, 248, 232, 0.76) 0%, transparent 42%),
    linear-gradient(135deg, #dfeee9 0%, #eef4ff 52%, #fff8e8 100%);
  color: var(--ink);
}

.site-boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(15, 111, 104, 0.98), rgba(38, 63, 120, 0.96) 58%, rgba(228, 87, 69, 0.92));
  transition: opacity 0.36s ease, visibility 0.36s ease;
}

.site-ready .site-boot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-boot-card {
  width: min(100%, 320px);
  display: grid;
  justify-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 28px 24px 24px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 26px 58px rgba(16, 32, 30, 0.28);
  color: white;
  text-align: center;
  backdrop-filter: blur(18px);
}

.site-boot-card img {
  width: 86px;
  height: 86px;
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.site-boot-card strong {
  font-size: 28px;
  line-height: 1;
}

.site-boot-card span {
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.45;
  font-weight: 800;
}

.site-boot-card i {
  width: 126px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.site-boot-card i::after {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
  animation: boot-progress 1.15s ease-in-out infinite;
}

@keyframes boot-progress {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(250%);
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

button:active {
  transform: translateY(1px) scale(0.992);
}

.app {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(247, 250, 248, 0.98) 170px),
    var(--paper);
  position: relative;
  box-shadow: 0 0 0 1px rgba(16, 32, 30, 0.08), 0 30px 90px rgba(16, 32, 30, 0.22);
  overflow-x: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 10px;
  border-bottom: 1px solid rgba(185, 203, 198, 0.76);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(244, 251, 248, 0.9)),
    rgba(247, 250, 248, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 22px rgba(16, 32, 30, 0.07);
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--teal);
  font-weight: 900;
  display: grid;
  place-items: center;
}

.cloud-sync-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #8b9995;
  box-shadow: 0 2px 7px rgba(16, 32, 30, 0.24);
}

.cloud-sync-dot[data-state="synced"] {
  background: #1f9d68;
}

.cloud-sync-dot[data-state="syncing"],
.cloud-sync-dot[data-state="queued"] {
  background: #e8a329;
}

.cloud-sync-dot[data-state="error"] {
  background: #d83839;
}

body.account-open {
  overflow: hidden;
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 12px max(18px, env(safe-area-inset-bottom));
  background: rgba(7, 24, 23, 0.56);
  backdrop-filter: blur(9px);
}

.account-modal[hidden] {
  display: none;
}

.account-sheet {
  width: min(100%, 440px);
  max-height: min(820px, calc(100vh - 34px));
  overflow-y: auto;
  padding: 18px;
  border: 1px solid rgba(15, 111, 104, 0.2);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 30px 80px rgba(7, 24, 23, 0.34);
  animation: account-sheet-in 220ms ease both;
}

@keyframes account-sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.account-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.account-sheet-head h2 {
  margin: 2px 0 0;
  font-size: 23px;
  line-height: 1.2;
}

.account-close {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f5f8f7;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.account-intro {
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.cloud-sync-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 111, 104, 0.14);
  border-radius: var(--radius);
  background: #f2f7f5;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.cloud-sync-status::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  background: #8b9995;
}

.cloud-sync-status[data-state="synced"]::before {
  background: #1f9d68;
}

.cloud-sync-status[data-state="syncing"]::before,
.cloud-sync-status[data-state="queued"]::before {
  background: #e8a329;
}

.cloud-sync-status[data-state="error"]::before {
  background: #d83839;
}

.account-message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #edf5f2;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.account-message[data-kind="error"] {
  background: #fff0ef;
  color: #9f2829;
}

.account-message[data-kind="success"] {
  background: #e7f8ee;
  color: #126d48;
}

.account-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef3f1;
}

.account-mode-switch button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.account-mode-switch button.active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 7px 18px rgba(16, 32, 30, 0.1);
}

.account-form {
  display: grid;
  gap: 11px;
}

.account-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.account-form label[hidden] {
  display: none !important;
}

.account-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.account-form input:focus {
  outline: 3px solid rgba(15, 111, 104, 0.14);
  border-color: var(--teal);
}

.account-text-action,
.account-danger-action {
  width: 100%;
  min-height: 42px;
  margin-top: 9px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.account-danger-action {
  color: #a72e30;
}

.account-signed-in {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.account-signed-in[hidden] {
  display: none;
}

.account-user {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid rgba(15, 111, 104, 0.18);
  border-radius: var(--radius);
  background: #f2f8f6;
}

.account-user span,
.account-user small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.account-user strong {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.account-policy-link {
  display: inline-block;
  margin-top: 14px;
}

.account-operator {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.account-operator span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-operator strong {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  .account-modal {
    align-items: center;
  }
}

.language-switch {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  min-width: 146px;
  min-height: 44px;
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(15, 111, 104, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(244, 251, 248, 0.82)),
    linear-gradient(135deg, rgba(216, 56, 57, 0.12), rgba(15, 111, 104, 0.16));
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
  box-shadow:
    0 12px 28px rgba(16, 32, 30, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.language-switch::before {
  content: "";
  position: absolute;
  inset: 5px auto 5px 5px;
  z-index: -1;
  width: calc(50% - 11px);
  border-radius: 999px;
  background: linear-gradient(135deg, #0f6f68, #1f8f86);
  box-shadow: 0 8px 18px rgba(15, 111, 104, 0.26);
  transition: transform 220ms ease;
}

html[lang="vi"] .language-switch::before {
  transform: translateX(calc(100% + 22px));
}

.language-switch span,
.language-switch b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.language-switch b {
  color: var(--coral);
  font-size: 14px;
}

.language-switch span:first-child,
html[lang="vi"] .language-switch span:last-child {
  color: #fff;
}

html[lang="vi"] .language-switch span:first-child {
  color: var(--teal-dark);
}

.icon-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 2px 0;
}

.brand {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.brand > div {
  min-width: 0;
  max-width: 100%;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.brand small,
small,
.muted {
  color: var(--muted);
}

@media (max-width: 420px) {
  .site-header {
    gap: 8px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    max-width: 96px;
  }

  .language-switch {
    min-width: 132px;
    min-height: 42px;
    font-size: 10px;
  }
}

main {
  min-height: calc(100vh - 150px);
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.screen {
  display: none;
  padding: 14px 16px 22px;
}

.screen.active {
  display: block;
}

.hero {
  min-height: 340px;
  border-radius: var(--radius);
  padding: 0;
  position: relative;
  display: block;
  overflow: hidden;
  color: white;
  background: #102b2a;
  box-shadow: 0 18px 42px rgba(16, 32, 30, 0.2);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 29, 28, 0.06) 0%, rgba(8, 28, 27, 0.16) 42%, rgba(8, 28, 27, 0.9) 100%),
    linear-gradient(90deg, rgba(12, 55, 52, 0.68), rgba(12, 55, 52, 0.08) 58%);
}

.hero-art {
  width: 100%;
  height: 100%;
  min-height: 340px;
  display: block;
  object-fit: cover;
}

.hero-copy {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-content: end;
  padding: 22px;
}

.hero p,
.hero h1 {
  margin: 0;
}

.hero p {
  opacity: 0.92;
  font-weight: 800;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}

.hero h1 {
  margin-top: 8px;
  max-width: 11ch;
  font-size: clamp(31px, 9vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.hero-actions {
  margin-top: 18px;
}

.hero-actions,
.sample-row,
.switcher,
.toolbar,
.reply {
  display: flex;
  gap: 8px;
}

.primary,
.secondary,
.small-action,
.sample-row button,
.switcher button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 900;
}

.primary {
  background: var(--teal);
  color: white;
}

.secondary {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(8px);
}

.full {
  width: 100%;
  margin-top: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.summary-grid article,
.card,
.job-card,
.lesson-card,
.learning-card,
.video-card,
.notice,
.result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.summary-grid article {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  text-align: center;
}

.summary-grid span {
  color: var(--teal);
  font-size: 24px;
  font-weight: 900;
}

.summary-grid small {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.card {
  padding: 16px;
  margin-top: 12px;
}

.screen-visual {
  margin: 0 0 12px;
  height: 184px;
  border: 1px solid rgba(15, 111, 104, 0.22);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0f2523;
  box-shadow: var(--shadow-media);
}

.screen-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

.card h2,
.screen-title h1,
.job-card h3,
.lesson-card h3 {
  margin: 0;
}

.card h2 {
  font-size: 21px;
  line-height: 1.25;
}

.progress {
  height: 9px;
  overflow: hidden;
  margin: 14px 0;
  border-radius: var(--radius);
  background: #e7efec;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.checklist {
  display: grid;
  gap: 8px;
}

.check-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fbfdfc;
}

.check-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
}

.feature-card {
  background:
    linear-gradient(116deg, rgba(255, 241, 207, 0.72), transparent 42%),
    linear-gradient(135deg, #f2faf7 0%, #ffffff 56%, #fff8e8 100%);
  border-color: rgba(15, 111, 104, 0.22);
}

.operator-credit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 2px 2px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.operator-credit span {
  font-weight: 800;
}

.operator-credit strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.service-grid,
.policy-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.service-grid {
  grid-template-columns: 1fr;
}

.service-grid span,
.policy-list span,
.job-proof span {
  min-height: 34px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 7px 10px;
  background: #fbfdfc;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.service-grid span:nth-child(1) {
  background: #edf7ff;
  border-color: #cfe1fb;
}

.service-grid span:nth-child(2) {
  background: #f2faf7;
  border-color: #c8e6df;
}

.service-grid span:nth-child(3) {
  background: #fff5dc;
  border-color: #ead7a7;
}

.service-grid span:nth-child(4) {
  background: #fff0ec;
  border-color: #f5ccc3;
}

.service-grid span:nth-child(5) {
  background: #f2f4ff;
  border-color: #d4daf4;
}

.screen-title {
  padding: 2px 0 12px;
}

.screen-title p {
  margin: 0 0 5px;
  color: var(--muted);
  font-weight: 800;
}

.screen-title h1 {
  max-width: 100%;
  font-size: clamp(24px, 6.9vw, 29px);
  line-height: 1.14;
  overflow-wrap: anywhere;
  word-break: normal;
  line-break: strict;
  text-wrap: balance;
}

.notice {
  display: grid;
  gap: 5px;
  padding: 13px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f4fbf8, #fffaf0);
  border-color: rgba(15, 111, 104, 0.22);
}

.notice strong {
  color: var(--teal);
}

.notice span {
  color: var(--muted);
  line-height: 1.45;
}

.source-policy {
  margin-bottom: 12px;
}

.source-policy p:last-child,
.job-sources-card > p:last-of-type,
.contract-guide > p:last-of-type {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.source-list,
.contract-guide-list,
.support-flow-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.source-row,
.contract-guide-row,
.support-flow-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(118deg, rgba(231, 237, 255, 0.5), transparent 38%),
    #fbfdfc;
}

.source-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 12px;
}

.source-row > span,
.contract-guide-row > div > span {
  width: max-content;
  border-radius: var(--radius);
  padding: 5px 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.source-row h3,
.contract-guide-row h3,
.support-flow-step strong {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.source-row p,
.contract-guide-row p,
.support-flow-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.source-row a {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  justify-self: start;
  border-radius: var(--radius);
  padding: 0 11px;
  background: var(--teal);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.contract-guide-row {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.contract-guide-row > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.contract-guide-row ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.support-flow-step {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.toolbar {
  margin-bottom: 12px;
}

.secondary-toolbar {
  margin-top: -4px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 176px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 111, 104, 0.2);
  border-color: var(--teal);
}

.toolbar select {
  flex: 0 0 118px;
}

.job-list,
.lesson-list,
.video-list {
  display: grid;
  gap: 12px;
}

.job-card,
.lesson-card,
.video-card {
  padding: 15px;
}

.job-card {
  background:
    linear-gradient(116deg, rgba(255, 241, 207, 0.55), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), #ffffff);
}

.job-card h3 {
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.2;
}

.job-card p {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.45;
}

.job-meta {
  display: grid;
  gap: 6px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.job-proof {
  display: grid;
  gap: 7px;
  margin: 10px 0 12px;
}

.job-proof span {
  background: #f6faf8;
}

.badge,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: var(--radius);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.badge.care,
.tag-row span {
  color: var(--teal);
  background: var(--teal-soft);
}

.badge.it {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge.hospitality,
.badge.restaurant {
  color: #8a4d04;
  background: var(--amber-soft);
}

.badge.manufacturing,
.badge.logistics,
.badge.construction {
  color: var(--indigo);
  background: #edf1ff;
}

.badge.education,
.badge.language {
  color: var(--lotus);
  background: var(--coral-soft);
}

.badge.sales,
.badge.service,
.badge.global {
  color: var(--green);
  background: #e7f8ee;
}

.tag-row span.danger {
  color: var(--coral);
  background: var(--coral-soft);
}

.job-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #edf5f2;
  color: var(--teal);
}

.small-action.primary-link {
  background: var(--teal);
  color: white;
}

.switcher {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf5f2;
  margin-bottom: 12px;
}

.switcher button {
  flex: 1;
  background: transparent;
  color: var(--muted);
}

.switcher button.active {
  background: var(--surface);
  color: var(--teal);
  box-shadow: 0 6px 14px rgba(16, 32, 30, 0.08);
}

.money-panel {
  display: none;
}

.money-panel.active {
  display: block;
}

.form-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}

label span {
  font-size: 13px;
}

input[type="number"] {
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.rate-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4fbf8;
}

.rate-card strong,
.rate-card small,
.rate-card a {
  display: block;
}

.rate-card small {
  margin-top: 3px;
  line-height: 1.4;
}

.rate-card a {
  grid-column: 1 / -1;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.result {
  margin-top: 12px;
  padding: 16px;
  display: grid;
  gap: 8px;
  color: white;
  background:
    linear-gradient(112deg, rgba(247, 211, 108, 0.22), transparent 42%),
    linear-gradient(135deg, #102c2a, #0f6f68);
}

.result.blue {
  background:
    linear-gradient(112deg, rgba(242, 99, 81, 0.2), transparent 42%),
    linear-gradient(135deg, #10284f, #263f78);
}

.result.danger {
  background:
    linear-gradient(112deg, rgba(247, 211, 108, 0.18), transparent 42%),
    linear-gradient(135deg, #381f1a, #7a2f25);
}

.result p,
.result small,
.result span {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
}

.result strong {
  font-size: 30px;
  line-height: 1.1;
}

.sample-row {
  margin-bottom: 10px;
}

.sample-row button {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--teal);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.lesson-card {
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 248, 0.96)),
    var(--surface);
}

.lesson-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--coral));
  opacity: 0.82;
}

.lesson-card > * {
  position: relative;
}

.lesson-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lesson-number {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.lesson-number small {
  line-height: 1.35;
  font-weight: 800;
}

.lesson-card h3 {
  font-size: 19px;
}

.lesson-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.lesson-card button.done {
  background: var(--green);
}

.lesson-video-link {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(15, 111, 104, 0.24);
  border-radius: var(--radius);
  padding: 8px;
  background:
    linear-gradient(112deg, rgba(231, 237, 255, 0.62), transparent 44%),
    linear-gradient(180deg, #f8fcfa, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.lesson-video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 7px;
  object-fit: cover;
  background: #0d1e1d;
  box-shadow: 0 8px 18px rgba(16, 32, 30, 0.15);
}

.lesson-video-link div {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.lesson-video-link span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.lesson-video-link button {
  width: max-content;
  max-width: 100%;
}

.learning-overview {
  margin-bottom: 12px;
}

.learning-card {
  padding: 16px;
  background:
    linear-gradient(116deg, rgba(255, 241, 207, 0.74), transparent 42%),
    linear-gradient(135deg, #f4fbf8, #ffffff 58%, #fff8e8);
  border-color: rgba(15, 111, 104, 0.22);
  box-shadow: var(--shadow-strong);
}

.learning-card-head,
.quiz-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.learning-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.learning-card-head strong {
  color: var(--teal);
  font-size: 30px;
  line-height: 1;
}

.learning-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.learning-stats span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: rgba(255, 255, 255, 0.82);
}

.learning-stats b,
.learning-stats small {
  display: block;
  overflow-wrap: anywhere;
}

.learning-stats b {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.15;
}

.learning-stats small {
  margin-top: 4px;
  line-height: 1.25;
}

.learning-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.lesson-section {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.lesson-section strong,
.lesson-quiz strong {
  color: var(--teal);
}

.lesson-section span,
.lesson-section li {
  color: var(--muted);
  line-height: 1.45;
}

.lesson-section ul {
  margin: 0;
  padding-left: 19px;
}

.phrase-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.phrase-list span {
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #edf5f2;
  color: var(--ink);
  font-weight: 800;
}

.lesson-quiz {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdfc;
}

.lesson-quiz.correct {
  border-color: rgba(31, 157, 104, 0.32);
  background: #f1fbf5;
}

.lesson-quiz.incorrect {
  border-color: rgba(228, 87, 69, 0.28);
  background: #fff5f2;
}

.lesson-quiz p,
.lesson-quiz small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.quiz-head span {
  min-height: 27px;
  border-radius: var(--radius);
  padding: 5px 9px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.lesson-quiz.incorrect .quiz-head span {
  color: var(--coral);
  background: var(--coral-soft);
}

.quiz-options {
  display: grid;
  gap: 7px;
}

.quiz-options button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  font-weight: 800;
}

.quiz-options button.selected {
  border-color: rgba(15, 111, 104, 0.38);
  background: #edf5f2;
}

.quiz-options button.answer {
  border-color: rgba(31, 157, 104, 0.4);
  background: #e7f8ee;
}

.manga-learning {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 15px;
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid rgba(15, 111, 104, 0.24);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.34), transparent 30%),
    linear-gradient(135deg, rgba(16, 32, 30, 0.98), rgba(15, 111, 104, 0.95) 50%, rgba(242, 99, 81, 0.82));
  box-shadow: var(--shadow-strong);
  color: white;
}

.manga-learning::after {
  content: "";
  position: absolute;
  inset: auto -70px -120px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(255, 241, 207, 0.2);
  pointer-events: none;
}

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

.manga-learning-head h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.16;
}

.manga-learning-head p:not(.eyebrow) {
  max-width: 760px;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.manga-learning-head strong {
  min-width: 76px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  padding: 13px 12px 11px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 14px 30px rgba(16, 32, 30, 0.18);
}

.manga-learning-head strong span {
  font-size: 11px;
  font-weight: 900;
}

.manga-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.manga-series-section {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.34);
}

.manga-series-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.manga-series-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
}

.manga-series-head p:not(.eyebrow) {
  max-width: 760px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.manga-series-head > strong {
  min-width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 20px;
  box-shadow: 0 12px 24px rgba(16, 32, 30, 0.18);
}

.manga-card.is-teen {
  border-color: rgba(255, 211, 107, 0.72);
}

.manga-card.is-teen .manga-image span {
  background: rgba(211, 78, 63, 0.9);
}

.manga-card.is-teen .manga-card-copy small {
  color: #b23c31;
}

.manga-card {
  overflow: hidden;
  display: grid;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(16, 32, 30, 0.22);
  animation-delay: calc(var(--stagger, 0) * 45ms);
}

.manga-image {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #f4f7f5;
}

.manga-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.manga-image span {
  position: absolute;
  top: 10px;
  left: 10px;
  min-width: 38px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(16, 32, 30, 0.78);
  color: white;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(16, 32, 30, 0.22);
}

.manga-card-copy {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.manga-card-copy small {
  color: var(--teal);
  font-weight: 900;
}

.manga-card-copy h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.28;
}

.manga-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.manga-card-copy dl {
  display: grid;
  gap: 8px;
  margin: 2px 0 0;
}

.manga-card-copy dl div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(15, 111, 104, 0.12);
  border-radius: var(--radius);
  padding: 9px 10px;
  background:
    linear-gradient(135deg, rgba(223, 244, 240, 0.82), rgba(255, 255, 255, 0.9));
}

.manga-card-copy dt {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.manga-card-copy dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.manga-card.is-read {
  border-color: rgba(81, 220, 164, 0.78);
}

.manga-read-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(15, 111, 104, 0.24);
  border-radius: var(--radius);
  background: #f2f8f6;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.manga-read-button.is-read {
  border-color: rgba(31, 157, 104, 0.38);
  background: #e7f8ee;
  color: #126d48;
}

.video-learning {
  display: grid;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(15, 111, 104, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(15, 111, 104, 0.08), rgba(45, 108, 223, 0.07) 48%, rgba(255, 248, 232, 0.9)),
    rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(10px);
}

.video-copy {
  border: 1px solid rgba(15, 111, 104, 0.22);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(118deg, rgba(242, 99, 81, 0.14), transparent 42%),
    linear-gradient(135deg, #f4fbf8 0%, #ffffff 58%, #fff7e7 100%);
  box-shadow: 0 10px 26px rgba(16, 32, 30, 0.08);
}

.video-copy::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--coral));
}

.video-copy > * {
  position: relative;
}

.video-copy h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
}

.video-copy p:not(.eyebrow) {
  margin: 8px 0 10px;
  color: var(--muted);
  line-height: 1.55;
}

.video-player {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(15, 111, 104, 0.28), rgba(16, 32, 30, 0.94)),
    #0d1e1d;
  box-shadow: var(--shadow-media);
}

.video-player iframe,
.video-empty {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-empty {
  display: grid;
  place-items: center;
  padding: 18px;
  color: white;
  font-weight: 900;
  text-align: center;
}

.video-card {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(231, 237, 255, 0.9), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), #ffffff);
  border-color: rgba(185, 203, 198, 0.92);
}

.video-card.active {
  border-color: rgba(15, 111, 104, 0.44);
  background:
    linear-gradient(120deg, rgba(223, 244, 240, 0.96), rgba(255, 255, 255, 0.92) 46%),
    #ffffff;
  box-shadow: 0 16px 36px rgba(15, 111, 104, 0.18);
}

.video-index {
  position: absolute;
  z-index: 2;
  left: 9px;
  top: 9px;
  min-width: 32px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(16, 32, 30, 0.78);
  color: white;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(16, 32, 30, 0.22);
}

.video-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: #0d1e1d;
  box-shadow: 0 9px 20px rgba(16, 32, 30, 0.13);
}

.video-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 420ms ease;
}

.video-thumb span {
  position: absolute;
  inset: auto auto 8px 8px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(16, 32, 30, 0.26);
}

.video-thumb span::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 9px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid var(--teal);
}

.video-card-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.video-card-copy small {
  color: var(--teal);
  font-weight: 800;
}

.video-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.28;
}

.video-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.video-actions .small-action {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.channel-link {
  justify-self: start;
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.learning-game {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
}

.game-hero,
.game-player,
.game-status-card,
.game-chapter-card,
.game-character-card,
.teacher-brief,
.teacher-row {
  border: 1px solid rgba(185, 203, 198, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.game-hero {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  display: grid;
  align-items: end;
  background:
    linear-gradient(150deg, rgba(21, 18, 51, 0.94), rgba(19, 82, 80, 0.86) 52%, rgba(242, 99, 81, 0.62)),
    #10201e;
  color: white;
  box-shadow: var(--shadow-strong);
}

.game-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.18), transparent 22%),
    radial-gradient(circle at 78% 10%, rgba(243, 178, 62, 0.22), transparent 22%),
    linear-gradient(180deg, transparent 44%, rgba(5, 18, 18, 0.78));
}

.game-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding: 18px;
}

.game-hero-copy h2,
.game-hero-copy p,
.game-hero-copy strong {
  margin: 0;
}

.game-hero-copy h2 {
  max-width: 9ch;
  font-size: 38px;
  line-height: 1.02;
}

.game-hero-copy > strong {
  color: #ffe9a8;
  font-size: 15px;
}

.game-hero-copy > p {
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
  font-weight: 700;
}

.game-hero-art {
  position: absolute;
  z-index: 1;
  right: -92px;
  top: -18px;
  width: min(92%, 430px);
  height: 104%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0.94;
  pointer-events: none;
}

.game-hero-art img {
  height: 100%;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 28px 42px rgba(0, 0, 0, 0.38));
}

.game-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  max-width: 360px;
}

.game-profile label {
  display: grid;
  gap: 5px;
}

.game-profile span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 900;
}

.game-profile input {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.62);
}

.game-course-switch {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 430px);
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(7, 31, 33, 0.34);
  backdrop-filter: blur(12px);
}

.game-course-switch button {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.76);
  font-weight: 900;
  line-height: 1.15;
}

.game-course-switch button b,
.game-course-switch button span {
  display: block;
}

.game-course-switch button b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-course-switch button span {
  margin-top: 3px;
  font-size: 10px;
  opacity: 0.76;
}

.game-course-switch button.active {
  background: linear-gradient(135deg, #ffe59a, #ffbc75);
  color: #18312f;
  box-shadow: 0 12px 26px rgba(255, 188, 117, 0.28);
}

.game-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary.dark {
  background: rgba(11, 30, 29, 0.46);
}

.game-hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 18px 18px;
}

.game-hero-stats span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  padding: 9px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
}

.game-hero-stats b,
.game-hero-stats small {
  display: block;
}

.game-hero-stats b {
  font-size: 18px;
}

.game-hero-stats small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.game-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.game-nav button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
}

.game-nav button.active {
  background: var(--teal);
  color: white;
  box-shadow: 0 10px 24px rgba(15, 111, 104, 0.2);
}

.game-panel {
  min-width: 0;
}

.game-chapter-grid,
.game-gallery-grid,
.game-status-layout,
.teacher-list {
  display: grid;
  gap: 10px;
}

.game-chapter-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  overflow: hidden;
  background:
    linear-gradient(126deg, rgba(223, 244, 240, 0.78), transparent 45%),
    #ffffff;
}

.game-chapter-card.current {
  border-color: rgba(15, 111, 104, 0.45);
}

.game-chapter-card.done {
  background:
    linear-gradient(126deg, rgba(231, 248, 238, 0.92), transparent 45%),
    #ffffff;
}

.game-chapter-card.locked {
  opacity: 0.72;
}

.game-chapter-top,
.game-player-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.game-chapter-top span {
  width: 38px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.game-chapter-top b {
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
}

.game-chapter-card.locked .game-chapter-top b {
  background: #eef1ef;
  color: var(--muted);
}

.game-chapter-characters {
  display: flex;
  min-height: 54px;
}

.game-chapter-characters img {
  width: 54px;
  height: 54px;
  margin-right: -10px;
  border: 2px solid white;
  border-radius: 999px;
  object-fit: cover;
  object-position: 50% 12%;
  background: #f8fbfa;
  box-shadow: 0 8px 20px rgba(16, 32, 30, 0.15);
}

.game-chapter-card h3,
.game-character-card h3,
.game-status-card h3,
.teacher-row h3,
.teacher-brief h3,
.game-player-top h3 {
  margin: 0;
  line-height: 1.2;
}

.game-chapter-card p,
.game-character-card p,
.game-status-card p,
.teacher-row p,
.teacher-brief p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.game-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game-meta-row small {
  border-radius: 999px;
  padding: 5px 8px;
  background: #f2f7f5;
  color: var(--muted);
  font-weight: 800;
}

.game-player {
  overflow: hidden;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(15, 111, 104, 0.08), rgba(255, 248, 232, 0.78)),
    #ffffff;
}

.game-bg-school {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(255, 248, 232, 0.8)),
    #ffffff;
}

.game-bg-factory {
  background:
    linear-gradient(135deg, rgba(234, 88, 12, 0.13), rgba(223, 244, 240, 0.84)),
    #ffffff;
}

.game-bg-life {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(255, 248, 232, 0.78)),
    #ffffff;
}

.game-bg-interview {
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(255, 241, 207, 0.84)),
    #ffffff;
}

.game-player-top {
  margin-bottom: 10px;
}

.game-player-top p {
  margin: 0 0 3px;
}

.game-scene {
  display: grid;
  gap: 10px;
}

.game-sprites {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.9)),
    linear-gradient(135deg, rgba(223, 244, 240, 0.9), rgba(255, 248, 232, 0.9));
  box-shadow: inset 0 0 0 1px rgba(15, 111, 104, 0.08);
}

.game-sprite {
  position: absolute;
  bottom: -42px;
  width: min(58%, 245px);
  margin: 0;
  display: grid;
  justify-items: center;
  filter: drop-shadow(0 24px 28px rgba(16, 32, 30, 0.2));
}

.game-sprite.left {
  left: -26px;
}

.game-sprite.right {
  right: -30px;
}

.game-sprite.center {
  left: 50%;
  transform: translateX(-50%);
  width: min(70%, 285px);
}

.game-sprite img {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  object-position: bottom center;
}

.game-sprite figcaption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 48px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--character-color), white 12%);
  color: white;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(16, 32, 30, 0.16);
}

.game-dialogue,
.game-learning-note,
.game-feedback {
  border: 1px solid rgba(185, 203, 198, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(16, 32, 30, 0.1);
}

.game-dialogue {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.speaker {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--character-color), white 18%);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.dialogue-ja,
.dialogue-vi {
  margin: 0;
  line-height: 1.55;
}

.dialogue-ja {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.dialogue-vi {
  color: var(--muted);
  font-weight: 750;
}

.game-narration {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--amber);
  padding-left: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.game-narration span,
.game-narration small {
  display: block;
}

.game-learning-note {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 13px;
  background:
    linear-gradient(118deg, rgba(255, 241, 207, 0.76), transparent 48%),
    #ffffff;
}

.game-learning-note strong {
  color: var(--teal);
}

.game-learning-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.game-learning-note div {
  display: grid;
  gap: 4px;
  border-radius: var(--radius);
  padding: 10px;
  background: #f5fbf8;
}

.game-learning-note span {
  color: var(--ink);
  font-weight: 900;
}

.game-pronunciation-card {
  display: grid;
  gap: 7px;
  margin: 10px 0 2px;
  border: 1px solid rgba(15, 111, 104, 0.24);
  border-radius: var(--radius);
  padding: 12px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 202, 116, 0.32), transparent 28%),
    linear-gradient(135deg, rgba(240, 253, 250, 0.96), rgba(255, 248, 232, 0.95));
  box-shadow: 0 12px 24px rgba(15, 111, 104, 0.12);
}

.game-pronunciation-card strong {
  color: var(--teal);
  font-size: 13px;
}

.game-pronunciation-card span {
  display: block;
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.45;
}

.game-pronunciation-card small {
  color: var(--muted);
  font-weight: 780;
  line-height: 1.45;
}

.game-pronunciation-card .small-action {
  width: max-content;
  min-height: 38px;
  padding-inline: 14px;
}

.game-choice-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.game-choice {
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: white;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(16, 32, 30, 0.07);
}

.game-choice b {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
}

.game-choice span {
  font-weight: 900;
  line-height: 1.35;
}

.game-choice small {
  line-height: 1.35;
}

.game-feedback {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
}

.game-feedback-character {
  min-height: 240px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #eef7f4);
}

.game-feedback-character img {
  width: 150%;
  height: 100%;
  margin-left: -24%;
  object-fit: contain;
  object-position: bottom center;
}

.game-feedback-copy {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.game-feedback-copy h3,
.game-feedback-copy p {
  margin: 0;
}

.feedback-ja {
  color: var(--ink);
  font-weight: 900;
}

.game-effect-group {
  display: grid;
  gap: 5px;
}

.game-effect-group strong {
  color: var(--teal);
  font-size: 13px;
}

.game-effect-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.game-effect-group span {
  border-radius: 999px;
  padding: 5px 8px;
  background: #f2f7f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.game-effect-group span.up {
  background: #e7f8ee;
  color: var(--green);
}

.game-effect-group span.down {
  background: var(--coral-soft);
  color: var(--coral);
}

.game-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: calc(var(--radius) + 2px);
  background: #0b1717;
  box-shadow: 0 20px 44px rgba(16, 32, 30, 0.22);
  isolation: isolate;
}

.game-stage-bg,
.game-stage-shade,
.game-stage-top,
.game-stage .game-sprites,
.game-stage-dialogue,
.game-stage-choices,
.game-stage-actions,
.game-stage-feedback {
  position: absolute;
}

.game-stage-bg {
  inset: 0;
  background-image: var(--scene-bg);
  background-size: cover;
  background-position: center;
  transform: scale(1.015);
  filter: saturate(1.08) contrast(1.03);
  z-index: 0;
}

.game-stage-shade {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 18, 18, 0.18), transparent 26%, rgba(7, 18, 18, 0.56)),
    radial-gradient(circle at 50% 24%, transparent 0 34%, rgba(7, 18, 18, 0.18) 70%),
    linear-gradient(90deg, rgba(7, 18, 18, 0.2), transparent 18%, transparent 78%, rgba(7, 18, 18, 0.2));
  z-index: 1;
}

.game-stage-top {
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 6;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.game-location-badge {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #0f8f7e, #13b78a);
  color: white;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(6, 24, 22, 0.22);
}

.game-affinity {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(16, 32, 30, 0.16);
}

.game-affinity small {
  color: #e11d48;
  font-size: 11px;
  font-weight: 950;
}

.game-hearts {
  display: flex;
  gap: 2px;
  color: rgba(255, 255, 255, 0.98);
  -webkit-text-stroke: 1px #e11d48;
  text-shadow: 0 1px 0 #ffffff, 0 3px 10px rgba(225, 29, 72, 0.2);
  font-size: 23px;
  line-height: 1;
}

.game-hearts span.filled {
  color: #e11d48;
}

.game-audio-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 430px);
  justify-content: stretch;
}

.game-audio-controls button {
  min-width: 0;
  min-height: 42px;
  display: grid;
  place-items: center;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 11px;
  padding: 6px 8px;
  background: rgba(7, 18, 18, 0.62);
  color: white;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(7, 18, 18, 0.2);
}

.game-audio-controls button b,
.game-audio-controls button span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-audio-controls button b {
  font-size: 11px;
  letter-spacing: 0;
}

.game-audio-controls button span {
  font-size: 10px;
  opacity: 0.82;
}

.game-audio-controls button.active {
  background: linear-gradient(135deg, var(--amber), var(--coral));
  color: #23110a;
}

.game-stage .game-sprites {
  inset: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  z-index: 3;
  pointer-events: none;
}

.game-stage .game-sprite {
  bottom: 2%;
  width: min(33%, 190px);
  height: 82%;
  filter: drop-shadow(0 18px 20px rgba(5, 16, 16, 0.34));
}

.game-stage .game-sprite.left {
  left: 4%;
}

.game-stage .game-sprite.right {
  right: 4%;
}

.game-stage .game-sprite.center {
  width: min(39%, 226px);
  height: 88%;
}

.game-stage .game-sprite img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: bottom center;
}

.game-stage .game-sprite figcaption {
  display: none;
}

.game-stage-dialogue {
  left: 3%;
  right: 38%;
  bottom: 3%;
  z-index: 5;
  min-height: 68px;
  max-height: 38%;
  overflow: auto;
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  background: rgba(8, 79, 78, 0.83);
  color: white;
  backdrop-filter: blur(8px);
}

.game-stage-dialogue .dialogue-ja {
  color: white;
  font-size: 15px;
  line-height: 1.42;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.26);
}

.game-stage-dialogue .dialogue-vi,
.game-stage-dialogue .game-narration {
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  line-height: 1.38;
}

.game-stage-dialogue .speaker {
  margin-top: -2px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(135deg, #0f8f7e, #13b78a);
  color: white;
}

.game-stage-choices {
  top: 27%;
  right: 3%;
  z-index: 6;
  width: min(36%, 238px);
  margin: 0;
  gap: 5px;
}

.game-stage-choices .game-choice {
  min-height: 0;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 7px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 9px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(6, 24, 22, 0.18);
}

.game-stage-choices .game-choice b {
  width: 24px;
  height: 24px;
  background: var(--coral);
  color: white;
  font-size: 12px;
}

.game-stage-choices .game-choice span {
  font-size: 12px;
  line-height: 1.24;
}

.game-stage-choices .game-choice small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.game-stage-actions {
  right: 3%;
  bottom: 43%;
  z-index: 6;
}

.game-stage-actions .primary {
  box-shadow: 0 14px 30px rgba(6, 24, 22, 0.28);
}

.game-stage-feedback {
  top: 24%;
  left: 3%;
  right: 3%;
  bottom: 3%;
  z-index: 7;
}

.game-stage-feedback .game-feedback {
  height: 100%;
  max-height: 100%;
  overflow: auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.game-player .game-learning-note {
  margin-top: 10px;
}

.game-status-layout {
  grid-template-columns: 1fr;
}

.game-status-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.game-status-card.ending {
  background:
    linear-gradient(116deg, rgba(79, 70, 229, 0.13), transparent 46%),
    linear-gradient(135deg, #ffffff, #fff8e8);
}

.game-meter-list,
.game-relation-list,
.game-phrase-notebook {
  display: grid;
  gap: 8px;
}

.game-meter {
  display: grid;
  gap: 5px;
}

.game-meter span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.game-meter em,
.game-relation em {
  color: var(--teal);
  font-style: normal;
  font-weight: 900;
}

.game-meter i,
.game-relation i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  position: relative;
  z-index: 1;
}

.game-meter::after,
.game-relation span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e7efec;
}

.game-meter,
.game-relation span {
  position: relative;
}

.game-relation {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.game-relation img {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
  object-position: 50% 12%;
  background: #f8fbfa;
}

.game-relation b,
.game-phrase-notebook b,
.game-phrase-notebook span {
  display: block;
}

.game-relation b {
  margin-bottom: 5px;
  font-size: 13px;
}

.game-phrase-notebook div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: #fbfdfc;
}

.game-phrase-notebook span {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.danger-action {
  border: 1px solid rgba(228, 87, 69, 0.28);
  background: var(--coral-soft);
  color: var(--coral);
}

.game-gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-character-card {
  overflow: hidden;
  display: grid;
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--character-color), white 84%), transparent 50%),
    #ffffff;
}

.game-character-image {
  height: 210px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), #ffffff),
    color-mix(in srgb, var(--character-color), white 88%);
}

.game-character-image img {
  width: 132%;
  height: 118%;
  object-fit: contain;
  object-position: top center;
  filter: drop-shadow(0 18px 24px rgba(16, 32, 30, 0.16));
}

.game-character-card > div:last-child {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.game-character-card strong {
  color: var(--teal);
  font-size: 13px;
}

.game-character-card small {
  font-weight: 900;
}

.teacher-mode {
  display: grid;
  gap: 10px;
}

.teacher-brief {
  display: grid;
  gap: 8px;
  padding: 14px;
  background:
    linear-gradient(116deg, rgba(255, 241, 207, 0.76), transparent 44%),
    #ffffff;
}

.teacher-brief ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.teacher-brief li {
  color: var(--muted);
  line-height: 1.45;
}

.teacher-brief li b,
.teacher-brief li span {
  display: block;
}

.teacher-brief li b {
  color: var(--ink);
}

.teacher-row {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.teacher-row > div:first-child {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
}

.teacher-row span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.teacher-row dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.teacher-row dt {
  color: var(--teal);
  font-weight: 900;
  font-size: 13px;
}

.teacher-row dd {
  margin: 0 0 5px;
  color: var(--muted);
  line-height: 1.45;
}

.policy-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 12px;
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 18px 60px;
  background: var(--paper);
}

.legal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 34px);
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(16, 32, 30, 0.08);
}

.legal-card h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.08;
}

.legal-card h2 {
  margin: 26px 0 8px;
  font-size: 20px;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.7;
}

.legal-card a {
  color: var(--teal);
  font-weight: 900;
}

.support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.support-resources {
  margin-bottom: 12px;
}

.resource-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.resource-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdfc;
}

.resource-card span {
  width: max-content;
  border-radius: var(--radius);
  padding: 5px 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.resource-card h3,
.resource-card p {
  margin: 0;
}

.resource-card h3 {
  font-size: 16px;
}

.resource-card p {
  color: var(--muted);
  line-height: 1.45;
}

.resource-card a {
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.openchat-card {
  display: grid;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  background:
    linear-gradient(116deg, rgba(31, 157, 104, 0.12), transparent 42%),
    linear-gradient(135deg, #f4fbf8, #ffffff 58%, #fff8e8);
  border-color: rgba(15, 111, 104, 0.22);
}

.openchat-copy {
  display: grid;
  gap: 9px;
}

.openchat-copy h2,
.openchat-copy p {
  margin: 0;
}

.openchat-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.openchat-copy a {
  width: max-content;
}

.openchat-qr {
  width: min(192px, 100%);
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: white;
  box-shadow: 0 14px 30px rgba(16, 32, 30, 0.1);
}

.support-tile {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(116deg, rgba(255, 241, 207, 0.48), transparent 46%),
    var(--surface);
  padding: 13px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  text-align: left;
  color: var(--ink);
  font-weight: 900;
}

.support-tile strong {
  display: block;
  margin-top: 7px;
  line-height: 1.25;
}

.support-tile small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.support-tile span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--teal);
  background: var(--teal-soft);
}

.support-tile.danger {
  background: #fff3ef;
  border-color: rgba(228, 87, 69, 0.28);
}

.support-tile.danger span {
  color: var(--coral);
  background: var(--coral-soft);
}

.chat {
  display: grid;
  gap: 10px;
}

.message {
  max-width: 92%;
  border-radius: var(--radius);
  padding: 11px 12px;
  line-height: 1.45;
}

.message.bot {
  background: #edf5f2;
}

.message.user {
  justify-self: end;
  background: var(--teal);
  color: white;
}

.reply input {
  min-width: 0;
}

.reply button {
  flex: 0 0 76px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 12;
  width: min(480px, 100vw);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: calc(70px + env(safe-area-inset-bottom));
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.bottom-nav button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 0 2px;
  font-size: 10px;
  font-weight: 900;
  overflow: hidden;
}

.bottom-nav span {
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 7px;
  background: var(--blue-soft);
  position: relative;
}

.bottom-nav button:nth-child(2) span,
.bottom-nav button:nth-child(5) span {
  background: var(--amber-soft);
}

.bottom-nav button:nth-child(3) span,
.bottom-nav button:nth-child(6) span {
  background: var(--teal-soft);
}

.bottom-nav button:nth-child(4) span,
.bottom-nav button:nth-child(7) span {
  background: var(--coral-soft);
}

.bottom-nav span::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 3px;
  background: currentColor;
}

.bottom-nav b {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.1;
  text-overflow: clip;
  white-space: nowrap;
}

.bottom-nav button.active {
  color: var(--teal);
}

@media (min-width: 760px) {
  body {
    padding: 24px 0;
  }

  .app {
    min-height: calc(100vh - 48px);
    border-radius: 22px;
    overflow: hidden;
  }

  .site-header {
    top: 24px;
  }

  .manga-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  body {
    min-height: 100vh;
    padding: 0;
  }

  .app {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    overflow-x: hidden;
    overflow-y: visible;
    background:
      linear-gradient(116deg, rgba(247, 211, 108, 0.16), transparent 34%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(247, 250, 248, 0.98));
    box-shadow: none;
  }

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 286px;
    min-height: 100vh;
    align-items: stretch;
    flex-direction: column;
    gap: 24px;
    padding: 32px 24px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 16px 0 48px rgba(16, 32, 30, 0.08);
  }

  .icon-btn {
    display: none;
  }

  .site-header #menuBtn {
    display: grid;
  }

  .brand {
    flex: 0 0 auto;
    align-items: flex-start;
  }

  .brand img {
    width: 48px;
    height: 48px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand small {
    max-width: 160px;
    white-space: normal;
    line-height: 1.35;
  }

  .language-switch {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    width: auto;
    min-height: 50px;
    flex-basis: auto;
    font-size: 13px;
  }

  main {
    min-height: 100vh;
    margin-left: 286px;
    padding: 38px clamp(32px, 5vw, 74px);
  }

  .screen {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    top: 130px;
    bottom: auto;
    z-index: 22;
    width: 286px;
    min-height: 0;
    transform: none;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0 18px;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .bottom-nav button {
    min-height: 50px;
    grid-template-columns: 26px 1fr;
    place-items: center start;
    justify-content: start;
    gap: 10px;
    border-radius: var(--radius);
    padding: 0 14px;
    font-size: 14px;
    text-align: left;
  }

  .bottom-nav button.active {
    color: var(--teal);
    background: var(--teal-soft);
  }

  .bottom-nav span {
    width: 24px;
    height: 24px;
  }

  .bottom-nav b {
    white-space: nowrap;
  }

  .screen[data-screen="home"].active {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.95fr);
    grid-template-areas:
      "hero checklist"
      "summary service"
      "operator operator";
    gap: 18px;
    align-items: start;
  }

  .screen[data-screen="home"] .hero {
    grid-area: hero;
  }

  .screen[data-screen="home"] .summary-grid {
    grid-area: summary;
  }

  .screen[data-screen="home"] > .card:not(.feature-card) {
    grid-area: checklist;
    margin-top: 0;
  }

  .screen[data-screen="home"] .feature-card {
    grid-area: service;
    margin-top: 0;
  }

  .screen[data-screen="home"] .operator-credit {
    grid-area: operator;
    margin-top: 0;
  }

  .hero,
  .hero-art {
    min-height: 460px;
  }

  .hero-copy {
    align-content: center;
    padding: 46px;
  }

  .hero h1 {
    max-width: 12ch;
    font-size: clamp(46px, 5vw, 64px);
  }

  .summary-grid {
    gap: 16px;
    margin: 0;
  }

  .summary-grid article {
    min-height: 110px;
    padding: 18px;
  }

  .summary-grid span {
    font-size: 32px;
  }

  .card {
    padding: 20px;
  }

  .screen-title {
    padding-bottom: 18px;
  }

  .screen-title h1 {
    max-width: 780px;
    font-size: clamp(34px, 3vw, 46px);
    line-height: 1.05;
  }

  .screen-visual {
    height: 300px;
    margin-bottom: 18px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 190px;
    gap: 12px;
  }

  .secondary-toolbar {
    grid-template-columns: repeat(2, minmax(190px, 240px));
    justify-content: start;
    margin-top: -2px;
  }

  .toolbar select {
    flex: initial;
  }

  .job-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .job-card {
    padding: 18px;
  }

  .job-proof {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .money-panel.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 18px;
    align-items: start;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .money-panel.active .form-grid {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .money-panel.active .rate-card,
  .money-panel.active .result {
    grid-column: 2;
    margin-top: 0;
  }

  .rate-card {
    grid-template-columns: 1fr;
  }

  .screen[data-screen="contract"].active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    grid-template-areas:
      "title title"
      "visual result"
      "samples result"
      "contract result"
      "scan result"
      "guide guide";
    gap: 14px 20px;
    align-items: start;
  }

  .screen[data-screen="contract"] .screen-title {
    grid-area: title;
  }

  .screen[data-screen="contract"] .screen-visual {
    grid-area: visual;
    margin-bottom: 0;
  }

  .screen[data-screen="contract"] .sample-row {
    grid-area: samples;
    margin-bottom: 0;
  }

  .screen[data-screen="contract"] #contractText {
    grid-area: contract;
    min-height: 230px;
  }

  .screen[data-screen="contract"] #scanBtn {
    grid-area: scan;
    margin-top: 0;
  }

  .screen[data-screen="contract"] .result {
    grid-area: result;
    margin-top: 0;
    min-height: 300px;
    align-content: start;
  }

  .screen[data-screen="contract"] .contract-guide {
    grid-area: guide;
    margin-top: 0;
  }

  .contract-guide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  .lesson-card {
    min-height: 220px;
    align-content: space-between;
  }

  .screen[data-screen="learn"].active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    grid-template-areas:
      "title title"
      "visual video"
      "manga video"
      "overview video"
      "game video"
      "lessons video";
    gap: 18px;
    align-items: start;
  }

  .screen[data-screen="learn"] .screen-title {
    grid-area: title;
  }

  .screen[data-screen="learn"] .screen-visual {
    grid-area: visual;
    margin-bottom: 0;
  }

  .screen[data-screen="learn"] .learning-overview {
    grid-area: overview;
    margin-bottom: 0;
  }

  .screen[data-screen="learn"] .manga-learning {
    grid-area: manga;
    margin-bottom: 0;
  }

  .screen[data-screen="learn"] .learning-game {
    grid-area: game;
    margin-bottom: 0;
  }

  .screen[data-screen="learn"] .video-learning {
    grid-area: video;
    margin-bottom: 0;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
  }

  .screen[data-screen="learn"] .video-list {
    max-height: min(52vh, 620px);
    overflow: auto;
    padding-right: 4px;
    scrollbar-color: rgba(15, 111, 104, 0.48) rgba(223, 244, 240, 0.6);
  }

  .screen[data-screen="learn"] .lesson-list {
    grid-area: lessons;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-status-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-status-card.ending,
  .game-status-card.phrases {
    grid-column: 1 / -1;
  }

  .screen[data-screen="support"].active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    grid-template-areas:
      "title title"
      "visual openchat"
      "how openchat"
      "resources topics"
      "chat policy";
    gap: 18px;
    align-items: start;
  }

  .screen[data-screen="support"] .screen-title {
    grid-area: title;
  }

  .screen[data-screen="support"] .screen-visual {
    grid-area: visual;
    margin-bottom: 0;
  }

  .openchat-card {
    grid-area: openchat;
    margin: 0;
    grid-template-columns: minmax(0, 1fr) 156px;
  }

  .support-grid {
    grid-area: topics;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
  }

  .support-how {
    grid-area: how;
    margin: 0;
  }

  .support-resources {
    grid-area: resources;
    margin: 0;
  }

  .screen[data-screen="support"] .chat {
    grid-area: chat;
    margin-top: 0;
  }

  .screen[data-screen="support"] > .card:not(.chat):not(.support-resources):not(.support-how):not(.openchat-card) {
    grid-area: policy;
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .game-hero {
    min-height: 390px;
  }

  .game-hero-copy h2 {
    font-size: 30px;
  }

  .game-hero-art {
    right: -112px;
    width: min(92%, 360px);
    opacity: 0.72;
  }

  .game-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-nav button {
    min-height: 44px;
  }

  .game-stage-top {
    top: 7px;
    left: 7px;
    right: 7px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .game-location-badge {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .game-affinity {
    padding: 3px 6px;
  }

  .game-affinity small {
    display: none;
  }

  .game-hearts {
    font-size: 18px;
  }

  .game-audio-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .game-audio-controls button {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 9px;
  }

  .game-stage .game-sprites {
    min-height: 0;
  }

  .game-stage .game-sprite {
    bottom: 8%;
    width: 36%;
    height: 72%;
  }

  .game-stage .game-sprite.left {
    left: -3%;
  }

  .game-stage .game-sprite.right {
    right: -3%;
  }

  .game-stage .game-sprite.center {
    width: 44%;
    height: 78%;
  }

  .game-stage-dialogue {
    left: 3%;
    right: 3%;
    bottom: 3%;
    min-height: 54px;
    max-height: 34%;
    padding: 7px 8px;
  }

  .game-stage.has-choices .game-stage-dialogue {
    right: 53%;
    min-height: 50px;
    max-height: 32%;
  }

  .game-stage-dialogue .dialogue-ja {
    font-size: 12px;
  }

  .game-stage-dialogue .dialogue-vi,
  .game-stage-dialogue .game-narration {
    display: none;
  }

  .game-stage-choices {
    top: 31%;
    right: 3%;
    width: 47%;
    gap: 3px;
  }

  .game-stage-choices .game-choice {
    grid-template-columns: 20px minmax(0, 1fr);
    max-height: 35px;
    overflow: hidden;
    padding: 4px 6px;
  }

  .game-stage-choices .game-choice b {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .game-stage-choices .game-choice span {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.15;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .game-stage-choices .game-choice small {
    display: none;
  }

  .game-stage-feedback {
    top: 27%;
    left: 3%;
    right: 3%;
    bottom: 3%;
  }

  .game-stage-feedback .game-feedback {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .game-stage-feedback .game-feedback-character {
    min-height: 112px;
  }
}

@media (max-width: 360px) {
  .screen-title h1 {
    font-size: 25px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero,
  .hero-art {
    min-height: 320px;
  }

  .screen-visual {
    height: 158px;
  }

  .support-grid,
  .summary-grid,
  .learning-stats {
    grid-template-columns: 1fr;
  }

  .video-card {
    grid-template-columns: 1fr;
  }

  .lesson-video-link {
    grid-template-columns: 1fr;
  }

  .game-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-hero-copy h2 {
    font-size: 25px;
  }

  .game-hero-stats {
    grid-template-columns: 1fr;
  }

  .game-sprites {
    min-height: 285px;
  }

  .game-sprite {
    width: min(62%, 210px);
  }

  .game-sprite.center {
    width: min(74%, 235px);
  }

  .game-feedback,
  .game-gallery-grid {
    grid-template-columns: 1fr;
  }

  .game-feedback-character {
    min-height: 210px;
  }
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes itemRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroPan {
  0% {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  50% {
    transform: scale(1.075) translate3d(-1.4%, -1.2%, 0);
  }
  100% {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
}

@keyframes sheen {
  from {
    transform: translateX(-130%);
  }
  to {
    transform: translateX(130%);
  }
}

@keyframes pressFlash {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(0.975);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes metricPop {
  0% {
    transform: translateY(0) scale(1);
  }
  38% {
    transform: translateY(-2px) scale(1.08);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes navPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(15, 111, 104, 0.24);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(15, 111, 104, 0);
  }
}

@keyframes playPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes gameResultPop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(16px) rotate(-10deg) scale(0.52);
  }
  62% {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px) rotate(-4deg) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(-5deg) scale(1);
  }
}

@keyframes gameStageResultPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-12deg) scale(0.38);
  }
  58% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-3deg) scale(1.12);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-5deg) scale(1);
  }
}

.app::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--coral), var(--blue), var(--teal));
  background-size: 240% 100%;
  animation: sheen 8s linear infinite;
  opacity: 0.88;
  z-index: 13;
}

.screen.active {
  animation: screenIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.route-enter .screen-title,
.route-enter .hero,
.route-enter .screen-visual,
.route-enter .learning-overview,
.route-enter .video-learning,
.route-enter .support-grid,
.route-enter .source-list,
.route-enter .contract-guide-list,
.route-enter .support-flow-list,
.route-enter > .card,
.route-enter > .notice,
.route-enter > .toolbar,
.route-enter > .result {
  animation: itemRise 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.route-enter .screen-visual {
  animation-delay: 60ms;
}

.route-enter > .card,
.route-enter > .notice,
.route-enter > .toolbar,
.route-enter > .result,
.route-enter .learning-overview,
.route-enter .video-learning,
.route-enter .support-grid,
.route-enter .source-list,
.route-enter .contract-guide-list,
.route-enter .support-flow-list {
  animation-delay: 110ms;
}

.job-card,
.lesson-card,
.video-card,
.check-item,
.support-tile,
.resource-card,
.source-row,
.contract-guide-row,
.support-flow-step {
  animation: itemRise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--stagger, 0) * 45ms);
}

.summary-grid article,
.card,
.job-card,
.lesson-card,
.learning-card,
.video-card,
.notice,
.result,
.support-tile,
.resource-card,
.source-row,
.contract-guide-row,
.support-flow-step,
.screen-visual,
.hero,
.primary,
.secondary,
.small-action,
.sample-row button,
.switcher button,
.language-switch,
.icon-btn {
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    color 220ms ease;
}

.hero-art {
  animation: heroPan 18s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
}

.hero::before,
.screen-visual::before,
.video-player::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 0 34%, rgba(255, 255, 255, 0.24) 45%, transparent 58% 100%);
  transform: translateX(-120%);
  animation: sheen 7s ease-in-out infinite;
  z-index: 1;
}

.screen-visual {
  position: relative;
}

.screen-visual img {
  transform: scale(1.01);
  transition: transform 600ms ease;
}

.progress {
  position: relative;
}

.progress span {
  position: relative;
  overflow: hidden;
  transition: width 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-120%);
}

.progress-pop span::after {
  animation: sheen 720ms ease;
}

.motion-pop {
  animation: metricPop 360ms ease;
}

.tap-flash {
  animation: pressFlash 240ms ease;
}

.service-grid span {
  position: relative;
  overflow: hidden;
}

.service-grid span::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-right: 8px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.72;
}

.job-card {
  position: relative;
  overflow: hidden;
}

.job-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), var(--amber), var(--coral));
  opacity: 0.82;
}

.job-card > * {
  position: relative;
}

.video-player {
  position: relative;
  overflow: hidden;
}

.video-card.active .video-thumb span,
.video-player iframe + span {
  animation: playPulse 1.8s ease-in-out infinite;
}

.video-card.active .video-thumb {
  box-shadow: 0 10px 24px rgba(15, 111, 104, 0.18);
}

.bottom-nav button.active span {
  animation: navPulse 1.8s ease-out infinite;
}

.bottom-nav button {
  position: relative;
}

.bottom-nav button.active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.5;
}

.screen.game-screen {
  padding-top: 0;
}

.screen.game-screen.active {
  display: block;
}

.game-dedicated {
  margin: 0;
}

.game-shell {
  container-type: inline-size;
  display: grid;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(9, 13, 30, 0.96), rgba(13, 60, 59, 0.94) 54%, rgba(31, 19, 51, 0.96)),
    #101827;
  color: white;
  box-shadow: 0 24px 60px rgba(5, 16, 16, 0.24);
}

.game-story-header {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(112deg, rgba(5, 16, 34, 0.82), rgba(10, 75, 73, 0.7) 52%, rgba(142, 84, 233, 0.4)),
    url("./assets/game/backgrounds/bg-office.png") center / cover;
  isolation: isolate;
}

.game-story-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(4, 9, 20, 0.86), rgba(4, 9, 20, 0.46) 54%, rgba(4, 9, 20, 0.84));
}

.game-story-header::after {
  content: "";
  position: absolute;
  right: -74px;
  bottom: -38px;
  z-index: -1;
  width: min(55%, 300px);
  height: 112%;
  background: url("./assets/game/characters/char01_mira_navigator.png") bottom center / contain no-repeat;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.34));
  opacity: 0.92;
}

.game-story-copy {
  display: grid;
  gap: 8px;
  max-width: 560px;
  padding-right: min(28vw, 170px);
}

.game-story-copy h1,
.game-story-copy p,
.game-story-copy strong {
  margin: 0;
}

.game-story-copy h1 {
  font-size: clamp(28px, 8vw, 54px);
  line-height: 1;
  color: white;
  letter-spacing: 0;
}

.game-story-copy strong {
  color: #ffe59a;
  line-height: 1.35;
}

.game-story-copy p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.game-command-panel {
  display: grid;
  gap: 8px;
  width: min(100%, 430px);
  max-width: 520px;
  position: relative;
  z-index: 2;
}

.game-profile-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(54px, auto);
  gap: 7px;
  align-items: end;
}

.game-profile-inline span {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 900;
}

.game-profile-inline input {
  min-width: 0;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.92);
}

.game-profile-inline .small-action {
  min-width: 54px;
  min-height: 40px;
  padding-inline: 10px;
  white-space: nowrap;
}

.game-header-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.game-header-metrics span,
.game-current-mission {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.game-header-metrics span {
  min-width: 0;
  padding: 9px;
}

.game-header-metrics b,
.game-header-metrics small,
.game-current-mission small,
.game-current-mission b,
.game-current-mission span {
  display: block;
}

.game-header-metrics b {
  font-size: 18px;
}

.game-header-metrics small,
.game-current-mission small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 900;
}

.game-current-mission {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.game-current-mission b {
  color: white;
  line-height: 1.25;
}

.game-current-mission span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.game-play-layout {
  display: grid;
  gap: 12px;
}

.game-cinema-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.game-cinema-card,
.game-story-sidebar,
.game-secondary-panel {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(3, 10, 16, 0.16);
}

.game-player-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  padding: 2px;
}

.game-player-top h3,
.game-player-top p {
  margin: 0;
  color: white;
}

.game-mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game-mode-actions .small-action {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
}

.game-mode-actions .small-action.active {
  background: #ffe59a;
  color: #17201d;
}

.game-screen .game-stage {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

.game-screen .game-stage-top {
  grid-template-columns: auto auto minmax(0, auto);
  justify-content: space-between;
  align-items: start;
}

.game-story-chip,
.game-readiness-pill {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(7, 18, 18, 0.64);
  color: white;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.game-readiness-pill {
  background: linear-gradient(135deg, #ffe59a, #f7a66a);
  color: #22160d;
}

.game-screen .game-stage .game-sprite {
  bottom: 0;
  width: min(35%, 228px);
  height: 86%;
}

.game-screen .game-stage .game-sprite.left {
  left: 1%;
}

.game-screen .game-stage .game-sprite.right {
  right: 1%;
}

.game-screen .game-stage .game-sprite.center {
  width: min(42%, 260px);
  height: 92%;
}

.game-screen .game-stage-dialogue {
  left: 3%;
  right: 3%;
  bottom: 3%;
  min-height: 72px;
  max-height: 36%;
  border-radius: 10px;
  background: rgba(5, 72, 75, 0.88);
}

.game-screen .game-stage-dialogue .dialogue-ja {
  font-size: clamp(13px, 3.4vw, 17px);
  font-weight: 950;
}

.game-screen .game-stage-dialogue .dialogue-vi,
.game-screen .game-stage-dialogue .game-narration {
  display: block;
  font-size: clamp(10px, 2.6vw, 12px);
}

.game-decision-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.game-decision-head {
  display: grid;
  gap: 3px;
}

.game-decision-head h3,
.game-decision-head p {
  margin: 0;
}

.game-decision-choices {
  position: static;
  width: auto;
  display: grid;
  gap: 8px;
  margin: 0;
}

.game-decision-choices .game-choice {
  min-height: 70px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  border: 1px solid rgba(15, 111, 104, 0.2);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
  text-align: left;
  box-shadow: 0 10px 22px rgba(16, 32, 30, 0.08);
}

.game-decision-choices .game-choice b {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--teal);
  color: white;
  display: grid;
  place-items: center;
}

.game-decision-choices .game-choice span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.35;
}

.game-decision-choices .game-choice small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.game-decision-feedback {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding-top: 116px;
}

.game-answer-mark {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 5;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 5px solid rgba(255, 255, 255, 0.96);
  color: #ffffff;
  text-align: center;
  transform: translateX(-50%) rotate(-5deg);
  box-shadow: 0 18px 38px rgba(16, 32, 30, 0.24);
  pointer-events: none;
  animation: gameResultPop 520ms cubic-bezier(0.18, 1.45, 0.28, 1) both;
}

.game-answer-mark::after {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: inherit;
  border: 2px solid currentColor;
  opacity: 0.24;
}

.game-answer-mark span {
  display: block;
  margin-top: -6px;
  font-size: 110px;
  font-weight: 950;
  line-height: 0.86;
  text-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
}

.game-answer-mark small {
  min-width: 64px;
  border-radius: 999px;
  padding: 3px 8px 4px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.game-answer-mark.is-correct,
.game-decision-feedback.is-correct .game-answer-mark {
  background:
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(135deg, #17b978, #0f7f68);
}

.game-answer-mark.is-correct small,
.game-decision-feedback.is-correct .game-answer-mark small {
  color: #08735e;
}

.game-answer-mark.is-incorrect,
.game-decision-feedback.is-incorrect .game-answer-mark {
  background:
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(135deg, #ff5b6f, #b42335);
}

.game-answer-mark.is-incorrect small,
.game-decision-feedback.is-incorrect .game-answer-mark small {
  color: #a7192d;
}

.game-stage-answer-mark {
  top: 50%;
  z-index: 8;
  width: clamp(160px, 30vw, 240px);
  height: auto;
  aspect-ratio: 1;
  border-width: 6px;
  transform: translate(-50%, -50%) rotate(-5deg);
  animation: gameStageResultPop 620ms cubic-bezier(0.18, 1.45, 0.28, 1) both;
}

.game-stage-answer-mark span {
  font-size: clamp(106px, 19vw, 158px);
}

.game-stage-answer-mark small {
  min-width: 72px;
  font-size: 13px;
}

.game-decision-feedback .game-feedback-character {
  min-height: 160px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--teal-soft), #ffffff);
}

.game-decision-feedback .game-feedback-copy {
  display: grid;
  gap: 8px;
}

.game-decision-feedback .game-feedback-copy h3,
.game-decision-feedback .game-feedback-copy p {
  margin: 0;
}

.game-decision-feedback .game-feedback-copy small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.game-learning-note {
  margin: 0;
  border-color: rgba(15, 111, 104, 0.18);
  background: linear-gradient(180deg, #ffffff, #eef8f6);
}

.chapter-clear {
  grid-template-columns: minmax(0, 1fr);
}

.chapter-clear h3,
.chapter-clear p {
  margin: 0;
}

.game-story-sidebar {
  display: grid;
  gap: 10px;
  align-content: start;
}

.game-story-map,
.game-side-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.game-story-map h3,
.game-side-card h3 {
  margin: 0;
  font-size: 14px;
}

.game-story-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.game-story-step span {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
}

.game-story-step b {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-story-step small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-story-step.current {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.game-story-step.done span {
  background: var(--teal);
  color: white;
}

.game-readiness-score {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), #1fa999);
  color: white;
}

.game-readiness-score b {
  font-size: 24px;
}

.game-readiness-score span {
  font-size: 12px;
  font-weight: 900;
}

.game-meter-list.compact {
  gap: 7px;
}

.game-phrase-notebook.compact {
  max-height: 210px;
  overflow: auto;
}

.game-secondary-panel {
  margin-top: 12px;
}

.game-secondary-panel .game-status-layout,
.game-secondary-panel .game-gallery-grid,
.game-secondary-panel .teacher-mode {
  color: var(--ink);
}

@media (min-width: 920px) {
  .screen.game-screen.active {
    max-width: 1160px;
  }

  .game-shell {
    padding: 16px;
  }

  .game-story-header {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.72fr);
    align-items: end;
  }

  .game-story-copy,
  .game-current-mission {
    grid-column: 1;
  }

  .game-command-panel,
  .game-header-metrics {
    grid-column: 2;
  }

  .game-play-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }

  .game-player-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .game-decision-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-decision-choices .game-choice {
    grid-template-columns: 34px minmax(0, 1fr);
    align-content: start;
  }
}

@container (max-width: 700px) {
  .game-story-header {
    min-height: 0;
    gap: 9px;
    padding: 12px;
  }

  .game-story-header::after {
    display: none;
  }

  .game-story-copy {
    max-width: none;
    padding-right: 0;
  }

  .game-story-copy h1 {
    font-size: clamp(25px, 8cqw, 34px);
  }

  .game-story-copy p:not(.eyebrow) {
    display: none;
  }

  .game-command-panel,
  .game-course-switch,
  .game-audio-controls {
    width: 100%;
    max-width: none;
  }

  .game-profile-inline {
    grid-template-columns: minmax(0, 1fr) 54px;
  }

  .game-course-switch {
    gap: 5px;
    padding: 4px;
  }

  .game-course-switch button {
    min-height: 44px;
  }

  .game-course-switch button b {
    font-size: 11px;
  }

  .game-audio-controls button {
    min-height: 40px;
    border-radius: 10px;
  }

  .game-header-metrics {
    gap: 6px;
  }

  .game-header-metrics span {
    padding: 8px;
  }

  .game-header-metrics b {
    font-size: 16px;
  }

  .game-header-metrics small {
    font-size: 9px;
    line-height: 1.2;
  }
}

@container (max-width: 420px) {
  .game-story-header {
    padding: 10px;
  }

  .game-profile-inline {
    grid-template-columns: minmax(0, 1fr) 50px;
    gap: 6px;
  }

  .game-profile-inline input,
  .game-profile-inline .small-action {
    min-height: 38px;
  }

  .game-course-switch button {
    min-height: 42px;
  }

  .game-course-switch button b {
    font-size: 10px;
  }

  .game-course-switch button span,
  .game-audio-controls button span {
    font-size: 9px;
  }

  .game-audio-controls {
    gap: 5px;
  }

  .game-audio-controls button {
    min-height: 38px;
    padding-inline: 6px;
  }
}

@media (max-width: 520px) {
  .game-shell {
    margin: 0 -2px;
    padding: 8px 8px calc(82px + env(safe-area-inset-bottom));
    border-radius: 14px;
  }

  .game-story-header {
    min-height: 0;
    gap: 6px;
    padding: 9px;
  }

  .game-story-header::after {
    display: none;
  }

  .game-story-copy {
    padding-right: 0;
  }

  .game-story-copy h1 {
    font-size: 22px;
    line-height: 1.08;
  }

  .game-story-copy strong {
    font-size: 12px;
  }

  .game-story-copy p:not(.eyebrow) {
    display: none;
  }

  .game-command-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .game-profile-inline {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  .game-header-metrics {
    display: none;
  }

  .game-current-mission {
    display: none;
  }

  .game-story-header .game-audio-controls {
    width: 100%;
    justify-content: stretch;
  }

  .game-story-header .game-course-switch button {
    min-height: 38px;
  }

  .game-story-header .game-audio-controls button {
    min-height: 34px;
  }

  .game-screen .game-stage-top {
    top: 6px;
    left: 6px;
    right: 6px;
    grid-template-columns: auto auto;
    gap: 5px;
  }

  .game-readiness-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .game-screen .game-stage .game-sprite {
    height: 76%;
    width: 40%;
  }

  .game-screen .game-stage .game-sprite.center {
    width: 48%;
    height: 82%;
  }

  .game-screen .game-stage-dialogue {
    min-height: 60px;
    max-height: 42%;
    padding: 8px;
  }

  .game-decision-feedback {
    grid-template-columns: 72px minmax(0, 1fr);
    padding-top: 118px;
  }

  .game-answer-mark {
    top: -8px;
    width: 168px;
    height: 168px;
    border-width: 4px;
  }

  .game-answer-mark span {
    font-size: 110px;
  }

  .game-answer-mark small {
    min-width: 68px;
    font-size: 12px;
  }

  .game-stage-answer-mark {
    width: 230px;
    height: auto;
    border-width: 5px;
  }

  .game-stage-answer-mark span {
    font-size: 150px;
  }

  .game-stage-answer-mark small {
    min-width: 72px;
    font-size: 12px;
  }

  .game-decision-choices .game-choice {
    min-height: 60px;
    padding: 8px;
  }

  .game-decision-choices .game-choice span {
    font-size: 14px;
    line-height: 1.25;
  }

  .game-decision-choices .game-choice small {
    font-size: 10px;
    line-height: 1.22;
  }

  .game-decision-feedback .game-feedback-character {
    min-height: 128px;
  }
}

@media (hover: hover) {
  .summary-grid article:hover,
  .card:hover,
  .job-card:hover,
  .lesson-card:hover,
  .learning-card:hover,
  .video-card:hover,
  .resource-card:hover,
  .support-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 44px rgba(16, 32, 30, 0.13);
    border-color: rgba(15, 111, 104, 0.28);
  }

  .primary:hover,
  .secondary:hover,
  .small-action:hover,
  .sample-row button:hover,
  .switcher button:hover,
  .language-switch:hover,
  .icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(16, 32, 30, 0.14);
  }

  .screen-visual:hover img,
  .video-thumb:hover img {
    transform: scale(1.045);
  }
}

@media (min-width: 960px) {
  .bottom-nav button.active::after {
    left: auto;
    right: 8px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .hero-art,
  .bottom-nav button.active span {
    animation: none !important;
  }
}

/* Learning library: category first, then textbook, then lesson. */
.learning-category-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 5px;
  border: 1px solid rgba(15, 111, 104, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(16, 32, 30, 0.08);
}

.learning-category-tab {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.learning-category-tab > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.learning-category-tab b,
.learning-category-tab small {
  overflow-wrap: anywhere;
}

.learning-category-tab b {
  color: inherit;
  font-size: 14px;
  line-height: 1.25;
}

.learning-category-tab small {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.learning-category-tab.active {
  border-color: rgba(15, 111, 104, 0.28);
  color: var(--teal);
  background: #e8f5f1;
  box-shadow: 0 8px 18px rgba(15, 111, 104, 0.12);
}

.learning-category-tab[data-learning-category="manga"].active {
  border-color: rgba(242, 99, 81, 0.28);
  color: #b94032;
  background: #fff0ed;
}

.category-tab-mark {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #dff4f0;
}

.video-mark::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 11px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid var(--teal);
}

.manga-mark {
  background: #ffe5df;
}

.manga-mark::before,
.manga-mark::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 10px;
  height: 20px;
  border: 2px solid #b94032;
  background: white;
}

.manga-mark::before {
  left: 7px;
  border-radius: 4px 0 0 4px;
}

.manga-mark::after {
  right: 7px;
  border-radius: 0 4px 4px 0;
}

.learning-category-panel[hidden] {
  display: none !important;
}

.learning-category-panel {
  min-width: 0;
}

.textbook-library {
  display: grid;
  gap: 12px;
}

.textbook-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 0;
}

.textbook-library-head h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.textbook-library-head p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.textbook-library-head > strong {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--teal);
  font-size: 20px;
  box-shadow: 0 10px 22px rgba(15, 111, 104, 0.2);
}

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

.textbook-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  align-content: start;
  border: 1px solid rgba(185, 203, 198, 0.9);
  border-radius: 8px;
  padding: 0;
  background: white;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 9px 22px rgba(16, 32, 30, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.textbook-card.active {
  border-color: var(--teal);
  box-shadow: 0 14px 30px rgba(15, 111, 104, 0.2), inset 0 0 0 2px rgba(15, 111, 104, 0.12);
}

.textbook-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #10201e;
}

.textbook-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(16, 32, 30, 0.52));
}

.textbook-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.textbook-cover i {
  position: absolute;
  z-index: 1;
  left: 7px;
  bottom: 7px;
  max-width: calc(100% - 14px);
  border-radius: 4px;
  padding: 4px 6px;
  color: white;
  background: rgba(15, 111, 104, 0.92);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.textbook-card-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.textbook-card-copy strong {
  font-size: 13px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.textbook-card-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.textbook-card-copy em {
  color: var(--teal);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.video-player-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 111, 104, 0.18);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-media);
}

.video-player-shell .video-player {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.selected-video-meta {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.selected-video-meta > div {
  min-width: 0;
}

.selected-video-meta small {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.selected-video-meta h3 {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.selected-video-meta .small-action {
  justify-self: start;
}

@media (max-width: 759px) {
  .screen[data-screen="learn"] .screen-visual {
    display: none;
  }

  .screen[data-screen="learn"] .video-copy {
    padding: 14px;
  }

  .screen[data-screen="learn"] .video-copy p:not(.eyebrow) {
    margin-bottom: 7px;
  }
}

@media (min-width: 760px) {
  .learning-category-switch {
    max-width: 720px;
  }

  .learning-category-tab {
    min-height: 82px;
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 12px 14px;
  }

  .category-tab-mark {
    width: 46px;
    height: 46px;
  }

  .video-mark::before {
    left: 18px;
    top: 13px;
    border-top-width: 10px;
    border-bottom-width: 10px;
    border-left-width: 14px;
  }

  .manga-mark::before,
  .manga-mark::after {
    top: 11px;
    width: 12px;
    height: 22px;
  }

  .manga-mark::before { left: 8px; }
  .manga-mark::after { right: 8px; }

  .learning-category-tab b { font-size: 16px; }
  .learning-category-tab small { font-size: 12px; }

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

  .selected-video-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 14px 16px;
  }
}

@media (min-width: 960px) {
  .screen[data-screen="learn"].active {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "visual"
      "switch"
      "panel";
    gap: 18px;
  }

  .screen[data-screen="learn"] .screen-title { grid-area: title; }
  .screen[data-screen="learn"] .screen-visual { grid-area: visual; }
  .screen[data-screen="learn"] .learning-category-switch { grid-area: switch; }
  .screen[data-screen="learn"] .learning-category-panel { grid-area: panel; }

  .screen[data-screen="learn"] .video-learning {
    position: static;
    max-height: none;
    overflow: visible;
    grid-template-columns: minmax(0, 1.32fr) minmax(330px, 0.68fr);
    grid-template-areas:
      "copy copy"
      "books books"
      "player list"
      "channel list";
    align-items: start;
    gap: 18px;
    padding: 18px;
  }

  .screen[data-screen="learn"] .video-copy { grid-area: copy; }
  .screen[data-screen="learn"] .textbook-library { grid-area: books; }
  .screen[data-screen="learn"] .video-player-shell { grid-area: player; }
  .screen[data-screen="learn"] .video-list {
    grid-area: list;
    max-height: min(68vh, 780px);
    overflow: auto;
    padding-right: 5px;
  }
  .screen[data-screen="learn"] .channel-link { grid-area: channel; }

  .textbook-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .screen[data-screen="learn"] .learning-overview {
    margin-top: 18px;
  }

  .screen[data-screen="learn"] .lesson-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
  }
}

@media (hover: hover) {
  .learning-category-tab:hover,
  .textbook-card:hover {
    transform: translateY(-2px);
  }

  .textbook-card:hover {
    border-color: rgba(15, 111, 104, 0.42);
    box-shadow: 0 16px 34px rgba(16, 32, 30, 0.13);
  }
}
