/* ============================================================
   Connect the Thoughts — shared bottom-sheet drawers + trigger pills.
   The text-entry game template keeps the play screen down to
   question + answer keys; everything browsable (clue lists, hint
   shops) lives in these sheets, opened from compact trigger pills.
   Pioneered in The Dictionary Game; shared so every game matches.

   Markup contract (ids are per-game; classes are the contract):
     <button class="drawer-trigger" aria-expanded="false">…</button>
     <div class="drawer-sheet" hidden>
       <div class="drawer-panel">
         <div class="drawer-handle"></div>
         <div class="drawer-header"><h2>…</h2>
           <button class="drawer-close" aria-label="Close">×</button></div>
         <div class="drawer-body">…re-parented game content…</div>
       </div>
     </div>
   ============================================================ */

/* ── Slim mode/difficulty row ─────────────────────────────────────────
   The template's standard spot for game mode + difficulty pills: one
   horizontally scrollable row pinned right under the topbar (pioneered
   in The Dictionary Game). Games re-parent their existing controls in
   on mobile and restore them on desktop. */
.slim-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  padding: 4px 8px;
  /* Wrap instead of scroll: on narrow phones the pills form two short
     centered lines — nothing gets pushed off-screen. */
  flex-wrap: wrap;
}

.drawer-trigger {
  flex: 1;
  position: relative;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-trigger:active { background: var(--border); }
/* "Something new inside" dot — a game toggles data-has-new on its trigger. */
.drawer-trigger[data-has-new]::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* The sheet fills the visible band above the keyboard when one is up
   (--kb-vh/--kb-top from arcade-keyboard.js), or the viewport when not. */
.drawer-sheet {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--kb-top, 0px);
  height: var(--kb-vh, 100dvh);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.45);
}
.drawer-sheet[hidden] { display: none; }

.drawer-panel {
  width: 100%;
  max-height: 100%;
  background: var(--bg-elev);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.22s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}
.drawer-sheet.open .drawer-panel { transform: translateY(0); }

.drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  margin: 8px auto 4px;
  flex-shrink: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 8px;
  flex-shrink: 0;
}
.drawer-header h2 { margin: 0; font-size: 1rem; }

.drawer-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--fg-subtle);
  cursor: pointer;
  padding: 0 4px;
}

.drawer-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
