* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: #101522;
  color: #f8f9ff;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

/* =========================
   GAME CANVAS
========================= */

#game {
  position: fixed;
  inset: 0;

  width: 100%;
  height: 100%;

  display: block;
}


/* =========================
   TOP BAR
========================= */

.topbar {
  position: fixed;

  z-index: 4;

  left: 0;
  right: 0;
  top: 0;

  height: 84px;

  padding: 14px 18px;

  display: flex;
  align-items: center;

  gap: 18px;

  background:
    linear-gradient(
      180deg,
      rgba(8, 12, 24, 0.94),
      rgba(8, 12, 24, 0.45),
      transparent
    );

  pointer-events: none;
}


/* =========================
   LOGO
========================= */

.logo {
  font-weight: 950;

  font-size: 25px;

  letter-spacing: 2px;

  text-shadow:
    0 3px 15px #000;

  white-space: nowrap;
}

.logo span {
  color: #ffd34f;
}

.logo small {
  display: block;

  margin-top: -2px;

  color: #9aa4bf;

  font-size: 9px;

  letter-spacing: 3px;
}


/* =========================
   TOP STAT BOXES
========================= */

.top-stats {
  display: flex;

  gap: 8px;

  flex: 1;

  flex-wrap: wrap;
}

.pill {
  min-width: 75px;

  padding: 6px 10px;

  background:
    rgba(13, 19, 37, 0.82);

  border:
    1px solid
    rgba(255, 255, 255, 0.1);

  border-radius: 12px;

  backdrop-filter: blur(8px);
}

.pill small {
  display: block;

  color: #8993b1;

  font-size: 8px;

  letter-spacing: 1.4px;
}

.pill strong {
  font-size: 18px;
}

.pill em {
  font-style: normal;

  font-size: 10px;

  color: #8d96b1;
}


/* =========================
   SOUND BUTTON
========================= */

.icon-btn {
  pointer-events: auto;

  width: 42px;
  height: 42px;

  background:
    rgba(13, 19, 37, 0.82);

  border:
    1px solid
    rgba(255, 255, 255, 0.1);

  border-radius: 12px;

  color: white;

  cursor: pointer;

  transition:
    transform 0.2s,
    background 0.2s;
}

.icon-btn:hover {
  transform: scale(1.08);

  background: #202b49;
}


/* =========================
   MAIN PROGRESS BAR
========================= */

.progress-wrap {
  position: fixed;

  z-index: 4;

  left: 18px;

  top: 91px;

  width: min(430px, 45vw);

  height: 7px;

  border-radius: 99px;

  background:
    rgba(255, 255, 255, 0.12);

  overflow: hidden;
}

#mainProgress {
  height: 100%;

  width: 0%;

  background:
    linear-gradient(
      90deg,
      #ffd34f,
      #8b6cff,
      #2ce3a4
    );

  box-shadow:
    0 0 18px #8b6cff;

  transition:
    width 0.5s ease;
}


/* =========================
   QUEST PANEL
========================= */

.quest-panel {
  position: fixed;

  z-index: 4;

  right: 18px;

  top: 96px;

  width: 285px;

  padding: 15px;

  background:
    rgba(10, 15, 29, 0.84);

  border:
    1px solid
    rgba(255, 255, 255, 0.11);

  border-radius: 17px;

  backdrop-filter: blur(10px);

  box-shadow:
    0 15px 50px
    rgba(0, 0, 0, 0.2);
}

.eyebrow {
  font-size: 9px;

  letter-spacing: 2px;

  color: #9ba5c0;
}

.quest-panel h3 {
  margin: 5px 0;

  font-size: 18px;
}

.quest-panel p {
  margin: 0;

  color: #b4bdd3;

  font-size: 12px;
}


/* =========================
   QUEST PROGRESS
========================= */

.quest-progress {
  height: 5px;

  margin-top: 12px;

  background: #252c42;

  border-radius: 99px;

  overflow: hidden;
}

.quest-progress i {
  display: block;

  width: 0%;

  height: 100%;

  background: #ffd34f;

  transition:
    width 0.3s ease;
}


/* =========================
   WORLD TITLE
========================= */

.world-label {
  position: fixed;

  z-index: 2;

  left: 50%;

  top: 104px;

  transform:
    translateX(-50%);

  font-weight: 900;

  letter-spacing: 4px;

  font-size: 11px;

  color:
    rgba(255, 255, 255, 0.45);

  pointer-events: none;
}


/* =========================
   BOTTOM HUD
========================= */

.bottom-hud {
  position: fixed;

  z-index: 4;

  left: 0;
  right: 0;
  bottom: 0;

  padding:
    14px
    18px
    18px;

  background:
    linear-gradient(
      0deg,
      rgba(7, 10, 20, 0.96),
      rgba(7, 10, 20, 0.55),
      transparent
    );

  display: flex;

  align-items: end;

  justify-content: space-between;

  gap: 12px;
}


/* =========================
   CONTROL HINT
========================= */

.hint {
  font-size: 11px;

  color: #9da7c0;
}

.hint b {
  color: #ffffff;
}


/* =========================
   ACTION BUTTONS
========================= */

.actions {
  display: flex;

  gap: 8px;

  flex-wrap: wrap;

  justify-content: flex-end;
}

.actions button {
  padding:
    11px
    14px;

  border-radius: 12px;

  background: #182039;

  border:
    1px solid
    rgba(255, 255, 255, 0.1);

  color: white;

  font-weight: 800;

  cursor: pointer;

  box-shadow:
    0 7px 25px
    rgba(0, 0, 0, 0.22);

  transition:
    transform 0.18s,
    background 0.18s;
}

.actions button:hover {
  transform: translateY(-2px);

  background: #232e4e;
}

.actions button:active {
  transform: translateY(1px);
}


/* =========================
   MAIN SALE BUTTON
========================= */

.actions .primary {
  background:
    linear-gradient(
      135deg,
      #7b5cff,
      #5034d1
    );

  box-shadow:
    0 8px 30px
    rgba(105, 75, 255, 0.3);
}

.actions .primary:hover {
  background:
    linear-gradient(
      135deg,
      #8c72ff,
      #6143e5
    );
}


/* =========================
   TOAST MESSAGE
========================= */

.toast {
  position: fixed;

  z-index: 9;

  left: 50%;

  top: 24%;

  transform:
    translate(-50%, -20px);

  opacity: 0;

  pointer-events: none;

  background: #0b1121;

  border:
    1px solid
    rgba(255, 255, 255, 0.15);

  border-radius: 14px;

  padding:
    12px
    18px;

  font-weight: 850;

  box-shadow:
    0 20px 60px
    #000;

  transition:
    0.3s ease;
}

.toast.show {
  opacity: 1;

  transform:
    translate(-50%, 0);
}


/* =========================
   MODAL
========================= */

.modal {
  position: fixed;

  z-index: 20;

  inset: 0;

  display: grid;

  place-items: center;

  background:
    rgba(0, 0, 0, 0.62);

  backdrop-filter:
    blur(7px);
}

.hidden {
  display: none;
}


/* =========================
   MODAL CARD
========================= */

.modal-card {
  position: relative;

  width: min(590px, 92vw);

  max-height: 85vh;

  overflow: auto;

  padding: 26px;

  background: #0d1426;

  border:
    1px solid
    rgba(255, 255, 255, 0.13);

  border-radius: 24px;

  box-shadow:
    0 35px 100px
    #000;
}

.modal-card h2 {
  margin:
    0 0 8px;
}

.modal-card p {
  color: #aeb7cf;
}


/* =========================
   CLOSE BUTTON
========================= */

.x {
  position: absolute;

  right: 13px;

  top: 10px;

  background: transparent;

  color: #9ca7c1;

  font-size: 28px;

  cursor: pointer;

  padding: 3px 9px;
}

.x:hover {
  color: white;
}


/* =========================
   LESSON TEXTAREA
========================= */

.modal-card textarea {
  width: 100%;

  height: 140px;

  padding: 13px;

  resize: vertical;

  background: #080d1b;

  border:
    1px solid
    #29334e;

  border-radius: 13px;

  color: white;

  font-family: inherit;

  font-size: 14px;

  outline: none;
}

.modal-card textarea:focus {
  border-color: #7b5cff;

  box-shadow:
    0 0 0 3px
    rgba(123, 92, 255, 0.12);
}


/* =========================
   MODAL FULL BUTTON
========================= */

.modal-card .full {
  width: 100%;

  margin-top: 12px;

  padding: 12px;

  border-radius: 12px;

  background: #795cff;

  color: white;

  font-weight: 900;

  cursor: pointer;
}

.modal-card .full:hover {
  background: #8b72ff;
}


/* =========================
   STATS GRID
========================= */

.grid {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 10px;

  margin-top: 15px;
}

.metric {
  padding: 14px;

  border-radius: 14px;

  background: #151d33;
}

.metric small {
  display: block;

  color: #8f99b6;

  font-size: 10px;

  letter-spacing: 1px;
}

.metric b {
  font-size: 24px;
}


/* =========================
   LESSON LIST
========================= */

.lesson-row {
  padding: 12px 0;

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.08);

  line-height: 1.5;
}

.lesson-row b {
  color: #ffd34f;
}

.empty {
  padding: 30px;

  text-align: center;

  color: #8993af;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 760px) {

  .topbar {
    height: auto;

    align-items: flex-start;
  }

  .logo {
    font-size: 20px;
  }

  .top-stats {
    max-width: 240px;
  }

  .pill {
    min-width: 64px;
  }

  .quest-panel {
    top: 148px;

    left: 12px;
    right: 12px;

    width: auto;
  }

  .world-label {
    top: 310px;
  }

  .bottom-hud {
    display: block;
  }

  .hint {
    text-align: center;

    margin-bottom: 8px;
  }

  .actions {
    justify-content: center;
  }

  .actions button {
    padding:
      10px
      9px;

    font-size: 11px;
  }

  .progress-wrap {
    top: 105px;

    width:
      calc(100% - 36px);
  }
}


/* =========================
   VERY SMALL SCREENS
========================= */

@media (max-width: 430px) {

  .topbar {
    padding: 10px;
  }

  .logo {
    font-size: 17px;
  }

  .pill {
    min-width: 58px;

    padding:
      5px
      7px;
  }

  .pill strong {
    font-size: 15px;
  }

  .quest-panel {
    padding: 12px;
  }

  .actions button {
    font-size: 10px;

    padding:
      9px
      7px;
  }

}
