/* Standalone page around the board: header, example questions, history drawer. */

:root {
  --bg: #e9e6df;
  --ink: #24262a;
  --soft: #6d7178;
  --line: rgba(30, 32, 36, .14);
  --card: #ffffff;
  --accent: #23975a;
  --spring: cubic-bezier(.22, 1.25, .36, 1);
}
:root[data-theme="chalk"] {
  --bg: #2b2a27;
  --ink: #f1ede4;
  --soft: #a9a59b;
  --line: rgba(255, 255, 255, .16);
  --card: #3a3935;
  --accent: #6fd3a0;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  transition: background .35s ease, color .35s ease;
}
button { font: inherit; color: inherit; }

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 1500px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.top { display: flex; align-items: center; justify-content: space-between; height: 46px; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; font-family: "Shantell Sans", cursive; font-weight: 700; font-size: 22px; line-height: 1; }
.brand svg { width: 30px; height: 30px; transition: transform .5s var(--spring); }
.brand:hover svg { transform: rotate(-8deg) scale(1.08); }
.top-r { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .25s var(--spring);
}
.pill svg { width: 16px; height: 16px; }
.pill:hover { background: color-mix(in srgb, var(--card) 70%, transparent); }
.pill:active { transform: scale(.95); }

.seg { display: flex; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font-size: 13.5px; font-weight: 500; color: var(--soft); cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }

main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 6px; }
#board { flex: 1; min-height: 0; opacity: 0; transform: translateY(10px) scale(.992); transition: opacity .5s ease, transform .7s var(--spring); }
.ready #board { opacity: 1; transform: none; }

:root[data-theme="chalk"] .bd { --bd-ui-ink: #f1ede4; --bd-ui-soft: #a9a59b; --bd-ui-line: rgba(255, 255, 255, .18); --bd-ui-card: #3a3935; --bd-accent: #3aa978; }
:root[data-theme="chalk"] .bd-caption p.bd-error { color: #ff9488; }

.ideas {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 8px;
  pointer-events: none;
  transition: opacity .3s ease, transform .4s ease;
}
.ideas button {
  pointer-events: auto;
  height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(.94);
  transition: transform .3s var(--spring), border-color .2s, background .2s;
  box-shadow: 0 6px 18px -12px rgba(30, 30, 20, .5);
}
.ready .ideas button { animation: idea .6s var(--spring) forwards; animation-delay: calc(.5s + var(--i) * 70ms); }
.ideas button:hover { transform: translateY(-2px) scale(1.03); border-color: var(--accent); }
.ideas.off { opacity: 0; transform: translateY(10px); }
.ideas.off button { pointer-events: none; }
.ideas[hidden] { display: none; }
@keyframes idea { to { opacity: 1; transform: none; } }


.drawer-bg { position: fixed; inset: 0; z-index: 20; background: rgba(20, 20, 16, 0); transition: background .26s ease; }
.drawer-bg.on { background: rgba(20, 20, 16, .32); }
.drawer {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(390px, calc(100vw - 20px));
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6);
  transform: translateX(calc(100% + 20px));
  transition: transform .42s cubic-bezier(.2, .9, .25, 1);
}
.drawer-bg.on .drawer { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px 22px; }
.drawer h2 { margin: 0; font-family: "Shantell Sans", cursive; font-size: 21px; font-weight: 700; }
.x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.x svg { width: 19px; height: 19px; }
.x:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.drawer-list { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.row {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transition: background .2s, border-color .2s, transform .3s var(--spring);
}
.drawer-bg.on .row { animation: idea .5s var(--spring) forwards; animation-delay: calc(.12s + var(--i) * 40ms); transform: translateX(16px); }
.row:hover { border-color: var(--accent); transform: translateX(-2px); }
.row b { display: block; font-family: "Shantell Sans", cursive; font-size: 17px; font-weight: 600; line-height: 1.25; }
.row small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--soft); }
.none { margin: 30px 12px; color: var(--soft); font-size: 15px; line-height: 1.5; text-align: center; }

@media (max-width: 720px) {
  .app { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .brand { font-size: 20px; }
  .brand svg { width: 26px; height: 26px; }
  .pill span { display: none; }
  .pill { padding: 0 9px; }
  .ideas { bottom: 10px; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; pointer-events: auto; padding: 4px 6px; }
  .ideas::-webkit-scrollbar { display: none; }
  .ideas button { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
