/* ===== Berean Play — Apple iOS Pastel Design System ===== */

:root {
  /* Pastel palette */
  --pastel-pink: #FFD3DD;
  --pastel-pink-deep: #FFB5C5;
  --pastel-peach: #FFD9C7;
  --pastel-coral: #FFB8A8;
  --pastel-yellow: #FFF2B8;
  --pastel-gold: #F5DDA0;
  --pastel-mint: #C8F0D6;
  --pastel-green: #A8E6BB;
  --pastel-sky: #C8E4F8;
  --pastel-blue: #A8D0F0;
  --pastel-lavender: #DDD0F5;
  --pastel-purple: #C8B5E8;
  --pastel-cream: #FFF7E8;
  --pastel-sand: #F5E8D0;
  --pastel-rose: #F0C8D5;

  /* CDBS canonical (softened to pastel) */
  --cdbs-gold: #F5DDA0;
  --cdbs-red: #F8B5B0;
  --cdbs-green: #A8E6BB;
  --cdbs-blue: #A8D0F0;
  --cdbs-purple: #C8B5E8;
  --cdbs-brown: #D4B89E;
  --cdbs-orange: #FFC4A8;
  --cdbs-yellow: #FFE8A0;

  /* Neutrals */
  --ink: #1C1C1E;
  --ink-2: #3A3A3C;
  --ink-3: #6E6E73;
  --ink-4: #98989D;
  --ink-5: #C7C7CC;
  --ink-6: #E5E5EA;
  --bg: #F5F2EC;
  --bg-grouped: #EFECE5;
  --card: #FFFFFF;
  --separator: rgba(60, 60, 67, 0.12);

  /* iOS system */
  --ios-blue: #007AFF;
  --ios-radius-sm: 10px;
  --ios-radius: 14px;
  --ios-radius-lg: 20px;
  --ios-radius-xl: 28px;

  /* Type */
  --font-display: -apple-system, "SF Pro Display", "Inter", system-ui, sans-serif;
  --font-text: -apple-system, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-rounded: "SF Pro Rounded", -apple-system, "Inter", system-ui, sans-serif;
  --font-serif: "New York", "Crimson Pro", Georgia, serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html, body {
  margin: 0;
  font-family: var(--font-text);
  background: #E8E3DC;
  color: var(--ink);
  letter-spacing: -0.01em;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, textarea { font-family: inherit; }

/* ===== Layout: phone screens ===== */
.screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding-top: 54px; /* status bar */
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 32px;
}
.screen-scroll::-webkit-scrollbar { width: 0; }

/* ===== Nav bars ===== */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 6px;
  min-height: 44px;
  background: rgba(245, 242, 236, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: relative;
  z-index: 5;
}
.nav-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  text-align: center;
  flex: 1;
}
.nav-side {
  min-width: 64px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-side.right { justify-content: flex-end; }
.nav-btn {
  color: var(--ios-blue);
  font-size: 17px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
}
.nav-btn.bold { font-weight: 600; }
.chev {
  width: 12px; height: 20px;
  display: inline-block;
  position: relative;
}
.chev::before {
  content: "";
  position: absolute;
  top: 4px; left: 2px;
  width: 10px; height: 10px;
  border-left: 2px solid var(--ios-blue);
  border-bottom: 2px solid var(--ios-blue);
  transform: rotate(45deg);
  border-radius: 1px;
}

.large-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.025em;
  padding: 4px 20px 12px;
  line-height: 1.05;
}

.section-header {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 18px 20px 6px;
}

/* ===== Cards (iOS grouped) ===== */
.card-list {
  margin: 0 16px;
  background: var(--card);
  border-radius: var(--ios-radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 44px;
  border-bottom: 0.5px solid var(--separator);
  cursor: pointer;
  transition: background 0.15s;
}
.row:last-child { border-bottom: none; }
.row:active { background: var(--ink-6); }
.row-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.row-text { flex: 1; font-size: 17px; letter-spacing: -0.02em; }
.row-text-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.row-trail { color: var(--ink-4); font-size: 16px; }
.row-chev::after {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-right: 2px solid var(--ink-4);
  border-top: 2px solid var(--ink-4);
  transform: rotate(45deg);
  margin-left: 4px;
}

/* ===== Tile grid (category cards, game cards) ===== */
.tile-grid {
  padding: 8px 16px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tile {
  position: relative;
  border-radius: var(--ios-radius-lg);
  padding: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(60, 50, 30, 0.06);
}
.tile:active { transform: scale(0.97); }
.tile-emoji {
  font-size: 38px;
  line-height: 1;
}
.tile-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.tile-sub {
  font-size: 12px;
  color: var(--ink-2);
  opacity: 0.75;
  margin-top: 2px;
  font-weight: 500;
}
.tile-tier {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.6);
  color: var(--ink-2);
  align-self: flex-start;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  border-radius: var(--ios-radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn-primary {
  background: var(--ink);
  color: white;
}
.btn-pastel {
  background: var(--pastel-blue);
  color: var(--ink);
}
.btn-ghost {
  background: rgba(0,0,0,0.05);
  color: var(--ink);
}
.btn-pill {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 15px;
}
.btn-block { width: 100%; }
.btn-lg { padding: 18px 24px; font-size: 18px; }

.btn-floating {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 16px;
  z-index: 10;
}

/* ===== Pills / Chips ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: rgba(255,255,255,0.7);
  color: var(--ink-2);
}
.pill-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 0 20px 8px;
}
.pill-tab {
  cursor: pointer;
  background: rgba(0,0,0,0.05);
  transition: background 0.15s, color 0.15s;
}
.pill-tab.active {
  background: var(--ink);
  color: white;
}

/* ===== Game template chrome ===== */
.game-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.game-hero {
  padding: 16px 20px 18px;
  text-align: center;
  position: relative;
}
.game-hero-emoji { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.game-hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.game-hero-sub {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 4px;
  font-weight: 500;
}

.game-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 80px;
}
.game-body::-webkit-scrollbar { width: 0; }

.game-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px 18px;
  background: linear-gradient(to top, var(--bg) 60%, rgba(245,242,236,0));
  display: flex;
  gap: 8px;
  z-index: 10;
}

/* ===== HUD ===== */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px 12px;
}
.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border-radius: 12px;
  padding: 8px 14px;
  flex: 1;
  min-width: 0;
}
.hud-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 700;
}
.hud-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

/* ===== Verse cards / Bible content ===== */
.verse-card {
  margin: 12px 16px;
  padding: 18px 18px 16px;
  background: var(--pastel-cream);
  border-radius: var(--ios-radius);
  position: relative;
}
.verse-text {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.45;
  font-style: italic;
  color: var(--ink-2);
}
.verse-ref {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 8px;
}

/* ===== Loaders ===== */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--ink-6);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--ink-3);
  font-size: 14px;
}

/* ===== Toast ===== */
.toast {
  position: absolute;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,0.92);
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 100;
  animation: toast-in 0.25s ease;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Modal sheet ===== */
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 50;
  animation: fade 0.2s ease;
}
.sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  padding: 14px 0 28px;
  z-index: 51;
  max-height: 70%;
  overflow-y: auto;
  animation: sheet-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-handle {
  width: 36px; height: 5px;
  background: var(--ink-5);
  border-radius: 99px;
  margin: 0 auto 10px;
}
.sheet-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  padding: 4px 20px 12px;
  letter-spacing: -0.02em;
}

/* ===== Tap targets / atoms ===== */
.tap-card {
  background: var(--card);
  border-radius: var(--ios-radius);
  padding: 14px 16px;
  margin: 8px 16px;
  cursor: pointer;
  transition: transform 0.1s;
}
.tap-card:active { transform: scale(0.98); }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ===== Wordle board ===== */
.wordle-board {
  display: grid;
  gap: 6px;
  margin: 16px auto 8px;
  width: max-content;
}
.wordle-row {
  display: grid;
  gap: 6px;
}
.wordle-cell {
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  border: 2px solid var(--ink-6);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-transform: uppercase;
  transition: transform 0.3s;
}
.wordle-cell.filled { border-color: var(--ink-4); }
.wordle-cell.green { background: var(--pastel-green); border-color: var(--pastel-green); }
.wordle-cell.yellow { background: var(--pastel-yellow); border-color: var(--pastel-yellow); }
.wordle-cell.gray { background: var(--ink-4); border-color: var(--ink-4); color: white; }

.kbd {
  display: grid;
  gap: 5px;
  padding: 8px 6px;
  user-select: none;
}
.kbd-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.key {
  flex: 1;
  height: 42px;
  background: #D7D9DC;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-transform: uppercase;
  min-width: 22px;
  transition: background 0.15s;
}
.key:active { background: var(--ink-5); }
.key.wide { flex: 1.5; font-size: 11px; }
.key.green { background: var(--pastel-green); }
.key.yellow { background: var(--pastel-yellow); }
.key.gray { background: var(--ink-4); color: white; }

/* ===== Trivia / multiple choice ===== */
.mc-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--ios-radius);
  padding: 16px;
  margin: 8px 16px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.mc-option:active { transform: scale(0.98); }
.mc-option.correct { background: var(--pastel-green); border-color: #4CAF50; }
.mc-option.wrong { background: var(--pastel-coral); border-color: #E53E3E; }
.mc-option.selected { border-color: var(--ios-blue); }
.mc-letter {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ink-6);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink-2);
  flex-shrink: 0;
}
.mc-text {
  flex: 1;
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 500;
  line-height: 1.3;
}

/* ===== CDBS palette ===== */
.cdbs-palette {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px 16px;
  background: var(--card);
  border-radius: 14px;
  margin: 8px 16px;
}
.cdbs-swatch {
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}
.cdbs-swatch:active { transform: scale(0.92); }
.cdbs-swatch.active { border-color: var(--ink); transform: scale(1.1); }

/* ===== Word search grid ===== */
.ws-grid {
  display: grid;
  gap: 2px;
  background: var(--card);
  padding: 6px;
  border-radius: 12px;
  margin: 8px auto;
  width: max-content;
  max-width: calc(100% - 24px);
  user-select: none;
}
.ws-cell {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  background: var(--bg-grouped);
  border-radius: 4px;
  color: var(--ink);
  text-transform: uppercase;
}
.ws-cell.found { background: var(--pastel-mint); color: var(--ink); }
.ws-cell.selecting { background: var(--pastel-blue); }

/* ===== Heart bins ===== */
.heart-bins {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 16px 16px;
}
.heart-bin {
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px dashed transparent;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.heart-bin.drag-over { border-color: var(--ink); transform: scale(1.04); }
.heart-icon { font-size: 26px; line-height: 1; }

/* ===== Animations ===== */
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.pop { animation: pop 0.3s ease-out; }
.pulse { animation: pulse 1.5s ease-in-out infinite; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake { animation: shake 0.4s; }

/* ===== Fullscreen / mobile overrides (Capacitor / phone) ===== */
body.fullscreen { background: var(--bg); margin: 0; height: 100vh; overflow: hidden; }
body.fullscreen #root { height: 100%; }
body.fullscreen .screen { padding-top: 8px; height: 100%; }

/* ===== Misc ===== */
.divider { height: 0.5px; background: var(--separator); margin: 8px 16px; }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.p-16 { padding: 16px; } .p-20 { padding: 20px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }

/* =====================================================================
 * OBOE THEME LAYER (v1.13) — parchment + ink outlines + hard "stack" shadows
 * Reference: oboe.com. Tokens: bg #E8E1D2, ink #3B2E27, shadow #C7C1B2,
 * accent #E08A3C. Serif display (Averia Serif Libre / Souvenir / Georgia).
 * ===================================================================== */
:root {
  --ob-bg: #E8E1D2;
  --ob-paper: #F1EBDC;
  --ob-ink: #3B2E27;
  --ob-ink-2: #6B5A4E;
  --ob-stack: #C7C1B2;
  --ob-accent: #E08A3C;
  --ob-line: 2.5px solid var(--ob-ink);
  --ob-line-thin: 1.5px solid var(--ob-ink);
  --ob-lift: 0 5px 0 0 var(--ob-stack);

  --ink: #3B2E27; --ink-2: #4E4036; --ink-3: #6B5A4E; --ink-4: #9A8B7C; --ink-5: #C7BDAE; --ink-6: #DDD4C3;
  --bg: #E8E1D2; --bg-grouped: #E2D9C7; --card: #F1EBDC;
  --separator: rgba(59, 46, 39, 0.18);
  --ios-blue: #B5601C;
  --pastel-green: #BCD9A8; --pastel-mint: #CFE3BC; --pastel-yellow: #F2D98C; --pastel-gold: #EBCB7C;
  --pastel-blue: #AFCBD6; --pastel-sky: #C3D9DF; --pastel-pink: #EDBFB5; --pastel-rose: #E7BDB0;
  --pastel-coral: #E9A48E; --pastel-peach: #F0C7A3; --pastel-lavender: #CFC3D8; --pastel-purple: #BBA9CC;
  --pastel-cream: #F1EBDC; --pastel-sand: #E5D8BC;
  --cdbs-gold: #EBCB7C; --cdbs-red: #E9A48E; --cdbs-green: #BCD9A8; --cdbs-blue: #AFCBD6;
  --cdbs-purple: #BBA9CC; --cdbs-brown: #CDB08F; --cdbs-orange: #F0B07A; --cdbs-yellow: #F2D98C;
  --font-display: "Averia Serif Libre", "Souvenir Std", "Souvenir", Georgia, "Times New Roman", serif;
  --font-text: "Public Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-rounded: "Averia Serif Libre", Georgia, serif;
  --font-serif: "Averia Serif Libre", Georgia, serif;
}
html, body { background: var(--ob-bg); color: var(--ob-ink); letter-spacing: 0; }
body.fullscreen { background: var(--ob-bg); }
.screen { background: var(--ob-bg); }
.nav-bar { background: rgba(232, 225, 210, 0.9); border-bottom: 1.5px dashed rgba(59,46,39,0.28); }
.nav-title, .large-title, .tile-title, .game-hero-title, .sheet-title, .btn, .hud-stat-value, .verse-text {
  font-family: var(--font-display); letter-spacing: 0;
}
.large-title { font-weight: 700; font-size: 36px; }
.section-header { font-family: var(--font-display); text-transform: none; font-size: 16px; letter-spacing: 0; color: var(--ob-ink-2); }
.chev::before { border-color: var(--ob-ink); }

/* Outlined, lifted surfaces */
.card-list, .tile, .verse-card, .hud-stat, .sheet, .tap-card, .mc-option, .toast {
  border: var(--ob-line);
  border-radius: 26px;
  box-shadow: var(--ob-lift);
}
.card-list { background: var(--ob-paper); margin-bottom: 6px; }
.row { border-bottom: 1.5px dashed rgba(59,46,39,0.25); }
.row:active { background: rgba(59,46,39,0.08); }
.row-icon { border: var(--ob-line-thin); border-radius: 10px; }
.tile { min-height: 148px; margin-bottom: 5px; }
.tile:active { transform: translateY(4px); box-shadow: 0 1px 0 0 var(--ob-stack); }
.tile-tier { background: var(--ob-paper); border: 1.5px solid var(--ob-ink); border-radius: 999px; color: var(--ob-ink); }
.tile-sub { opacity: 0.85; }

/* Buttons: pressable stacked slabs */
.btn { border: var(--ob-line); border-radius: 999px; box-shadow: 0 4px 0 0 var(--ob-ink); font-weight: 700; transition: transform 0.08s, box-shadow 0.08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 0 var(--ob-ink); opacity: 1; }
.btn-primary { background: var(--ob-accent); color: var(--ob-ink); }
.btn-pastel { background: var(--pastel-sky); }
.btn-ghost { background: var(--ob-paper); }
.btn-pill { box-shadow: 0 3px 0 0 var(--ob-ink); }
.pill { background: var(--ob-paper); border: 1.5px solid var(--ob-ink); color: var(--ob-ink); }
.pill-tab { background: var(--ob-paper); }
.pill-tab.active { background: var(--ob-ink); color: var(--ob-paper); }

/* Game chrome */
.game-hero-emoji { filter: drop-shadow(0 3px 0 var(--ob-stack)); }
.verse-card { background: var(--ob-paper); }
.verse-text { font-style: italic; }
.hud-stat { border-radius: 18px; box-shadow: 0 3px 0 0 var(--ob-stack); background: var(--ob-paper); }
.sheet { border-radius: 30px 30px 0 0; border-bottom: none; background: var(--ob-paper); box-shadow: 0 -4px 0 0 var(--ob-stack); }
.sheet-handle { background: var(--ob-ink); }
.toast { background: var(--ob-ink); color: var(--ob-paper); border-radius: 999px; box-shadow: 0 4px 0 0 rgba(59,46,39,0.35); }
.tap-card, .mc-option { background: var(--ob-paper); box-shadow: 0 4px 0 0 var(--ob-stack); border-radius: 20px; }
.mc-option.correct { background: var(--pastel-green); border-color: var(--ob-ink); }
.mc-option.wrong { background: var(--pastel-coral); border-color: var(--ob-ink); }
.mc-option.selected { border-color: var(--ob-accent); box-shadow: 0 4px 0 0 var(--ob-accent); }

/* Boards, keys, grids */
.wordle-cell { border: var(--ob-line-thin); border-radius: 12px; background: var(--ob-paper); font-family: var(--font-display); font-weight: 700; }
.wordle-cell.filled { border-color: var(--ob-ink); }
.wordle-cell.green { background: var(--pastel-green); border-color: var(--ob-ink); }
.wordle-cell.yellow { background: var(--pastel-yellow); border-color: var(--ob-ink); }
.wordle-cell.gray { background: var(--ink-3); border-color: var(--ob-ink); color: var(--ob-paper); }
.key { background: var(--ob-paper); border: 1.5px solid var(--ob-ink); border-radius: 10px; box-shadow: 0 2px 0 0 var(--ob-ink); color: var(--ob-ink); }
.key:active { transform: translateY(2px); box-shadow: none; background: var(--ink-6); }
.key.green { background: var(--pastel-green); } .key.yellow { background: var(--pastel-yellow); }
.key.gray { background: var(--ink-3); color: var(--ob-paper); }
.ws-grid { border: var(--ob-line); border-radius: 20px; background: var(--ob-paper); box-shadow: var(--ob-lift); }
.ws-cell { font-family: var(--font-display); }
.ws-cell.found { background: var(--pastel-green); }
.heart-bin { border: 2px dashed var(--ob-ink); border-radius: 20px; background: var(--ob-paper); }
.heart-bin.drag-over { border-style: solid; background: var(--pastel-yellow); }
.cdbs-swatch { border: var(--ob-line-thin); box-shadow: 0 3px 0 0 var(--ob-ink); }
.cdbs-swatch.active { border-color: var(--ob-ink); box-shadow: 0 0 0 3px var(--ob-accent), 0 3px 0 0 var(--ob-ink); }
.divider { height: 0; border-top: 1.5px dashed rgba(59,46,39,0.3); background: none; }
.muted { color: var(--ob-ink-2); }
input, textarea { color: var(--ob-ink); }
input[type="text"], input:not([type]), textarea { background: var(--ob-paper); border: var(--ob-line-thin); border-radius: 14px; }
::selection { background: var(--ob-accent); color: var(--ob-ink); }

/* Catch inline white surfaces from game modules */
[style*="background: white"], [style*="background: rgb(255, 255, 255)"], [style*="background: #fff"], [style*="background: #FFF"], [style*="background: var(--card)"] {
  background: var(--ob-paper) !important;
  border-color: var(--ob-ink);
}
.game-hero { border-bottom: var(--ob-line); border-radius: 0 0 34px 34px; box-shadow: 0 5px 0 0 var(--ob-stack); margin-bottom: 6px; }

/* ===== Oboe-style motion + collage ===== */
.iso-banner {
  margin: 4px 16px 10px; border: var(--ob-line); border-radius: 30px; overflow: hidden;
  box-shadow: var(--ob-lift); background: var(--ob-paper); animation: ob-pop 0.5s cubic-bezier(.2,.9,.3,1.2) backwards;
}
.hero-collage { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-collage .iso-collage { height: 100% !important; }
.game-hero { position: relative; overflow: hidden; }
.game-hero > :not(.hero-collage) { position: relative; z-index: 1; }
.game-hero-title { text-shadow: 0 2px 0 var(--ob-paper); }
.iso-banner .iso-collage { border-radius: 0; }

@keyframes ob-pop { 0% { opacity: 0; transform: translateY(10px) scale(0.94); } 100% { opacity: 1; transform: none; } }
@keyframes ob-rise { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }
@keyframes ob-shimmer { 0% { background-position: -120% 0; } 100% { background-position: 250% 0; } }
@keyframes ob-wobble { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes ob-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* staggered entrance for tiles, cards and rows */
.tile, .card-list, .tap-card, .hud-stat, .verse-card { animation: ob-pop 0.45s cubic-bezier(.2,.9,.3,1.15) backwards; }
.tile:nth-child(2) { animation-delay: .05s } .tile:nth-child(3) { animation-delay: .1s } .tile:nth-child(4) { animation-delay: .15s }
.tile:nth-child(5) { animation-delay: .2s } .tile:nth-child(6) { animation-delay: .25s } .tile:nth-child(7) { animation-delay: .3s }
.tile:nth-child(8) { animation-delay: .35s } .tile:nth-child(n+9) { animation-delay: .4s }
.tile-emoji, .game-hero-emoji { display: inline-block; animation: ob-bounce 3.2s ease-in-out infinite; }
.tile:hover .tile-emoji { animation: ob-wobble 0.5s ease-in-out infinite; }
.game-hero-title, .game-hero-sub { animation: ob-rise 0.5s 0.1s ease-out backwards; }
.screen-scroll > .section-header, .screen-scroll > .large-title { animation: ob-rise 0.4s ease-out backwards; }
.pop { animation: ob-pop 0.3s cubic-bezier(.2,.9,.3,1.4); }
.wordle-cell.filled { animation: ob-pop 0.15s ease-out; }
.wordle-cell.green, .wordle-cell.yellow, .wordle-cell.gray { animation: ob-pop 0.4s cubic-bezier(.2,.9,.3,1.4) backwards; }
.mc-option.correct { animation: ob-pop 0.35s cubic-bezier(.2,.9,.3,1.4); }
.toast { animation: ob-toast 0.32s cubic-bezier(.2,.9,.3,1.3) both; white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 32px); line-height: 1.3; }
@keyframes ob-toast { 0% { opacity: 0; transform: translate(-50%, -10px) scale(0.94); } 100% { opacity: 1; transform: translate(-50%, 0); } }

/* spinner + loading in ink */
.spinner { border-color: rgba(59,46,39,0.2); border-top-color: var(--ob-accent); }
.loading-pad { color: var(--ob-ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.cat-hero > :not(.hero-collage) { position: relative; z-index: 1; }
.cat-hero { text-shadow: 0 1px 0 var(--ob-paper); }
.loading-pad { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 20px; }
.loading-collage { width: 100%; max-width: 360px; border: var(--ob-line); border-radius: 28px; overflow: hidden; background: var(--ob-paper); box-shadow: var(--ob-lift); animation: ob-pop 0.4s cubic-bezier(.2,.9,.3,1.2) backwards; }
.loading-label { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 16px; color: var(--ob-ink-2); }
.loading-label .spinner { width: 18px; height: 18px; margin: 0; border-width: 2.5px; display: inline-block; }

/* Outline inline-coloured surfaces from game modules (inline border/shadow still wins) */
[style*="background: var(--pastel"]:not(.game-hero):not(.tile):not(.btn):not(.screen):not(.wordle-cell):not(.key):not(.cat-hero),
[style*="background: var(--cdbs"]:not(.btn):not(.screen),
[style*="background: white"], [style*="background: rgb(255, 255, 255)"], [style*="background: var(--card)"] {
  border: 2px solid var(--ob-ink);
}
[style*="border-radius: 14px"][style*="background: var(--pastel"],
[style*="border-radius: 16px"][style*="background: var(--pastel"],
[style*="border-radius: 18px"][style*="background: var(--pastel"],
[style*="border-radius: 20px"][style*="background: var(--pastel"] {
  box-shadow: 0 4px 0 0 var(--ob-stack);
}
.btn:disabled, .btn[disabled] { opacity: 0.5; box-shadow: 0 2px 0 0 var(--ob-stack); transform: none; cursor: default; }
.btn:disabled:active { transform: none; }

/* ===== The Feed (Oboe "endless puzzles in one feed") ===== */
.feed-screen { padding-top: 0; }
.feed { flex: 1; min-height: 0; overflow-y: auto; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { width: 0; }
.feed-card {
  height: 100%; min-height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; gap: 14px; padding: 58px 18px 26px; position: relative;
  border-bottom: 2.5px solid var(--ob-ink);
}
.feed-top { display: flex; align-items: center; justify-content: space-between; }
.feed-menu { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 17px; color: inherit; }
.feed-burger { width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; border: 1.5px solid currentColor; font-size: 14px; }
.feed-count { font-family: var(--font-display); font-size: 13px; opacity: 0.7; }
.feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 18px; }
.feed-title { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.05; }
.feed-chips { display: flex; gap: 6px; flex-shrink: 0; }
.ob-chip {
  font-family: var(--font-display); font-size: 13px; padding: 5px 10px; border-radius: 7px;
  background: var(--ob-paper); color: var(--ob-ink); border: 1.5px solid var(--ob-ink);
  box-shadow: 0 2px 0 0 var(--ob-ink); transition: transform .08s, box-shadow .08s;
}
.ob-chip:active { transform: translateY(2px); box-shadow: none; }
.feed-tray {
  flex: 1; min-height: 220px; position: relative; overflow: hidden; border-radius: 22px;
  border: var(--ob-line); box-shadow: 0 7px 0 0 var(--ob-ink), 0 12px 0 0 rgba(59,46,39,0.18);
  display: grid; place-items: center; cursor: pointer;
}
.feed-card.dark .feed-tray { border-color: #10201C; box-shadow: 0 7px 0 0 #10201C, 0 12px 0 0 rgba(0,0,0,0.25); }
.feed-collage { position: absolute; inset: 0; }
.feed-collage .iso-collage { height: 100% !important; }
.feed-keycap {
  position: relative; z-index: 1; width: 118px; height: 118px; border-radius: 26px; display: grid; place-items: center;
  font-size: 62px; background: var(--ob-paper); border: var(--ob-line);
  box-shadow: 0 8px 0 0 var(--ob-ink); animation: ob-bounce 3.2s ease-in-out infinite;
}
.feed-rules { padding: 22px; font-size: 15px; line-height: 1.5; color: var(--ob-ink); background: var(--ob-paper); position: absolute; inset: 0; overflow-y: auto; cursor: default; }
.feed-rules-h { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.feed-rules-theme { margin-top: 12px; font-size: 13px; color: var(--ob-ink-2); font-style: italic; }
.feed-status { font-family: var(--font-display); font-style: italic; font-size: 15px; text-align: center; opacity: 0.85; margin-top: 4px; }
.feed-actions { display: flex; align-items: center; gap: 12px; }
.feed-round {
  width: 46px; height: 46px; border-radius: 23px; flex-shrink: 0; display: grid; place-items: center;
  font-size: 20px; color: var(--ob-ink); background: var(--ob-paper); border: 1.5px solid var(--ob-ink);
  box-shadow: 0 3px 0 0 var(--ob-ink);
}
.feed-round:active { transform: translateY(3px); box-shadow: none; }
.feed-round.on { background: var(--pastel-pink); color: #B23A48; animation: ob-pop .3s cubic-bezier(.2,.9,.3,1.4); }
.feed-play { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-hint { text-align: center; font-size: 12px; opacity: 0.6; animation: ob-bounce 1.6s ease-in-out infinite; }
.feed-entry {
  display: flex; align-items: center; gap: 14px; width: calc(100% - 32px); margin: 4px 16px 14px; padding: 16px 18px;
  background: #2F4A45; color: var(--ob-paper); border: var(--ob-line); border-radius: 26px; box-shadow: var(--ob-lift);
  font-family: var(--font-display); animation: ob-pop .45s cubic-bezier(.2,.9,.3,1.15) backwards;
}
.feed-entry:active { transform: translateY(4px); box-shadow: 0 1px 0 0 var(--ob-stack); }
.feed-entry-emoji { font-size: 34px; }
.feed-entry-title { display: block; font-size: 20px; font-weight: 700; }
.feed-entry-sub { display: block; font-family: var(--font-text); font-size: 13px; opacity: 0.8; margin-top: 2px; }
.feed-entry-go { font-size: 22px; }

/* Keycap tiles (Oboe boards): chunky raised faces with an ink bottom edge */
.wordle-cell { box-shadow: 0 3px 0 0 var(--ob-ink); }
.key { box-shadow: 0 3px 0 0 var(--ob-ink); }
.ws-cell { border-radius: 6px; }
.mc-option { box-shadow: 0 4px 0 0 var(--ob-ink); }
.hud-stat { box-shadow: 0 3px 0 0 var(--ob-ink); }
.feed-card.dark .feed-collage { opacity: 0.55; }
.feed-board { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; padding: 18px; }
.fb-grid { display: grid; gap: 7px; padding: 12px; border-radius: 16px; background: rgba(59,46,39,0.82); border: var(--ob-line); box-shadow: 0 6px 0 0 var(--ob-ink); }
.fb-word { grid-template-columns: repeat(5, 46px); }
.fb-cdbs { grid-template-columns: repeat(3, 66px); }
.fb-key {
  height: 46px; border-radius: 9px; display: grid; place-items: center; background: var(--ob-paper);
  font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--ob-ink);
  border: 1.5px solid var(--ob-ink); box-shadow: 0 4px 0 0 #1E1612; animation: ob-pop .4s cubic-bezier(.2,.9,.3,1.3) backwards;
}
.fb-cdbs .fb-key { height: 66px; border-radius: 12px; }
.fb-key.g { background: var(--pastel-green); } .fb-key.y { background: var(--pastel-yellow); }
.fb-key.fb-emoji { font-size: 34px; }
.fb-fan { position: relative; width: 250px; height: 190px; }
.fb-card {
  position: absolute; left: 50%; top: 50%; width: 118px; height: 160px; margin: -80px 0 0 -59px; border-radius: 16px;
  background: var(--ob-paper); border: var(--ob-line); box-shadow: 0 6px 0 0 var(--ob-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px;
  animation: ob-pop .45s cubic-bezier(.2,.9,.3,1.25) backwards;
}
.fb-card:nth-child(1) { left: calc(50% - 62px); } .fb-card:nth-child(3) { left: calc(50% + 62px); }
.fb-card:nth-child(2) { z-index: 2; }
.fb-card-emoji { font-size: 48px; }
.fb-card-tag { font-family: var(--font-display); font-size: 13px; text-align: center; color: var(--ob-ink); line-height: 1.2; }
.fb-card-back { width: 100%; height: 100%; border-radius: 10px; background: #B5601C repeating-linear-gradient(45deg, rgba(241,235,220,.18) 0 7px, transparent 7px 14px); border: 1.5px solid var(--ob-ink); }
@media (max-width: 360px) { .fb-word { grid-template-columns: repeat(5, 38px); } .fb-key { height: 38px; font-size: 17px; } }

/* ===== Play polish v1.15: hints, feedback, celebration ===== */
@keyframes bp-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes bp-glow { 0% { box-shadow: 0 0 0 0 rgba(120,200,140,.75); } 100% { box-shadow: 0 0 0 14px rgba(120,200,140,0); } }
@keyframes bp-jiggle { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-12deg) } 75% { transform: rotate(12deg) } }
@keyframes bp-float-up { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -48px) scale(1); } }
@keyframes bp-confetti { 0% { transform: translate3d(0,-10vh,0) rotate(0); opacity: 1; } 100% { transform: translate3d(var(--dx, 0), 105vh, 0) rotate(var(--rot, 540deg)); opacity: .9; } }
@keyframes bp-hint-ring { 0% { box-shadow: 0 0 0 0 rgba(245,190,60,.9); } 70% { box-shadow: 0 0 0 10px rgba(245,190,60,0); } 100% { box-shadow: 0 0 0 0 rgba(245,190,60,0); } }
@keyframes bp-tap { 0% { transform: scale(1); } 40% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes bp-slide-in { 0% { opacity: 0; transform: translateX(-16px); } 100% { opacity: 1; transform: none; } }

.bp-flip { animation: bp-flip .5s ease-in-out backwards; }
.bp-glow { animation: bp-glow .7s ease-out; }
.bp-shake { animation: shake .4s; }
.bp-tap:active { animation: bp-tap .18s ease-out; }
.bp-slide-in { animation: bp-slide-in .3s ease-out backwards; }
.bp-hinted { animation: bp-hint-ring 1s ease-out 3; outline: 2px dashed #E0A93A; outline-offset: 2px; }
.wordle-cell.green, .wordle-cell.yellow, .wordle-cell.gray { animation: bp-flip .5s ease-in-out backwards; }
.wordle-row.bp-shake { animation: shake .4s; }
.wordle-row.bp-win .wordle-cell { animation: ob-bounce .5s ease-in-out 2; }
.key, .btn, .pill { -webkit-tap-highlight-color: transparent; }
.key:active, .btn:active { transform: scale(.94); transition: transform .08s; }

.hint-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: var(--ob-line-thin, 1.5px solid #3b2e27); background: var(--pastel-yellow, #F5DDA0); color: var(--ob-ink, #3b2e27);
  font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 3px 0 0 var(--ob-stack, rgba(59,46,39,.35)); }
.hint-btn:disabled { opacity: .45; cursor: default; }
.hint-btn .hint-bulb { display: inline-block; }
.hint-btn:not(:disabled):hover .hint-bulb, .hint-btn.bp-used .hint-bulb { animation: bp-jiggle .5s ease-in-out; }
.hint-btn .hint-cost { font-size: 11px; font-weight: 600; opacity: .7; }

.bp-float { position: absolute; left: 50%; top: 0; pointer-events: none; font-family: var(--font-display); font-weight: 800;
  font-size: 22px; color: var(--ob-accent, #B5601C); text-shadow: 0 2px 0 var(--ob-paper, #fff); animation: bp-float-up 1s ease-out forwards; z-index: 40; }

.bp-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.bp-confetti i { position: absolute; top: 0; width: 8px; height: 12px; border-radius: 2px; animation: bp-confetti linear forwards; }
.bp-score-pop { display: inline-block; animation: ob-pop .5s cubic-bezier(.2,.9,.3,1.4) backwards; }
@media (prefers-reduced-motion: reduce) {
  .bp-confetti, .bp-float { display: none; }
  .bp-flip, .bp-glow, .bp-hinted, .wordle-cell.green, .wordle-cell.yellow, .wordle-cell.gray { animation: none; }
}

/* Foundation Storm weather */
@keyframes bp-rain-fall { from { background-position: 0 0; } to { background-position: -40px 280px; } }
@keyframes bp-flash { 0%, 8%, 100% { opacity: 0; } 4% { opacity: .85; } 52% { opacity: 0; } 55% { opacity: .6; } 58% { opacity: 0; } }
@keyframes bp-sway { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }
@keyframes bp-fall-off { 0% { transform: none; opacity: 1; } 100% { transform: translate(120px, 160px) rotate(70deg); opacity: 0; } }
.bp-rain { position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(105deg, rgba(255,255,255,.55) 0 2px, transparent 2px 22px);
  background-size: 40px 70px; animation: bp-rain-fall .5s linear infinite; }
.bp-lightning { position: absolute; inset: 0; background: #fff; pointer-events: none; animation: bp-flash 2.4s linear infinite; }
.bp-sway { animation: bp-sway .9s ease-in-out infinite; transform-origin: bottom center; }
.bp-fall { animation: bp-fall-off 1.1s .5s ease-in forwards; }
@media (prefers-reduced-motion: reduce) { .bp-rain, .bp-lightning { display: none; } .bp-sway, .bp-fall { animation: none; } }
