:root {
  --ink: #17313b;
  --muted: #5c6b68;
  --sea: #0ea5a8;
  --sea-dark: #08777d;
  --leaf: #3f8f4d;
  --leaf-dark: #286337;
  --amber: #f2b33d;
  --coral: #e86f51;
  --cream: #fff7e2;
  --paper: #fffdf5;
  --line: rgba(23, 49, 59, 0.16);
  --shadow: 0 20px 48px rgba(18, 47, 60, 0.18);
  --soft-shadow: 0 10px 28px rgba(18, 47, 60, 0.12);
  --radius: 8px;
  --game-font: "Trebuchet MS", "Arial Rounded MT Bold", Inter, ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
  font-family: var(--game-font);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100svh;
  background:
    radial-gradient(circle at top left, rgba(242, 179, 61, 0.22), transparent 34rem),
    linear-gradient(140deg, #eaf9f6 0%, #f9f3df 48%, #e8f5f0 100%);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

.app {
  width: 100%;
  min-height: 100svh;
}

.logo-lockup {
  display: inline-grid;
  gap: 0;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 0.88;
  font-family: Georgia, "Times New Roman", var(--game-font);
  filter: drop-shadow(0 12px 18px rgba(5, 18, 24, 0.44));
}

.logo-main {
  display: block;
  color: #ffdb63;
  font-size: clamp(48px, 8vw, 118px);
  font-weight: 1000;
  -webkit-text-fill-color: #ffdb63;
  -webkit-text-stroke: 1.7px #5b3008;
  text-shadow:
    0 2px 0 #fff3a8,
    0 5px 0 #9c5515,
    0 8px 0 #472305,
    0 14px 22px rgba(5, 18, 24, 0.44);
}

.logo-sub {
  display: block;
  margin-left: 0.12em;
  color: #48e6de;
  font-size: clamp(24px, 4vw, 58px);
  font-weight: 1000;
  -webkit-text-fill-color: #48e6de;
  -webkit-text-stroke: 0.9px #07383f;
  text-shadow:
    0 2px 0 #e8fff9,
    0 5px 0 #08777d,
    0 9px 14px rgba(5, 18, 24, 0.38);
}

.logo-entry .logo-main,
.logo-home .logo-main,
.logo-map .logo-main {
  font-size: clamp(38px, 6vw, 76px);
}

.logo-entry .logo-sub,
.logo-home .logo-sub,
.logo-map .logo-sub {
  font-size: clamp(20px, 3vw, 38px);
}

.welcome-screen {
  min-height: 100svh;
  padding: clamp(12px, 2.4vw, 28px);
}

.welcome-map {
  position: relative;
  min-height: calc(100svh - clamp(24px, 4.8vw, 56px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background-image:
    linear-gradient(90deg, rgba(9, 58, 71, 0.72), rgba(9, 58, 71, 0.16) 48%, rgba(255, 255, 255, 0.04)),
    url("assets/nusantara-map.png");
  background-position: center, var(--bg-x, 50%) var(--bg-y, 50%);
  background-size: auto, cover;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
}

.welcome-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 28%, rgba(255, 225, 122, 0.2), transparent 24rem),
    linear-gradient(180deg, rgba(9, 58, 71, 0), rgba(9, 58, 71, 0.36));
  pointer-events: none;
}

.welcome-copy {
  position: relative;
  z-index: 2;
  display: grid;
  max-width: 690px;
  min-height: calc(100svh - clamp(24px, 4.8vw, 56px));
  align-content: center;
  padding: clamp(24px, 6vw, 78px);
  color: white;
}

.welcome-lead,
.home-lead {
  max-width: 620px;
  margin: 18px 0 24px;
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(17px, 2.1vw, 24px);
  line-height: 1.5;
  text-shadow: 0 2px 14px rgba(7, 38, 46, 0.42);
}

.big-btn {
  min-height: 54px;
  padding: 0 24px;
  font-size: 16px;
}

.character-duo {
  display: block;
  width: min(43vw, 560px);
  height: auto;
  filter: drop-shadow(0 24px 32px rgba(9, 58, 71, 0.28));
  transform: translate(var(--anim-x, 0), var(--anim-y, 0));
  will-change: transform;
  pointer-events: none;
}

.welcome-characters {
  position: absolute;
  right: clamp(6px, 4vw, 52px);
  bottom: clamp(-34px, -2vw, -8px);
  z-index: 2;
  width: min(48vw, 660px);
}

.welcome-orbit {
  position: absolute;
  z-index: 1;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 208, 76, 0.55), rgba(255, 208, 76, 0));
  animation: sparkleDrift 4.8s ease-in-out infinite;
}

.welcome-orbit.one {
  top: 18%;
  right: 34%;
}

.welcome-orbit.two {
  right: 8%;
  bottom: 22%;
  width: 150px;
  height: 150px;
  animation-delay: -1.4s;
}

.entry {
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: stretch;
  padding: clamp(18px, 4vw, 42px);
}

.entry-art {
  position: relative;
  overflow: hidden;
  min-height: 540px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background-image:
    linear-gradient(180deg, rgba(12, 95, 103, 0.08), rgba(255, 255, 255, 0.1)),
    url("assets/nusantara-map.png");
  background-position: center, var(--bg-x, 50%) var(--bg-y, 50%);
  background-size: auto, cover;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
}

.entry-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(9, 58, 71, 0.08), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.entry-title {
  position: absolute;
  left: clamp(18px, 5vw, 46px);
  bottom: clamp(18px, 5vw, 46px);
  z-index: 2;
  width: min(560px, calc(100% - 36px));
  color: white;
  text-shadow: 0 2px 18px rgba(6, 41, 51, 0.45);
}

.entry-title h1 {
  margin: 0 0 10px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.92;
  letter-spacing: 0;
}

.entry-title p {
  max-width: 560px;
  margin: 0;
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.45;
}

.entry-characters {
  position: absolute;
  right: clamp(-42px, -2vw, -12px);
  bottom: -26px;
  z-index: 1;
  width: min(43vw, 520px);
}

.entry-panel {
  display: flex;
  min-height: 540px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.92);
  box-shadow: var(--shadow);
}

.back-inline {
  align-self: start;
  margin-bottom: 18px;
}

.entry-panel h2,
.dashboard h2,
.mission-stage h2,
.map-header h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

.entry-panel p,
.form-note,
.body-copy {
  color: var(--muted);
  line-height: 1.6;
}

.field-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #31494a;
  font-size: 14px;
  font-weight: 750;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(23, 49, 59, 0.22);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--sea);
  box-shadow: 0 0 0 4px rgba(14, 165, 168, 0.14);
}

.btn-row,
.tool-row,
.phase-row,
.mission-actions,
.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.icon-btn,
.node-btn,
.choice-btn,
.tab-btn,
.formula-btn,
.mini-btn {
  cursor: pointer;
  border-radius: var(--radius);
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid rgba(255, 246, 201, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 44%),
    linear-gradient(135deg, var(--leaf), var(--sea-dark));
  color: white;
  box-shadow:
    inset 0 -4px 0 rgba(10, 69, 58, 0.28),
    0 12px 26px rgba(8, 119, 125, 0.25);
  text-shadow: 0 2px 0 rgba(7, 50, 42, 0.28);
}

.secondary-btn {
  min-height: 42px;
  padding: 0 15px;
  border: 2px solid rgba(133, 84, 11, 0.2);
  background:
    linear-gradient(180deg, #ffffff, #fff2c6);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(133, 84, 11, 0.1);
}

.danger-btn {
  min-height: 42px;
  padding: 0 15px;
  background: #fff0ea;
  color: #9a3b27;
}

.mini-btn,
.tab-btn,
.formula-btn,
.choice-btn {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(23, 49, 59, 0.16);
  background: white;
  color: var(--ink);
}

.mini-btn.is-active,
.tab-btn.is-active,
.formula-btn.is-active,
.choice-btn.is-active {
  background: #e5f6f0;
  border-color: rgba(63, 143, 77, 0.52);
  color: var(--leaf-dark);
}

.primary-btn:hover,
.secondary-btn:hover,
.danger-btn:hover,
.icon-btn:hover,
.node-btn:hover,
.choice-btn:hover,
.tab-btn:hover,
.formula-btn:hover,
.mini-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.danger-btn:disabled,
.choice-btn:disabled,
.mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.shell {
  display: grid;
  min-height: 100svh;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(460px, 1.35fr) minmax(148px, auto) minmax(150px, 180px);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(23, 49, 59, 0.14);
  background: rgba(255, 253, 245, 0.94);
  padding: 12px clamp(14px, 3vw, 28px);
  backdrop-filter: blur(14px);
}

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

.brand-mark,
.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--amber), var(--coral));
  color: white;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(232, 111, 81, 0.22);
}

.brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.05;
}

.brand span,
.student-chip span,
.hud-label,
.small-text {
  color: var(--muted);
  font-size: 12px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 8px;
}

.hud-item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 7px;
  align-items: center;
  border: 2px solid rgba(23, 49, 59, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 205, 0.9));
  padding: 7px 8px;
  box-shadow: inset 0 -3px 0 rgba(133, 84, 11, 0.08);
}

.hud-icon {
  display: grid;
  width: 20px;
  height: 20px;
  grid-row: span 2;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  color: white;
  box-shadow: 0 6px 16px rgba(232, 111, 81, 0.2);
}

.hud-icon svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.hud-value {
  display: block;
  overflow: visible;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-controls {
  display: grid;
  grid-template-columns: 42px minmax(82px, 120px);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(23, 49, 59, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.86);
  padding: 6px;
}

.audio-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid rgba(23, 49, 59, 0.12);
  border-radius: var(--radius);
  background: white;
  color: var(--sea-dark);
  cursor: pointer;
}

.audio-btn.is-on {
  background: #e5f6f0;
  color: var(--leaf-dark);
}

.audio-btn svg {
  width: 22px;
  height: 22px;
}

.audio-controls input[type="range"] {
  width: 100%;
  accent-color: var(--leaf);
}

.student-chip {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.student-chip strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-chip span {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  min-height: 0;
}

.rail {
  border-right: 1px solid rgba(23, 49, 59, 0.13);
  background: rgba(255, 253, 245, 0.75);
  padding: 14px 10px;
}

.rail nav {
  display: grid;
  gap: 10px;
}

.icon-btn {
  display: grid;
  min-height: 62px;
  place-items: center;
  gap: 4px;
  border: 1px solid rgba(23, 49, 59, 0.13);
  background: white;
  color: var(--ink);
  font-size: 11px;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.icon-btn.is-active {
  background: #e6f7f3;
  color: var(--sea-dark);
  border-color: rgba(14, 165, 168, 0.36);
}

.content {
  min-width: 0;
  padding: clamp(14px, 2.2vw, 26px);
}

.game-shell {
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 209, 83, 0.26), transparent 34rem),
    linear-gradient(180deg, #143845 0%, #0b202b 100%);
}

.game-content {
  width: 100%;
  min-height: 100svh;
  padding: clamp(10px, 1.5vw, 18px);
}

.game-top-actions {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
}

.frame-btn {
  min-height: 38px;
  border: 2px solid rgba(255, 226, 126, 0.65);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(43, 102, 75, 0.95), rgba(15, 75, 76, 0.95));
  color: #fff6cf;
  padding: 0 13px;
  font-weight: 950;
  box-shadow: 0 8px 0 rgba(56, 30, 8, 0.28), 0 18px 24px rgba(5, 18, 24, 0.22);
}

.audio-frame {
  width: 174px;
  border-color: rgba(255, 226, 126, 0.52);
  background: rgba(8, 38, 45, 0.62);
}

.audio-frame input[type="range"] {
  accent-color: #ffd64f;
}

.game-session-chip {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: grid;
  justify-items: end;
  border: 2px solid rgba(255, 226, 126, 0.52);
  border-radius: var(--radius);
  background: rgba(8, 38, 45, 0.66);
  color: #fff6cf;
  padding: 8px 12px;
  box-shadow: 0 16px 22px rgba(5, 18, 24, 0.2);
}

.game-session-chip strong {
  max-width: 180px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-session-chip span {
  max-width: 180px;
  overflow: hidden;
  color: rgba(255, 246, 207, 0.76);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-hud {
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 8px;
  width: min(840px, calc(100% - 420px));
}

.frame-hud .hud-item {
  min-height: 54px;
  border: 2px solid rgba(255, 226, 126, 0.56);
  background:
    linear-gradient(180deg, rgba(255, 248, 216, 0.96), rgba(230, 184, 76, 0.82)),
    #fff4c4;
  box-shadow:
    inset 0 -4px 0 rgba(95, 54, 15, 0.16),
    0 10px 18px rgba(5, 18, 24, 0.18);
}

.map-game-layout {
  display: block;
}

.map-game-frame {
  width: 100%;
  min-height: calc(100svh - clamp(20px, 3vw, 36px));
  border: 4px solid rgba(255, 226, 126, 0.72);
  box-shadow:
    inset 0 0 0 3px rgba(67, 37, 9, 0.34),
    0 24px 60px rgba(0, 0, 0, 0.34);
}

.map-game-frame::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 246, 207, 0.18), transparent 18rem),
    linear-gradient(180deg, rgba(6, 28, 38, 0.18), rgba(6, 28, 38, 0.36));
  content: "";
  pointer-events: none;
}

.map-title-center {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 12;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
  text-align: center;
}

.map-title-center .logo-map .logo-main {
  font-size: clamp(52px, 7vw, 108px);
}

.map-title-center .logo-map .logo-sub {
  font-size: clamp(24px, 3.6vw, 54px);
}

.map-title-center > span {
  margin-top: 4px;
  border: 2px solid rgba(255, 226, 126, 0.72);
  border-radius: 999px;
  background: rgba(7, 38, 46, 0.74);
  color: #fff6cf;
  padding: 6px 16px;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(5, 18, 24, 0.22);
}

.map-frame-hud {
  position: absolute;
  left: 50%;
  top: 154px;
  transform: translateX(-50%);
}

.map-character-dock {
  position: absolute;
  right: 2.2%;
  bottom: 2%;
  z-index: 12;
  width: clamp(240px, 24vw, 390px);
  height: clamp(330px, 37vw, 540px);
  pointer-events: none;
  transform: translate(var(--anim-x, 0), var(--anim-y, 0));
}

.map-character-dock .map-characters {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  width: 100%;
}

.map-guide-bubble {
  position: absolute;
  right: 2%;
  bottom: 46%;
  z-index: 12;
  display: grid;
  max-width: 300px;
  gap: 4px;
  transform: translateY(var(--anim-y, 0));
  border: 3px solid rgba(255, 246, 201, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.96);
  padding: 12px 14px;
  box-shadow: 0 18px 24px rgba(5, 18, 24, 0.22);
}

.map-guide-bubble strong {
  color: var(--sea-dark);
  font-size: 17px;
}

.map-guide-bubble span {
  color: #213f42;
  font-weight: 850;
  line-height: 1.35;
}

.map-start-btn {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 18;
  min-width: min(360px, calc(100% - 36px));
  transform: translateX(-50%);
}

.map-start-btn:hover,
.home-start-btn:hover {
  transform: translateX(-50%) translateY(-1px);
}

.map-start-btn:active,
.home-start-btn:active {
  transform: translateX(-50%) translateY(0);
}

.map-game-frame .mission-node {
  z-index: 24;
}

.map-game-frame .node-btn {
  border-color: rgba(255, 226, 126, 0.9);
  background: rgba(18, 75, 57, 0.93);
}

.home-screen {
  width: 100%;
}

.home-game-frame {
  position: relative;
  min-height: calc(100svh - clamp(20px, 3vw, 36px));
  overflow: hidden;
  border: 4px solid rgba(255, 226, 126, 0.72);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 226, 126, 0.18), transparent 30rem),
    linear-gradient(180deg, rgba(10, 52, 58, 0.72), rgba(8, 31, 42, 0.78)),
    url("assets/nusantara-map.png");
  background-position: center, center, var(--bg-x, 50%) var(--bg-y, 50%);
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 0 3px rgba(67, 37, 9, 0.34),
    0 24px 60px rgba(0, 0, 0, 0.34);
}

.home-game-frame::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 38, 46, 0.24), rgba(7, 38, 46, 0.42)),
    radial-gradient(circle at 52% 35%, rgba(255, 246, 207, 0.08), transparent 28rem);
  content: "";
  pointer-events: none;
}

.home-title-center {
  position: absolute;
  top: 30px;
  left: 50%;
  z-index: 14;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
  text-align: center;
}

.home-title-center .logo-home .logo-main {
  font-size: clamp(62px, 8vw, 126px);
}

.home-title-center .logo-home .logo-sub {
  font-size: clamp(28px, 4vw, 62px);
}

.home-title-center > span {
  margin-top: 8px;
  border: 2px solid rgba(255, 226, 126, 0.7);
  border-radius: 999px;
  background: rgba(7, 38, 46, 0.76);
  color: #fff6cf;
  padding: 6px 16px;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(5, 18, 24, 0.22);
}

.home-frame-hud {
  position: absolute;
  top: 222px;
  left: 50%;
  z-index: 14;
  width: min(720px, calc(100% - 560px));
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  transform: translateX(-50%);
}

.home-map-preview {
  position: absolute;
  inset: 250px 24% 110px 5%;
  z-index: 4;
  overflow: hidden;
  border: 3px solid rgba(255, 246, 201, 0.86);
  border-radius: var(--radius);
  background-image:
    linear-gradient(180deg, rgba(255, 253, 245, 0), rgba(9, 58, 71, 0.16)),
    url("assets/nusantara-map.png");
  background-position: center, var(--bg-x, 50%) var(--bg-y, 50%);
  background-size: auto, cover;
  background-repeat: no-repeat;
  box-shadow: 0 28px 58px rgba(6, 42, 47, 0.28);
}

.home-map-preview::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 74% 66%, rgba(255, 222, 109, 0.24), transparent 13rem),
    linear-gradient(180deg, rgba(7, 38, 46, 0.06), rgba(7, 38, 46, 0.22));
  pointer-events: none;
}

.home-character-dock {
  position: absolute;
  right: 3.5%;
  bottom: 92px;
  z-index: 10;
  width: clamp(250px, 25vw, 430px);
  height: clamp(300px, 33vw, 520px);
  pointer-events: none;
  transform: translate(var(--anim-x, 0), var(--anim-y, 0));
}

.home-characters {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 100%;
}

.home-guide-bubble {
  position: absolute;
  right: 66%;
  bottom: 42%;
  z-index: 3;
  display: grid;
  width: min(320px, 36vw);
  gap: 4px;
  border: 3px solid rgba(255, 246, 201, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.96);
  color: var(--ink);
  padding: 12px 14px;
  box-shadow: 0 18px 24px rgba(5, 18, 24, 0.22);
}

.home-guide-bubble strong {
  color: var(--sea-dark);
  font-size: 17px;
}

.home-guide-bubble span {
  color: #213f42;
  font-weight: 850;
  line-height: 1.35;
}

.home-pin {
  position: absolute;
  z-index: 7;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  transform: translate(-50%, -50%) translate(var(--anim-x, 0), var(--anim-y, 0)) scale(var(--anim-scale, 1));
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: var(--coral);
  color: white;
  font-weight: 950;
  box-shadow: 0 0 0 calc(var(--glow, 0.2) * 16px) rgba(255, 208, 76, 0.2);
}

.home-pin.is-complete {
  background: var(--leaf);
}

.home-start-btn {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 16;
  min-width: min(420px, calc(100% - 36px));
  min-height: 58px;
  transform: translateX(-50%);
  font-size: 18px;
}

.mission-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.mission-card {
  display: grid;
  min-height: 88px;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(23, 49, 59, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.94);
  color: var(--ink);
  padding: 10px;
  text-align: left;
  box-shadow: var(--soft-shadow);
}

.mission-card-index {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  color: white;
  font-weight: 950;
}

.mission-card strong,
.mission-card small {
  display: block;
}

.mission-card small {
  margin-top: 4px;
  color: var(--muted);
}

.mission-card.is-complete .mission-card-index {
  background: var(--leaf);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.map-layout.map-game-layout {
  display: block;
  grid-template-columns: none;
}

.map-board {
  position: relative;
  overflow: hidden;
  min-height: min(760px, calc(100svh - 138px));
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background-image:
    linear-gradient(180deg, rgba(255, 253, 245, 0), rgba(255, 253, 245, 0.08)),
    url("assets/nusantara-map.png");
  background-position: center, var(--bg-x, 50%) var(--bg-y, 50%);
  background-size: auto, cover;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
}

.map-board::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(15, 72, 80, 0), rgba(10, 59, 71, 0.16));
  pointer-events: none;
}

.map-header {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  max-width: min(520px, calc(100% - 36px));
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.9);
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.logo-map {
  margin-bottom: 8px;
}

.map-characters {
  position: absolute;
  left: clamp(-56px, -3vw, -18px);
  bottom: -22px;
  z-index: 3;
  width: min(31vw, 430px);
}

.map-dialogue {
  position: absolute;
  left: clamp(165px, 24vw, 300px);
  bottom: 44px;
  z-index: 4;
  max-width: 280px;
  transform: translateY(var(--anim-y, 0));
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.95);
  padding: 10px 12px;
  box-shadow: var(--soft-shadow);
}

.map-dialogue.byte {
  left: clamp(425px, 52vw, 620px);
  bottom: 18px;
}

.map-dialogue strong,
.map-dialogue span {
  display: block;
}

.map-dialogue strong {
  color: var(--leaf-dark);
  font-weight: 950;
}

.map-dialogue span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.mission-node {
  position: absolute;
  z-index: 3;
  transform: translate(calc(-50% + var(--anim-x, 0px)), calc(-50% + var(--anim-y, 0px))) scale(var(--anim-scale, 1));
  will-change: transform;
}

.node-btn {
  display: grid;
  grid-template-columns: 38px minmax(110px, auto);
  gap: 8px;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(24, 79, 61, 0.92);
  color: white;
  padding: 8px 10px;
  box-shadow:
    0 16px 32px rgba(6, 42, 47, 0.28),
    0 0 0 calc(var(--glow, 0.18) * 16px) rgba(255, 208, 76, 0.13);
}

.node-index {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  font-weight: 950;
}

.node-label {
  display: block;
  min-width: 0;
  font-weight: 900;
  white-space: nowrap;
}

.node-meta {
  display: block;
  color: #f7d273;
  font-size: 12px;
}

.node-btn.is-complete {
  background: rgba(28, 118, 79, 0.94);
}

.aside-panel,
.mission-stage,
.dashboard,
.research-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.94);
  box-shadow: var(--soft-shadow);
}

.aside-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: min(760px, calc(100svh - 138px));
  padding: 18px;
}

.phase-list {
  display: grid;
  gap: 10px;
}

.phase-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(23, 49, 59, 0.12);
  border-radius: var(--radius);
  background: white;
  padding: 10px;
}

.phase-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: #e5f6f0;
  color: var(--leaf-dark);
  font-weight: 950;
}

.phase-item strong {
  display: block;
  margin-bottom: 3px;
}

.mission-stage {
  display: grid;
  gap: 16px;
  padding: clamp(14px, 2vw, 22px);
}

.mission-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.mission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(23, 49, 59, 0.11);
  border-radius: var(--radius);
  background: #f4fbf8;
  color: #2e5f4b;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.38fr);
  gap: 16px;
}

.work-surface,
.mission-notes,
.dashboard-section {
  border: 1px solid rgba(23, 49, 59, 0.12);
  border-radius: var(--radius);
  background: white;
  padding: 14px;
}

.work-surface {
  min-height: 420px;
}

.game-surface {
  display: grid;
  gap: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 242, 0.96)),
    #ffffff;
}

.game-scene {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(23, 49, 59, 0.12);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 236, 142, 0.36), transparent 18rem),
    linear-gradient(180deg, #d8f6f4 0%, #f9f5df 58%, #e1f0dd 100%);
  box-shadow: inset 0 -18px 40px rgba(23, 49, 59, 0.08);
}

.game-scene::after {
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(29, 103, 79, 0.08));
  pointer-events: none;
}

.scene-label {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  display: grid;
  gap: 2px;
  max-width: min(420px, calc(100% - 28px));
  border: 2px solid rgba(255, 246, 201, 0.82);
  border-radius: var(--radius);
  background: rgba(12, 72, 75, 0.88);
  color: white;
  padding: 10px 12px;
  box-shadow: var(--soft-shadow);
}

.scene-label strong {
  font-size: 18px;
  line-height: 1.05;
}

.scene-label span {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.35;
}

.grid-adventure {
  background-image:
    linear-gradient(180deg, rgba(9, 58, 71, 0.2), rgba(255, 255, 255, 0.08)),
    url("assets/nusantara-map.png");
  background-position: center;
  background-size: cover;
}

.adventure-board {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(92%, 560px);
  aspect-ratio: 1;
  grid-template-columns: repeat(var(--grid-size, 5), 1fr);
  gap: 8px;
  margin: 78px auto 58px;
  border: 3px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: rgba(14, 104, 88, 0.24);
  padding: 8px;
  box-shadow: 0 24px 44px rgba(6, 42, 47, 0.22);
}

.adventure-cell {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(135deg, #85bd67, #4c9a69);
  color: rgba(14, 53, 51, 0.82);
  font-weight: 950;
  box-shadow: inset 0 -5px 0 rgba(8, 67, 56, 0.16);
}

.adventure-cell span {
  position: absolute;
  top: 6px;
  left: 7px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  padding: 2px 6px;
  font-size: 12px;
}

.adventure-cell.is-path {
  outline: 4px solid rgba(47, 225, 210, 0.34);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 246, 201, 0.6), transparent 44%),
    linear-gradient(135deg, #9ed7a1, #4bb79f);
}

.adventure-cell.is-start {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent 44%),
    linear-gradient(135deg, #68c782, #21a8a4);
}

.adventure-cell.is-target {
  background:
    radial-gradient(circle, rgba(255, 232, 123, 0.88), transparent 54%),
    linear-gradient(135deg, #86c974, #239a8f);
}

.adventure-cell.is-obstacle {
  background:
    radial-gradient(circle at 46% 42%, #9a7457, #5f4939 62%, #48382d);
}

.rock-prop {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  aspect-ratio: 1.25;
  transform: translate(-50%, -38%) rotate(-7deg);
  border-radius: 42% 58% 38% 62%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.22), transparent 22%),
    linear-gradient(135deg, #9e8061, #5b4738);
  box-shadow: 0 8px 0 rgba(23, 49, 59, 0.14);
}

.gate-prop {
  position: absolute;
  right: 12%;
  bottom: 10%;
  width: 58%;
  height: 64%;
  border: 5px solid rgba(255, 215, 87, 0.9);
  border-bottom: 0;
  border-radius: 50% 50% 8px 8px;
  box-shadow:
    inset 0 0 18px rgba(47, 225, 210, 0.28),
    0 0 20px rgba(255, 215, 87, 0.24);
}

.gate-prop.is-open {
  border-color: #2fe1d2;
  box-shadow:
    inset 0 0 24px rgba(47, 225, 210, 0.55),
    0 0 26px rgba(47, 225, 210, 0.5);
}

.adventure-agent {
  position: absolute;
  left: var(--agent-x, 10%);
  top: var(--agent-y, 90%);
  z-index: 5;
  width: clamp(48px, 8vw, 74px);
  height: clamp(62px, 10vw, 96px);
  overflow: visible;
  transform: translate(-50%, -50%);
  transition: left 0.24s ease, top 0.24s ease;
}

.adventure-agent::after {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 2px;
  height: 10px;
  border-radius: 999px;
  background: rgba(6, 42, 47, 0.22);
  content: "";
  filter: blur(2px);
}

.adventure-agent img {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: 260px;
  max-width: none;
  transform: translateX(-64%);
  filter: drop-shadow(0 12px 16px rgba(6, 42, 47, 0.28));
}

.adventure-agent.is-walking {
  animation: walkBob 0.38s ease-in-out infinite;
}

.adventure-agent.is-bumped {
  animation: bumpShake 0.42s ease-in-out 2;
}

.byte-bubble {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: grid;
  gap: 2px;
  max-width: min(360px, calc(100% - 28px));
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.94);
  color: var(--ink);
  padding: 10px 12px;
  box-shadow: var(--soft-shadow);
}

.byte-bubble strong {
  color: var(--sea-dark);
}

.byte-bubble span {
  font-size: 13px;
  line-height: 1.35;
}

.byte-bubble.is-error {
  border-color: rgba(232, 111, 81, 0.48);
}

.byte-bubble.is-success {
  border-color: rgba(63, 143, 77, 0.52);
}

.scene-guide {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 8;
  display: flex;
  max-width: min(430px, calc(100% - 28px));
  align-items: flex-end;
  gap: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  filter: drop-shadow(0 18px 22px rgba(6, 42, 47, 0.22));
}

.guide-robot {
  position: relative;
  z-index: 2;
  display: block;
  width: clamp(78px, 10vw, 128px);
  height: clamp(122px, 16vw, 200px);
  overflow: visible;
  flex: 0 0 auto;
  transform-origin: center bottom;
  animation: robotFloat 2.6s ease-in-out infinite;
}

.guide-robot::before {
  position: absolute;
  inset: auto 15% 2px;
  height: 14px;
  border-radius: 999px;
  background: rgba(7, 38, 46, 0.2);
  content: "";
  filter: blur(3px);
}

.guide-robot::after {
  position: absolute;
  left: 50%;
  bottom: 23%;
  width: 28%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(47, 225, 210, 0.9), rgba(47, 225, 210, 0));
  content: "";
  animation: robotCore 1.2s ease-in-out infinite alternate;
}

.guide-robot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.guide-tooltip {
  position: relative;
  display: grid;
  min-width: min(290px, 54vw);
  max-width: 330px;
  gap: 3px;
  margin-left: -14px;
  margin-bottom: 18px;
  border: 3px solid rgba(255, 246, 201, 0.92);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 245, 0.98), rgba(255, 246, 220, 0.97)),
    #fffdf5;
  padding: 10px 12px;
  text-align: left;
  box-shadow:
    inset 0 -4px 0 rgba(133, 84, 11, 0.1),
    0 12px 24px rgba(6, 42, 47, 0.14);
}

.guide-tooltip::before {
  position: absolute;
  left: -13px;
  bottom: 26px;
  width: 20px;
  height: 20px;
  transform: rotate(45deg);
  border-left: 3px solid rgba(255, 246, 201, 0.92);
  border-bottom: 3px solid rgba(255, 246, 201, 0.92);
  background: #fff9e8;
  content: "";
}

.guide-tooltip strong {
  color: var(--sea-dark);
  font-size: 15px;
  line-height: 1;
}

.guide-tooltip span {
  color: #254448;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.guide-tooltip small {
  color: rgba(37, 68, 72, 0.62);
  font-size: 10px;
  font-weight: 850;
}

.scene-guide:hover .guide-robot,
.scene-guide:focus-visible .guide-robot,
.scene-guide.is-speaking .guide-robot {
  animation: robotTalk 0.62s ease-in-out infinite;
}

.scene-guide.is-error .guide-robot {
  animation: robotAlert 0.32s ease-in-out 3;
}

.scene-guide.is-success .guide-tooltip {
  border-color: rgba(47, 225, 210, 0.82);
  background:
    linear-gradient(180deg, rgba(240, 255, 251, 0.98), rgba(226, 255, 248, 0.97)),
    #effbf8;
}

.scene-guide.is-error .guide-tooltip {
  border-color: rgba(232, 111, 81, 0.74);
  background:
    linear-gradient(180deg, rgba(255, 248, 242, 0.98), rgba(255, 236, 226, 0.97)),
    #fff1eb;
}

.scene-guide.is-hint .guide-tooltip {
  border-color: rgba(242, 179, 61, 0.82);
}

.game-command-panel,
.tool-console,
.game-answer-grid,
.bridge-tool-grid {
  margin-top: 0;
}

.action-cards .mini-btn {
  min-width: 78px;
}

.temple-scene {
  display: grid;
  align-content: center;
  min-height: 430px;
  padding-top: 80px;
}

.temple-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.temple-roof,
.temple-gate {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #c66a3e, #f2b33d);
  box-shadow: 0 12px 0 rgba(9, 58, 71, 0.12);
}

.temple-roof {
  top: 72px;
  width: min(430px, 78%);
  height: 54px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.temple-gate {
  bottom: 34px;
  width: min(520px, 84%);
  height: 82px;
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0.18;
}

.temple-floor {
  position: relative;
  z-index: 2;
  width: min(92%, 560px);
  transform: perspective(900px) rotateX(50deg);
  transform-origin: center bottom;
  margin: 52px auto 26px;
}

.temple-tile {
  position: relative;
  min-height: 78px;
  cursor: pointer;
  border: 2px solid rgba(133, 84, 11, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent),
    #d7c79b;
  color: #3a3326;
  font-weight: 950;
  box-shadow: inset 0 -5px 0 rgba(133, 84, 11, 0.12);
}

.temple-tile.is-selected {
  border-color: rgba(242, 179, 61, 0.84);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 248, 190, 0.78), transparent 42%),
    linear-gradient(135deg, #f2d56b, #4bb79f);
  box-shadow:
    inset 0 -5px 0 rgba(133, 84, 11, 0.16),
    0 0 18px rgba(242, 179, 61, 0.3);
}

.temple-tile.is-void {
  cursor: not-allowed;
  border-color: rgba(21, 98, 113, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    #69c7c9;
  color: rgba(9, 56, 65, 0.64);
  box-shadow: inset 0 -5px 0 rgba(9, 83, 93, 0.16);
  opacity: 0.72;
}

.build-meter {
  position: relative;
  z-index: 3;
  width: min(78%, 480px);
  height: 30px;
  overflow: hidden;
  border: 2px solid rgba(255, 246, 201, 0.8);
  border-radius: 999px;
  background: rgba(10, 59, 71, 0.34);
  margin: 0 auto;
}

.build-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f2b33d, #2fe1d2);
  transition: width 0.22s ease;
}

.build-meter strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 13px;
  text-shadow: 0 2px 0 rgba(7, 38, 46, 0.4);
}

.cube-forge {
  min-height: 330px;
  background:
    radial-gradient(circle at 50% 62%, rgba(47, 225, 210, 0.25), transparent 16rem),
    linear-gradient(180deg, #d8f6f4, #f6eed7);
}

.forge-stage {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 250px;
  place-items: center;
  padding-top: 58px;
}

.blueprint-frame {
  position: relative;
  width: min(78%, 500px);
  height: 175px;
  border: 3px dashed rgba(9, 58, 71, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(47, 225, 210, 0.12)),
    rgba(255, 253, 245, 0.72);
  transform: perspective(700px) rotateX(58deg) rotateZ(-8deg);
  box-shadow: 0 26px 42px rgba(6, 42, 47, 0.16);
}

.blueprint-frame.is-full {
  border-color: rgba(63, 143, 77, 0.76);
  box-shadow:
    0 26px 42px rgba(6, 42, 47, 0.16),
    0 0 32px rgba(47, 225, 210, 0.36);
}

.stack-cube {
  position: absolute;
  width: 54px;
  height: 54px;
  transform: skewY(-18deg);
  border: 2px solid rgba(23, 49, 59, 0.18);
  border-radius: 6px;
  background: linear-gradient(135deg, #f2b33d, #e86f51);
  box-shadow: 10px 10px 0 rgba(8, 119, 125, 0.2);
  animation: cubeDrop 0.28s ease both;
}

.stack-cube:nth-child(1) { left: 18%; top: 48%; }
.stack-cube:nth-child(2) { left: 32%; top: 48%; }
.stack-cube:nth-child(3) { left: 46%; top: 48%; }
.stack-cube:nth-child(4) { left: 18%; top: 25%; }
.stack-cube:nth-child(5) { left: 32%; top: 25%; }
.stack-cube:nth-child(6) { left: 46%; top: 25%; }
.stack-cube:nth-child(7) { left: 26%; top: 38%; background: linear-gradient(135deg, #f6d16d, #21a8a4); }
.stack-cube:nth-child(8) { left: 40%; top: 38%; background: linear-gradient(135deg, #f6d16d, #21a8a4); }
.stack-cube:nth-child(9) { left: 54%; top: 38%; background: linear-gradient(135deg, #f6d16d, #21a8a4); }
.stack-cube:nth-child(10) { left: 26%; top: 15%; background: linear-gradient(135deg, #f6d16d, #21a8a4); }
.stack-cube:nth-child(11) { left: 40%; top: 15%; background: linear-gradient(135deg, #f6d16d, #21a8a4); }
.stack-cube:nth-child(12) { left: 54%; top: 15%; background: linear-gradient(135deg, #f6d16d, #21a8a4); }

.forge-counter,
.debug-progress {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  border: 2px solid rgba(255, 246, 201, 0.82);
  border-radius: 999px;
  background: rgba(12, 72, 75, 0.88);
  color: white;
  padding: 8px 13px;
  font-weight: 950;
}

.forge-board {
  max-width: 580px;
  margin-top: 14px;
}

.forge-slot {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(47, 225, 210, 0.12)),
    #edf5ee;
}

.forge-board.isometric {
  grid-template-columns: repeat(var(--cube-cols, 3), minmax(74px, 1fr));
  max-width: 580px;
}

.forge-board.front {
  grid-template-columns: repeat(var(--cube-cols, 3), minmax(86px, 1fr));
  max-width: 520px;
}

.forge-board.front .forge-slot {
  min-height: 62px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(47, 225, 210, 0.1)),
    #eef7f1;
}

.forge-board.front .forge-slot::before {
  width: 52px;
  height: 42px;
  transform: none;
  border-radius: 4px;
  box-shadow: none;
}

.forge-board.front .forge-slot.is-selected::before {
  box-shadow: 5px 0 0 rgba(8, 119, 125, 0.24);
}

.forge-board.top {
  grid-template-columns: repeat(var(--cube-cols, 6), minmax(54px, 1fr));
  max-width: 720px;
}

.forge-board.top .forge-slot {
  min-height: 64px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 246, 201, 0.24), transparent 48%),
    #edf5ee;
}

.forge-board.top .forge-slot::before {
  width: 44px;
  height: 44px;
  transform: rotate(45deg) skew(0deg);
  border-radius: 4px;
}

.forge-board.top .forge-slot.is-selected::before {
  box-shadow: 7px 7px 0 rgba(8, 119, 125, 0.2);
}

.bridge-repair {
  min-height: 380px;
  background:
    linear-gradient(180deg, #ccefeb 0%, #e7f8f5 52%, #2e9ab0 53%, #0c6f8a 100%);
}

.bridge-repair .bridge-visual {
  min-height: 300px;
  background: transparent;
}

.river-flow {
  position: absolute;
  inset: 52% 0 0;
  background:
    repeating-linear-gradient(-10deg, rgba(255, 255, 255, 0.24) 0 18px, transparent 18px 46px),
    linear-gradient(180deg, #29b9c4, #0a6f8a);
  animation: riverSlide 5s linear infinite;
}

.bridge-runner {
  position: absolute;
  left: 12%;
  bottom: 106px;
  z-index: 4;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid white;
  border-radius: 999px;
  background: linear-gradient(180deg, #e86f51, #9a3b27);
  color: white;
  font-weight: 950;
  box-shadow: var(--soft-shadow);
}

.bridge-runner.is-crossing {
  animation: crossBridge 1.8s ease-in-out infinite alternate;
}

.bridge-part.is-ghost {
  opacity: 0.25;
  filter: grayscale(0.75);
  border-style: dashed;
}

.bridge-part.is-selected {
  opacity: 1;
  animation: partSnap 0.28s ease both;
}

.bridge-tool-grid .check-card {
  display: grid;
  gap: 4px;
  text-align: center;
}

.boss-gate {
  min-height: 360px;
  background:
    radial-gradient(circle at 50% 45%, rgba(47, 225, 210, 0.28), transparent 13rem),
    linear-gradient(180deg, #143b46, #0d2632);
}

.gate-machine {
  position: relative;
  z-index: 2;
  width: min(68%, 420px);
  height: 250px;
  margin: 78px auto 36px;
  border: 5px solid rgba(255, 246, 201, 0.55);
  border-bottom-width: 12px;
  border-radius: 44% 44% 8px 8px;
  background:
    linear-gradient(90deg, rgba(47, 225, 210, 0.08), transparent 45%, rgba(47, 225, 210, 0.08)),
    #18515c;
  box-shadow:
    inset 0 0 30px rgba(47, 225, 210, 0.18),
    0 26px 52px rgba(0, 0, 0, 0.24);
}

.gate-door {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 34%;
  height: 58%;
  transform: translateX(-50%);
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #09242d, #06151b);
  box-shadow: inset 0 0 24px rgba(47, 225, 210, 0.18);
}

.boss-gate.is-open .gate-door {
  background: radial-gradient(circle, rgba(47, 225, 210, 0.9), rgba(9, 36, 45, 0.78));
  animation: gateGlow 0.9s ease-in-out infinite alternate;
}

.gate-core {
  position: absolute;
  top: 38%;
  display: block;
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: #6f7d7f;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.08);
}

.gate-core:nth-child(1) { left: 16%; }
.gate-core:nth-child(2) { left: calc(50% - 27px); }
.gate-core:nth-child(3) { right: 16%; }

.gate-machine.has-four .gate-core:nth-child(1) { left: 11%; }
.gate-machine.has-four .gate-core:nth-child(2) { left: 34%; }
.gate-machine.has-four .gate-core:nth-child(3) { right: 34%; }
.gate-machine.has-four .gate-core:nth-child(4) { right: 11%; }

.gate-core.is-fixed {
  background: radial-gradient(circle, #fff6a8, #2fe1d2);
  box-shadow: 0 0 28px rgba(47, 225, 210, 0.7);
}

.gate-core.is-error {
  background: radial-gradient(circle, #ffd8c6, #e86f51);
  animation: coreShake 0.28s ease-in-out 2;
}

.boss-grid {
  margin-top: 14px;
}

.dialogue-console {
  border: 2px solid rgba(255, 246, 201, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 253, 245, 0.98), rgba(238, 249, 246, 0.94));
  box-shadow:
    inset 0 -5px 0 rgba(133, 84, 11, 0.08),
    var(--soft-shadow);
}

.npc-line {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
}

.npc-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: linear-gradient(180deg, #2fe1d2, #0b737d);
  color: white;
  font-weight: 950;
  font-size: 12px;
  box-shadow: var(--soft-shadow);
}

.process-chip-row,
.ct-mini-log {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.process-chip-row span,
.ct-mini-log span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: rgba(255, 246, 201, 0.86);
  color: #6b4a13;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.dialogue-console .feedback {
  display: grid;
  gap: 4px;
  border-radius: var(--radius);
  border-left-width: 5px;
}

.hint-card {
  border-color: var(--amber);
  background: #fff8dd;
}

.mission-notes {
  display: grid;
  align-content: start;
  gap: 12px;
}

.feedback {
  border-left: 4px solid var(--sea);
  background: #effbf8;
  padding: 11px 12px;
  color: #254448;
  line-height: 1.5;
}

.feedback.is-error {
  border-color: var(--coral);
  background: #fff1eb;
}

.feedback.is-success {
  border-color: var(--leaf);
  background: #eef9ee;
}

.mission-game-stage {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.mission-game-frame {
  position: relative;
  display: grid;
  width: 100%;
  min-height: calc(100svh - clamp(20px, 3vw, 36px));
  gap: 12px;
  overflow: hidden;
  border: 4px solid rgba(255, 226, 126, 0.72);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 224, 104, 0.2), transparent 30rem),
    linear-gradient(180deg, rgba(16, 70, 76, 0.96), rgba(8, 31, 42, 0.98));
  padding: 158px 16px 16px;
  box-shadow:
    inset 0 0 0 3px rgba(67, 37, 9, 0.34),
    0 24px 60px rgba(0, 0, 0, 0.34);
}

.mission-title-center {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 18;
  display: grid;
  min-width: 320px;
  justify-items: center;
  transform: translateX(-50%);
  color: #fff6cf;
  text-align: center;
  text-shadow: 0 3px 0 rgba(42, 23, 6, 0.72), 0 12px 22px rgba(0, 0, 0, 0.35);
}

.mission-title-center span {
  color: #f6d36a;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.mission-title-center strong {
  font-family: Georgia, "Times New Roman", var(--game-font);
  font-size: clamp(32px, 3.9vw, 50px);
  font-weight: 1000;
  line-height: 0.98;
  -webkit-text-stroke: 1px #3a2109;
}

.mission-title-center small {
  display: none;
}

.mission-frame-hud {
  position: absolute;
  left: 50%;
  top: 104px;
  transform: translateX(-50%);
}

.mission-frame-actions {
  position: absolute;
  right: 14px;
  top: 96px;
  z-index: 20;
  display: flex;
  gap: 8px;
}

.mission-token-row {
  display: none;
}

.level-selector {
  position: relative;
  z-index: 12;
  display: flex;
  max-width: min(920px, 100%);
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 auto 2px;
}

.level-pill {
  display: grid;
  min-width: 188px;
  gap: 2px;
  border: 2px solid rgba(255, 226, 126, 0.52);
  border-radius: var(--radius);
  background: rgba(9, 44, 51, 0.74);
  color: #fff8d7;
  padding: 8px 12px;
  text-align: left;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.18);
}

.level-pill span {
  color: #f6d36a;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.level-pill strong {
  font-size: 14px;
  line-height: 1.15;
}

.level-pill small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 800;
}

.level-pill.is-active {
  border-color: rgba(255, 246, 201, 0.95);
  background: linear-gradient(180deg, rgba(67, 135, 74, 0.96), rgba(13, 97, 91, 0.94));
}

.level-pill.is-complete {
  border-color: rgba(119, 209, 142, 0.9);
}

.mission-game-stage .stage-grid {
  display: block;
}

.mission-game-stage .mission-notes {
  display: none;
}

.mission-game-stage .work-surface {
  border: 2px solid rgba(255, 226, 126, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 253, 245, 0.95), rgba(235, 246, 236, 0.92)),
    #fffdf5;
  box-shadow: inset 0 0 0 2px rgba(67, 37, 9, 0.1);
}

.mission-game-stage .game-scene {
  min-height: min(58svh, 560px);
  border: 3px solid rgba(255, 226, 126, 0.5);
  box-shadow:
    inset 0 0 44px rgba(13, 50, 52, 0.16),
    0 16px 26px rgba(7, 38, 46, 0.16);
}

.scene-status {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 7;
  display: flex;
  max-width: min(460px, 38%);
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  text-align: right;
}

.scene-status span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid rgba(255, 226, 126, 0.65);
  border-radius: 999px;
  background: rgba(7, 38, 46, 0.68);
  color: #fff6cf;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
}

.mission-game-stage .adventure-board {
  width: min(54%, 520px);
  margin: 86px auto 42px 7%;
}

.mission-game-stage .adventure-agent {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 3px solid white;
  border-radius: 999px;
  background: linear-gradient(180deg, #f09363, #a9432b);
  color: white;
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 0 10px 18px rgba(6, 42, 47, 0.24);
}

.mission-game-stage .adventure-agent::after {
  left: 16%;
  right: 16%;
  bottom: -6px;
  height: 7px;
}

.mission-game-stage .adventure-agent span {
  position: relative;
  z-index: 2;
}

.mission-game-stage .scene-guide {
  right: 24px;
  bottom: 22px;
  max-width: min(410px, 41%);
}

.mission-game-stage .guide-robot {
  width: clamp(118px, 12vw, 168px);
  height: clamp(178px, 18vw, 252px);
}

.mission-game-stage .guide-robot img {
  width: 100%;
}

.mission-game-stage .guide-tooltip {
  min-width: min(270px, 26vw);
  max-width: 310px;
}

.mission-game-stage .temple-floor {
  width: min(48%, 520px);
  margin-left: 16%;
  margin-right: auto;
}

.mission-game-stage .build-meter {
  width: min(48%, 480px);
  margin-left: 16%;
  margin-right: auto;
}

.mission-game-stage .blueprint-frame {
  width: min(46%, 500px);
  margin-left: -18%;
}

.mission-game-stage .gate-machine {
  margin-left: 17%;
  margin-right: auto;
}

.mission-game-stage .debug-progress {
  right: 31%;
}

.command-bank {
  display: grid;
  gap: 12px;
}

.command-list {
  display: flex;
  min-height: 50px;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px dashed rgba(23, 49, 59, 0.24);
  border-radius: var(--radius);
  background: #fbfaf2;
  padding: 10px;
}

.command-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: var(--radius);
  background: #17313b;
  color: white;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 850;
}

.grid-board {
  display: grid;
  width: min(100%, 430px);
  aspect-ratio: 1;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 auto 16px;
}

.grid-cell,
.tile-cell,
.cube-slot {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid rgba(23, 49, 59, 0.16);
  background: #f7f2db;
  color: var(--ink);
  font-weight: 900;
}

.grid-cell.is-obstacle {
  background: #795742;
  color: white;
}

.grid-cell.is-start {
  background: #dff7e5;
  color: var(--leaf-dark);
}

.grid-cell.is-target {
  background: #ffe8a7;
  color: #85540b;
}

.grid-cell.is-path {
  outline: 4px solid rgba(14, 165, 168, 0.24);
  background: #dff9f9;
}

.grid-cell.is-agent::after {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7);
  content: "";
}

.tile-board {
  display: grid;
  width: min(100%, 520px);
  grid-template-columns: repeat(var(--tile-cols, 4), 1fr);
  gap: 8px;
  margin: 0 auto 16px;
}

.tile-cell {
  min-height: 82px;
  cursor: pointer;
  background: #fff8d9;
}

.tile-cell.is-selected {
  background:
    linear-gradient(135deg, rgba(242, 179, 61, 0.35), rgba(14, 165, 168, 0.22)),
    #fff2ba;
  border-color: rgba(232, 111, 81, 0.5);
}

.formula-grid,
.debug-grid,
.decompose-grid {
  display: grid;
  gap: 10px;
}

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

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

.cube-board {
  display: grid;
  grid-template-columns: repeat(var(--cube-cols, 3), minmax(74px, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: 10px auto 18px;
}

.cube-slot {
  min-height: 78px;
  cursor: pointer;
  background: #edf5ee;
}

.cube-slot::before {
  width: 40px;
  height: 40px;
  transform: skewY(-18deg) rotate(0deg);
  border: 2px solid rgba(23, 49, 59, 0.26);
  background: rgba(255, 255, 255, 0.8);
  content: "";
}

.cube-slot.is-selected::before {
  background: linear-gradient(135deg, #f2b33d, #e86f51);
  border-color: rgba(23, 49, 59, 0.2);
  box-shadow: 8px 8px 0 rgba(8, 119, 125, 0.28);
}

.bridge-visual {
  display: grid;
  min-height: 230px;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(14, 165, 168, 0.18), rgba(255, 255, 255, 0.78)),
    #eefaf7;
}

.bridge-blocks {
  position: relative;
  width: min(540px, 100%);
  height: 190px;
}

.bridge-part {
  position: absolute;
  border: 2px solid rgba(23, 49, 59, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f5c25a, #d97d52);
  box-shadow: 10px 12px 0 rgba(8, 119, 125, 0.18);
}

.bridge-part.deck {
  left: 13%;
  bottom: 76px;
  width: 74%;
  height: 48px;
}

.bridge-part.tower {
  left: 42%;
  bottom: 28px;
  width: 16%;
  height: 94px;
  background: linear-gradient(135deg, #6fc17b, #0ea5a8);
}

.bridge-part.decoration {
  left: 24%;
  bottom: 128px;
  width: 52%;
  height: 28px;
  background: linear-gradient(135deg, #f8e5a2, #f2b33d);
}

.check-card,
.debug-card {
  border: 1px solid rgba(23, 49, 59, 0.13);
  border-radius: var(--radius);
  background: #fffdf5;
  padding: 12px;
}

.check-card.is-selected,
.debug-card.is-fixed {
  border-color: rgba(63, 143, 77, 0.52);
  background: #edf8ef;
}

.debug-card.is-error {
  border-color: rgba(232, 111, 81, 0.5);
  background: #fff2ed;
}

.completion-box {
  border: 1px solid rgba(63, 143, 77, 0.36);
  border-radius: var(--radius);
  background: #eef9ee;
  padding: 14px;
}

.mission-intro,
.success-burst {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(8, 55, 63, 0.34);
  pointer-events: none;
}

.mission-intro-card,
.success-card {
  display: grid;
  min-width: min(420px, calc(100vw - 40px));
  justify-items: center;
  gap: 8px;
  transform-origin: center;
  border: 3px solid rgba(255, 246, 201, 0.92);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, #0c5f67, #2f7d45);
  color: white;
  padding: 24px;
  text-align: center;
  text-shadow: 0 2px 0 rgba(7, 38, 46, 0.32);
  box-shadow:
    inset 0 -6px 0 rgba(5, 45, 46, 0.32),
    0 28px 70px rgba(6, 42, 47, 0.3);
  animation: introPop 1.2s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.success-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(135deg, #e86f51, #f2b33d);
  animation: successPop 1.6s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.intro-badge {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.mission-intro-card strong,
.success-card strong {
  font-size: clamp(28px, 5vw, 54px);
  line-height: 0.98;
}

.mission-intro-card small,
.success-card small {
  max-width: 380px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
}

.success-stars {
  color: #fff2a8;
  font-size: 36px;
  letter-spacing: 4px;
}

.admin-shell {
  min-height: 100svh;
  padding: clamp(16px, 3vw, 34px);
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background-image:
    linear-gradient(90deg, rgba(9, 58, 71, 0.88), rgba(9, 58, 71, 0.44)),
    url("assets/nusantara-map.png");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 34px);
}

.logo-admin .logo-main {
  font-size: clamp(36px, 5vw, 72px);
}

.logo-admin .logo-sub {
  font-size: clamp(19px, 2.8vw, 36px);
}

.admin-lead {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 17px;
  line-height: 1.55;
  text-shadow: 0 2px 14px rgba(7, 38, 46, 0.4);
}

.admin-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.admin-dashboard {
  background: rgba(255, 253, 245, 0.96);
}

.not-found-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(18px, 4vw, 42px);
}

.not-found-panel {
  display: grid;
  width: min(520px, 100%);
  justify-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.94);
  padding: clamp(24px, 5vw, 44px);
  text-align: center;
  box-shadow: var(--shadow);
}

.not-found-panel h1 {
  margin: 4px 0 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
}

.not-found-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.primary-link-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 246, 201, 0.84);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 44%),
    linear-gradient(135deg, var(--leaf), var(--sea-dark));
  color: white;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  box-shadow:
    inset 0 -4px 0 rgba(10, 69, 58, 0.28),
    0 12px 26px rgba(8, 119, 125, 0.25);
}

.session-filter {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 218, 0.9));
}

.compact-form {
  margin-top: 0;
}

.assessment-table {
  margin-top: 12px;
}

.dashboard {
  display: grid;
  gap: 16px;
  padding: clamp(14px, 2vw, 22px);
}

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

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

.metric {
  border: 1px solid rgba(23, 49, 59, 0.12);
  border-radius: var(--radius);
  background: white;
  padding: 12px;
}

.metric strong {
  display: block;
  font-size: 24px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

th,
td {
  border-bottom: 1px solid rgba(23, 49, 59, 0.12);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #31494a;
  font-size: 12px;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: var(--radius);
  background: #fff3d2;
  color: #85540b;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
}

.status-pill.is-complete {
  background: #e4f7e7;
  color: #24653b;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: 360px;
  transform: translateY(20px);
  border-radius: var(--radius);
  background: #17313b;
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

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

@keyframes sparkleDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.72;
  }
  50% {
    transform: translate3d(12px, -18px, 0) scale(1.12);
    opacity: 0.32;
  }
}

@keyframes introPop {
  0% {
    transform: translateY(16px) scale(0.82);
    opacity: 0;
  }
  18%,
  72% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-12px) scale(0.94);
    opacity: 0;
  }
}

@keyframes successPop {
  0% {
    transform: scale(0.72) rotate(-2deg);
    opacity: 0;
  }
  22%,
  78% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(1.06) rotate(1deg);
    opacity: 0;
  }
}

@keyframes walkBob {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-7px);
  }
}

@keyframes robotFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-7px) rotate(1deg);
  }
}

@keyframes robotCore {
  from {
    opacity: 0.45;
    transform: translateX(-50%) scale(0.84);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
  }
}

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

@keyframes robotAlert {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px) rotate(-4deg);
  }
  75% {
    transform: translateX(6px) rotate(4deg);
  }
}

@keyframes bumpShake {
  0%,
  100% {
    transform: translate(-50%, -50%) translateX(0);
  }
  25% {
    transform: translate(-50%, -50%) translateX(-8px);
  }
  75% {
    transform: translate(-50%, -50%) translateX(8px);
  }
}

@keyframes coreShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

@keyframes cubeDrop {
  0% {
    transform: translateY(-18px) skewY(-18deg);
    opacity: 0;
  }
  100% {
    transform: translateY(0) skewY(-18deg);
    opacity: 1;
  }
}

@keyframes riverSlide {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 120px 0, 0 0;
  }
}

@keyframes crossBridge {
  from {
    left: 12%;
  }
  to {
    left: 82%;
  }
}

@keyframes partSnap {
  0% {
    transform: translateY(-12px) scale(0.96);
    opacity: 0.35;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes gateGlow {
  from {
    box-shadow: inset 0 0 24px rgba(47, 225, 210, 0.3);
  }
  to {
    box-shadow:
      inset 0 0 42px rgba(47, 225, 210, 0.9),
      0 0 32px rgba(47, 225, 210, 0.58);
  }
}

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

  .home-title-center .logo-home .logo-main {
    font-size: clamp(50px, 9vw, 92px);
  }

  .home-frame-hud {
    top: 196px;
    width: min(760px, calc(100% - 28px));
    grid-template-columns: repeat(4, minmax(102px, 1fr));
  }

  .home-map-preview {
    inset: 272px 18px 136px 18px;
  }

  .home-character-dock {
    right: 2.5%;
    bottom: 66px;
    width: min(44vw, 360px);
    height: 430px;
  }

  .home-guide-bubble {
    right: 54%;
    width: min(300px, 44vw);
  }

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

  .student-chip {
    justify-content: flex-start;
  }

  .map-layout,
  .stage-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .frame-hud {
    width: min(760px, calc(100% - 28px));
    grid-template-columns: repeat(3, minmax(112px, 1fr));
  }

  .map-frame-hud,
  .mission-frame-hud {
    top: 132px;
  }

  .map-title-center .logo-map .logo-main {
    font-size: clamp(42px, 8vw, 82px);
  }

  .mission-game-frame {
    padding-top: 202px;
  }

  .mission-frame-actions {
    top: 14px;
    right: 14px;
  }

  .mission-game-stage .adventure-board,
  .mission-game-stage .temple-floor,
  .mission-game-stage .build-meter {
    width: min(78%, 560px);
    margin-left: auto;
    margin-right: auto;
  }

  .mission-game-stage .scene-guide {
    max-width: min(430px, calc(100% - 28px));
  }
}

@media (max-width: 760px) {
  .entry {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .welcome-screen {
    padding: 10px;
  }

  .welcome-copy {
    min-height: 52svh;
    padding: 24px;
    align-content: start;
  }

  .welcome-characters {
    right: 50%;
    width: min(94vw, 520px);
    transform: translate(calc(50% + var(--anim-x, 0px)), var(--anim-y, 0px));
  }

  .welcome-lead,
  .home-lead {
    font-size: 16px;
  }

  .entry-art,
  .entry-panel {
    min-height: 420px;
  }

  .entry-characters {
    right: -36px;
    width: min(72vw, 430px);
  }

  .home-game-frame {
    min-height: calc(100svh - 16px);
  }

  .home-title-center {
    position: relative;
    top: auto;
    left: auto;
    z-index: 18;
    margin: 12px auto 0;
    transform: none;
  }

  .home-title-center .logo-home .logo-main {
    font-size: clamp(44px, 16vw, 74px);
  }

  .home-title-center .logo-home .logo-sub {
    font-size: clamp(22px, 8vw, 42px);
  }

  .home-frame-hud {
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% - 20px);
    margin: 14px auto 10px;
    transform: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-map-preview {
    position: relative;
    inset: auto;
    width: calc(100% - 20px);
    height: 360px;
    margin: 12px auto 148px;
  }

  .home-character-dock {
    right: 50%;
    bottom: 72px;
    width: min(70vw, 320px);
    height: 330px;
    transform: translate(calc(50% + var(--anim-x, 0px)), var(--anim-y, 0px));
  }

  .home-guide-bubble {
    right: 50%;
    bottom: 69%;
    width: min(280px, 82vw);
    transform: translateX(50%);
  }

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

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

  .rail {
    position: sticky;
    top: 110px;
    z-index: 15;
    border-right: 0;
    border-bottom: 1px solid rgba(23, 49, 59, 0.13);
    padding: 8px;
  }

  .rail nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .icon-btn {
    min-height: 50px;
  }

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

  .audio-controls {
    width: min(100%, 230px);
  }

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

  .admin-actions {
    justify-items: start;
  }

  .mission-top,
  .answer-grid,
  .formula-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .map-board {
    min-height: 720px;
  }

  .map-header {
    right: 14px;
  }

  .map-characters {
    width: min(80vw, 400px);
  }

  .map-dialogue {
    left: 24px;
    right: 24px;
    bottom: 126px;
    max-width: none;
  }

  .map-dialogue.byte {
    left: 24px;
    right: 24px;
    bottom: 60px;
  }

  .node-btn {
    grid-template-columns: 32px minmax(92px, auto);
    padding: 6px;
  }

  .node-index {
    width: 32px;
    height: 32px;
  }

  .node-label {
    white-space: normal;
  }

  .game-content {
    padding: 8px;
  }

  .game-top-actions {
    position: relative;
    top: auto;
    left: auto;
    margin: 10px;
  }

  .game-session-chip {
    display: none;
  }

  .map-game-frame,
  .mission-game-frame {
    min-height: calc(100svh - 16px);
  }

  .map-title-center {
    top: 72px;
  }

  .map-frame-hud,
  .mission-frame-hud {
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% - 20px);
    margin: 78px auto 10px;
    transform: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-character-dock {
    right: 0;
    width: min(70vw, 360px);
    height: 430px;
  }

  .map-guide-bubble {
    right: 4%;
    bottom: 44%;
    max-width: 250px;
  }

  .mission-game-frame {
    padding: 12px;
  }

  .mission-title-center {
    position: relative;
    top: auto;
    left: auto;
    min-width: 0;
    margin: 6px auto 0;
    transform: none;
  }

  .mission-frame-actions {
    position: relative;
    top: auto;
    right: auto;
    justify-content: center;
  }

  .mission-game-stage .game-scene {
    min-height: 520px;
  }

  .scene-status {
    top: auto;
    right: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    text-align: left;
  }

  .mission-game-stage .scene-guide {
    right: 8px;
    bottom: 86px;
    max-width: calc(100% - 16px);
  }

  .mission-game-stage .guide-tooltip {
    min-width: min(230px, 58vw);
  }

  .game-scene {
    min-height: 430px;
  }

  .adventure-board {
    width: min(96%, 420px);
    margin-top: 70px;
  }

  .scene-guide {
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
  }

  .guide-tooltip {
    min-width: min(240px, 64vw);
    margin-left: -18px;
    padding: 9px 10px;
  }

  .guide-tooltip span {
    font-size: 12px;
  }

  .guide-tooltip small {
    display: none;
  }
}

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