:root {
  --bg: #0E0A0B;
  --surface: #1C1214;
  --surface-2: #2A0D14;
  --line: #3A2226;
  --line-soft: #2E1C1F;
  --wine: #7A0E1E;
  --red: #C41E3A;
  --gold: #E0B04A;
  --gold-hi: #F0C768;
  --cream: #F6EAD3;
  --muted: #BFAE9C;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: Manrope, system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #080607; color: var(--cream); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
button { font-family: var(--sans); cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 560px; min-height: 100vh; margin: 0 auto; background: var(--bg); position: relative; }
.view { padding: 18px 20px calc(96px + var(--safe-b)); outline: none; }
@media (min-width: 600px) { .app { border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); } }

/* Tab bar */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(5, 1fr); background: #080607; border-top: 1px solid var(--line-soft); padding: 6px 0 calc(8px + var(--safe-b)); z-index: 10; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; justify-content: center; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabbar a.active { color: var(--gold); }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
.h-display { font-size: 36px; line-height: 1.05; font-weight: 500; }
.h-display em { color: var(--gold); }
.h-page { font-size: 30px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.eyebrow.gold { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.section { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }

/* Header */
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 54px; height: 54px; border-radius: 50%; background: #fff; border: 1px solid var(--gold); object-fit: cover; }
.brand .club { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.brand .name { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--gold); }
.flourish { display: block; width: 100%; height: 14px; margin: 14px 0 6px; }

/* Inputs */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; height: 54px; }
.search svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--cream); font: 16px var(--sans); outline: none; }
.search input::placeholder { color: #9A8A7C; }
.field { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--cream); font: 16px var(--sans); padding: 12px 14px; }
textarea.field { min-height: 90px; resize: vertical; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--cream); font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 600; }
.chip.more { background: transparent; border-style: dashed; color: var(--gold); }
.tag { display: inline-flex; padding: 5px 10px; border-radius: 12px; border: 1px solid var(--red); font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 14px; background: var(--red); font-size: 12px; font-weight: 600; border: 0; color: var(--cream); }

/* Spice */
.spice { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.spice button { height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.spice button.on { background: var(--red); border-color: var(--red); color: var(--cream); font-weight: 700; }
.peppers { color: var(--gold); font-size: 12px; letter-spacing: 1px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.btn-gold { background: var(--gold); color: var(--bg); }
.btn-gold:hover { background: var(--gold-hi); color: var(--bg); }
.btn-red { background: var(--red); color: var(--cream); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--cream); }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--cream); border-radius: 22px; text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card-red { background: var(--surface-2); border-color: var(--red); }
.card-gold { border-color: var(--gold); }
.result { display: flex; gap: 12px; }
.result .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.result .title { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.1; color: var(--cream); text-decoration: none; }
.result .actions { display: flex; gap: 6px; margin-top: 6px; }
.result .actions .btn { min-height: 38px; font-size: 12px; flex: 1; padding: 0 8px; }
.list { display: flex; flex-direction: column; gap: 12px; }

/* Covers */
.cover { width: 72px; height: 108px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--wine); position: relative; display: block; }
.cover img, .cover svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover img { position: absolute; inset: 0; }
.cover.lg { width: 120px; height: 180px; box-shadow: 0 12px 34px rgba(196, 30, 58, .35); border: 1px solid var(--gold); }
.cover.sm { width: 60px; height: 90px; }

/* Book detail */
.book-head { display: flex; gap: 16px; align-items: flex-end; margin-top: 4px; }
.pairing { display: flex; gap: 12px; align-items: center; }
.pairing svg { width: 46px; height: 46px; flex-shrink: 0; }
.buy { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 12px; text-decoration: none; font-size: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--cream); }
.buy.primary { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 700; }
.buy span { color: var(--gold); font-size: 12px; }
.buy.primary span { color: var(--bg); }
details.cw { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
details.cw summary { min-height: 46px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-size: 14px; list-style: none; }
details.cw summary::-webkit-details-marker { display: none; }
details.cw p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.disclosure { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 10px; }

/* Segmented */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 42px; border-radius: 10px; border: 0; background: transparent; color: var(--cream); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-selected="true"] { background: var(--gold); color: var(--bg); }
.seg svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* Threads */
.thread { display: flex; flex-direction: column; gap: 4px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.thread:last-child { border-bottom: 0; }
.thread b { font-size: 15px; }
.badge { font-size: 10px; font-weight: 700; color: var(--red); letter-spacing: 1px; margin-left: 6px; }
.post-actions { display: flex; gap: 14px; font-size: 12px; }
.post-actions button { background: none; border: 0; color: var(--muted); padding: 6px 0; min-height: 32px; font-size: 12px; }

/* Spin */
.table { position: relative; width: min(330px, 86vw); aspect-ratio: 1; margin: 18px auto 0; }
.table > svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.seat { position: absolute; width: 31%; min-height: 38px; transform: translate(-50%, -50%); padding: 4px 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; display: flex; align-items: center; justify-content: center; transition: background .3s, opacity .3s; }
.seat.hit { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.seat.out { opacity: .35; text-decoration: line-through; }
.bottle { position: absolute; left: 50%; top: 50%; width: 13%; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); transition: transform 3.2s cubic-bezier(.15, .7, .2, 1); }
.bottle svg { width: 100%; height: auto; display: block; }
.shortlist li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line-soft); min-height: 46px; font-size: 14px; }
.shortlist { list-style: none; padding: 0; margin: 0; }

/* Age gate */
.agegate { position: fixed; inset: 0; background: rgba(8, 6, 7, .96); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.agegate[hidden] { display: none; }
.agegate-card { max-width: 360px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.agegate-card img { border-radius: 50%; background: #fff; border: 2px solid var(--gold); }
.agegate-card h1 { font-size: 32px; }
.agegate-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.agegate-card .btn { width: 100%; }

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty h2 { color: var(--cream); font-size: 24px; margin-bottom: 6px; }
.note { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; line-height: 1.5; }
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--gold); color: var(--bg); font-weight: 700; font-size: 13px; padding: 10px 16px; border-radius: 20px; z-index: 30; }

/* Password show/hide */
.pw-wrap { position: relative; }
.pw-wrap .field { padding-right: 76px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; min-width: 60px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--gold); font-size: 12px; font-weight: 700; }

/* Reading status buttons */
.status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.status-row button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--cream); font-size: 13px; font-weight: 600; }
.status-row button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; padding: 10px 0; min-height: 40px; }

/* Bookcase */
.bookcase { margin-top: 14px; padding: 16px 12px 4px; border-radius: 10px; background: linear-gradient(180deg, #2A160C, #1C0E08); border: 3px solid #4A2A14; box-shadow: inset 0 0 24px rgba(0,0,0,.6); }
.case-row { margin-bottom: 14px; }
.case-books { display: flex; align-items: flex-end; gap: 3px; min-height: 132px; padding: 0 2px; }
.bookend { height: 124px; width: auto; flex-shrink: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.case-empty + .bookend { margin-left: auto; }
.case-books > span[role="listitem"] { display: flex; }
.spine { display: flex; align-items: center; justify-content: center; border-radius: 3px 3px 1px 1px; text-decoration: none; box-shadow: inset 2px 0 0 rgba(255,255,255,.12), inset -3px 0 0 rgba(0,0,0,.35), 0 2px 3px rgba(0,0,0,.5); background-image: linear-gradient(transparent 10px, rgba(224,176,74,.55) 10px, rgba(224,176,74,.55) 12px, transparent 12px, transparent calc(100% - 12px), rgba(224,176,74,.55) calc(100% - 12px), rgba(224,176,74,.55) calc(100% - 10px), transparent calc(100% - 10px)); overflow: hidden; }
.spine span { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--serif); font-size: 11px; font-weight: 600; line-height: 1.05; max-height: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spine:hover, .spine:focus-visible { transform: translateY(-6px); transition: transform .15s; }
.case-empty { flex: 1; text-align: center; font-size: 12px; color: #BFAE9C; align-self: center; padding: 0 6px; }
.plank { height: 14px; margin: 0 -12px; background: linear-gradient(180deg, #7A4A22, #4A2A14 70%, #2A160C); box-shadow: 0 4px 6px rgba(0,0,0,.5); border-radius: 2px; }

/* Meetup theme */
.theme-line { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--cream); margin-top: 2px; }
.theme-tag { display: inline-block; font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--bg); background: var(--gold); border-radius: 6px; padding: 2px 6px; vertical-align: 2px; }

/* iPhone: never auto-zoom when tapping a text box (needs 16px+), and never scroll sideways. */
input, select, textarea { font-size: 16px; }
html, body { overflow-x: hidden; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.cal-head { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; letter-spacing: 1px; }
.cal-day { position: relative; aspect-ratio: 1; min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--cream); text-decoration: none; font-size: 14px; }
.cal-day.today { border-color: var(--gold); color: var(--gold); font-weight: 700; }
.cal-day.sel { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.cal-day .dots { display: flex; gap: 3px; height: 6px; }
.dot { width: 6px; height: 6px; border-radius: 3px; display: inline-block; background: var(--cream); }
.dot.kind-meetup { background: var(--red); } .dot.kind-zoom { background: #5BA8FF; } .dot.kind-other { background: var(--gold); }
.cal-day.sel .dot { box-shadow: 0 0 0 1px var(--bg); }
.kind-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--surface-2); color: var(--cream); border: 1px solid var(--line); }
.kind-badge.kind-meetup { background: var(--red); border-color: var(--red); }
.kind-badge.kind-zoom { background: #1D3A66; border-color: #5BA8FF; color: #CFE4FF; }
.kind-badge.kind-other { background: #3A2A10; border-color: var(--gold); color: var(--gold); }
.event-card { display: flex; flex-direction: column; gap: 6px; }
.event-title { font-family: var(--serif); font-size: 21px; line-height: 1.15; }
.up-row { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: var(--cream); padding: 6px 0; border-top: 1px solid var(--line-soft); }
.up-row .kind-badge { flex-shrink: 0; margin-top: 2px; }

/* Blog */
.blog-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.blog-logo { width: 100%; max-width: 420px; height: auto; display: block; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.blog-card { display: flex; gap: 12px; text-decoration: none; color: inherit; }
.blog-card .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.blog-card .title { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.15; color: var(--cream); }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 14px; }
.post { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.post-title { font-size: 34px; line-height: 1.08; font-weight: 600; }
.review-box { display: flex; gap: 12px; margin-top: 6px; }
.review-box .info { display: flex; flex-direction: column; gap: 4px; }
.review-box .title { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--cream); text-decoration: none; }
.post-body { font-size: 17px; line-height: 1.7; color: #EFE3CC; }
.post-body p { margin: 0 0 1em; }
.post-body strong { color: var(--cream); }
.post-body em { color: var(--gold-hi); }

/* Spin: Club pick / Practice tabs, turn order editor */
.seg a.seg-a { min-height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--cream); text-decoration: none; }
.seg a.seg-a[aria-current="page"] { background: var(--gold); color: var(--bg); }
.seg button:disabled { opacity: .45; }
.rot-list { margin: 4px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.rot-list li { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.rot-list li.cur { color: var(--gold); }
.rb { min-height: 34px; min-width: 34px; padding: 0 8px; font-size: 12px; }

.btn:disabled { opacity: .45; cursor: default; }
