@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600&display=swap');
/* If shared/fonts/Fredoka.ttf exists it is used; otherwise the font comes from Google Fonts above. */
@font-face { font-family: 'Fredoka'; src: url('fonts/Fredoka.ttf') format('truetype'); font-weight: 300 700; font-display: swap; }

:root {
  --peach: #FFB5A7;
  --butter: #FCD5A5;
  --mint: #B8E0D2;
  --sky: #A9C7F5;
  --lilac: #CDB4DB;
  --green: #7FCBA8;
  --plum: #5B4B6E;
  --cream: #FFF6EC;
  --cream-2: #F6E7D6;
  --blush: #FF8C8C;
  --font: 'Fredoka', 'Nunito', 'Segoe UI Rounded', 'Arial Rounded MT Bold', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--plum);
  font-family: var(--font);
  min-height: 100%;
  user-select: none;
  -webkit-user-select: none;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: 0.3px; }

.viz-btn {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  color: var(--plum);
  background: var(--green);
  border: 3px solid var(--plum);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--plum);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  touch-action: manipulation;
}
.viz-btn:active { transform: translateY(4px) scale(0.97); box-shadow: 0 1px 0 var(--plum); }
.viz-btn:disabled { opacity: 0.45; cursor: default; }
.viz-btn.peach { background: var(--peach); }
.viz-btn.butter { background: var(--butter); }
.viz-btn.sky { background: var(--sky); }
.viz-btn.lilac { background: var(--lilac); }
.viz-btn.mint { background: var(--mint); }
.viz-btn.small { font-size: 15px; padding: 7px 14px; box-shadow: 0 3px 0 var(--plum); }

.viz-card {
  background: #fff;
  border: 3px solid var(--plum);
  border-radius: 24px;
  box-shadow: 0 6px 0 var(--plum);
  padding: 18px;
}

.viz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
}
.viz-home {
  text-decoration: none;
  color: var(--plum);
  font-weight: 600;
  font-size: 16px;
  background: #fff;
  border: 3px solid var(--plum);
  border-radius: 999px;
  padding: 5px 14px;
  box-shadow: 0 3px 0 var(--plum);
}
@media (max-width: 480px) {
  .viz-topbar { padding: 8px 8px; gap: 6px; }
  .viz-home, .viz-pill { font-size: 14px; padding: 4px 10px; }
  .hide-sm { display: none; }
}
@media (max-width: 400px) {
  .viz-topbar { gap: 4px; padding: 8px 6px; }
  .viz-home, .viz-pill { font-size: 13px; padding: 3px 8px; }
}
.viz-pill {
  background: #fff;
  border: 3px solid var(--plum);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 3px 0 var(--plum);
  white-space: nowrap;
}

.viz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(91, 75, 110, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.viz-overlay .viz-card { max-width: 420px; width: 100%; text-align: center; animation: viz-pop 0.35s cubic-bezier(.2,1.6,.4,1); }
@keyframes viz-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.viz-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--plum);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 500;
  z-index: 60;
  animation: viz-pop 0.25s ease;
}

#viz-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

/* Game screens: the play area always fits whatever space the browser window gives it,
   so nothing is pushed off-screen when the window isn't full screen. */
.layout { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.layout > canvas { flex: 1 1 0; min-height: 0; height: 0; }
.layout > .viz-topbar, .layout > .bottombar { flex: none; }
/* Pop-up cards scroll inside very short windows instead of being cut off. */
.viz-overlay .viz-card { max-height: calc(100% - 10px); overflow-y: auto; }
