:root {

  --bg: #f7f5ff;
  --surface: #ffffff;
  --surface-soft: #f2efff;

  --purple: #8974dc;
  --purple-dark: #6652b8;
  --purple-light: #e9e3ff;

  --pink: #efa7c9;
  --blue: #a9c9ed;
  --yellow: #f5d98a;

  --text: #302b40;
  --muted: #89839a;

  --border: #ebe7f4;

  --shadow:
    0 20px 60px rgba(76, 61, 125, .09);

  --radius: 24px;
}


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


body {

  min-height: 100vh;

  background:
    radial-gradient(
      circle at 10% 10%,
      rgba(217, 205, 255, .45),
      transparent 27%
    ),

    radial-gradient(
      circle at 90% 20%,
      rgba(255, 220, 238, .4),
      transparent 25%
    ),

    var(--bg);

  color: var(--text);

  font-family: "DM Sans", sans-serif;

  overflow-x: hidden;
}


button {
  border: none;
  font: inherit;
  cursor: pointer;
}


button:active {
  transform: scale(.97);
}


/* =========================
   BACKGROUND
========================= */

.stars {

  position: fixed;
  inset: 0;

  pointer-events: none;

  opacity: .25;

  background-image:
    radial-gradient(circle, #9a8cd5 1px, transparent 1px);

  background-size: 42px 42px;
}


.moon {

  position: fixed;

  width: 220px;
  height: 220px;

  right: -70px;
  top: 90px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle at 35% 35%,
      #fff9dd,
      #e9dbff 65%,
      transparent 66%
    );

  opacity: .25;

  pointer-events: none;
}


/* =========================
   TOPBAR
========================= */

.topbar {

  height: 78px;

  padding: 0 30px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  position: sticky;
  top: 0;
  z-index: 100;

  background: rgba(255,255,255,.82);

  backdrop-filter: blur(18px);

  border-bottom: 1px solid var(--border);
}


.logo {

  display: flex;
  align-items: center;

  gap: 12px;
}


.logo-symbol {

  width: 45px;
  height: 45px;

  display: grid;
  place-items: center;

  border-radius: 16px;

  color: white;

  background:
    linear-gradient(
      135deg,
      #8e7be0,
      #b99cec
    );

  font-size: 22px;

  box-shadow:
    0 8px 22px rgba(120,95,210,.22);
}


.logo h1 {

  font-family: "Fredoka", sans-serif;

  font-size: 21px;

  font-weight: 600;
}


.logo p {

  margin-top: -2px;

  color: var(--muted);

  font-size: 10px;
}


.top-info {

  display: flex;
  align-items: center;

  gap: 9px;
}


.resource {

  height: 40px;
  min-width: 70px;

  padding: 0 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  border: 1px solid var(--border);

  border-radius: 13px;

  background: white;

  font-size: 12px;
}


.save-button {

  width: 40px;
  height: 40px;

  border-radius: 13px;

  background: white;

  border: 1px solid var(--border);

  transition: .2s;
}


.save-button:hover {

  background: var(--purple-light);

}


/* =========================
   APP
========================= */

.app {

  max-width: 1450px;

  margin: auto;

  padding: 25px;

  display: grid;

  grid-template-columns: 240px 1fr;

  gap: 25px;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {

  display: flex;

  flex-direction: column;

  gap: 14px;
}


.character-card,
.stats-card,
.side-nav,
.day-card {

  background: rgba(255,255,255,.9);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);
}


.character-card {

  padding: 17px;

  display: flex;

  align-items: center;

  gap: 11px;
}


.character-avatar {

  width: 55px;
  height: 55px;

  display: grid;
  place-items: center;

  border-radius: 18px;

  background: var(--purple-light);

  font-size: 28px;
}


.character-info span,
.character-info small {

  display: block;

  color: var(--muted);

  font-size: 10px;
}


.character-info h2 {

  margin: 2px 0;

  font-family: "Fredoka", sans-serif;

  font-size: 17px;
}


/* STATS */

.stats-card {

  padding: 16px;
}


.stat-line {

  display: flex;

  align-items: center;
  justify-content: space-between;

  margin-bottom: 6px;

  font-size: 10px;
}


.stat-line strong {

  font-size: 11px;
}


.progress {

  height: 7px;

  margin-bottom: 13px;

  overflow: hidden;

  background: #eeeaf7;

  border-radius: 99px;
}


.progress div {

  height: 100%;

  width: 0;

  border-radius: inherit;

  transition: width .5s ease;
}


#happinessBar {

  background: linear-gradient(
    90deg,
    #ef9fc4,
    #f6bdd8
  );
}


#energyBar {

  background: linear-gradient(
    90deg,
    #8bbce7,
    #b6d8f3
  );
}


#xpBar {

  background: linear-gradient(
    90deg,
    #8b78db,
    #b9a6f0
  );
}


/* NAV */

.side-nav {

  padding: 8px;
}


.nav-button {

  width: 100%;

  padding: 11px 13px;

  display: flex;
  align-items: center;

  gap: 10px;

  color: var(--muted);

  background: transparent;

  border-radius: 14px;

  text-align: left;

  font-size: 11px;

  transition: .2s;
}


.nav-button:hover,
.nav-button.active {

  background: var(--purple-light);

  color: var(--purple-dark);

  font-weight: 700;
}


.nav-button span {

  width: 24px;

  text-align: center;

  font-size: 16px;
}


/* DAY */

.day-card {

  padding: 15px;
}


.day-card strong,
.day-card span:last-child {

  display: block;
}


.day-card strong {

  margin-top: 4px;

  font-family: "Fredoka", sans-serif;

  font-size: 16px;
}


.day-card span:last-child {

  color: var(--muted);

  font-size: 10px;
}


/* =========================
   CONTENT
========================= */

.content {

  min-width: 0;
}


.page {

  display: none;

  animation: pageIn .3s ease;
}


.page.active {

  display: block;
}


@keyframes pageIn {

  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }

}


.eyebrow {

  color: var(--purple);

  font-size: 9px;

  font-weight: 700;

  letter-spacing: 1.7px;
}


/* =========================
   WELCOME
========================= */

.welcome {

  min-height: 140px;

  padding: 25px;

  display: flex;

  align-items: center;
  justify-content: space-between;

  border-radius: 28px;

  background:
    linear-gradient(
      120deg,
      #eee9ff,
      #faf7ff 55%,
      #fff2f8
    );

  border: 1px solid var(--border);
}


.welcome h2 {

  margin-top: 7px;

  font-family: "Playfair Display", serif;

  font-size: 30px;

  font-weight: 600;
}


.welcome p {

  margin-top: 5px;

  color: var(--muted);

  font-size: 11px;
}


.weather {

  width: 75px;
  height: 75px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: rgba(255,255,255,.7);

  font-size: 39px;

  box-shadow: 0 12px 30px rgba(100,80,150,.08);
}


/* =========================
   STORY
========================= */

.story-card {

  margin-top: 16px;

  padding: 25px;

  position: relative;

  overflow: hidden;

  border-radius: 27px;

  background: #302b40;

  color: white;

  box-shadow:
    0 20px 55px rgba(48,43,64,.2);
}


.story-decoration {

  position: absolute;

  right: 30px;
  top: 17px;

  color: #bca8fa;

  font-size: 65px;

  opacity: .12;
}


.story-card .eyebrow {

  color: #b9a7f2;
}


.story-card h2 {

  margin-top: 7px;

  font-family: "Playfair Display", serif;

  font-size: 24px;
}


.story-card > p {

  max-width: 700px;

  margin-top: 8px;

  color: #c5c0d0;

  font-size: 12px;

  line-height: 1.7;
}


.choice-list {

  margin-top: 18px;

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 10px;
}


.choice-button {

  padding: 13px;

  display: flex;

  align-items: center;

  gap: 11px;

  text-align: left;

  border: 1px solid rgba(255,255,255,.12);

  background: rgba(255,255,255,.07);

  color: white;

  border-radius: 15px;

  transition: .2s;
}


.choice-button:hover {

  background: rgba(255,255,255,.13);

  transform: translateY(-2px);
}


.choice-button > span {

  font-size: 20px;
}


.choice-button strong,
.choice-button small {

  display: block;
}


.choice-button strong {

  font-size: 11px;
}


.choice-button small {

  margin-top: 2px;

  color: #aaa5b7;

  font-size: 9px;
}


/* =========================
   ACTIONS
========================= */

.section-heading {

  margin-top: 23px;

  margin-bottom: 11px;
}


.section-heading h3 {

  margin-top: 3px;

  font-family: "Fredoka", sans-serif;

  font-size: 18px;
}


.action-grid {

  display: grid;

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

  gap: 10px;
}


.action-card {

  min-height: 82px;

  padding: 13px;

  display: grid;

  grid-template-columns: 45px 1fr auto;

  align-items: center;

  gap: 10px;

  text-align: left;

  background: white;

  border: 1px solid var(--border);

  border-radius: 18px;

  box-shadow: 0 10px 30px rgba(70,60,100,.04);

  transition: .2s;
}


.action-card:hover {

  transform: translateY(-3px);

  border-color: #cfc5f5;
}


.action-icon {

  width: 43px;
  height: 43px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  background: var(--surface-soft);

  font-size: 22px;
}


.action-card strong,
.action-card span {

  display: block;
}


.action-card strong {

  font-size: 12px;
}


.action-card span {

  margin-top: 3px;

  color: var(--muted);

  font-size: 9px;
}


.action-card b {

  color: var(--purple);

  font-size: 11px;
}


/* QUEST */

.quest-preview {

  margin-top: 15px;

  padding: 16px;

  display: grid;

  grid-template-columns: 45px 1fr auto;

  align-items: center;

  gap: 11px;

  background: rgba(255,255,255,.85);

  border: 1px solid var(--border);

  border-radius: 18px;
}


.quest-icon {

  width: 43px;
  height: 43px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  background: #fff6d9;

  font-size: 21px;
}


.quest-preview h3 {

  margin-top: 2px;

  font-family: "Fredoka", sans-serif;

  font-size: 13px;
}


.quest-preview p {

  color: var(--muted);

  font-size: 9px;
}


.quest-preview > strong {

  color: var(--purple);

  font-size: 10px;
}


.quest-progress {

  height: 6px;

  max-width: 350px;

  margin-top: 7px;

  background: #eeeaf7;

  border-radius: 99px;

  overflow: hidden;
}


.quest-progress div {

  width: 0;
  height: 100%;

  background: var(--purple);

  transition: .4s;
}


/* =========================
   PAGE HEADING
========================= */

.page-heading {

  padding: 10px 0 22px;
}


.page-heading h2 {

  margin-top: 5px;

  font-family: "Playfair Display", serif;

  font-size: 29px;
}


.page-heading p {

  margin-top: 5px;

  color: var(--muted);

  font-size: 11px;
}


/* =========================
   EXPLORE
========================= */

.location-grid {

  display: grid;

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

  gap: 14px;
}


.location-card {

  overflow: hidden;

  background: white;

  border: 1px solid var(--border);

  border-radius: 23px;

  text-align: left;

  box-shadow: var(--shadow);

  transition: .25s;
}


.location-card:not(.locked):hover {

  transform: translateY(-5px);

  box-shadow:
    0 25px 60px rgba(70,60,110,.13);
}


.location-image {

  height: 160px;

  display: grid;

  place-items: center;

  position: relative;

  font-size: 57px;
}


.cafe-bg {

  background:
    linear-gradient(
      135deg,
      #f4dfcf,
      #ead6ef
    );
}


.forest-bg {

  background:
    linear-gradient(
      135deg,
      #cfe8d0,
      #b4d5ca
    );
}


.academy-bg {

  background:
    linear-gradient(
      135deg,
      #d8d1f3,
      #bfc9ec
    );
}


.beach-bg {

  background:
    linear-gradient(
      135deg,
      #c9eafa,
      #f4dfad
    );
}


.lock {

  position: absolute;

  inset: 0;

  display: grid;

  place-items: center;

  background: rgba(50,45,70,.25);

  backdrop-filter: blur(2px);

  font-size: 25px;
}


.location-info {

  padding: 17px;
}


.location-info > span {

  color: var(--purple);

  font-size: 9px;

  font-weight: 700;
}


.location-info h3 {

  margin-top: 3px;

  font-family: "Fredoka", sans-serif;

  font-size: 18px;
}


.location-info p {

  margin-top: 4px;

  color: var(--muted);

  font-size: 10px;

  line-height: 1.5;
}


.location-info b {

  display: block;

  margin-top: 12px;

  color: var(--purple);

  font-size: 10px;
}


/* =========================
   FRIENDS
========================= */

.friends-grid {

  display: grid;

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

  gap: 13px;
}


.friend-card {

  padding: 18px;

  display: flex;

  gap: 13px;

  background: white;

  border: 1px solid var(--border);

  border-radius: 22px;

  box-shadow: var(--shadow);
}


.friend-avatar {

  flex: 0 0 65px;

  height: 65px;

  display: grid;

  place-items: center;

  border-radius: 21px;

  font-size: 32px;
}


.aeri {

  background: #e9e1ff;
}


.leo {

  background: #fff0bf;
}


.mira {

  background: #ffe1ed;
}


.kael {

  background: #dedde8;
}


.friend-info {

  flex: 1;
}


.friend-name {

  display: flex;

  justify-content: space-between;

  gap: 10px;
}


.friend-name h3 {

  font-family: "Fredoka", sans-serif;

  font-size: 16px;
}


.friend-name span {

  display: block;

  margin-top: 2px;

  color: var(--muted);

  font-size: 8px;
}


.friend-name b {

  font-size: 14px;
}


.friend-bar {

  height: 6px;

  margin-top: 12px;

  background: #eeeaf5;

  border-radius: 99px;

  overflow: hidden;
}


.friend-bar div {

  width: 0;

  height: 100%;

  background: var(--purple);

  transition: .4s;
}


.friend-info > p {

  margin-top: 4px;

  color: var(--muted);

  font-size: 8px;
}


.talk-button {

  margin-top: 9px;

  padding: 7px 11px;

  color: var(--purple-dark);

  background: var(--purple-light);

  border-radius: 9px;

  font-size: 9px;
}


/* =========================
   JOURNAL
========================= */

.journal {

  display: flex;

  flex-direction: column;

  gap: 10px;
}


.journal-entry {

  padding: 17px;

  display: flex;

  gap: 14px;

  background: white;

  border: 1px solid var(--border);

  border-radius: 18px;

  box-shadow: var(--shadow);
}


.journal-date {

  min-width: 55px;

  text-align: center;
}


.journal-date strong {

  display: block;

  font-family: "Fredoka", sans-serif;

  font-size: 17px;
}


.journal-date span {

  color: var(--muted);

  font-size: 8px;
}


.journal-content {

  padding-left: 13px;

  border-left: 1px solid var(--border);
}


.journal-content h3 {

  font-family: "Fredoka", sans-serif;

  font-size: 13px;
}


.journal-content p {

  margin-top: 4px;

  color: var(--muted);

  font-size: 10px;

  line-height: 1.6;
}


/* =========================
   ACHIEVEMENTS
========================= */

.achievement-grid {

  display: grid;

  grid-template-columns:
    repeat(3, minmax(0,1fr));

  gap: 12px;
}


.achievement {

  padding: 18px;

  background: white;

  border: 1px solid var(--border);

  border-radius: 20px;

  box-shadow: var(--shadow);

  text-align: center;

  transition: .2s;
}


.achievement.unlocked {

  border-color: #d7cef9;

  background:
    linear-gradient(
      145deg,
      #fff,
      #f8f5ff
    );
}


.achievement-icon {

  width: 54px;
  height: 54px;

  margin: auto;

  display: grid;
  place-items: center;

  border-radius: 17px;

  background: #eeeaf8;

  font-size: 25px;

  filter: grayscale(1);

  opacity: .55;
}


.achievement.unlocked
.achievement-icon {

  filter: none;

  opacity: 1;

  background: var(--purple-light);
}


.achievement h3 {

  margin-top: 9px;

  font-family: "Fredoka", sans-serif;

  font-size: 13px;
}


.achievement p {

  margin-top: 4px;

  color: var(--muted);

  font-size: 9px;

  line-height: 1.5;
}


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

.modal-overlay {

  position: fixed;

  inset: 0;

  z-index: 300;

  display: none;

  align-items: center;

  justify-content: center;

  padding: 20px;

  background: rgba(40,35,60,.35);

  backdrop-filter: blur(8px);
}


.modal-overlay.show {

  display: flex;
}


.dialogue-modal {

  width: min(460px,100%);

  padding: 30px;

  position: relative;

  text-align: center;

  background: white;

  border-radius: 28px;

  box-shadow:
    0 30px 80px rgba(50,40,80,.2);

  animation: modalIn .25s ease;
}


@keyframes modalIn {

  from {

    opacity: 0;

    transform: translateY(15px) scale(.97);

  }

  to {

    opacity: 1;

    transform: translateY(0) scale(1);

  }

}


.modal-close {

  position: absolute;

  right: 17px;
  top: 15px;

  width: 34px;
  height: 34px;

  border-radius: 50%;

  background: #f5f2fb;

  color: var(--muted);

  font-size: 20px;
}


.dialogue-character {

  width: 75px;
  height: 75px;

  margin: 0 auto 13px;

  display: grid;

  place-items: center;

  border-radius: 25px;

  background: var(--purple-light);

  font-size: 40px;
}


.dialogue-modal h2 {

  margin-top: 6px;

  font-family: "Playfair Display", serif;

  font-size: 22px;
}


.dialogue-modal p {

  margin-top: 10px;

  color: var(--muted);

  font-size: 11px;

  line-height: 1.8;
}


.primary-button {

  margin-top: 20px;

  padding: 11px 20px;

  background: var(--purple);

  color: white;

  border-radius: 12px;

  font-size: 10px;

  box-shadow:
    0 8px 20px rgba(120,95,210,.2);
}


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

.toast {

  position: fixed;

  left: 50%;
  bottom: 30px;

  z-index: 500;

  padding: 12px 17px;

  display: flex;

  align-items: center;

  gap: 8px;

  color: white;

  background: rgba(47,43,60,.95);

  border-radius: 14px;

  font-size: 10px;

  opacity: 0;

  pointer-events: none;

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

  transition: .3s;
}


.toast.show {

  opacity: 1;

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


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

.mobile-nav {

  display: none;
}


@media (max-width: 1000px) {

  .app {

    grid-template-columns: 190px 1fr;

  }

  .achievement-grid {

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

  }

}


@media (max-width: 780px) {

  .topbar {

    height: 70px;

    padding: 0 14px;

  }

  .logo-symbol {

    width: 40px;
    height: 40px;

  }

  .logo h1 {

    font-size: 18px;

  }

  .app {

    display: block;

    padding: 14px;

    padding-bottom: 90px;

  }

  .sidebar {

    display: none;

  }

  .mobile-nav {

    position: fixed;

    left: 8px;
    right: 8px;
    bottom: 8px;

    z-index: 200;

    height: 65px;

    display: grid;

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

    background: rgba(255,255,255,.94);

    backdrop-filter: blur(18px);

    border: 1px solid var(--border);

    border-radius: 21px;

    box-shadow:
      0 15px 45px rgba(60,50,100,.16);

  }

  .mobile-nav button {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 3px;

    background: transparent;

    color: var(--muted);

    font-size: 17px;

  }

  .mobile-nav button span {

    font-size: 7px;

  }

  .mobile-nav button.active {

    color: var(--purple);

    font-weight: 700;

  }

}


@media (max-width: 560px) {

  .resource {

    min-width: 42px;

    width: 42px;

    padding: 0;

  }

  .resource span {

    display: none;

  }

  .welcome {

    padding: 20px;

  }

  .welcome h2 {

    font-size: 24px;

  }

  .weather {

    width: 55px;
    height: 55px;

    font-size: 27px;

  }

  .choice-list {

    grid-template-columns: 1fr;

  }

  .action-grid {

    grid-template-columns: 1fr;

  }

  .location-grid,
  .friends-grid {

    grid-template-columns: 1fr;

  }

  .achievement-grid {

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

  }

  .achievement {

    padding: 13px 8px;

  }

  .achievement-icon {

    width: 45px;
    height: 45px;

  }

}
