/* =====================================================================
   Pot & Bloom — Theme selector (index.html)
   Self-contained: does not depend on css/styles.css.
   ===================================================================== */

:root {
  --maroon:  #651C23;
  --ink:     #2B2320;
  --ink-soft:#6B615B;
  --ink-faint:#A99E95;
  --line:    #ECE3D6;
  --surface: #ffffff;
  --r-md: 16px;
  --r-lg: 22px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 700px at 50% -10%, #FBF4E8 0%, #F5EDDD 55%, #EFE6D2 100%);
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 12px;
}

/* ----------------------------- Phone frame ------------------------- */
.phone {
  position: relative;
  width: 390px;
  height: 844px;
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border-radius: 44px;
  box-shadow: 0 30px 70px rgba(30, 40, 33, .28), 0 0 0 11px #1d211e, 0 0 0 13px #2c322d;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 150px; height: 28px; background: #1d211e;
  border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;
  z-index: 60;
}
.status-bar {
  height: 50px; flex: 0 0 50px;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 24px 6px; font-size: 13px; font-weight: 700; color: var(--ink);
}
.sb-right { display: flex; align-items: center; gap: 5px; }

/* ------------------------------- Picker ---------------------------- */
.ts-screen {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: linear-gradient(170deg, #FFF6E6 0%, #F6F2E3 55%, #ffffff 100%);
}

.ts-head { padding: 12px 24px 8px; text-align: center; }
.ts-head img { display: block; margin: 0 auto; width: 104px; height: auto; }
.ts-title {
  margin: 10px 0 3px; font-size: 18px; font-weight: 800; letter-spacing: -.2px;
}
.ts-sub { font-size: 12px; color: var(--ink-soft); line-height: 1.45; margin: 0; }

.ts-list {
  flex: 1 1 auto; overflow-y: auto;
  padding: 2px 20px 12px;
  display: flex; flex-direction: column; gap: 9px;
}
.ts-list::-webkit-scrollbar { width: 0; }

/* ---- Theme card ---- */
.ts-card {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 3px 12px rgba(74, 20, 26, .08);
  color: inherit; text-decoration: none; font: inherit;
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease;
}
.ts-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(74, 20, 26, .14); }
.ts-card:active { transform: scale(.985); }
.ts-card.is-current { border-color: var(--maroon); }

/* Swatch — a mini phone showing the theme's chrome + palette */
.ts-swatch {
  flex: 0 0 auto; width: 56px; height: 70px; border-radius: 12px;
  overflow: hidden; position: relative;
  border: 1px solid rgba(0, 0, 0, .08);
  background: var(--sw-bg, #fff);
  background-size: cover; background-position: center;
  display: flex; flex-direction: column;
}
.ts-swatch .sw-bar { height: 20px; background: var(--sw-bar, #fff); border-bottom: 1px solid rgba(0,0,0,.06); }
.ts-swatch .sw-body { flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.ts-swatch .sw-line { height: 6px; border-radius: 3px; background: var(--sw-card, rgba(255,255,255,.8)); }
.ts-swatch .sw-line.short { width: 60%; }
/* Image variants show a photo tile inside the card instead of a third
   text line — the veil is applied to media, not to the chrome. */
.ts-swatch .sw-photo {
  flex: 1 1 auto; min-height: 0; border-radius: 3px;
  background-size: cover; background-position: center;
}
.ts-swatch .sw-nav {
  height: 14px; background: var(--sw-nav, #fff);
  border-top: 1px solid rgba(0,0,0,.06);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.ts-swatch .sw-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--sw-accent, #651C23); }
.ts-swatch .sw-dot.mute { background: rgba(0, 0, 0, .18); }

.ts-body { flex: 1 1 auto; min-width: 0; }
.ts-name {
  font-size: 15px; font-weight: 800; letter-spacing: -.1px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.ts-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: #F5E7E8; color: #4A141A;
}
.ts-desc { font-size: 11px; color: var(--ink-soft); line-height: 1.42; margin-top: 3px; }

/* Palette chips */
.ts-chips { display: flex; gap: 5px; margin-top: 7px; }
.ts-chip {
  width: 15px; height: 15px; border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, .08);
}

.ts-go {
  flex: 0 0 auto; align-self: center;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: #F5E7E8; color: var(--maroon);
}
.ts-go svg { width: 15px; height: 15px; }

.ts-foot {
  flex: 0 0 auto;
  padding: 8px 24px 12px; text-align: center;
  font-size: 10px; color: var(--ink-faint); line-height: 1.45;
  background: rgba(255, 255, 255, .82);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 430px) {
  body { padding: 0; }
  .phone { width: 100%; height: 100vh; max-height: none; border-radius: 0; box-shadow: none; }
  .notch { display: none; }
}
