/* Box Batter: a plum room at night, the field on one canvas, a few DOM pieces on top (the bar, the faster button, the
   end card). The title screen and the sheets are shared/mainmenu.js (menu.css, loaded after this); only their colors
   are set here (--sg-*). */
:root {
  --bg: #1d1730; --bg-hi: #3a2f63; --ink: #fff6ea; --ink-soft: #c7bce6; --line: rgba(255, 246, 234, 0.18);
  --accent: #ffcf4a; --accent-ink: #2a1d3a; --sheet: #fff8ef; --sheet-ink: #33243f; --sheet-soft: #76658a;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
* { touch-action: manipulation; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(ellipse 120% 50% at 50% 0%, var(--bg-hi), transparent 70%), var(--bg);
  overflow: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
.app {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--sg-corner-top) - 6px) 8px calc(env(safe-area-inset-bottom, 0px) + 10px); /* the bar's 56px row centers the corner's menu button (shared/menu.css) */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}

/* ---- the bar ---- */
.bar { width: 100%; max-width: 520px; display: grid; grid-template-columns: 76px 1fr 76px; align-items: center; gap: 6px; min-height: 56px; }
.bar > .sg-corner-slot { margin-left: calc(var(--sg-corner-left) - 8px); } /* under the corner's menu button (shared/menu.css) */
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 16px;
  background: rgba(255, 255, 255, 0.13); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.8; stroke-linecap: round; }
.icon-btn:active { transform: scale(0.94); }
.score { text-align: center; line-height: 1; }
.score b { display: block; font-weight: 800; font-size: 34px; letter-spacing: 0.5px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.score small { display: block; margin-top: 2px; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.score b.pop { animation: pop 0.18s ease-out; }
.rowpill {
  justify-self: end; padding: 6px 12px 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.28);
  font-weight: 800; font-size: 17px; white-space: nowrap; box-shadow: inset 0 0 0 1.5px var(--line);
}
.rowpill.up { animation: pop 0.3s ease-out; }

/* ---- the field ---- */
.stage { position: relative; flex: 1; width: 100%; max-width: 520px; min-height: 0; display: flex; align-items: center; justify-content: center; }
#field {
  display: block; border-radius: 14px; box-shadow: 0 0 0 3px #151024, 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.ff {
  position: absolute; right: 10px; bottom: 10px; min-width: 96px; min-height: 46px; padding: 4px 14px 2px 10px;
  display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 246, 234, 0.92); color: var(--accent-ink); font-weight: 800; font-size: 17px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); -webkit-tap-highlight-color: transparent;
}
.ff svg { width: 22px; height: 22px; fill: currentColor; }
.ff.on { background: var(--accent); }
.ff:active { transform: scale(0.95); }
.hint {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); margin: 0; padding: 8px 16px 6px;
  border-radius: 999px; background: rgba(20, 14, 36, 0.78); font-weight: 800; font-size: 18px; white-space: nowrap;
  pointer-events: none; animation: breathe 1.6s ease-in-out infinite;
}

/* ---- the end card ---- */
.over { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(14, 9, 28, 0.6); }
.over-card {
  width: min(340px, 100%); padding: 20px 20px 16px; border-radius: 24px; text-align: center;
  background: var(--sheet); color: var(--sheet-ink); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  animation: rise 0.32s ease-out;
}
.over-kicker { margin: 0; font-weight: 800; font-size: 20px; color: var(--sheet-soft); }
.over-score { margin: 2px 0 0; font-weight: 800; font-size: 52px; line-height: 1; }
.over-row { margin: 6px 0 0; font-weight: 700; font-size: 18px; }
.over-best { margin: 4px 0 0; font-weight: 800; font-size: 16px; color: #8a5a10; min-height: 22px; }
.over-best.new { color: #2f8a55; }
.over-new { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.over-new li { padding: 7px 12px 5px; border-radius: 12px; background: #f3e8ff; font-weight: 700; font-size: 15px; line-height: 1.25; }
.over-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pill {
  min-height: 50px; border: 0; border-radius: 999px; padding: 4px 14px 2px; cursor: pointer;
  background: rgba(51, 36, 63, 0.1); color: var(--sheet-ink); font-weight: 800; font-size: 17px;
  -webkit-tap-highlight-color: transparent;
}
.pill.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 #b98a1a; }
.pill:active { transform: scale(0.97); }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px); z-index: 30; transform: translate(-50%, -8px);
  margin: 0; padding: 8px 16px 6px; border-radius: 14px; max-width: calc(100vw - 32px); width: max-content;
  background: #fff8ef; color: var(--sheet-ink); font-weight: 800; font-size: 16px; text-align: center;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- sheets: looks and achievements ---- */
.bb-looks h3 { margin: 4px 0 8px; font-size: 17px; }
.bb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.bb-pick {
  min-height: 96px; border: 0; border-radius: 16px; padding: 6px 4px 4px; cursor: pointer; display: grid; justify-items: center; gap: 2px;
  background: rgba(51, 36, 63, 0.08); color: var(--sheet-ink); font-weight: 800; font-size: 14px; line-height: 1.15;
  -webkit-tap-highlight-color: transparent;
}
.bb-pick.on { box-shadow: inset 0 0 0 3px #7b5bd0; background: #efe6ff; }
.bb-pick.locked { opacity: 0.55; }
.bb-pick small { font-weight: 700; font-size: 12px; color: var(--sheet-soft); }
.bb-pick .face { width: 56px; height: 56px; }
.bb-pick .face svg, .bb-pick .ball svg { display: block; width: 100%; height: 100%; }
.bb-pick .ball { width: 40px; height: 40px; margin: 8px 0 6px; }
.bb-ach { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bb-ach li { display: flex; gap: 10px; align-items: center; padding: 8px 12px 6px; border-radius: 14px; background: rgba(51, 36, 63, 0.06); font-weight: 700; font-size: 15px; line-height: 1.25; }
.bb-ach li b { display: block; font-size: 16px; }
.bb-ach li.no { opacity: 0.55; }
.bb-ach .medal { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #f4c44e; color: #6b4a0c; font-weight: 800; }
.bb-ach li.no .medal { background: rgba(51, 36, 63, 0.14); color: transparent; }
.bb-howto p { margin: 0 0 10px; }

/* ---- the title screen's colors (the layout is shared/mainmenu.js) ---- */
#mm {
  --sg-bg: radial-gradient(ellipse 100% 70% at 50% 25%, var(--bg-hi), transparent 75%), var(--bg);
  --sg-ink: var(--ink); --sg-ink-soft: var(--ink-soft);
  --sg-title: #ffd86b; --sg-title-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  --sg-accent: var(--accent); --sg-accent-ink: var(--accent-ink);
  --sg-card: #fff8ef; --sg-card-ink: var(--sheet-ink); --sg-line: rgba(255, 246, 234, 0.22);
}
#mm .bb-title-art { width: 260px; height: 150px; }
#mm .bb-title-art svg { display: block; width: 100%; height: 100%; }
.sg-sheet { --sg-sheet-bg: var(--sheet); --sg-sheet-ink: var(--sheet-ink); --sg-accent: #4a3570; --sg-accent-ink: #fff; --sg-ink-soft: var(--sheet-soft); }

@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
@media (max-height: 700px) {
  .bar { min-height: 50px; }
  .score b { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .score b.pop, .rowpill.up, .over-card, .hint { animation: none; }
  .toast { transition: none; }
}

.bb-daily { text-align: center; }
.bb-daily p { margin: 0 0 8px; font-weight: 700; }
.bb-daily .big { font-weight: 800; font-size: 48px; line-height: 1.1; }
.bb-pick .face.outfit { overflow: visible; }

/* ---- a trick to keep, a first meeting, a moment ---- */
.pick, .meet { position: fixed; inset: 0; z-index: 18; display: grid; place-items: end center; padding: 16px 12px calc(env(safe-area-inset-bottom, 0px) + 18px); background: rgba(14, 9, 28, 0.5); }
.pick-card, .meet-card {
  width: min(380px, 100%); padding: 16px 14px 14px; border-radius: 24px; background: var(--sheet); color: var(--sheet-ink);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7); animation: rise 0.28s ease-out;
}
.pick-kicker { margin: 0 0 10px; text-align: center; font-weight: 800; font-size: 19px; }
.pick-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick-opt {
  min-height: 150px; border: 0; border-radius: 18px; padding: 10px 8px 8px; cursor: pointer; display: grid; justify-items: center; align-content: start; gap: 4px;
  background: #f3e8ff; color: var(--sheet-ink); box-shadow: inset 0 0 0 2px #cdb8f2, 0 3px 0 #b39bdc; -webkit-tap-highlight-color: transparent; text-align: center;
}
.pick-opt:active { transform: scale(0.97); }
.pick-opt b { font-size: 17px; line-height: 1.1; }
.pick-ico { width: 48px; height: 48px; }
.pick-ico svg { display: block; width: 100%; height: 100%; }
.pick-text { font-weight: 600; font-size: 14px; line-height: 1.25; color: var(--sheet-soft); }
.pick-have { margin: 10px 0 0; text-align: center; font-weight: 700; font-size: 14px; color: var(--sheet-soft); }
.meet-card { display: grid; grid-template-columns: 72px 1fr; gap: 6px 12px; align-items: center; }
.meet-art { width: 72px; height: 72px; }
.meet-words b { font-size: 19px; }
.meet-words p { margin: 2px 0 0; font-weight: 600; font-size: 15px; line-height: 1.3; }
.meet-words .meet-new { margin: 0; font-weight: 800; font-size: 13px; color: #7b5bd0; letter-spacing: 0.5px; text-transform: uppercase; }
.meet-card .pill { grid-column: 1 / -1; margin-top: 6px; }
.banner {
  position: fixed; left: 50%; top: 34%; z-index: 16; transform: translate(-50%, -50%); pointer-events: none; text-align: center;
  padding: 10px 26px 8px; border-radius: 20px; background: #ffd04f; color: #3a2508; box-shadow: 0 6px 0 #b98a1a, 0 16px 40px -10px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}
.banner b { display: block; font-weight: 800; font-size: 30px; line-height: 1.05; }
.banner small { display: block; font-weight: 800; font-size: 16px; opacity: 0.8; }
.banner.on { animation: banner 1.9s ease-out both; }
@keyframes banner {
  0% { transform: translate(-50%, -50%) scale(0.3) rotate(-6deg); opacity: 0; }
  12% { transform: translate(-50%, -50%) scale(1.12) rotate(2deg); opacity: 1; }
  22% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -62%) scale(0.96); opacity: 0; }
}
@keyframes banner-calm { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pick-card, .meet-card { animation: none; }
  .banner.on { animation: banner-calm 1.9s linear both; }
}
