/* workspace/starcode2/shell/base.css */
/* Reset, colour tokens, the title screen, the menu grid with its arrange
   mode, the top bar, the prototype root and the toast. The capture overlay
   lives in capture.css. */
:root {
  --bg: #0b0f14;
  --bg2: #141b24;
  --bg3: #1c2530;
  --fg: #e8eef5;
  --muted: #8a98a8;
  --accent: #4fd1c5;
  --accent-ink: #06211e;
  --line: #243040;
  --warn: #f6ad55;
  --tap: 48px;
  --radius: 12px;
  color-scheme: dark;
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
[hidden] {
  display: none !important;
}
button, input {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
h1 {
  font-size: inherit;
}
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
#app.app-fixed {
  height: 100dvh;
  overflow: hidden;
}
/* Title screen */
.title-tap {
  flex: 1;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: env(safe-area-inset-top) 24px env(safe-area-inset-bottom);
  color: var(--fg);
  animation: title-in 300ms ease-out;
}
.title-name {
  font-size: clamp(40px, 12vw, 88px);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.title-sub {
  font-size: clamp(14px, 4vw, 22px);
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.title-hint {
  margin-top: 48px;
  color: var(--muted);
  font-size: 14px;
}
@keyframes title-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Menu */
.menu {
  overflow-x: clip;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom));
}
.menu-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px 10px;
}
.menu-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}
.menu-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.menu-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}
.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.menu-link, .menu-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.menu-link:active, .menu-btn:active {
  background: var(--bg3);
}
.menu-btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.menu-btn-accent:active {
  background: var(--accent);
  opacity: 0.85;
}
.menu-link:focus-visible, .menu-btn:focus-visible, .card-open:focus-visible, .card-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* In arrange mode the header stays at the top of the viewport while the
   grid scrolls under it. */
.menu-arrange .menu-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-top: calc(-8px - env(safe-area-inset-top));
  padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* Save, Export layout, Reset order and Done fit on one row from 360px wide
   up: at 14px with this padding and gap the row is about 312px wide and
   the header offers 328px. */
.menu-arrange .menu-actions {
  gap: 6px;
}
.menu-arrange .menu-btn {
  padding: 0 8px;
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.card {
  position: relative;
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 120px;
}
.card:active {
  background: var(--bg3);
}
.card-open {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.card-title {
  font-weight: 700;
  font-size: 17px;
}
.card-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.card-pitch {
  font-size: 13px;
  opacity: 0.85;
}
/* The feel line sits at the bottom of the card under a 22px band. The band
   is there in both modes, and while arranging the drag handle sits in it. */
.card-feel {
  margin-top: auto;
  padding-top: 22px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* The drag handle: hidden while browsing, a 48 by 44 grip at the bottom right
   of every card while arranging. It is out of the flow, and the card keeps
   the same height and text wrapping in both modes. touch-action none lives
   here alone, so a finger on the rest of the page still scrolls it. */
.card-handle {
  display: none;
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 48px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg3);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.card-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 22px;
  transform: translate(-50%, -50%);
  background-image: radial-gradient(circle, var(--fg) 1.5px, transparent 2px);
  background-size: 7px 7px;
  opacity: 0.8;
}
.card-handle:hover {
  border-color: var(--muted);
}
.menu-arrange .card-handle {
  display: block;
}
.menu-arrange .card {
  transition: transform 160ms ease;
  user-select: none;
  -webkit-user-select: none;
}
.menu-arrange .card:active {
  background: var(--bg2);
}
.menu-arrange .card-open {
  pointer-events: none;
}
/* While arranging the feel text is hidden and keeps its space; the handle
   sits where it was. */
.menu-arrange .card-feel {
  visibility: hidden;
}
.menu-arrange .card.card-dragging {
  transition: none;
  z-index: 10;
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.menu-arrange .card.card-dragging .card-handle {
  border-color: var(--accent);
  cursor: grabbing;
}
/* The textarea the copy step selects from, kept out of view. */
.copy-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
/* Top bar and prototype root */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: var(--tap);
  padding-top: env(safe-area-inset-top);
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.topbar-btn {
  min-height: var(--tap);
  min-width: 64px;
  padding: 0 14px;
  color: var(--accent);
  font-weight: 600;
}
.topbar-readout {
  grid-column: 1 / -1;
  padding: 0 14px 6px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.topbar-title {
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proto {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}
