/* js/side-picker.css - PICK A SIDE (js/side-picker.js), the one overview every side game shows before its front room.
 *
 * The founder (2026-09-28): "a cool overview page on what each side is / does." Two painted halves: THE HERD on the
 * candy village holding the light (the war page's banner, its bright half) in candy pink and gold, THE HORDE on the
 * evil splash in toxic green, a render of each side
 * standing in its painting, the ten gods' faces under the Horde, and the side game's own lines. Everything is scoped
 * under .sp so it sits on any side game's page without touching that page's rules. System fonts only (the site's CSP
 * allows no font host). Motion stops under prefers-reduced-motion. */

.sp {
  --sp-ink: #0B0814;
  --sp-parchment: #FBF3E7;
  --sp-lavender: #C9A8F5;
  --sp-muted: #A99BC9;
  --sp-gold: #F5C242;
  --sp-pink: #FF8FC7;
  --sp-green: #6BE04A;
  --sp-green-soft: #B9F59E;
  --sp-blood: #FF6B6B;
  --sp-font: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
  --sp-title: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  position: fixed; inset: 0; z-index: 48;
  background: radial-gradient(120% 90% at 50% 0%, #1E1433 0%, var(--sp-ink) 62%);
  color: var(--sp-parchment); font-family: var(--sp-font); line-height: 1.45;
  opacity: 0; transition: opacity 0.26s ease;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.sp.is-open { opacity: 1; }
.sp *, .sp *::before, .sp *::after { box-sizing: border-box; }
.sp button { font-family: inherit; }

.sp-shell {
  min-height: 100%; display: flex; flex-direction: column; gap: clamp(10px, 2vh, 20px);
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  max-width: 1240px; margin: 0 auto;
}
.sp-wait { margin: auto; color: var(--sp-muted); letter-spacing: 0.08em; }

/* ---- the head ---------------------------------------------------------------------------------------------------- */
.sp-head { text-align: center; padding-top: clamp(2px, 1.2vh, 14px); }
.sp-kicker { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--sp-lavender); }
.sp-kicker-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--sp-gold); box-shadow: 0 0 8px var(--sp-gold); }
.sp-title {
  margin: 2px 0 0; font-family: var(--sp-title); font-weight: bold; font-size: clamp(32px, 5.2vw, 58px); line-height: 1.02; letter-spacing: 0.06em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--sp-pink) 0%, var(--sp-gold) 38%, var(--sp-green-soft) 62%, var(--sp-green) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6));
}
.sp-sub { margin: 2px 0 0; font-family: var(--sp-title); font-style: italic; font-size: clamp(15px, 1.8vw, 19px); color: #E6D8FF; }
.sp-note { margin: 8px auto 0; max-width: 780px; font-size: 14px; color: var(--sp-parchment); background: rgba(42, 33, 64, 0.55); border: 1px solid rgba(201, 168, 245, 0.28); border-radius: 12px; padding: 8px 14px; }
.sp-note--warn { border-color: rgba(255, 143, 199, 0.55); background: rgba(74, 20, 44, 0.5); }

/* ---- the two halves ---------------------------------------------------------------------------------------------- */
.sp-sides { flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(8px, 1.4vw, 18px); align-items: stretch; }
.sp-vs { display: grid; place-items: center; }
.sp-vs span { font-family: var(--sp-title); font-style: italic; font-size: 22px; color: var(--sp-muted); text-shadow: 0 2px 10px #000; }

.sp-side {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 20px;
  display: flex; flex-direction: column;
  background: var(--sp-panel);
  border: 1px solid var(--sp-edge); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.sp-side--herd { --sp-accent: var(--sp-pink); --sp-accent-2: var(--sp-gold); --sp-edge: rgba(255, 143, 199, 0.45); --sp-glow: rgba(255, 143, 199, 0.35);
  --sp-panel: linear-gradient(180deg, #2A1A36 0%, #1A1226 100%); }
.sp-side--horde { --sp-accent: var(--sp-green); --sp-accent-2: var(--sp-green-soft); --sp-edge: rgba(107, 224, 74, 0.45); --sp-glow: rgba(107, 224, 74, 0.35);
  --sp-panel: linear-gradient(180deg, #13241A 0%, #0A120D 100%); }
.sp-side:hover { transform: translateY(-3px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--sp-glow); border-color: var(--sp-accent); }
.sp-side.is-mine { border-color: var(--sp-accent); box-shadow: 0 0 0 2px var(--sp-accent), 0 0 46px var(--sp-glow), 0 18px 50px rgba(0, 0, 0, 0.55); }

/* the painting across the top of each half, a render of the side standing in it */
.sp-hero { position: relative; height: clamp(118px, 21vh, 210px); overflow: hidden; flex: none; }
.sp-art { position: absolute; inset: -4%; background-size: cover; background-position: 18% 58%; animation: sp-drift 26s ease-in-out infinite alternate; }
.sp-side--horde .sp-art { background-position: 52% 26%; }
.sp-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 8, 20, 0) 45%, rgba(26, 18, 38, 0.92) 100%); }
.sp-side--horde .sp-hero-shade { background: linear-gradient(180deg, rgba(5, 12, 8, 0) 40%, rgba(19, 36, 26, 0.95) 100%); }
.sp-unit { position: absolute; bottom: -6px; height: 92%; width: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.65)); animation: sp-bob 5.5s ease-in-out infinite; pointer-events: none; }
.sp-side--herd .sp-unit { right: 5%; }
.sp-side--horde .sp-unit { right: 5%; transform: scaleX(-1); animation-name: sp-bob-flip; }
.sp-badge { position: absolute; top: 12px; left: 12px; margin: 0; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: bold; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sp-ink); background: var(--sp-accent); box-shadow: 0 0 16px var(--sp-glow), 0 4px 10px rgba(0, 0, 0, 0.5); }
.sp-gods { position: absolute; left: 14px; bottom: 10px; right: 34%; display: flex; flex-wrap: wrap; gap: 5px; }
.sp-god { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6); }
.sp-god.is-sworn { width: 40px; height: 40px; box-shadow: 0 0 14px var(--sp-green); }

.sp-body { position: relative; flex: 1; display: flex; flex-direction: column; padding: clamp(10px, 1.8vw, 20px) clamp(14px, 2.2vw, 24px) clamp(14px, 2vw, 20px); }
.sp-titlerow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.sp-name { margin: 0; font-family: var(--sp-title); font-size: clamp(26px, 3.2vw, 40px); line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sp-accent-2); text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8), 0 0 24px var(--sp-glow); }
.sp-tag { margin: 4px 0 6px; font-family: var(--sp-title); font-style: italic; font-size: 16px; color: var(--sp-parchment); }
.sp-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.sp-lines li { position: relative; padding-left: 16px; font-size: 14px; color: #D9CCEF; }
.sp-lines li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--sp-accent); box-shadow: 0 0 6px var(--sp-accent); }
.sp-coin { margin: 0; display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 5px; border-radius: 999px; background: rgba(11, 8, 20, 0.6); border: 1px solid var(--sp-edge); font-size: 12px; font-weight: bold; color: var(--sp-accent-2); }
.sp-coin img { width: 20px; height: 20px; object-fit: contain; }
.sp-here { margin: 10px 0 5px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--sp-accent); }
.sp-lines--here li { color: var(--sp-parchment); }
.sp-act { margin-top: auto; padding-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* ---- buttons and links ------------------------------------------------------------------------------------------- */
.sp-btn {
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: bold; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sp-ink);
  background: linear-gradient(180deg, var(--sp-accent-2, var(--sp-gold)), var(--sp-accent, var(--sp-pink)));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 22px var(--sp-glow, rgba(245, 194, 66, 0.3));
  transition: transform 0.15s ease, filter 0.15s ease;
}
.sp-btn:hover:not([disabled]) { transform: translateY(-1px); filter: brightness(1.08); }
.sp-btn:focus-visible, .sp-link:focus-visible, .sp-tile:focus-visible { outline: 3px solid var(--sp-parchment); outline-offset: 3px; }
.sp-btn[disabled] { cursor: default; opacity: 0.55; filter: grayscale(0.4); }
.sp-btn--mine { min-width: 180px; }
.sp-btn--dark { color: var(--sp-green-soft); background: linear-gradient(180deg, #1C3A16, #0C1A09); border: 1px solid var(--sp-green); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 22px rgba(107, 224, 74, 0.3); }
.sp-btn--danger { color: #fff; background: linear-gradient(180deg, #D9364A, #7A1022); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 107, 107, 0.35); }
.sp-btn--ghost { color: var(--sp-lavender); background: rgba(42, 33, 64, 0.8); border: 1px solid rgba(201, 168, 245, 0.5); box-shadow: none; }
.sp-fine { margin: 0; font-size: 12px; color: var(--sp-muted); }
.sp-fine--warn { color: var(--sp-pink); }
.sp-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; padding-bottom: 6px; }
.sp-link { background: none; border: 0; padding: 8px 4px; min-height: 40px; cursor: pointer; color: var(--sp-lavender); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.sp-link:hover { color: var(--sp-parchment); }
.sp-link--out { display: inline-flex; align-items: center; }

/* ---- the layer: the Herd's confirm, SERVE A GOD, the hard confirm ------------------------------------------------ */
.sp-layer { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 10, 0.8); backdrop-filter: blur(5px); overflow-y: auto; }
.sp-layer[hidden] { display: none; }
.sp-card { width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px 22px 18px; border-radius: 18px; background: linear-gradient(180deg, #221A38, #140F22); border: 1px solid rgba(245, 194, 66, 0.5); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7); }
.sp-card p { margin: 0 0 10px; font-size: 14px; }
.sp-card--gods { width: min(980px, 100%); border-color: rgba(107, 224, 74, 0.55); --sp-accent: var(--sp-green); --sp-accent-2: var(--sp-green-soft); --sp-glow: rgba(107, 224, 74, 0.35); }
.sp-card--swear { border-color: rgba(255, 107, 107, 0.7); }
.sp-card-kind { font-size: 11px !important; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sp-gold); }
.sp-card-kind--warn { color: var(--sp-blood); }
.sp-card-title { margin: 0 0 10px; font-family: var(--sp-title); font-size: 26px; line-height: 1.15; color: var(--sp-parchment); }
.sp-card-line { min-height: 2.9em; color: #E6D8FF; }
.sp-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 6px 0 14px; }
.sp-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; cursor: pointer; background: rgba(20, 18, 26, 0.9); border: 1px solid color-mix(in srgb, var(--god) 45%, transparent); color: var(--sp-parchment); transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.sp-tile:hover { transform: translateY(-2px); border-color: var(--god); }
.sp-tile.is-on { border: 2px solid var(--sp-gold); box-shadow: 0 0 18px color-mix(in srgb, var(--god) 60%, transparent); }
.sp-tile img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--god); }
.sp-tile-name { font-weight: bold; font-size: 13px; color: var(--god); text-align: center; }
.sp-tile-epi { font-size: 10px; font-style: italic; color: var(--sp-lavender); text-align: center; line-height: 1.25; }
.sp-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.sp-check { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 14px; font-size: 14px; font-weight: bold; cursor: pointer; }
.sp-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--sp-blood); }
.sp-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sp-error { color: var(--sp-blood); font-weight: bold; }

/* ---- smaller screens --------------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .sp-sides { grid-template-columns: 1fr; }
  .sp-vs { padding: 0; }
  .sp-hero { height: 150px; }
  .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* a phone on its side (the Gate and the Casino turn landscape): everything smaller, side by side, the page scrolls */
@media (max-height: 520px) and (min-width: 561px) {
  .sp-sides { grid-template-columns: 1fr auto 1fr; }
  .sp-shell { gap: 6px; padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .sp { line-height: 1.3; }
  .sp-head { padding-top: 0; }
  .sp-kicker { font-size: 10px; }
  .sp-title { font-size: 24px; }
  .sp-sub { font-size: 13px; }
  .sp-note { font-size: 11px; margin-top: 4px; padding: 4px 10px; }
  .sp-hero { height: 72px; }
  .sp-body { padding: 6px 12px 10px; }
  .sp-sub, .sp-tag, .sp-lines:not(.sp-lines--here) { display: none; }
  .sp-gods { right: 26%; bottom: 6px; gap: 3px; }
  .sp-name { font-size: 22px; }
  .sp-tag { font-size: 13px; margin: 2px 0 4px; }
  .sp-lines li { font-size: 11.5px; }
  .sp-god { width: 20px; height: 20px; border-width: 1px; }
  .sp-here { margin: 6px 0 3px; font-size: 11px; }
  .sp-act { padding-top: 8px; }
  .sp-btn { min-height: 40px; font-size: 13px; padding: 0 16px; }
  .sp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .sp-tile img { width: 40px; height: 40px; }
  .sp-tile-epi { display: none; }
  .sp-card { padding: 14px; }
  .sp-card-title { font-size: 20px; }
}

@keyframes sp-drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.06) translate(-1.2%, -1%); } }
@keyframes sp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes sp-bob-flip { 0%, 100% { transform: scaleX(-1) translateY(0); } 50% { transform: scaleX(-1) translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .sp, .sp-side, .sp-btn, .sp-tile { transition: none; }
  .sp-art, .sp-unit { animation: none; }
}
