/* ============================================================
   styles.css — all the looks.
   The colors live in :root variables at the top, so you can
   recolor the whole site by editing just a few lines.
   ============================================================ */
:root {
  --bg1: #ffdcec;            /* background gradient start (pink)     */
  --bg2: #e7d8ff;            /* background gradient end (lavender)   */
  --accent: #ff6fb0;         /* main pink                            */
  --accent-dark: #db4f93;    /* deeper pink for text/edges           */
  --ink: #5c3a55;            /* body text color                      */
  --card: rgba(255, 255, 255, 0.82);
  --shadow: 0 10px 30px rgba(180, 80, 140, 0.25);
}

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

body {
  font-family: "Fredoka", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  overflow-x: hidden;
  text-align: center;
  display: flex;          /* stack the page top-to-bottom: */
  flex-direction: column; /* centered content → leaderboard → footer */
}

/* ---------- center stage / hero ---------- */
.center {
  flex: 1;            /* fill the space above the leaderboard… */
  display: flex;      /* …and keep its own content perfectly centered */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 700; }
.hero .name { color: var(--accent-dark); }
.subtitle { font-size: 1rem; opacity: 0.75; margin-top: 0.4rem; }

/* ---------- present button + counter ---------- */
.present-btn {
  font-family: inherit;
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  border-radius: 999px;
  padding: 1.1rem 2.4rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.present-btn:hover { transform: translateY(-3px) scale(1.03); }
.present-btn:active { transform: translateY(1px) scale(0.98); }

.counter { display: flex; flex-direction: row; align-items: baseline; justify-content: center; gap: 0.7rem; }
.count {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1;
  display: inline-block;
  transform-origin: center right; /* pop grows leftward into empty space, never onto the label */
}
.count.pop { animation: pop 0.3s ease; }
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.counter-label { font-size: 1rem; opacity: 0.8; text-align: left; max-width: 16rem; line-height: 1.15; }

/* ---------- controls (fun toggle + patch notes) ---------- */
.controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.switch {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--card); padding: 0.5rem 0.9rem;
  border-radius: 999px; cursor: pointer; box-shadow: var(--shadow);
}
.switch input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); cursor: pointer; }
.ghost-btn {
  font-family: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--card); border: none; border-radius: 999px;
  padding: 0.55rem 1rem; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.ghost-btn:hover { transform: translateY(-2px); }

/* ---------- the four corners ---------- */
.corner { position: fixed; display: none; z-index: 20; max-width: 42vw; }
body.fun-on .corner { display: block; }   /* <- Fun Mode reveals them */
.corner-tl { top: 1rem; left: 1rem; }
.corner-tr { top: 1rem; right: 1rem; }
.corner-bl { bottom: 1rem; left: 1rem; }
.corner-br { bottom: 1rem; right: 1rem; }

.corner-label { display: block; font-size: 0.75rem; opacity: 0.7; margin-top: 0.25rem; }
.corner-btn {
  font-size: 2.2rem; background: var(--card); border: none;
  border-radius: 50%; width: 64px; height: 64px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.12s ease;
}
.corner-btn:hover { transform: scale(1.1) rotate(-6deg); }

.bubble {
  margin-top: 0.5rem; background: #fff; border-radius: 14px;
  padding: 0.5rem 0.7rem; font-size: 0.85rem; max-width: 200px;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(-6px);
}
.bubble.show { animation: fadeIn 0.3s ease forwards; }
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

/* photos corner */
.photo-frame {
  width: 110px; height: 110px; border-radius: 16px; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.photo { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { font-size: 2rem; line-height: 1.1; }
.corner-cap { display: block; font-size: 0.72rem; opacity: 0.7; margin-top: 0.2rem; }

/* slot machine */
.slot-machine { background: var(--card); border-radius: 16px; padding: 0.7rem; box-shadow: var(--shadow); }
.reels {
  display: flex; gap: 0.3rem; background: #fff; border-radius: 10px;
  padding: 0.4rem 0.5rem; font-size: 2rem; justify-content: center;
}
.reel { width: 2.2rem; }
.spin-btn {
  font-family: inherit; margin-top: 0.5rem; width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; border: none; border-radius: 999px; padding: 0.4rem;
  font-size: 0.95rem; cursor: pointer;
}
.spin-btn:disabled { opacity: 0.6; cursor: default; }
.slot-msg { font-size: 0.78rem; margin-top: 0.35rem; min-height: 1.1em; }

/* ---------- patch notes modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(70, 30, 60, 0.45);
  display: none; align-items: center; justify-content: center;
  padding: 1rem; z-index: 80;
}
.modal.open { display: flex; }
.modal-card {
  background: #fff; border-radius: 18px; width: min(560px, 100%);
  max-height: 80vh; overflow: auto; padding: 1.3rem; text-align: left;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.close-btn { border: none; background: none; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.modal-sub { font-size: 0.9rem; opacity: 0.75; margin: 0.3rem 0 0.8rem; }
.patchnotes { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.patchnotes li { background: var(--bg1); border-radius: 10px; padding: 0.6rem 0.8rem; }
.pn-msg { display: block; font-weight: 600; }
.pn-meta { display: block; font-size: 0.75rem; opacity: 0.7; margin-top: 0.2rem; }

/* ---------- account / leaderboard panel ---------- */
.account-panel {
  align-self: center; width: 260px; max-width: 90vw; margin-bottom: 0.75rem;
  max-height: 48vh; overflow-y: auto;  /* scroll inside if the leaderboard gets long */
  background: var(--card); border-radius: 16px;
  padding: 0.9rem; box-shadow: var(--shadow); z-index: 30; text-align: center;
}
.panel-hint { font-size: 0.8rem; opacity: 0.8; margin-bottom: 0.5rem; }
.panel-input {
  font-family: inherit; width: 100%; box-sizing: border-box;
  border: 1px solid #f0c4dd; border-radius: 999px;
  padding: 0.4rem 0.7rem; margin-bottom: 0.4rem; font-size: 0.85rem;
}
.panel-input:focus { outline: 2px solid var(--accent); }
.panel-row { display: flex; gap: 0.4rem; }
.panel-btn {
  font-family: inherit; width: 100%; cursor: pointer; margin-top: 0.15rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; border: none; border-radius: 999px; padding: 0.45rem; font-size: 0.85rem;
}
.panel-row .panel-btn { margin-top: 0; }
.panel-btn.ghost { background: none; color: var(--accent-dark); border: 1px solid var(--accent); }
.panel-msg { font-size: 0.72rem; color: var(--accent-dark); margin-top: 0.4rem; min-height: 1em; }
.panel-hello { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.panel-mine { font-size: 0.8rem; opacity: 0.85; margin-bottom: 0.5rem; line-height: 1.3; }
.panel-mine span { font-size: 1.6rem; font-weight: 700; color: var(--accent-dark); display: block; }
/* The panel sits centered in the page flow (below the centered content), so
   the main content above it stays perfectly centered left-to-right. */
@media (max-width: 560px) {
  .account-panel .panel-row { flex-direction: column; } /* stack Log in / Sign up */
}
.site-footer { padding: 0.5rem 1rem 1.25rem; font-size: 0.75rem; opacity: 0.55; }

/* leaderboard inside the panel */
.leaderboard { margin-top: 0.8rem; border-top: 1px solid #f0c4dd; padding-top: 0.6rem; }
.lb-title { font-size: 0.9rem; margin-bottom: 0.4rem; }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; text-align: left; }
.lb-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; padding: 0.2rem 0.4rem; border-radius: 8px; }
.lb-row.lb-me { background: #ffe3f1; font-weight: 600; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { color: var(--accent-dark); font-weight: 600; flex-shrink: 0; }
.lb-empty { font-size: 0.78rem; opacity: 0.6; }

/* ---------- emoji burst ---------- */
.burst-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.burst {
  position: fixed; font-size: 1.6rem; transform: translate(-50%, -50%);
  animation: burst 1s ease-out forwards;
}
@keyframes burst {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); }
}

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .corner-btn { width: 50px; height: 50px; font-size: 1.6rem; }
  .photo-frame { width: 84px; height: 84px; }
  .reels { font-size: 1.5rem; }
  .reel { width: 1.7rem; }
  .bubble { max-width: 42vw; font-size: 0.75rem; }
}
