/* GLOW MERGE · style
 * Cozy AI-big-sis aesthetic: blush, lavender, cream. Mobile-first.
 */
:root {
  --blush: #ff8fb3;
  --blush-deep: #e85d8a;
  --lav: #b79ced;
  --lav-deep: #7c5cd6;
  --cream: #fff7f0;
  --ink: #43284f;
  --ink-soft: #7a5c7e;
  --gold: #ffcf5c;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(124, 92, 214, .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -5%, #ffe3ee 0%, transparent 60%),
    radial-gradient(1000px 700px at 110% 20%, #e7dbff 0%, transparent 55%),
    var(--cream);
  display: flex;
  justify-content: center;
}

.gm-wrap {
  width: 100%;
  max-width: 520px;
  padding: 20px 16px 40px;
}

.gm-screen--hidden { display: none !important; }

.gm-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  animation: gm-fade .35s ease;
}
@keyframes gm-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.gm-hero-emoji { font-size: 44px; letter-spacing: 6px; }

.gm-title {
  margin: 0;
  font-size: clamp(40px, 11vw, 58px);
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(100deg, var(--blush-deep), var(--lav-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gm-title--small { font-size: clamp(30px, 8vw, 42px); }

.gm-tagline { margin: 0; max-width: 42ch; color: var(--ink-soft); line-height: 1.55; }
.gm-ai-note { font-size: .82em; opacity: .85; }

.gm-how {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.gm-how__row { display: flex; gap: 12px; align-items: center; font-size: 15px; }
.gm-how__row span:first-child { font-size: 20px; }

.gm-ladder-preview {
  display: flex;
  gap: 4px;
  font-size: 22px;
  background: var(--card);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow-x: auto;
}

.gm-btn {
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--lav);
  border-radius: 999px;
  padding: 13px 30px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.gm-btn:hover { transform: translateY(-2px); }
.gm-btn:active { transform: translateY(1px) scale(.98); }
.gm-btn--primary {
  color: #fff;
  background: linear-gradient(100deg, var(--blush-deep), var(--lav-deep));
  border: none;
}

.gm-best { margin: 0; color: var(--ink-soft); font-weight: 700; }
.gm-foot { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-soft); max-width: 44ch; line-height: 1.5; }

/* ---------- HUD ---------- */
.gm-hud {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px 14px;
}
.gm-hud__score { flex: 1; text-align: left; }
.gm-hud__score span:last-child, #hud-score {
  display: block; font-size: 26px; font-weight: 900; color: var(--lav-deep);
}
.gm-hud__label { font-size: 11px; letter-spacing: 2px; color: var(--ink-soft); font-weight: 800; }
.gm-hud__next { font-size: 26px; background: var(--cream); border-radius: 12px; padding: 4px 10px; }
.gm-hud__mute, .gm-hud__quit {
  font: inherit; border: none; background: var(--cream); border-radius: 12px;
  width: 42px; height: 42px; font-size: 19px; cursor: pointer;
}

/* ---------- Board ---------- */
.gm-board-wrap { position: relative; width: 100%; }
#board {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 22px;
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: crosshair;
  background: #fff;
}

.gm-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: 92%;
  background: rgba(67, 40, 79, .92);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 999px;
  pointer-events: none;
  transition: opacity .25s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-toast--hidden { opacity: 0; }

/* ---------- Game over ---------- */
.gm-result-card {
  width: 100%;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.gm-result-card__emoji { font-size: 64px; }
.gm-result-card__rank {
  font-size: 24px; font-weight: 900; color: var(--lav-deep); margin: 6px 0;
}
.gm-result-card__line { color: var(--ink-soft); line-height: 1.5; margin: 0 0 14px; }
.gm-result-card__scores { display: flex; justify-content: center; gap: 34px; }
.gm-result-card__scores strong { display: block; font-size: 24px; color: var(--blush-deep); }

.gm-btnrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.gm-share { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.gm-share--hidden { display: none; }
#share-canvas {
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.gm-copy-ok { color: var(--lav-deep); font-weight: 700; margin: 0; }
.gm-copy-ok--hidden { display: none; }

.gm-email {
  width: 100%;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: left;
}
.gm-email__pitch { margin: 0 0 12px; line-height: 1.55; color: var(--ink-soft); }
.gm-email .mila-email__label { font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.gm-email .mila-email__input {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 14px;
  border: 2px solid #e9ddf7; margin: 6px 0 10px;
}
.gm-email .mila-email__input:focus { outline: none; border-color: var(--lav); }
.gm-email .mila-email__btn { width: 100%; }
.gm-email .mila-email__msg { margin: 8px 0 0; font-size: 14px; }
.gm-email .mila-email__msg--ok { color: #2e8b57; font-weight: 700; }
.gm-email .mila-email__msg--err { color: #c0392b; font-weight: 700; }
