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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #4a4a4a;
  min-height: 100vh;
  position: relative;
}

/* Site-wide vignette — fixed, drawn over every sub-page, never blocks input */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 65%,
    rgba(0, 0, 0, 0.05) 80%,
    rgba(0, 0, 0, 0.18) 100%
  );
  z-index: 5;
}

/* ===== BGM mute button — fixed top-right, icon only, no backdrop ===== */
/* Material Symbols variation: filled, weight 200, optical size 24. */
.material-symbols-sharp {
  font-variation-settings:
    'FILL' 1,
    'wght' 200,
    'GRAD' 0,
    'opsz' 24;
  font-size: 26px;
  line-height: 1;
  user-select: none;
}

#bgm-mute {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 50;            /* above canvas + vignette, below modals */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  /* Default state = muted → music_off in #6F6F6F. The :not(.muted) and
     per-page rules below override this when audio is on. */
  color: #6F6F6F;
}
#bgm-mute:active { transform: scale(0.92); }
#bgm-mute:focus-visible {
  outline: 1.5px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Music ON: black globally, white only on page 2 (Isolate). */
#bgm-mute:not(.muted)                       { color: #000; }
body.page-active-2 #bgm-mute:not(.muted)    { color: #fff; }

/* Show music_on by default; swap to music_off when .muted is set. */
#bgm-mute .icon-muted       { display: none; }
#bgm-mute.muted .icon-on    { display: none; }
#bgm-mute.muted .icon-muted { display: inline-block; }

/* ===== Navigation ===== */
/* Floating nav — outlined pill buttons centered at the top, scaled down to fit */
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 1.2rem 2rem;
  background: transparent;
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
}

/* Phone-width adjustments — tighter spacing so wrapped rows still fit */
@media (max-width: 600px) {
  nav {
    gap: 8px;
    padding: 0.7rem 0.8rem;
    row-gap: 8px;
  }
  nav button {
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem 0.3rem 0.35rem;
  }
  nav .nav-icon {
    width: 22px;
  }
}

nav button {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1.2px solid #bdbdbd;
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: 'Doto', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.3px;
  color: #979797;
  white-space: nowrap;
  font-variation-settings: 'ROND' 0;
}

nav .nav-icon {
  width: 28px;
  height: auto;
  opacity: 0.75;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  transition: opacity 0.2s ease;
}

nav button:hover {
  transform: translateY(-1px);
}

nav button.active {
  border-color: #626262;
  color: #1b1b1b;
  font-weight: 1000;
}

nav button.active .nav-icon {
  opacity: 1;
}

/* ===== Pages ===== */
.page {
  display: none;
  /* Vertical padding only — horizontal padding would carve a gap on either
     side of the canvas (which is sized to the full window width). */
  padding: 2rem 0;
  min-height: 100vh;
}

.page.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#canvas-holder,
#canvas-holder-remember { position: relative; }

/* Remember tab — light grey backdrop replaces white when active */
.page-remember.active { background: #f4f4f4; }

/* Play tab — explicit white backdrop */
.page-play.active { background: #ffffff; }

#canvas-holder-play { position: relative; }

/* Send tab — warm beige backdrop */
#canvas-holder-send { position: relative; }
.page-send.active { background: #CAC2B4; }

/* PART 2 — PAGE ISOLATE — top 3/4 dark gradient, lower 1/4 #D9D9D9. */
#canvas-holder-isolate { position: relative; }
.page-isolate.active {
  background: linear-gradient(
    180deg,
    #1B1B1B 0%,
    #464646 75%,
    #D9D9D9 75%,
    #D9D9D9 100%
  );
}

.blank-page {
  color: #b5ad9d;
  font-style: italic;
  font-size: 1.1rem;
}

/* ===== Status bar ===== */
#status {
  display: none;
}

#blink-count {
  color: #c97b8a;
  font-weight: 600;
}
