:root {
  color-scheme: light;
  --bg: #eef5f2;
  --surface: #ffffff;
  --surface-2: #f4f9f5;
  --text: #173529;
  --muted: #62756e;
  --line: #dbe9e2;
  --mint: #25ac7b;
  --mint-dark: #14754e;
  --ink: #0d4734;
  --gold: #ffcb51;
  --gold-dark: #ce9929;
  --red: #ed6975;
  --blue: #6178e0;
  --shadow: 0 14px 36px rgba(20, 72, 52, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 5%, #d5f7e5 0, transparent 24rem),
    radial-gradient(circle at 92% 30%, #eef0ff 0, transparent 25rem),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.dark {
  color-scheme: dark;
  --bg: #12251f;
  --surface: #1c332b;
  --surface-2: #243e33;
  --text: #eefbf1;
  --muted: #bad0c1;
  --line: #38564a;
  --ink: #94f0bf;
  --shadow: 0 14px 36px rgba(3, 14, 10, 0.3);
}

button,
input {
  font: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:focus-visible,
input:focus-visible,
label[for]:focus-visible {
  outline: 3px solid rgba(97, 120, 224, 0.45);
  outline-offset: 3px;
}

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

h1,
h2,
h3,
strong {
  letter-spacing: -0.02em;
}

.hidden,
.screen {
  display: none !important;
}

.screen.active {
  display: block !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.shell {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 0 24px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 83px;
}

.bare-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-size: 22px;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background:
    linear-gradient(#181818 0 33%, #db302f 33% 66%, #f3c846 66%);
  color: #fff;
  box-shadow: 0 6px 0 #0a5139;
  font-size: 13px;
  font-weight: 1000;
  text-shadow: 0 1px 2px #000;
}

.brand-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 4px 8px;
  border: 1px solid #f1d48b;
  border-radius: 999px;
  background: #fff0cf;
  color: #78510b;
  font-size: 9px;
  letter-spacing: 1px;
  vertical-align: middle;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill,
.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}

.pill {
  padding: 8px 12px;
  font-size: 13px;
}

.label {
  padding: 4px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.label.green {
  border-color: #bfe8cf;
  background: #dcf9e8;
  color: #1c814f;
}

body.dark .label.green {
  border-color: #356b4b;
  background: #214a34;
  color: #bdf6d2;
}

.icon-button {
  display: grid;
  min-width: 41px;
  height: 41px;
  padding: 0 9px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 19px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(215px, 250px) minmax(0, 1fr) minmax(220px, 278px);
  gap: 20px;
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 17px;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h2 {
  margin-bottom: 8px;
  font-size: 21px;
  line-height: 1.2;
}

.card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.eyebrow {
  color: var(--mint-dark);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

body.dark .eyebrow {
  color: #a1f4cb;
}

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

.small {
  font-size: 12px;
}

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

.learner-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
}

.learner-head strong {
  display: block;
  margin-top: 2px;
  line-height: 1.2;
}

.learner-avatar {
  display: grid;
  width: 49px;
  height: 49px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #f5d484;
  border-radius: 17px;
  background: #fff4d8;
  font-size: 28px;
}

.progress-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.progress-label strong {
  color: var(--text);
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface-2);
}

.progress-bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4acf83, #169b6b);
  transition: width 0.3s ease;
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.mini-stats div {
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
}

.mini-stats strong,
.mini-stats span {
  display: block;
}

.mini-stats strong {
  font-size: 20px;
}

.mini-stats span {
  color: var(--muted);
  font-size: 10px;
}

.nav-card {
  display: grid;
  gap: 7px;
  padding: 9px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 850;
}

.nav-button:hover,
.nav-button.selected {
  border-color: var(--line);
  background: var(--surface-2);
}

.resume-card {
  border-color: #bce4cc;
  background: linear-gradient(145deg, var(--surface), #e7f9ee);
}

body.dark .resume-card {
  background: linear-gradient(145deg, var(--surface), #203f31);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 17px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 900;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--mint);
  color: #fff;
  box-shadow: 0 5px 0 #177e58;
}

.button.gold {
  background: var(--gold);
  color: #5f4208;
  box-shadow: 0 5px 0 var(--gold-dark);
}

.button.outline {
  border: 1.5px solid var(--line);
  background: var(--surface);
}

.button.danger {
  background: #ffe5e8;
  color: #a6283e;
}

.button.full {
  width: 100%;
}

.small-button {
  min-height: 37px;
  padding: 7px 12px;
  border-radius: 11px;
  font-size: 12px;
}

.mini-button {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.zoo-card h3 {
  margin: 2px 0 0;
}

.zoo-animals {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px;
  overflow-x: auto;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 25px;
}

.zoo-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.hero {
  position: relative;
  display: grid;
  min-height: 300px;
  grid-template-columns: minmax(0, 1.25fr) minmax(230px, 0.75fr);
  gap: 20px;
  overflow: hidden;
  padding: 30px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.15), transparent 9rem),
    linear-gradient(135deg, #155b44, #1c9469);
  color: #fff;
  box-shadow: 0 16px 34px rgba(17, 89, 64, 0.18);
}

.hero::before,
.hero::after {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.hero::before {
  right: -35px;
  bottom: -100px;
  width: 280px;
  height: 280px;
}

.hero::after {
  right: 120px;
  top: -110px;
  width: 220px;
  height: 220px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
}

.hero .eyebrow {
  color: #a8f6d1;
}

.hero h1 {
  max-width: 620px;
  margin: 8px 0 12px;
  font-size: clamp(29px, 4vw, 45px);
  line-height: 1.09;
  letter-spacing: -1.4px;
}

.hero p {
  max-width: 590px;
  margin-bottom: 20px;
  opacity: 0.92;
  font-size: 16px;
}

.hero-art {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 240px;
  place-items: center;
}

.hero-mascot {
  display: grid;
  width: 172px;
  height: 172px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 52px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 50px rgba(5, 48, 34, 0.25);
  font-size: 105px;
  transform: rotate(4deg);
}

.hero-bubble {
  position: absolute;
  display: grid;
  min-width: 50px;
  height: 38px;
  place-items: center;
  padding: 0 12px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 950;
  backdrop-filter: blur(5px);
}

.hero-bubble.one {
  top: 11px;
  left: 8px;
  transform: rotate(-9deg);
}

.hero-bubble.two {
  top: 31px;
  right: 0;
  transform: rotate(8deg);
}

.hero-bubble.three {
  right: 7px;
  bottom: 8px;
  transform: rotate(-6deg);
}

.journey-card,
.setup-card {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 3px 0 0;
}

.journey {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.journey-line {
  position: absolute;
  top: 29px;
  right: 11%;
  left: 11%;
  height: 5px;
  border-radius: 10px;
  background: var(--line);
}

.journey-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 4px;
  text-align: center;
}

.journey-node {
  display: grid;
  width: 61px;
  height: 61px;
  place-items: center;
  margin-bottom: 4px;
  border: 3px solid var(--line);
  border-bottom-width: 6px;
  border-radius: 21px;
  background: var(--surface-2);
  font-size: 20px;
  font-weight: 950;
}

.journey-node.current {
  border-color: #58cc91;
  background: #def8e8;
  color: #155b3c;
}

.journey-node.gold-node {
  border-color: #e6ba4e;
  background: #fff3c8;
  color: #80570a;
}

body.dark .journey-node.current {
  background: #214b35;
  color: #d9ffe8;
}

body.dark .journey-node.gold-node {
  background: #534522;
  color: #ffe296;
}

.journey-step strong {
  font-size: 12px;
}

.journey-step small {
  color: var(--muted);
  font-size: 10px;
}

.path-hero {
  position: relative;
  display: grid;
  min-height: 230px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  padding: 28px 31px;
  border-radius: 27px;
  background:
    radial-gradient(circle at 83% 22%, rgba(255, 255, 255, 0.18), transparent 10rem),
    linear-gradient(135deg, #155b44, #1c9469);
  color: #fff;
  box-shadow: 0 16px 34px rgba(17, 89, 64, 0.18);
}

.path-hero::after {
  position: absolute;
  right: -45px;
  bottom: -75px;
  width: 250px;
  height: 250px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
}

.path-hero .eyebrow {
  color: #a8f6d1;
}

.path-hero h1 {
  margin: 5px 0 8px;
  font-size: clamp(29px, 4vw, 43px);
  line-height: 1.08;
}

.path-hero p {
  max-width: 620px;
  margin-bottom: 17px;
  opacity: 0.9;
}

.path-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.path-summary span {
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 11px;
  backdrop-filter: blur(5px);
}

.path-hero-guardian {
  position: relative;
  z-index: 1;
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-radius: 45px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 35px rgba(6, 52, 37, 0.24);
  font-size: 86px;
  transform: rotate(4deg);
}

.snake-map-card {
  margin-top: 18px;
  padding: 22px;
}

.snake-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: -5px 0 16px;
  color: var(--muted);
  font-size: 10px;
}

.snake-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
}

.legend-dot.current-dot {
  border-color: #41b87c;
  background: #62d69a;
}

.legend-dot.done-dot {
  border-color: #18895b;
  background: #209f6c;
}

.legend-dot.locked-dot {
  border-color: #aebeb7;
  background: #dce6e1;
}

.snake-path {
  position: relative;
  display: grid;
  gap: 4px;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 5px 25px;
}

.snake-path::before {
  position: absolute;
  top: 70px;
  bottom: 70px;
  left: 50%;
  width: 7px;
  border-radius: 20px;
  background: repeating-linear-gradient(
    to bottom,
    #8fd5b2 0,
    #8fd5b2 13px,
    transparent 13px,
    transparent 24px
  );
  content: "";
  transform: translateX(-50%);
}

.snake-stage {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 180px;
  grid-template-columns: minmax(0, 1fr) 115px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.snake-stage::before {
  position: absolute;
  top: 50%;
  width: calc(25% - 5px);
  border-top: 6px dotted #8fd5b2;
  content: "";
}

.snake-stage.left::before {
  left: 25%;
}

.snake-stage.right::before {
  right: 25%;
}

.snake-node-wrap {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.snake-stage.left .snake-node-wrap {
  grid-column: 1;
}

.snake-stage.right .snake-node-wrap {
  grid-column: 3;
}

.snake-node {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  padding: 8px;
  border: 5px solid var(--line);
  border-bottom-width: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  box-shadow: 0 8px 20px rgba(20, 72, 52, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.snake-node:disabled {
  cursor: default;
  opacity: 1;
}

.snake-stage.is-current .snake-node {
  border-color: #4fc389;
  background: linear-gradient(145deg, #f2fff7, #dff8e9);
  color: #155b3c;
  box-shadow: 0 0 0 7px rgba(79, 195, 137, 0.13), 0 10px 24px rgba(22, 126, 88, 0.16);
}

.snake-stage.is-current .snake-node:hover {
  transform: translateY(-4px) scale(1.025);
}

.snake-stage.is-done .snake-node {
  border-color: #209f6c;
  background: linear-gradient(145deg, #dff9e8, #c9f0d8);
  color: #155b3c;
}

.snake-stage.is-locked .snake-node {
  filter: grayscale(0.55);
}

.boss-stage {
  min-height: 205px;
}

.boss-stage::before {
  border-top-color: #b695e2;
}

.boss-stage .boss-node {
  width: 125px;
  height: 125px;
  border-color: #9c70d4;
  background: linear-gradient(145deg, #f6efff, #eadcff);
  color: #593184;
  box-shadow: 0 8px 0 #66418f, 0 15px 28px rgba(87, 52, 134, 0.18);
}

.boss-stage.is-current .boss-node {
  border-color: #9c70d4;
  background: linear-gradient(145deg, #f8f1ff, #e5d2ff);
  color: #593184;
  box-shadow:
    0 8px 0 #66418f,
    0 0 0 8px rgba(142, 91, 208, 0.13),
    0 18px 30px rgba(87, 52, 134, 0.2);
}

.boss-stage.is-done .boss-node {
  border-color: #d2a83d;
  background: linear-gradient(145deg, #fff7d9, #ffe79d);
  color: #6f4b08;
  box-shadow: 0 8px 0 #ad8427, 0 14px 25px rgba(130, 91, 11, 0.16);
}

.boss-stage .boss-guardian {
  border-color: #cbb2ec;
  background: linear-gradient(145deg, var(--surface), #f5efff);
}

.boss-stage .guardian-emoji {
  border-color: #c2a2e7;
  background: #f1e7ff;
}

.boss-stage .guardian-badge {
  background: #efe3ff;
  color: #66418f;
}

.boss-stage.is-done .guardian-badge {
  background: #fff0b9;
  color: #76500b;
}

body.dark .snake-stage.is-current .snake-node {
  background: linear-gradient(145deg, #254a37, #1d3c2e);
  color: #dcffea;
}

body.dark .snake-stage.is-done .snake-node {
  background: linear-gradient(145deg, #214b35, #193e2c);
  color: #dcffea;
}

body.dark .boss-stage .boss-node,
body.dark .boss-stage.is-current .boss-node {
  background: linear-gradient(145deg, #49345f, #382549);
  color: #f2e4ff;
}

body.dark .boss-stage.is-done .boss-node {
  background: linear-gradient(145deg, #58491f, #453916);
  color: #ffe9a8;
}

body.dark .boss-stage .boss-guardian {
  background: linear-gradient(145deg, var(--surface), #382b45);
}

body.dark .boss-stage .guardian-emoji {
  border-color: #70508f;
  background: #402d51;
}

body.dark .boss-stage .guardian-badge {
  background: #49345f;
  color: #eedcff;
}

.word-card.boss-word {
  border-color: #7c4dff;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(145deg, #efe8ff, #ddd0ff);
  box-shadow: 0 18px 42px rgba(91, 52, 166, 0.18);
}

body.dark .word-card.boss-word {
  color: #fff6cc;
  border-color: #b998ff;
  background: linear-gradient(145deg, #4d356f, #37274e);
}

.snake-node-number {
  display: block;
  font-size: 31px;
  font-weight: 1000;
  line-height: 1;
}

.snake-node-state {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  line-height: 1;
}

.snake-node-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
}

.snake-node-caption {
  color: var(--muted);
  font-size: 10px;
}

.guardian-card {
  display: grid;
  max-width: 190px;
  justify-items: center;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.snake-stage.left .guardian-card {
  grid-column: 3;
}

.snake-stage.right .guardian-card {
  grid-column: 1;
  grid-row: 1;
}

.guardian-emoji {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 2px solid #f0d48d;
  border-radius: 24px;
  background: #fff5d8;
  font-size: 45px;
}

.guardian-card strong {
  margin-top: 3px;
  font-size: 11px;
}

.guardian-card small {
  color: var(--muted);
  font-size: 9px;
}

.guardian-badge {
  margin-top: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.snake-stage.is-current .guardian-card {
  border-color: #8ed7b0;
}

.snake-stage.is-current .guardian-emoji {
  animation: guardian-float 2.4s ease-in-out infinite;
}

.snake-stage.is-done .guardian-badge {
  background: #dcf9e8;
  color: #1c814f;
}

.snake-stage.is-locked .guardian-card {
  opacity: 0.58;
  filter: grayscale(0.6);
}

body.dark .guardian-emoji {
  border-color: #75623a;
  background: #493c23;
}

body.dark .snake-stage.is-done .guardian-badge {
  background: #214b35;
  color: #c8f8d9;
}

.path-certificate {
  display: flex;
  max-width: 580px;
  align-items: center;
  gap: 13px;
  margin: 15px auto 0;
  padding: 13px 16px;
  border: 1px solid #edd28d;
  border-radius: 18px;
  background: #fff7dc;
  color: #634a14;
}

.path-certificate-icon {
  font-size: 35px;
}

.path-certificate strong,
.path-certificate small {
  display: block;
}

.path-certificate small {
  margin-top: 2px;
  font-size: 10px;
}

body.dark .path-certificate {
  border-color: #79643a;
  background: #493c23;
  color: #ffe9a8;
}

@keyframes guardian-float {
  0%,
  100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

.setup-icon {
  display: grid;
  width: 51px;
  height: 51px;
  place-items: center;
  border-radius: 17px;
  background: #e6f2ff;
  font-size: 27px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > span,
.field legend {
  padding: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.field input,
.certificate-actions input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
}

.field input:focus,
.certificate-actions input:focus {
  border-color: var(--mint);
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 172, 123, 0.12);
}

.field small {
  color: var(--muted);
  font-size: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 5px;
  border-radius: 15px;
  background: var(--surface-2);
}

.segment {
  min-height: 47px;
  padding: 7px 10px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.segment small {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  font-weight: 700;
}

.segment.active {
  border-color: #91dcb4;
  background: var(--surface);
  color: var(--mint-dark);
  box-shadow: 0 3px 9px rgba(20, 117, 78, 0.08);
}

body.dark .segment.active {
  color: #baf6d4;
}

.segmented.locked {
  opacity: 0.72;
}

.segmented.locked .segment {
  cursor: not-allowed;
}

.start-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.start-option {
  display: grid;
  min-height: 92px;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 14px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.start-option:hover {
  border-color: #73c89a;
  transform: translateY(-2px);
}

.option-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: var(--surface-2);
  font-size: 26px;
}

.start-option strong,
.start-option small {
  display: block;
}

.start-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.option-arrow {
  color: var(--mint);
  font-size: 24px;
  font-weight: 950;
}

.sample-file-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid #b9d7c6;
  border-radius: 14px;
  background: #f2fbf6;
  color: #24513a;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sample-file-link:hover {
  transform: translateY(-1px);
  border-color: #73c89a;
  background: #e8f8ef;
}

.sample-file-link strong,
.sample-file-link small {
  display: block;
}

.sample-file-link small {
  margin-top: 2px;
  color: #557061;
  font-size: 10px;
}

.sample-file-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  background: #d8f2e3;
  color: #20573a;
  font-size: 18px;
  font-weight: 950;
}

body.dark .sample-file-link {
  border-color: #3d7057;
  background: #203e31;
  color: #d9f7e6;
}

body.dark .sample-file-link:hover {
  border-color: #6bc897;
  background: #274b3b;
}

body.dark .sample-file-link small {
  color: #b8d7c5;
}

body.dark .sample-file-icon {
  background: #315c47;
  color: #d9f7e6;
}

.storage-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #d8e5fb;
  border-radius: 13px;
  background: #f3f7ff;
  color: #445776;
  font-size: 11px;
}

body.dark .storage-note {
  border-color: #3a526c;
  background: #253747;
  color: #d7e5f5;
}

.leaderboard-card h3,
.recent-card h3 {
  margin: 2px 0 0;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: leaders;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: var(--surface-2);
  counter-increment: leaders;
}

.leaderboard-list li::before {
  content: counter(leaders);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

.leaderboard-list li:nth-child(1)::before {
  content: "🥇";
  font-size: 17px;
}

.leaderboard-list li:nth-child(2)::before {
  content: "🥈";
  font-size: 17px;
}

.leaderboard-list li:nth-child(3)::before {
  content: "🥉";
  font-size: 17px;
}

.leader-name {
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score {
  color: var(--mint-dark);
  font-size: 11px;
  font-weight: 950;
}

body.dark .leader-score {
  color: #a1f4cb;
}

.empty-mini {
  margin: 13px 0 2px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.recent-preview {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.recent-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.recent-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item strong {
  white-space: nowrap;
}

.daily-card {
  padding: 15px;
  border: 1px solid #ffe4a8;
  border-radius: 17px;
  background: #fff8e4;
  color: #614f27;
}

.daily-card p {
  margin: 5px 0 0;
  font-size: 11px;
}

body.dark .daily-card {
  border-color: #76603a;
  background: #493c23;
  color: #f6de9b;
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.challenge-title {
  display: grid;
  min-width: 0;
  justify-items: center;
}

.challenge-title strong {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 15px;
  padding: 11px;
}

.game-stat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 14px;
  background: var(--surface-2);
}

.game-stat > span {
  font-size: 21px;
}

.game-stat strong,
.game-stat small {
  display: block;
}

.game-stat strong {
  font-size: 16px;
}

.game-stat small {
  color: var(--muted);
  font-size: 9px;
}

.question-card {
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.round-label {
  margin-left: 7px;
  color: var(--muted);
  font-size: 10px;
}

.question-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.certificate-eligibility {
  padding: 5px 9px;
  border: 1px solid #bfe8cf;
  border-radius: 999px;
  background: #e5faed;
  color: #1b7749;
  font-size: 10px;
  font-weight: 900;
}

.certificate-eligibility.lost {
  border-color: #f1c4c9;
  background: #fff0f2;
  color: #a33b4c;
}

.certificate-eligibility.pending {
  border-color: #efd28e;
  background: #fff6dc;
  color: #805b12;
}

body.dark .certificate-eligibility {
  border-color: #356b4b;
  background: #214a34;
  color: #c8f8d9;
}

body.dark .certificate-eligibility.lost {
  border-color: #71434b;
  background: #553037;
  color: #ffdce2;
}

body.dark .certificate-eligibility.pending {
  border-color: #79643a;
  background: #493c23;
  color: #ffe7a1;
}

.hearts {
  color: #e45566;
  font-size: 19px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.large-progress {
  height: 12px;
  margin: 13px 0 19px;
}

.game-direction {
  display: grid;
  width: fit-content;
  max-width: 100%;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 9px;
  margin: 0 auto 20px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
}

.direction-lock-icon {
  grid-row: 1 / span 2;
  font-size: 18px;
}

.game-direction strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.1;
}

.game-direction small {
  font-size: 10px;
  line-height: 1.2;
}

.word-card {
  display: grid;
  min-height: 164px;
  place-items: center;
  padding: 25px 20px;
  border: 2px solid #88d5ac;
  border-bottom-width: 6px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 203, 81, 0.25), transparent 7rem),
    linear-gradient(145deg, #f5fff9, #e6f8ee);
  color: #135c40;
  font-size: clamp(32px, 6vw, 55px);
  font-weight: 950;
  letter-spacing: -1px;
  text-align: center;
}

body.dark .word-card {
  background: linear-gradient(145deg, #223f33, #1b342a);
  color: #c9f8dc;
}

.word-card.no-help-word {
  border-color: #e3b744;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 203, 81, 0.34), transparent 7rem),
    linear-gradient(145deg, #fffdf4, #fff3c9);
  color: #6f4d0b;
}

body.dark .word-card.no-help-word {
  border-color: #c69d38;
  background: linear-gradient(145deg, #4c4024, #3c341f);
  color: #ffe8a5;
}

.word-instruction {
  margin: 12px 0 15px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

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

#user-input {
  width: 100%;
  min-height: 57px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 19px;
  font-weight: 750;
  text-align: center;
}

#user-input:focus {
  border-color: var(--mint);
  outline: none;
  box-shadow: 0 0 0 5px rgba(37, 172, 123, 0.12);
}

#user-input.shake {
  animation: shake 0.45s ease;
}

.check-button {
  min-width: 135px;
}

.feedback {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #bceccc;
  border-radius: 15px;
  background: #f0faf4;
  color: #1b5d3a;
  font-weight: 800;
}

.feedback.bad {
  border-color: #f4bac0;
  background: #fff1f2;
  color: #7b2d40;
}

.feedback.info {
  border-color: #bfd0f7;
  background: #f1f5ff;
  color: #354c87;
}

body.dark .feedback {
  background: #204635;
  color: #ddffe9;
}

body.dark .feedback.bad {
  background: #553037;
  color: #ffe4ea;
}

body.dark .feedback.info {
  background: #293958;
  color: #e2eaff;
}

.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.hint-actions {
  display: flex;
  gap: 8px;
}

.hint-button {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.hint-button > span:first-child {
  font-size: 21px;
}

.hint-button > span:last-child {
  font-size: 10px;
  font-weight: 900;
}

.hint-button small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.rank-message {
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

body.dark .rank-message {
  color: #a1f4cb;
}

.game-rule {
  max-width: 720px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.result-hero {
  padding: 34px 25px;
  text-align: center;
}

.big-icon {
  font-size: 65px;
  line-height: 1.1;
}

.result-hero h1 {
  margin: 5px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
}

.result-sentence {
  color: var(--muted);
  font-size: 17px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 670px;
  margin: 20px auto;
}

.result-grid div {
  padding: 14px;
  border-radius: 15px;
  background: var(--surface-2);
}

.result-grid strong,
.result-grid span {
  display: block;
}

.result-grid strong {
  font-size: 24px;
}

.result-grid span {
  color: var(--muted);
  font-size: 10px;
}

.badge-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.result-badge {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 850;
}

.certificate-teaser {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 17px;
  align-items: center;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid #eed796;
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.65), transparent 8rem),
    linear-gradient(135deg, #fff8df, #ffedb9);
  color: #5e4816;
  box-shadow: var(--shadow);
}

.certificate-teaser.locked {
  border-color: #e2c2c6;
  background: linear-gradient(135deg, #fff4f5, #f7e4e7);
  color: #70404a;
}

body.dark .certificate-teaser {
  border-color: #79643a;
  background: linear-gradient(135deg, #493c23, #5b4c2a);
  color: #ffe9a8;
}

body.dark .certificate-teaser.locked {
  border-color: #6e444b;
  background: linear-gradient(135deg, #4b3036, #563940);
  color: #ffdce2;
}

.certificate-teaser h2,
.certificate-teaser p {
  margin-bottom: 4px;
}

.certificate-teaser p {
  font-size: 12px;
}

.certificate-seal {
  display: grid;
  width: 67px;
  height: 67px;
  place-items: center;
  border: 2px dashed #d1a640;
  border-radius: 50%;
  background: #fff6d9;
  font-size: 35px;
}

.certificate-teaser.locked .certificate-seal {
  filter: grayscale(1);
  opacity: 0.65;
}

.finish-details {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-top: 16px;
}

.summary-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 11px;
}

.finish-actions {
  display: grid;
  gap: 10px;
}

.results-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 25px;
  background: linear-gradient(135deg, #155b44, #1c9469);
  color: #fff;
}

.results-header .eyebrow {
  color: #a8f6d1;
}

.results-header h1 {
  margin: 3px 0;
  font-size: 35px;
}

.results-header p {
  max-width: 560px;
  margin: 0;
  opacity: 0.85;
}

.results-trophy {
  align-self: center;
  font-size: 75px;
  transform: rotate(7deg);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-width: 420px;
  margin-bottom: 16px;
  padding: 5px;
  border-radius: 15px;
  background: var(--surface-2);
}

.tab {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tab.active {
  background: var(--surface);
  color: var(--mint-dark);
  box-shadow: 0 3px 10px rgba(20, 72, 52, 0.08);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

td strong {
  color: var(--mint-dark);
}

body.dark td strong {
  color: #a1f4cb;
}

.place-medal {
  font-size: 19px;
}

.empty-state {
  padding: 35px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state > span {
  font-size: 42px;
}

.empty-state h3 {
  margin: 7px 0 2px;
  color: var(--text);
}

.bottom-nav {
  display: none;
}

.modal-shade {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 27, 22, 0.76);
  backdrop-filter: blur(4px);
}

.modal-shade.open {
  display: flex;
}

.modal {
  width: min(610px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.modal-head h2 {
  margin: 2px 0 0;
}

.modal-close {
  font-size: 25px;
}

.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #bfe5d0;
  border-radius: 14px;
  background: #eefaf3;
  color: #285f45;
  font-size: 12px;
}

body.dark .notice {
  border-color: #3b674d;
  background: #254434;
  color: #d9f7e4;
}

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

.modal hr {
  margin: 19px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row small {
  color: var(--muted);
}

.danger-zone {
  padding: 14px;
  border: 1px solid #f3c4ca;
  border-radius: 15px;
  background: #fff6f7;
}

body.dark .danger-zone {
  border-color: #71434b;
  background: #4b3036;
}

.shop-modal-content {
  width: min(720px, 100%);
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-top: 17px;
}

.shop-item {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 142px;
  align-content: center;
  padding: 12px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: 17px;
  background: var(--surface);
  color: var(--text);
}

.shop-item:hover:not(:disabled) {
  border-color: #69c792;
}

.shop-item.owned {
  border-color: #72c99b;
  background: #ecfaf2;
}

body.dark .shop-item.owned {
  background: #214a34;
}

.shop-emoji {
  font-size: 42px;
}

.shop-price,
.shop-status {
  font-size: 10px;
  font-weight: 900;
}

.shop-price {
  color: #a36a00;
}

body.dark .shop-price {
  color: #ffd46f;
}

.certificate-history-list {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}

.certificate-history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.certificate-history-item > span {
  font-size: 25px;
}

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

.certificate-history-item small {
  color: var(--muted);
  font-size: 10px;
}

.certificate-overlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: none;
  overflow: auto;
  padding: 18px;
  background: rgba(7, 27, 22, 0.9);
}

.certificate-overlay.open {
  display: block;
}

.certificate-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.certificate-actions {
  display: flex;
  align-items: end;
  gap: 9px;
  margin-bottom: 13px;
  padding: 11px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.certificate-actions label {
  display: grid;
  min-width: 220px;
  flex: 1;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.certificate-actions input {
  min-height: 43px;
}

.certificate-paper {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 297 / 210;
  min-height: 620px;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  padding: 52px 65px;
  border: 13px solid #143f31;
  outline: 4px solid #ddb343;
  outline-offset: -25px;
  background:
    radial-gradient(circle at 12% 13%, rgba(37, 172, 123, 0.13), transparent 15rem),
    radial-gradient(circle at 88% 80%, rgba(255, 203, 81, 0.22), transparent 17rem),
    #fffdf6;
  color: #16382b;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.38);
}

.certificate-paper::before,
.certificate-paper::after {
  position: absolute;
  width: 130px;
  height: 130px;
  border: 3px double #d6ad42;
  border-radius: 50%;
  content: "";
  opacity: 0.38;
}

.certificate-paper::before {
  top: -66px;
  left: -66px;
}

.certificate-paper::after {
  right: -66px;
  bottom: -66px;
}

.certificate-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
}

.certificate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #164934;
  font: 900 16px/1.2 ui-rounded, "Segoe UI", sans-serif;
  letter-spacing: 1.8px;
}

.certificate-brand span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(#181818 0 33%, #db302f 33% 66%, #f3c846 66%);
  color: #fff;
  font-size: 10px;
  text-shadow: 0 1px 2px #000;
}

.certificate-topline p,
.certificate-number {
  margin: 7px 0 0;
  color: #61746c;
  font: 12px/1.4 ui-rounded, "Segoe UI", sans-serif;
}

.certificate-number {
  font-weight: 850;
}

.certificate-main {
  align-self: center;
  text-align: center;
}

.certificate-stars {
  color: #d5a938;
  font-size: 23px;
  letter-spacing: 8px;
}

.certificate-main h1 {
  max-width: 860px;
  margin: 10px auto 20px;
  color: #113c2d;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 1.5px;
}

.certificate-main p {
  margin: 5px 0;
  color: #536c62;
  font-size: 17px;
}

.certificate-person {
  max-width: 720px;
  margin: 11px auto;
  padding: 3px 20px 7px;
  border-bottom: 2px solid #d2ad4e;
  color: #164934;
  font-size: clamp(30px, 5vw, 54px);
  font-style: italic;
  font-weight: 700;
  line-height: 1.15;
}

.certificate-achievement {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  border: 1px solid #e1c36f;
  border-radius: 999px;
  background: #fff4cf;
  color: #61470c;
  font: 900 16px/1.3 ui-rounded, "Segoe UI", sans-serif;
}

.certificate-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 25px;
  align-items: end;
}

.certificate-footer > div:first-child strong,
.certificate-footer > div:first-child span,
.certificate-signature strong,
.certificate-signature span {
  display: block;
}

.certificate-footer > div:first-child strong,
.certificate-signature strong {
  font-size: 15px;
}

.certificate-footer > div:first-child span,
.certificate-signature span {
  color: #64756e;
  font: 11px/1.4 ui-rounded, "Segoe UI", sans-serif;
}

.certificate-seal-large {
  display: grid;
  width: 80px;
  height: 80px;
  place-items: center;
  border: 3px double #d1a33b;
  border-radius: 50%;
  background: #fff3c7;
  font-size: 42px;
}

.certificate-signature {
  text-align: right;
}

.certificate-signature > span:first-child {
  margin-bottom: -2px;
  color: #1d5842;
  font: italic 24px/1.2 "Brush Script MT", cursive;
}

.toast {
  position: fixed;
  z-index: 200;
  bottom: 24px;
  left: 50%;
  display: none;
  max-width: min(90vw, 620px);
  padding: 12px 18px;
  border-radius: 14px;
  background: #113e2d;
  color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.toast.show {
  display: block;
  animation: toast-in 0.25s ease both;
}

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

.confetti-piece {
  position: absolute;
  top: -18px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  animation: confetti-fall 2.5s linear forwards;
}

@keyframes shake {
  10%,
  90% { transform: translateX(-2px); }
  20%,
  80% { transform: translateX(5px); }
  30%,
  50%,
  70% { transform: translateX(-8px); }
  40%,
  60% { transform: translateX(8px); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes confetti-fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0); opacity: 1; }
  100% { transform: translate3d(var(--drift), 110vh, 0) rotate(850deg); opacity: 0.9; }
}

@media (max-width: 1160px) {
  .layout {
    grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  }

  .right-sidebar {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .right-sidebar .daily-card {
    align-self: stretch;
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 0 13px 95px;
  }

  .topbar {
    min-height: 67px;
  }

  .brand {
    font-size: 16px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    box-shadow: 0 4px 0 #0a5139;
  }

  .brand-tag,
  .top-actions .pill:first-child {
    display: none;
  }

  .layout {
    display: block;
  }

  .left-sidebar,
  .right-sidebar {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .hero-art {
    display: none;
  }

  .hero h1 {
    font-size: clamp(29px, 9vw, 42px);
  }

  .path-hero {
    min-height: auto;
    grid-template-columns: 1fr auto;
    padding: 24px;
  }

  .path-hero-guardian {
    width: 105px;
    height: 105px;
    border-radius: 35px;
    font-size: 65px;
  }

  .bottom-nav {
    position: fixed;
    z-index: 70;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(16px);
  }

  .bottom-nav button {
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 5px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--text);
    font-size: 20px;
  }

  .bottom-nav button:hover {
    background: var(--surface-2);
  }

  .bottom-nav small {
    color: var(--muted);
    font-size: 8px;
    font-weight: 850;
  }

  .certificate-paper {
    min-height: 0;
    padding: 38px 45px;
  }

  .certificate-main h1 {
    margin-bottom: 12px;
    font-size: 31px;
  }

  .certificate-person {
    font-size: 34px;
  }

  .certificate-main p {
    font-size: 13px;
  }
}

@media (max-width: 620px) {
  .top-actions .pill {
    padding: 6px 8px;
  }

  .top-actions .icon-button {
    min-width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .journey {
    grid-template-columns: 1fr 1fr;
    gap: 18px 7px;
  }

  .journey-line {
    display: none;
  }

  .journey-node {
    width: 52px;
    height: 52px;
    border-radius: 18px;
  }

  .path-hero {
    grid-template-columns: 1fr;
  }

  .path-hero-guardian {
    display: none;
  }

  .snake-map-card {
    padding: 15px 10px;
  }

  .snake-path {
    padding-right: 0;
    padding-left: 0;
  }

  .snake-stage {
    min-height: 150px;
    grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
    gap: 7px;
  }

  .snake-stage::before {
    width: calc(25% - 2px);
    border-top-width: 5px;
  }

  .snake-node {
    width: 86px;
    height: 86px;
    border-width: 4px;
    border-bottom-width: 8px;
  }

  .boss-stage .boss-node {
    width: 96px;
    height: 96px;
  }

  .snake-node-number {
    font-size: 25px;
  }

  .snake-node-state {
    font-size: 13px;
  }

  .snake-node-label {
    font-size: 10px;
  }

  .snake-node-caption {
    font-size: 8px;
  }

  .guardian-card {
    max-width: 125px;
    padding: 8px 5px;
    border-radius: 15px;
  }

  .guardian-emoji {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    font-size: 34px;
  }

  .guardian-card strong {
    font-size: 9px;
  }

  .guardian-card small {
    font-size: 8px;
  }

  .path-certificate {
    margin-right: 5px;
    margin-left: 5px;
  }

  .form-grid,
  .start-options {
    grid-template-columns: 1fr;
  }

  .setup-card,
  .journey-card {
    padding: 15px;
  }

  .quiz-top {
    align-items: flex-start;
  }

  .challenge-title {
    justify-items: start;
  }

  .challenge-title strong {
    max-width: 170px;
  }

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

  .question-head {
    align-items: flex-start;
  }

  .question-status {
    display: grid;
    justify-items: end;
    gap: 5px;
  }

  .certificate-eligibility {
    max-width: 145px;
    text-align: center;
    white-space: normal;
  }

  .word-card {
    min-height: 130px;
  }

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

  .check-button {
    width: 100%;
  }

  .question-footer {
    display: grid;
  }

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

  .rank-message {
    text-align: center;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .certificate-teaser {
    grid-template-columns: auto 1fr;
  }

  .certificate-teaser .button {
    grid-column: 1 / -1;
  }

  .finish-details {
    grid-template-columns: 1fr;
  }

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

  .results-trophy {
    font-size: 50px;
  }

  .modal-actions,
  .shop-items {
    grid-template-columns: 1fr 1fr;
  }

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

  .certificate-actions label {
    grid-column: 1 / -1;
  }

  .certificate-paper {
    min-width: 800px;
  }

  .certificate-shell {
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .brand > span:last-child {
    max-width: 145px;
    line-height: 1.05;
  }

  .top-actions {
    gap: 4px;
  }

  .top-actions .pill {
    font-size: 11px;
  }

  .hero,
  .question-card,
  .result-hero {
    padding: 18px;
  }

  .hero h1 {
    font-size: 30px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  body {
    background: #fff !important;
  }

  body > *:not(#certificate-overlay) {
    display: none !important;
  }

  #certificate-overlay {
    position: static !important;
    display: block !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .certificate-shell {
    width: 297mm !important;
    margin: 0 !important;
  }

  .certificate-actions {
    display: none !important;
  }

  .certificate-paper {
    width: 297mm !important;
    height: 210mm !important;
    min-height: 210mm !important;
    border-width: 10mm !important;
    outline-offset: -16mm !important;
    box-shadow: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
