/* Zeltrix Play subscriptions: events preferences form and per-event Follow button (scripts/lib/subscribe.mjs).
 * Loaded after styles.css by pages that render them: writePage({ styles: ['subscribe.css'] }).
 * Builds on the .newsletter-* rules in styles.css; these forms sit on light backgrounds. */

.subscribe-prefs { color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; gap: 16px; box-shadow: var(--shadow); }
.subscribe-label { font-size: 14px; font-weight: 700; color: var(--ink); }
.subscribe-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.subscribe-group legend { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; padding: 0; }
.subscribe-group legend span { font-weight: 400; color: var(--muted); }
.subscribe-prefs .newsletter-chip { border-color: var(--border-strong); background: var(--bg); color: var(--text); }
.subscribe-prefs .newsletter-chip:has(input:checked) { border-color: var(--blue); background: var(--bg-soft); }
.subscribe-prefs .newsletter-chip input { accent-color: var(--blue); }

.subscribe-where { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr); gap: 10px 12px; align-items: end; }
.subscribe-where legend { grid-column: 1 / -1; }
.subscribe-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.subscribe-field label { font-size: 13px; color: var(--muted); }
.subscribe-field select, .subscribe-field input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); font: inherit; width: 100%; }
.subscribe-field input { text-transform: uppercase; }
.subscribe-note { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); }

.subscribe-frequency { display: flex; flex-direction: column; gap: 6px; }
.subscribe-radio, .subscribe-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.subscribe-radio input, .subscribe-check input { margin-top: 3px; width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--blue); }
.subscribe-prefs .newsletter-consent input { accent-color: var(--blue); }
.subscribe-actions { display: flex; }
.subscribe-prefs .newsletter-status[data-kind=ok], .play-follow .newsletter-status[data-kind=ok] { color: var(--ok-text); }
.subscribe-prefs .newsletter-status[data-kind=error], .play-follow .newsletter-status[data-kind=error] { color: var(--error-text); }

/* Follow button + inline form */
.play-follow { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.play-follow-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; font-size: 14px; background: transparent; color: var(--ink); border-color: var(--border-strong); }
.play-follow-button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.play-follow-button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.play-follow-button.is-following { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.play-follow-form[hidden] { display: none; } /* .newsletter-form sets display:flex, which would beat the hidden attribute */
.play-follow-form { width: 100%; max-width: 520px; color: var(--text); background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.play-follow-lead { margin: 0; font-size: 14px; line-height: 1.5; }
.play-follow-form .newsletter-consent input { accent-color: var(--blue); }

@media (max-width: 640px) {
  .subscribe-prefs { padding: 16px; }
  .subscribe-where { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .subscribe-where .subscribe-field:first-of-type { grid-column: 1 / -1; }
}

/* Short signup cards (releases, learn): scripts/lib/subscribe.mjs releaseNewsSignup / eventsWeekSignup */
.signup-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px 32px; align-items: start; margin: 40px 0 8px; padding: 24px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.signup-copy h2 { margin: 0 0 8px; font-size: 22px; }
.signup-copy p { margin: 0; color: var(--text); line-height: 1.6; }
.signup-card .signup-form { padding: 0; border: 0; box-shadow: none; background: transparent; }
.signup-card .newsletter-status[data-kind=ok] { color: var(--ok-text); }
.signup-card .newsletter-status[data-kind=error] { color: var(--error-text); }
@media (max-width: 760px) { .signup-card { grid-template-columns: 1fr; padding: 18px; } }

/* Preferences v2: email choices, "use my location", no-JS note */
.subscribe-emails { display: flex; flex-direction: column; gap: 8px; }
.subscribe-hint { display: block; font-size: 13px; color: var(--muted); }
.subscribe-locate-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.subscribe-locate { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.subscribe-locate[hidden] { display: none; }
.newsletter-noscript { margin: 0; font-size: 14px; color: var(--warn-text); background: var(--warn-bg); border-radius: var(--radius-sm); padding: 8px 12px; }
.newsletter-form button[disabled][data-needs-js] { opacity: .6; cursor: not-allowed; }

/* Favourite stores (src/assets/play.js): star on venue lists and a labelled button on venue pages */
/* Above the cards' stretched-link overlay (styles.css: h3 a::after, z-index 1), so they stay clickable. */
.play-fav-store, .release-follow-btn { position: relative; z-index: 2; }
.play-fav-store { display: inline-flex; align-items: center; justify-content: center; gap: 6px; vertical-align: middle; cursor: pointer; color: var(--subtle); }
.play-fav-store:not(.button) { width: 36px; height: 36px; margin-left: 6px; padding: 0; border: 0; border-radius: 999px; background: transparent; }
.play-fav-store:not(.button):hover { background: var(--bg-soft); color: var(--navy); }
.play-fav-store .ico { width: 20px; height: 20px; }
.play-fav-store.is-fav { color: var(--navy); }
.play-fav-store.is-fav .ico { fill: var(--lime); stroke: var(--navy); }
.play-fav-store.button { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.play-fav-store.button.is-fav { background: var(--lime); border-color: var(--lime); }
.play-fav-store:focus-visible, .release-follow-btn:focus-visible, .my-game-chip:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; box-shadow: 0 0 0 5px var(--navy); }
/* Labelled in lists too ("Favourite" / "Favourite ✓"), filled once added; on store cards it sits in the top corner. */
.play-fav-store.is-labelled { width: auto; height: 32px; margin: 0; padding: 0 12px 0 9px; border: 1px solid var(--border-strong); border-radius: 999px; background: #fff; color: var(--navy); font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap; }
.play-fav-store.is-labelled:hover { border-color: var(--navy); background: #fff; }
.play-fav-store.is-labelled .ico { width: 16px; height: 16px; }
.play-fav-store.is-labelled.is-fav { background: var(--lime); border-color: var(--lime); }
.play-fav-store.is-fav.is-labelled .ico, .play-fav-store.button.is-fav .ico { fill: var(--navy); stroke: var(--navy); }
.play-venues > li.has-fav > h3 { padding-right: 120px; }
.play-venues > li.has-fav > .play-fav-store { position: absolute; top: 16px; right: 14px; }
.play-fav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 0; }
.play-header .play-fav-row .inline-link { color: inherit; }

/* Release follows (src/assets/follow.js) */
.release-follow { margin: 10px 0 0; }
.release-follow-btn { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.release-follow-btn[hidden] { display: none; }
.release-follow-btn.is-following { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.release-follow-note { margin: 12px 0 16px; font-size: 14px; color: var(--text); }
.release-follow-note[hidden], .release-follow-section[hidden] { display: none; }
.release-follow-section { margin: 40px 0 8px; padding: 24px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.release-follow-section h2 { margin: 0 0 8px; font-size: 22px; }
.release-follow-section > p { margin: 0 0 16px; line-height: 1.6; }
.release-follow-form { padding: 0; border: 0; box-shadow: none; background: transparent; }

/* My Zeltrix (/my-zeltrix/) */
.my-section h2 { margin-bottom: 8px; }
.my-game-chips { margin-top: 8px; }
.my-game-chip { cursor: pointer; font: inherit; }
.my-game-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.my-store-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.my-store-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.my-store-list a { color: var(--ink); font-weight: 700; }
.my-hint { font-size: 14px; margin-top: 8px; }
.my-city { max-width: 280px; margin: 0 0 12px; }
.my-release-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.my-release { display: flex; align-items: flex-start; gap: 14px; padding: 12px 16px 12px 12px; border: 1px solid var(--border); border-left: 5px solid var(--g); border-radius: var(--radius); background: var(--bg); }
.my-release-thumb { display: grid; flex: 0 0 72px; place-items: center; width: 72px; height: 72px; overflow: hidden; border-radius: 12px; background: #f3f5fa; }
.my-release-thumb img { width: 100%; height: 100%; padding: 4px; box-sizing: border-box; object-fit: contain; }
.my-release-thumb .fs-tile { display: grid; place-items: center; width: 100%; height: 100%; padding: 4px; box-sizing: border-box; background: var(--g); color: var(--g-on); font-size: 10px; font-weight: 800; line-height: 1.1; text-align: center; text-transform: uppercase; }
.my-release-text { flex: 1 1 auto; min-width: 0; }
.my-release-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; font-size: 13px; }
.my-release-name { font-weight: 700; color: var(--ink); }
.my-release-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.my-release-when .cd { display: inline-flex; padding: 2px 10px; border-radius: 999px; background: var(--lime); color: var(--navy); font-size: 12px; font-weight: 800; line-height: 1.6; }
.my-release-ca { margin: -4px 0 6px; }
.my-release-delay { margin: -2px 0 8px; font-size: 13px; line-height: 1.45; color: #7a4a00; }
.my-page [data-my-clear][hidden] { display: none; }

/* My Zeltrix dashboard (owner, 2026-10-22: the visitor's own events and follows first; scripts/sections/my.mjs) */
.my-page .play-shell > .my-section:first-of-type, .my-page .member-pitch + noscript + .my-section { margin-top: 24px; }
/* "Events for your games": one of two lines, picked before the first paint (html.has-city, member-flag.js; play.js
   keeps it in step and fills in the city's name). */
.my-where { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.my-where[data-my-where-city], html.has-city .my-where[data-my-where-all] { display: none; }
html.has-city .my-where[data-my-where-city] { display: block; }
.my-sub { margin: 18px 0 8px; font-size: 17px; font-weight: 800; color: var(--ink); }
.my-section > h2 + .my-sub { margin-top: 4px; }
.my-more { margin: 8px 0 0; font-size: 14px; }
.my-all-games { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.my-stores-block { margin-bottom: 4px; }
.my-near-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.my-near-item { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.my-near-item a { color: var(--ink); font-weight: 700; }
.my-how { padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); }
.my-how > summary { cursor: pointer; list-style: none; }
.my-how > summary::-webkit-details-marker { display: none; }
.my-how > summary h2 { display: inline; margin: 0; font-size: 20px; }
.my-how > summary::after { content: '+'; margin-left: 10px; font-size: 22px; font-weight: 800; color: var(--blue); }
.my-how[open] > summary::after { content: '−'; }
.my-how > p { margin: 12px 0 0; line-height: 1.6; }
/* Room for the visitor's own lists until they load (html.has-*, set in <head> by member-flag.js; play.js adds .is-loaded),
   so the sections below do not jump when the events arrive. About four cards on phones, two rows of two on wider screens. */
html.has-saved [data-my-saved-events]:not(.is-loaded), html.has-stores [data-my-store-events]:not(.is-loaded), html.has-games [data-my-game-events]:not(.is-loaded) { min-height: 1000px; }
@media (min-width: 701px) { html.has-saved [data-my-saved-events]:not(.is-loaded), html.has-stores [data-my-store-events]:not(.is-loaded), html.has-games [data-my-game-events]:not(.is-loaded) { min-height: 540px; } }
html.has-saved [data-my-saved-empty][data-initial], html.has-stores [data-my-store-events-empty][data-initial], html.has-games [data-my-game-events-empty][data-initial] { display: none; }
