* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --background: #f5f8fc;
  --white: #ffffff;
  --soft: #edf2f7;

  --text: #172033;
  --muted: #758195;
  --border: #dce4ed;

  --accent: #4263eb;
  --red: #ff4d4f;
  --blue: #4285f4;
  --green: #32b978;
  --yellow: #f5b82e;
}

body {
  min-height: 100vh;

  background:
    radial-gradient(
      circle at 50% 0%,
      #ffffff 0%,
      var(--background) 65%
    );

  color: var(--text);

  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  overflow-x: hidden;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  height: 72px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 5vw;

  background: rgba(255,255,255,.9);

  border-bottom: 1px solid var(--border);

  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;

  gap: 10px;

  font-weight: 900;
  letter-spacing: .16em;
}

.logo-dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;

  background: var(--accent);
}

.header-stats {
  display: flex;
  gap: 25px;
}

.header-stats div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.header-stats small {
  font-size: .6rem;
  color: var(--muted);
  letter-spacing: .12em;
}

.header-stats b {
  font-size: .95rem;
}

main {
  min-height: calc(100vh - 72px);
}

.page {
  display: none;

  min-height: calc(100vh - 72px);
}

.page.active {
  display: flex;
}

/* HOME */

#home {
  align-items: center;
  justify-content: center;

  padding: 30px;
}

.home-card {
  width: min(700px, 94vw);

  text-align: center;
}

.version {
  display: inline-block;

  padding: 7px 13px;

  background: var(--soft);

  border: 1px solid var(--border);

  border-radius: 999px;

  color: var(--accent);

  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.home-card h1 {
  margin-top: 24px;

  font-size: clamp(
    2.5rem,
    7vw,
    5.5rem
  );

  line-height: .98;

  letter-spacing: -.055em;
}

.home-card p {
  max-width: 560px;

  margin: 25px auto;

  color: var(--muted);

  line-height: 1.7;
}

.primary {
  padding: 15px 42px;

  border: 0;
  border-radius: 12px;

  background: var(--accent);
  color: white;

  font-weight: 900;

  letter-spacing: .08em;

  box-shadow:
    0 12px 28px rgba(66,99,235,.2);
}

.primary:hover {
  transform: translateY(-2px);
}

.home-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;

  gap: 10px;

  margin-top: 14px;
}

.secondary {
  padding: 11px 17px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: white;

  color: var(--text);

  font-weight: 700;
}

.secondary:hover {
  background: var(--soft);
}

/* GAME */

#game {
  position: relative;

  flex-direction: column;
}

.game-info {
  height: 68px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 5vw;

  background: white;

  border-bottom: 1px solid var(--border);
}

.game-info div:not(#hearts) {
  display: flex;
  flex-direction: column;
}

.game-info small {
  color: var(--muted);

  font-size: .58rem;

  letter-spacing: .12em;
}

.game-info strong {
  font-size: 1rem;
}

#hearts {
  letter-spacing: 3px;
}

#arena {
  position: relative;

  width: min(900px, 92vw);

  height: min(
    650px,
    66vh
  );

  margin: auto;

  overflow: hidden;

  background:
    radial-gradient(
      circle,
      white 0%,
      #edf2f8 100%
    );

  border: 1px solid var(--border);

  border-radius: 28px;

  box-shadow:
    0 20px 60px rgba(30,50,80,.08);
}

/*
   THE CORE NEVER MOVES.
*/

#core {
  position: absolute;

  left: 50%;
  top: 50%;

  width: 128px;
  height: 128px;

  transform:
    translate(-50%, -50%);

  background: white;

  border: 7px solid var(--text);

  border-radius: 50%;

  z-index: 10;

  box-shadow:
    0 0 0 10px rgba(23,32,51,.035),
    0 15px 40px rgba(23,32,51,.14);
}

#coreColor {
  position: absolute;

  inset: 18px;

  border-radius: 50%;

  background: var(--blue);

  transition:
    background .12s ease;
}

.incoming {
  position: absolute;

  width: 42px;
  height: 42px;

  transform:
    translate(-50%, -50%);

  border-radius: 50%;

  z-index: 5;

  box-shadow:
    0 8px 20px rgba(20,30,50,.15);
}

.incoming::after {
  content: "";

  position: absolute;

  inset: -6px;

  border: 2px solid currentColor;

  border-radius: 50%;

  opacity: .15;
}

.red {
  background: var(--red);
}

.blue {
  background: var(--blue);
}

.green {
  background: var(--green);
}

.yellow {
  background: var(--yellow);
}

.color-panel {
  display: flex;
  justify-content: center;

  gap: 15px;

  padding: 18px;
}

.color {
  width: 58px;
  height: 58px;

  border: 5px solid white;

  border-radius: 50%;

  box-shadow:
    0 8px 22px rgba(20,30,50,.15);

  transition:
    transform .12s ease;
}

.color:hover {
  transform: translateY(-3px);
}

.color:active {
  transform: scale(.92);
}

#message {
  position: absolute;

  left: 50%;
  top: 42%;

  transform:
    translate(-50%, -50%);

  font-size: 1.4rem;

  font-weight: 900;

  pointer-events: none;

  opacity: 0;
}

#message.show {
  animation: message .55s ease forwards;
}

@keyframes message {

  0% {
    opacity: 0;
    transform:
      translate(-50%, 0);
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      translate(-50%, -60px);
  }

}

.exit {
  position: absolute;

  right: 20px;
  bottom: 20px;

  padding: 8px 13px;

  background: white;

  border: 1px solid var(--border);

  border-radius: 9px;

  color: var(--muted);
}

/* PANELS */

.panel {
  width: min(850px, 92vw);

  margin: 40px auto;
}

.back {
  padding: 9px 14px;

  background: white;

  border: 1px solid var(--border);

  border-radius: 9px;
}

.panel h2 {
  margin: 28px 0;

  font-size: 2.4rem;

  letter-spacing: -.04em;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mission,
.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 19px;

  margin-bottom: 12px;

  background: white;

  border: 1px solid var(--border);

  border-radius: 15px;
}

.mission-info,
.shop-info {
  flex: 1;
}

.mission h3,
.shop-item h3 {
  margin-bottom: 5px;
}

.mission p,
.shop-item p {
  color: var(--muted);

  font-size: .88rem;
}

.progress {
  height: 7px;

  margin-top: 12px;

  background: var(--soft);

  border-radius: 99px;

  overflow: hidden;
}

.progress div {
  height: 100%;

  background: var(--accent);
}

.claim,
.buy {
  padding: 9px 14px;

  border: 0;

  border-radius: 9px;

  background: var(--accent);

  color: white;

  font-weight: 800;
}

.claim:disabled,
.buy:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* SETTINGS */

.setting {
  min-height: 70px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid var(--border);
}

.setting select {
  padding: 9px 12px;

  background: white;

  border: 1px solid var(--border);

  border-radius: 9px;
}

.switch {
  min-width: 60px;

  padding: 8px 12px;

  border: 0;

  border-radius: 9px;

  background: var(--soft);
}

.switch.active {
  background: var(--accent);
  color: white;
}

.danger {
  padding: 8px 13px;

  border: 0;

  border-radius: 9px;

  background: #fff0f0;

  color: #d63939;
}

/* GAME OVER */

.overlay {
  position: fixed;

  inset: 0;

  z-index: 1000;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(20,30,45,.25);

  backdrop-filter: blur(8px);
}

.hidden {
  display: none !important;
}

.result {
  width: min(470px, 92vw);

  padding: 34px;

  text-align: center;

  background: white;

  border: 1px solid var(--border);

  border-radius: 23px;

  box-shadow:
    0 30px 80px rgba(20,30,50,.2);
}

.result-mark {
  width: 58px;
  height: 58px;

  margin: 0 auto 15px;

  display: grid;
  place-items: center;

  background: var(--soft);

  border-radius: 50%;

  color: var(--accent);

  font-size: 1.6rem;
}

.result h2 {
  margin-bottom: 24px;
}

.results {
  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 10px;

  margin-bottom: 24px;
}

.results div {
  padding: 14px;

  background: var(--soft);

  border-radius: 11px;
}

.results small {
  display: block;

  color: var(--muted);

  font-size: .58rem;
}

.results strong {
  display: block;

  margin-top: 5px;
}

.full {
  width: 100%;
  margin-top: 10px;
}

/* SPLASH */

#splash {
  position: fixed;

  inset: 0;

  z-index: 9999;

  display: flex;

  align-items: center;
  justify-content: center;

  flex-direction: column;

  background: var(--background);

  animation:
    splashHide 1s ease 2.6s forwards;
}

.splash-title {
  font-size:
    clamp(
      3rem,
      10vw,
      7rem
    );

  font-weight: 900;

  letter-spacing: .18em;

  animation:
    titleIn 1.1s ease forwards,
    titleOut .8s ease 1.8s forwards;
}

.splash-line {
  margin-top: 8px;

  color: var(--muted);

  font-size: .7rem;

  letter-spacing: .3em;

  opacity: 0;

  animation:
    fadeIn 1s ease .8s forwards;
}

@keyframes titleIn {

  from {
    opacity: 0;
    transform: scale(.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }

}

@keyframes titleOut {

  to {
    opacity: 0;
  }

}

@keyframes fadeIn {

  to {
    opacity: 1;
  }

}

@keyframes splashHide {

  to {
    opacity: 0;
    visibility: hidden;
  }

}

@media (max-width: 600px) {

  .topbar {
    height: 64px;
  }

  main,
  .page {
    min-height:
      calc(100vh - 64px);
  }

  #arena {
    height: 58vh;
    border-radius: 20px;
  }

  #core {
    width: 108px;
    height: 108px;
  }

  .color {
    width: 52px;
    height: 52px;
  }

  .mission,
  .shop-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .results {
    grid-template-columns: 1fr;
  }

}