/* ============================================================
   SHIP HAPPENS — Main Stylesheet
   Dark purple/blue theme · Premium card game feel
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-deep:       #07060f;
  --bg-base:       #0d0b1a;
  --bg-surface:    #13102a;
  --bg-card:       #1c1840;
  --bg-modal:      #1a1635;

  --purple-900:    #2d1b69;
  --purple-700:    #5b21b6;
  --purple-500:    #7c3aed;
  --purple-400:    #a855f7;
  --purple-300:    #c084fc;
  --purple-100:    #f3e8ff;

  --blue-500:      #3b82f6;
  --blue-400:      #60a5fa;
  --pink-500:      #ec4899;
  --pink-400:      #f472b6;
  --green-500:     #10b981;
  --amber-500:     #f59e0b;
  --red-500:       #ef4444;

  --neon-purple:   #b44fff;
  --neon-blue:     #4488ff;
  --neon-pink:     #ff4da6;

  --text-primary:  #f0eeff;
  --text-secondary:#a99ec4;
  --text-muted:    #6b5f8a;
  --text-on-dark:  #ffffff;

  --radius-card:   16px;
  --radius-btn:    12px;
  --radius-modal:  20px;

  --shadow-card:   0 8px 32px rgba(124,58,237,0.25), 0 2px 8px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 24px rgba(168,85,247,0.5);
  --shadow-btn:    0 4px 20px rgba(124,58,237,0.4);

  --font-sans:     'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:     'SF Mono', 'Fira Code', monospace;

  --transition-fast: 150ms ease;
  --transition-med:  280ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 450ms cubic-bezier(0.4,0,0.2,1);

  --deck-z:        10;
  --card-z:        20;
  --overlay-z:     100;
  --modal-z:       200;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  width: 100%; height: 100%;
  position: relative;
  overflow: hidden;
}

/* ── Scene base ─────────────────────────────────────────────── */
.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, #1c0d3a 0%, var(--bg-base) 60%);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.sh-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sh-btn:active:not(:disabled) {
  transform: scale(0.94) translateY(1px);
}

.sh-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Primary */
.sh-btn--primary {
  background: linear-gradient(135deg, var(--purple-500) 0%, var(--blue-500) 100%);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.sh-btn--primary:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(124,58,237,0.6);
  transform: translateY(-1px);
}

.sh-btn__glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

/* Ghost */
.sh-btn--ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
}

.sh-btn--ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

/* Size variants */
.sh-btn--xl   { padding: 16px 40px; font-size: 17px; border-radius: 14px; min-width: 200px; }
.sh-btn--sm   { padding: 8px 16px;  font-size: 13px; }
.sh-btn--icon { padding: 8px 12px;  font-size: 16px; min-width: 0; }

/* Special types */
.sh-btn--yes  { background: linear-gradient(135deg, #10b981, #059669); color: #fff; flex: 1; font-size: 16px; padding: 14px; }
.sh-btn--no   { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; flex: 1; font-size: 16px; padding: 14px; }
.sh-btn--yes:hover { box-shadow: 0 0 20px rgba(16,185,129,0.5); }
.sh-btn--no:hover  { box-shadow: 0 0 20px rgba(239,68,68,0.5); }

.sh-btn--player {
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--text-primary);
  padding: 12px 20px;
  font-size: 15px;
  width: 100%;
  text-align: left;
}

.sh-btn--player:hover:not(:disabled) {
  background: rgba(124,58,237,0.3);
  border-color: var(--purple-400);
}

.sh-btn--player.sh-btn--selected {
  background: rgba(124,58,237,0.5);
  border-color: var(--purple-300);
  color: #fff;
}

.sh-btn--confirm {
  background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
  color: #fff;
  margin-top: 12px;
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.sh-btn--back {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 12px;
  align-self: flex-start;
}

.sh-btn--add {
  color: var(--purple-400);
  border: 1px dashed rgba(124,58,237,0.4);
  font-size: 14px;
  padding: 10px 20px;
  margin-top: 8px;
}

.sh-btn--remove {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.2);
  color: #ef4444;
  font-size: 13px;
  padding: 6px 10px;
  flex-shrink: 0;
}

.sh-btn--tap-race {
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 700;
}

.sh-btn--attr {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  color: var(--text-primary);
  padding: 10px 16px;
  font-size: 13px;
  width: 100%;
  text-align: left;
}

.sh-btn--attr:hover {
  background: rgba(59,130,246,0.25);
}

.sh-btn--char-pick, .sh-btn--ship-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  text-align: left;
  border-radius: 10px;
}

.sh-btn--char-pick:hover, .sh-btn--ship-pick:hover {
  background: rgba(124,58,237,0.25);
}

.sh-btn__char-img {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ── Input ──────────────────────────────────────────────────── */
.sh-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 12px 16px;
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  flex: 1;
}

.sh-input:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}

.sh-input::placeholder { color: var(--text-muted); }

/* ── Cards ──────────────────────────────────────────────────── */
.sh-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.sh-card__frame {
  position: relative;
  width: 100%;
  height: 100%;
}

.sh-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sh-card__img--template {
  object-fit: fill;
}

.sh-card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

/* Text overlay for attribute/event cards */
.sh-card__overlay {
  position: absolute;
  inset: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 4px;
}

.sh-card__code {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.04);
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.sh-card__type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.sh-card__type--attribute { color: var(--blue-400); }
.sh-card__type--event     { color: var(--pink-400); }

.sh-card__name {
  font-size: 13px;
  font-weight: 700;
  color: #1a1030;
  line-height: 1.2;
  margin: 2px 0;
}

.sh-card__desc {
  font-size: 10px;
  color: #2a1f48;
  line-height: 1.35;
}

/* Mine card overlay */
.sh-card__frame--mine { background: #1a0a0a; }

.sh-card__mine-overlay {
  position: absolute;
  bottom: 10%;
  left: 10%;
  right: 10%;
  text-align: center;
  padding: 6px;
  background: rgba(0,0,0,0.65);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.sh-card__mine-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 12px var(--neon-pink);
  margin-bottom: 4px;
}

.sh-card__mine-desc {
  font-size: 9px;
  color: rgba(255,255,255,0.75);
  line-height: 1.3;
}

/* Size variants */
.sh-card--small {
  width: 72px;
  height: 100px;
}

.sh-card--normal {
  width: 120px;
  height: 168px;
}

.sh-card--large {
  width: min(280px, 72vw);
  height: auto;
  aspect-ratio: 5/7;
}

.sh-card--large .sh-card__name { font-size: 18px; }
.sh-card--large .sh-card__desc { font-size: 13px; }
.sh-card--large .sh-card__type { font-size: 11px; }
.sh-card--large .sh-card__code { font-size: 11px; }

/* Flawed marker */
.sh-card--flawed::after {
  content: '🚩';
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 16px;
}

/* ── Character card text overlay ────────────────────────────
   Paints a solid white block over the bottom ~40% of the
   placeholder image (which already has a white section with
   printed text). We cover that and render our own labels.   */
.sh-card__char-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 42%;
  background: #ffffff;
  padding: 15px 16px 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  overflow: hidden;
}

.sh-card__char-name {
  font-size: 11px;
  font-weight: 800;
  color: #110d2a;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sh-card__char-subtitle {
  font-size: 8px;
  font-style: italic;
  color: #5b21b6;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sh-card__char-desc {
  font-size: 7.5px;
  color: #3d3060;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Large card — scale overlay text up */
.sh-card--large .sh-card__char-name    { font-size: 36px; }
.sh-card--large .sh-card__char-subtitle{ font-size: 16px; }
.sh-card--large .sh-card__char-desc    { font-size: 14px; -webkit-line-clamp: 4; }


/* ── Deck Select Scene ──────────────────────────────────────── */
/* Peek carousel: 3 cards on mobile, 5-7 on desktop.            */
/* Active card centered; adjacent half-visible. Loops.          */

/* Deck select scene — header + carousel vertically centered,
   back button sits at top-left via absolute positioning.        */
.scene--deckselect {
  display: flex;
  flex-direction: column;
  justify-content: center;  /* center the title+carousel block  */
  overflow: hidden;
  position: relative;
  gap: 16px;
  padding: 48px 0 28px;     /* top clears the back button       */
}

/* Back button floats above the centered group */
.scene--deckselect > .sh-btn--back {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
}

/* Header — title, hint, dots. No back button here. */
.ds__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;

  height: 15vh;
  justify-content: end;
}

.ds__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Dots */
.ds__dots {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 16px;
}

.ds__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-900);
  transition: background var(--transition-fast), transform var(--transition-fast), width var(--transition-fast);
}

.ds__dot--on {
  background: var(--purple-400);
  transform: scale(1.4);
}

/* Carousel viewport — clips overflow, height driven by card aspect-ratio */
.ds__viewport {
  overflow: hidden;
  display: flex;
  /* align-items: center; */
  flex-shrink: 0;           /* sized by card content, not stretched */

  height: 75vh;
  padding-bottom: 10vh;
  padding-top: 2vh;
}

/* Track: flex row, JS controls translateX */
.ds__track {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 8px 0;
  will-change: transform;
  flex-shrink: 0;
}

/* Mobile: 62vw center card → ~30% of each adjacent card peeks in.
   aspect-ratio drives the height so no collapse.                */
.ds__slide {
  flex: 0 0 62vw;
  max-width: 300px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0.45;
  transform: scale(0.9);
  cursor: pointer;
}

/* Active slide */
.ds__slide--active {
  opacity: 1;
  transform: scale(1);
}

/* Desktop: wider cards */
@media (min-width: 640px) {
  .ds__slide {
    flex: 0 0 min(260px, 28vw);
    max-width: 300px;
  }
}

/* Card face — aspect-ratio always drives height, no collapse */
.ds__card {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.ds__slide--active .ds__card {
  box-shadow: 0 12px 48px rgba(124,58,237,0.4), 0 4px 12px rgba(0,0,0,0.6);
  border-color: rgba(180,79,255,0.35);
}

.ds__boxart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gradient overlay — shows deck colour, doubles as backdrop when img missing */
.ds__card-tint {
  position: absolute;
  inset: 0;
  background: var(--ds-grad);
  opacity: 0.0;
  mix-blend-mode: multiply;
}

/* If no image, tint becomes the whole background */
.ds__card:not(:has(img[src])) .ds__card-tint,
.ds__card img[style*="display:none"] ~ .ds__card-tint {
  opacity: 1;
  mix-blend-mode: normal;
}

/* Bottom bar inside card: emoji + name */
.ds__card-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 14px 14px;
  background: linear-gradient(to top, rgba(7,6,15,0.9) 0%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds__card-emoji {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6));
}

.ds__card-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Tap to select" hint — only on active card */
.ds__card-tap-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(124,58,237,0.75);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.ds__slide--active .ds__card-tap-hint {
  opacity: 1;
}

/* Hint line */
.ds__hint {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin: 0;
}

/* ── Info bottom sheet ──────────────────────────────────────── */
/* ── Deck info popup (centered modal) ───────────────────────── */
.ds__popup {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
  background: rgba(5, 4, 15, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.ds__popup--open {
  opacity: 1;
  pointer-events: auto;
}

.ds__popup-card {
  background: #fff;
  border-radius: 22px;
  width: 100%;
  max-width: 380px;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9) translateY(16px);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.ds__popup--open .ds__popup-card {
  transform: scale(1) translateY(0);
}

.ds__popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  z-index: 2;
  line-height: 1;
}

/* Popup inner content */
.ds__pop-banner {
  height: 110px;
  border-radius: 22px 22px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ds__pop-emoji { font-size: 52px; line-height: 1; }

.ds__pop-content {
  padding: 18px 22px 24px;
}

.ds__pop-name {
  font-size: 22px;
  font-weight: 800;
  color: #111;
  margin: 0 0 10px;
}

.ds__pop-desc {
  font-size: 14px;
  color: #444;
  line-height: 1.65;
  margin: 0 0 18px;
}

.ds__pop-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ds__pop-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  background: #f1f1f6;
  border-radius: 20px;
  padding: 4px 10px 4px 6px;
}

.ds__pop-pill-ico {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.ds__pop-play {
  width: 100%;
  padding: 15px;
  font-size: 15px;
}

/* ── Modal ──────────────────────────────────────────────────── */
.sh-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,4,15,0.75);
  backdrop-filter: blur(6px);
  z-index: var(--modal-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none; /* don't capture clicks while hidden or fading out */
  transition: opacity var(--transition-med);
}

.sh-modal-overlay--visible { opacity: 1; pointer-events: auto; }

.sh-modal {
  background: var(--bg-modal);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: var(--radius-modal);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 40px rgba(124,58,237,0.2);
  transform: translateY(16px) scale(0.97);
  transition: transform var(--transition-med);
  max-height: 85vh;
  overflow-y: auto;
}

.sh-modal--visible { transform: translateY(0) scale(1); }
.sh-modal--large   { max-width: 480px; }

/* Announce modal */
.sh-modal__announce { text-align: center; }
.sh-modal__announce-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.25;
  color: #ffffff;
  text-shadow: 0 1px 12px rgba(0,0,0,0.55);
}
.sh-modal__announce-body {
  font-size: 16px;
  color: rgba(255,255,255,0.88);
  line-height: 1.55;
}
.sh-modal__announce-hint {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* Vote modal */
.sh-modal__vote { }
.sh-modal__vote-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}
.sh-modal__vote-body {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}
.sh-modal__vote-btns {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.sh-modal__vote-group-btn {
  width: 100%;
  margin-top: 4px;
  font-size: 13px;
}
.sh-modal__vote-pass {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Select modal */
.sh-modal__select-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}
.sh-modal__select-body {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
}
.sh-modal__select-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}
.sh-modal__select-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sh-modal__select-btns--attrs {
  max-height: 260px;
  overflow-y: auto;
}
.sh-modal__select-chars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

/* Race modal */
.sh-modal__race-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.sh-modal__race-body {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
}
.sh-modal__race-timer {
  font-size: 56px;
  font-weight: 900;
  text-align: center;
  color: var(--neon-purple);
  text-shadow: 0 0 20px var(--neon-purple);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}
.sh-modal__race-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sh-modal__result { text-align: center; }
.sh-modal__result-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
  text-shadow: 0 1px 12px rgba(0,0,0,0.55);
}
.sh-modal__result-tally {
  font-size: 17px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

/* ── START SCENE ────────────────────────────────────────────── */
.scene--start {
  align-items: center;
  justify-content: space-between;   /* hero → cta → footer evenly spaced */
  padding: 56px 24px 32px;
  background: radial-gradient(ellipse at 40% 30%, #1e0a3c 0%, #08061a 70%);
  overflow: hidden;
}

/* Tiled background with very slow diagonal drift */
.start__bg-tile {
  position: absolute;
  inset: -320px;
  background-image: url('../images/branding/bg-tile.jpg');
  background-repeat: repeat;
  background-size: 280px;
  opacity: 0.25;               /* was 0.07 — now clearly visible */
  animation: bg-drift 60s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Dimmer variant used on spinner scene */
.start__bg-tile--dim {
  opacity: 0.09;
}

/* Floating parallax icon particles */
.start__bg-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.start__particle {
  position: absolute;
  bottom: -15%;
  animation: particle-float linear infinite;
  pointer-events: none;
}

/* ── Hero block: logo + tagline, tightly grouped ── */
.start__hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 16vh;
}

/* Logo image with pink CSS glow */
.start__logo-img {
  width: 75vw;
  max-width: 360px;
  filter: drop-shadow(0 0 18px rgba(193, 39, 180, 0.6))
          drop-shadow(0 0 52px rgba(193, 39, 180, 0.25));
}

.start__tagline-img {
  height: 24px;
  width: auto;
  opacity: 0.80;
}

/* ── CTA block: button directly above player hint ── */
.start__cta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.start__player-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: 0.02em;
}

/* ── Footer: copyright pinned to bottom ── */
.start__footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start__copyright {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.45;
  text-align: center;
}

/* ── SETUP SCENE ────────────────────────────────────────────── */
.scene--setup {
  padding: 0;
}

.setup__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.setup__title {
  font-size: 22px;
  font-weight: 700;
  flex: 1;
}

.setup__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup__players {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup__player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-in-up 200ms ease both;
}

.setup__player-row--exit {
  animation: slide-out-right 200ms ease both;
}

.setup__player-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--purple-400);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.setup__footer {
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.setup__min-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── SPINNER SCENE ──────────────────────────────────────────── */
.scene--spinner {
  align-items: center;
  padding: 24px 20px;
  gap: 20px;
}

.spinner__header { text-align: center; }

.spinner__title {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-300), var(--pink-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.spinner__sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.spinner__wheel-wrap {
  position: relative;
  width: min(360px, 90vw);
  height: min(360px, 90vw);
  flex-shrink: 0;
}

#spinner-canvas {
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(124,58,237,0.3), 0 0 0 3px rgba(124,58,237,0.4);
  display: block;
  width: 100%;
  height: 100%;
  /* Canvas itself rotates; transform-origin is its centre */
  transform-origin: center center;
  will-change: transform;
}

/* Static pointer pinned above the wheel (does NOT rotate) */
.spinner__pointer-static {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  color: var(--neon-purple);
  text-shadow: 0 0 16px var(--neon-purple);
  filter: drop-shadow(0 2px 8px rgba(180,79,255,0.8));
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.spinner__result {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner__result--visible .spinner__result-inner {
  animation: result-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

.spinner__result-inner {
  text-align: center;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: 16px;
  padding: 14px 32px;
}

.spinner__result-name {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--purple-300);
  text-shadow: 0 0 20px rgba(168,85,247,0.6);
}

.spinner__result-sub {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.spinner__actions { width: 100%; display: flex; justify-content: center; }

/* ── GAME SCENE ─────────────────────────────────────────────── */
.scene--game {
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #1a0830 0%, var(--bg-base) 65%);
}

/* Top bar */
.game__topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 8px;
  background: rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* Logo in topbar */
.game__topbar-logo {
  height: 64px;
  width: auto;
  flex: 1;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 0 8px rgba(193,39,180,0.45));
  margin-bottom: -20px;
  margin-left: 5px;
}

/* Turn banner — lives near the deck at the bottom */
.game__turn-banner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 4px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.game__turn-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game__turn-player {
  font-size: 17px;
  font-weight: 800;
  color: var(--purple-300);
  text-shadow: 0 0 12px rgba(168,85,247,0.5);
  line-height: 1.1;
}

.game__deck-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: rgba(255,255,255,0.05);
  padding: 6px 14px;
  border-radius: 10px;
}

.game__deck-count {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.game__deck-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game__btn-players { flex-shrink: 0; }

/* Table area */
.game__table {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Active mines badges */
.game__active-mines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game__mine-badge {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: #fca5a5;
  animation: mine-pulse 2s ease-in-out infinite;
}

/* Center zone */
.game__center-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.game__center-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.game__center-card {
  position: relative;
  cursor: pointer;
}

.game__center-char-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.game__center-char-card:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}

.game__center-empty {
  width: 120px;
  height: 168px;
  border: 2px dashed rgba(124,58,237,0.3);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
}

.game__center-empty-icon { font-size: 28px; opacity: 0.4; }
.game__center-empty-text { font-size: 11px; }

.game__center-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 100%;
}

.game__attrs-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.game__attr-card {
  transform: rotate(calc(var(--attr-i, 0) * 1.5deg - 3deg));
  transition: transform var(--transition-fast);
  animation: attr-drop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  animation-delay: calc(var(--attr-i, 0) * 40ms);
}

.game__attr-card:active {
  transform: rotate(0deg) scale(0.94) !important;
  transition: transform 0.1s ease !important;
}

.game__attr-card:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.06);
  z-index: 10;
}

/* ── Small card text overrides (table view) ─────────────────────
   Cards on the table use sh-card--small, so text must be tiny.
   These apply to both attached attrs and pending attrs.           */
.game__attr-card .sh-card__overlay,
.game__attr-card--pending .sh-card__overlay {
  gap: 0;
}
.game__attr-card .sh-card__name,
.game__attr-card--pending .sh-card__name {
  font-size: 5px;
  line-height: 1.1;
}
.game__attr-card .sh-card__desc,
.game__attr-card--pending .sh-card__desc {
  font-size: 3px;
  line-height: 1.1;
}
.game__attr-card .sh-card__type,
.game__attr-card--pending .sh-card__type {
  font-size: 2px;
  letter-spacing: 1px;
}

/* Character card small-size text (center zone) */
.game__center-char-card .sh-card__char-overlay {
  padding: 8px 10px 8px;
  gap: 1px;
}
.game__center-char-card .sh-card__char-name {
  line-height: 1.3;
}
.game__center-char-card .sh-card__char-subtitle {
  font-size: 6px;
}
.game__center-char-card .sh-card__char-desc {
  font-size: 6px;
  line-height: 1;
  -webkit-line-clamp: 4;
}

/* Discard zone */
.game__discard-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.game__discard-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game__discard-pile {
  width: 70px;
  height: 98px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game__discard-empty {
  font-size: 11px;
  color: var(--text-muted);
}

/* Deck area (bottom) */
.game__deck-area {
  flex-shrink: 0;
  padding: 0 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.2);
}

.game__pending-attrs {
  min-height: 20px;
}

.game__pending-label {
  font-size: 12px;
  color: var(--amber-500);
  font-weight: 600;
}

.game__deck-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.game__deck-stack {
  position: relative;
  transition: transform var(--transition-fast);
}

.game__deck-stack:hover .game__deck-card {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(124,58,237,0.4);
}

.game__deck-stack:active .game__deck-card {
  transform: translateY(-4px) scale(0.97);
}

.game__deck-card {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.game__deck-prompt {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  padding: 4px 8px;
}

.game__deck-empty {
  width: 120px;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-card);
  color: var(--text-muted);
  font-size: 13px;
}

/* Card draw overlay */
.game__draw-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--overlay-z);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(5,4,15,0.92);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}

.game__draw-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.game__draw-card-wrap {
  position: relative;
  z-index: 2;
}

.game__draw-card {
  animation-fill-mode: both;
}

.game__draw-card--enter {
  animation: card-enter 0.55s cubic-bezier(0.34,1.36,0.64,1) both;
}

/* ── Card draw flip structure ─────────────────────────────────── */
.game__draw-flip-wrap {
  position: relative;
  transform-origin: center center;
  /* width/height set by JS to match card size */
}

/* Glow type classes — applied at flip-start, filter transitions in during the spin */
.game__draw-flip-wrap--character,
.game__draw-flip-wrap--attribute,
.game__draw-flip-wrap--event,
.game__draw-flip-wrap--mine {
  transition: filter 1.4s ease-out;
}
.game__draw-flip-wrap--character { filter: drop-shadow(0 0 22px rgba(168,85,247,0.85)) drop-shadow(0 0 48px rgba(168,85,247,0.4)); }
.game__draw-flip-wrap--attribute { filter: drop-shadow(0 0 22px rgba(59,130,246,0.85))  drop-shadow(0 0 48px rgba(59,130,246,0.4)); }
/* .game__draw-flip-wrap--event     { filter: drop-shadow(0 0 22px rgba(236,72,153,0.85))  drop-shadow(0 0 48px rgba(236,72,153,0.4)); } */
.game__draw-flip-wrap--event     { filter: drop-shadow(0 0 22px rgba(75,207,24,0.85))  drop-shadow(0 0 48px rgba(75,207,24,0.4)); }
.game__draw-flip-wrap--mine      { filter: drop-shadow(0 0 22px rgba(255,77,166,0.9))   drop-shadow(0 0 52px rgba(255,77,166,0.5)); }

/* Hover float — added on landing after bounce settles */
.game__draw-flip-wrap--landed {
  animation: draw-card-hover 2.8s ease-in-out infinite;
}

.game__draw-flipper {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  /* 3.5 rotations (1260deg) → ends at rotateY(180deg) = front face visible */
  transition: transform 1.4s cubic-bezier(0.2, 0, 0.05, 1);
}

.game__draw-flipper--flipped {
  transform: rotateY(1260deg);
}

.game__draw-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

/* back face visible by default (flipper starts at 0deg) */
.game__draw-face--back { /* no extra transform */ }

/* front face hidden until flipper flips */
.game__draw-face--front {
  transform: rotateY(180deg);
}

.game__draw-back-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

/* Speed streak lines that fall downward as card flies upward */
.game__streak {
  position: absolute;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(to bottom,
    rgba(255,255,255,0.0),
    rgba(255,255,255,0.85) 30%,
    rgba(168,85,247,0.6) 70%,
    transparent);
  pointer-events: none;
  transform-origin: top center;
  animation: streak-fall 0.45s ease-in both;
}

/* Slow background streaks — dimmer, taller, give the scene depth */
.game__streak--slow {
  background: linear-gradient(to bottom,
    rgba(255,255,255,0.0),
    rgba(168,85,247,0.35) 40%,
    rgba(255,77,166,0.25) 70%,
    transparent);
  z-index: 0; /* behind fast streaks */
}

/* Rising particle variant (replaces petal-fall after flip) */
.game__particle--rising {
  animation: particle-rise ease-out both;
}

.game__draw-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.4;
}

.game__draw-glow--character { background: radial-gradient(circle, rgba(168,85,247,0.6) 0%, transparent 70%); }
.game__draw-glow--attribute { background: radial-gradient(circle, rgba(59,130,246,0.6) 0%, transparent 70%); }
.game__draw-glow--event     { background: radial-gradient(circle, rgba(236,72,153,0.6) 0%, transparent 70%); }
.game__draw-glow--mine      { background: radial-gradient(circle, rgba(255,77,166,0.8) 0%, transparent 60%); }
.game__draw-glow--pulse     { animation: glow-pulse 0.8s ease-in-out infinite alternate; }

.game__draw-info {
  text-align: center;
  z-index: 2;
}

.game__draw-player-name {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.game__draw-card-type {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.game__draw-card-type--character { color: var(--purple-300); text-shadow: 0 0 12px var(--neon-purple); }
.game__draw-card-type--attribute { color: var(--blue-400); }
.game__draw-card-type--event     { color: var(--pink-400); }
.game__draw-card-type--mine      { color: var(--neon-pink); text-shadow: 0 0 20px var(--neon-pink); animation: mine-type-pulse 0.6s ease-in-out infinite alternate; }

.game__draw-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1; /* behind card (z-index:2) — particles burst from "behind" the card */
}

.game__particle {
  position: absolute;
  animation: particle-burst 1.5s ease-out both;
}

.game__particle--icon {
  object-fit: contain;
  pointer-events: none;
}

/* Petal variant — falls from top instead of burst outward */
.game__particle--petal {
  animation: petal-fall ease-in both;
}

/* Curtain variant — longer duration, don't clear early */
.game__particle--curtain {
  z-index: 5;
}

.game__draw-continue {
  z-index: 3;
  margin-top: 8px;
  position: relative;
  overflow: hidden; /* clips timeout bar to button border-radius */
}

/* Timeout progress bar — drains across bottom of the continue button */
.game__timeout-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  z-index: 4;
  overflow: hidden;
}

.game__timeout-bar__fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
  transform-origin: left center;
}

@keyframes timeout-drain {
  from { width: 100%; }
  to   { width: 0%; }
}

/* Particle dot (confetti in burst) */
.game__particle--dot {
  position: absolute;
  pointer-events: none;
  /* inherits particle-burst animation from .game__particle */
}

/* ── Card Peek Overlay ───────────────────────────────────────────
   Dedicated overlay for tapping table cards to read them up close.
   Completely independent from the draw overlay — no shared state.  */
.game__peek-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;   /* above everything in the scene */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(5,4,15,0.92);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.game__peek-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.game__peek-card-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game__peek-card-inner {
  position: relative;
}

/* Hover float once card has landed */
.game__peek-card-inner--glow {
  animation: draw-card-hover 2.8s ease-in-out infinite;
}

/* Type-specific drop shadows */
.game__peek-card-inner--character { filter: drop-shadow(0 0 22px rgba(168,85,247,0.85)) drop-shadow(0 0 48px rgba(168,85,247,0.4)); }
.game__peek-card-inner--attribute { filter: drop-shadow(0 0 22px rgba(59,130,246,0.85))  drop-shadow(0 0 48px rgba(59,130,246,0.4)); }
.game__peek-card-inner--event     { filter: drop-shadow(0 0 22px rgba(236,72,153,0.85))  drop-shadow(0 0 48px rgba(236,72,153,0.4)); }
.game__peek-card-inner--mine      { filter: drop-shadow(0 0 22px rgba(255,77,166,0.9))   drop-shadow(0 0 52px rgba(255,77,166,0.5)); }

.game__peek-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.game__peek-overlay--visible .game__peek-glow { opacity: 1; }
.game__peek-glow--character { background: radial-gradient(ellipse at 50% 40%, rgba(168,85,247,0.18) 0%, transparent 70%); }
.game__peek-glow--attribute { background: radial-gradient(ellipse at 50% 40%, rgba(59,130,246,0.18) 0%, transparent 70%); }
.game__peek-glow--event     { background: radial-gradient(ellipse at 50% 40%, rgba(236,72,153,0.18) 0%, transparent 70%); }
.game__peek-glow--mine      { background: radial-gradient(ellipse at 50% 40%, rgba(255,77,166,0.22) 0%, transparent 70%); }

.game__peek-info {
  text-align: center;
  z-index: 2;
}

/* Players modal */
.game__players-modal {
  position: absolute;
  inset: 0;
  z-index: var(--modal-z);
  background: rgba(5,4,15,0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
  display: flex;
  justify-content: flex-end;
}

.game__players-modal--visible {
  opacity: 1;
  pointer-events: auto;
}

.game__players-panel {
  background: var(--bg-modal);
  border-left: 1px solid rgba(124,58,237,0.3);
  width: min(340px, 90vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}

.game__players-modal--visible .game__players-panel {
  transform: translateX(0);
}

.game__players-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.game__players-header h3 { font-size: 18px; font-weight: 700; }

.game__players-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game__player-row {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 12px;
}

.game__player-row--active {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.4);
}

.game__player-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.game__badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.game__badge--lock  { background: rgba(245,158,11,0.2); color: var(--amber-500); border: 1px solid rgba(245,158,11,0.3); }
.game__badge--two   { background: rgba(236,72,153,0.2); color: var(--pink-400);  border: 1px solid rgba(236,72,153,0.3); }
.game__badge--skip  { background: rgba(107,114,128,0.2); color: #9ca3af;         border: 1px solid rgba(107,114,128,0.3); }
.game__badge--auto  { background: rgba(239,68,68,0.2);  color: #f87171;          border: 1px solid rgba(239,68,68,0.3); }
.game__badge--mine  { background: rgba(239,68,68,0.15); color: #fca5a5;          border: 1px solid rgba(239,68,68,0.25); }

.game__player-no-ship {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.game__player-ships {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Character detail modal */
.game__detail-modal { max-width: 380px; }

.game__detail-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.game__detail-char-img {
  width: 80px;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}

.game__detail-char-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.2;
}

.game__detail-char-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.game__detail-attrs-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.game__detail-attrs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.game__detail-attr {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game__detail-attr-code {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.game__detail-attr strong {
  font-size: 13px;
  color: var(--blue-400);
}

.game__detail-attr span {
  font-size: 12px;
  color: var(--text-secondary);
}

.game__detail-no-attrs {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px;
}

.game__detail-close { width: 100%; }

/* ── MODE SELECT SCENE ──────────────────────────────────────── */
.scene--modeselect {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}

.ms__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 8px;
  flex-shrink: 0;
}

.ms__title {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

/* ── 3D Roulette drum ────────────────────────────────────────── */
.ms__roulette-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
  perspective-origin: 50% 50%;
  min-height: 280px;
  max-height: 380px;
}

.ms__drum {
  position: relative;
  width: 100%;
  height: 180px; /* one item tall — items overflow via transform */
  transform-style: preserve-3d;
  user-select: none;
  touch-action: pan-x;
  cursor: grab;
}
.ms__drum:active { cursor: grabbing; }

/* Fade gradients to fade out non-selected items */
.ms__fade {
  position: absolute;
  left: 0; right: 0;
  z-index: 10;
  pointer-events: none;
}
.ms__fade--top {
  top: 0;
  height: 80px;
  background: linear-gradient(to bottom, var(--bg) 30%, transparent);
}
.ms__fade--bottom {
  bottom: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg) 30%, transparent);
}

/* Selection highlight frame */
.ms__selector-frame {
  position: absolute;
  left: 20px; right: 20px;
  top: 50%; transform: translateY(-50%);
  height: 164px;
  border: 2px solid rgba(167,139,250,.35);
  border-radius: 18px;
  background: rgba(167,139,250,.06);
  pointer-events: none;
  z-index: 5;
}

/* Individual drum item */
.ms__item {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform, opacity;
  transition: none; /* JS-driven */
  padding: 0 24px;
}

.ms__item-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

.ms__item--selected .ms__item-inner {
  border-color: var(--mode-color, var(--purple-400));
  box-shadow: 0 0 0 1px var(--mode-color, var(--purple-400)), 0 8px 32px rgba(0,0,0,.4);
}

.ms__item-img-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 112px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.ms__item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ms__item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(167,139,250,.2), rgba(236,72,153,.2));
}

.ms__item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ms__item-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.ms__item-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.ms__item-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Explainer ────────────────────────────────────────────────── */
.ms__explainer {
  flex-shrink: 0;
  padding: 0 24px;
  min-height: 80px;
  opacity: 0;
  transform: translateY(6px);
  transition: none;
}

.ms__explainer--visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease;
}

.ms__explainer-inner {
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.07);
}

.ms__explainer-name {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.ms__explainer-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ── Footer ──────────────────────────────────────────────────── */
.ms__footer {
  flex-shrink: 0;
  padding: 16px 24px 32px;
}

.ms__footer .sh-btn {
  width: 100%;
}

/* ── First Date game UI: character badge + center card back ────── */
.game__center-char-draw {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px;
}

.game__center-char-back-card {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.game__center-char-back-card:active {
  transform: scale(0.97);
}

.game__center-char-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 2px;
}

/* Character deck badge — red counter pill */
.game__char-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* When char is active in center, badge floats over the center zone */
.game__center-card {
  position: relative;
}
.game__char-badge--active {
  top: -8px;
  right: -8px;
}

/* ── RESULTS SCENE ──────────────────────────────────────────── */
.scene--results {
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 0%, #1e0a3c 0%, var(--bg-base) 70%);
}

.results__confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.results__confetti-piece {
  position: absolute;
  top: -20px;
  animation: confetti-fall linear both;
}

/* ── Results phase wrapper ─────────────────────────────────── */
.results__phase {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════
   SUMMARY
══════════════════════════════════════════════════════════════ */
.res-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 48px;
  gap: 20px;
  min-height: 100%;
}

.res-summary__header {
  text-align: center;
  padding: 0 24px;
}

/* Logo replacing the plain "Ship Happens!" title on results screen */
.res-summary__logo {
  width: 55vw;
  max-width: 260px;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 14px rgba(193,39,180,0.5));
}

/* Small logo on ranking screen */
.res-ranking__logo {
  width: 40vw;
  max-width: 180px;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 10px rgba(193,39,180,0.4));
}

.res-summary__title {
  font-size: 34px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple-300) 0%, var(--pink-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.res-summary__sub {
  font-size: 15px;
  color: var(--text-secondary);
}

.res-summary__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  width: 100%;
  max-width: 400px;
}

/* no ships */
.res-no-ships {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 24px;
}

.res-no-ships__icon {
  font-size: 72px;
}

.res-no-ships__text {
  font-size: 17px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════════
   CAROUSEL (shared: summary + vote)
══════════════════════════════════════════════════════════════ */
.res-carousel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.res-carousel__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 12%;
  padding-inline: 12%;
  gap: 12px;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.res-carousel__track::-webkit-scrollbar { display: none; }

.res-carousel__slide {
  scroll-snap-align: center;
  flex: 0 0 76vw;
  max-width: 340px;
}

@media (min-width: 640px) {
  .res-carousel__track { scroll-padding-inline: 8%; padding-inline: 8%; }
  .res-carousel__slide { flex: 0 0 min(300px, 26vw); }
}

.res-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.res-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.res-dot--on {
  background: var(--purple-400);
  transform: scale(1.3);
}

/* ══════════════════════════════════════════════════════════════
   SHIP CARD (inside carousel slides)
══════════════════════════════════════════════════════════════ */
.res-ship-card {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.res-ship-card--selected {
  border-color: var(--purple-400);
  box-shadow: 0 0 0 2px rgba(124,58,237,0.35), 0 8px 32px rgba(124,58,237,0.2);
}

.res-ship-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.res-ship-card__player {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.res-ship-card__heart {
  font-size: 20px;
}

.res-ship-card__char-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.res-ship-card__img {
  width: 64px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.res-ship-card__char-info {
  flex: 1;
  min-width: 0;
}

.res-ship-card__char-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--purple-300);
  margin-bottom: 3px;
}

.res-ship-card__char-sub {
  font-size: 12px;
  color: var(--pink-400);
  margin-bottom: 5px;
}

.res-ship-card__char-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.res-ship-card__attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.res-attr {
  font-size: 11px;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.25);
  color: var(--blue-400);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.res-attr--empty {
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

/* vote select button inside card */
.res-vote-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.res-vote-btn--on {
  background: rgba(124,58,237,0.25);
  border-color: var(--purple-400);
  color: var(--purple-300);
}

/* ══════════════════════════════════════════════════════════════
   VOTE LOCK SCREEN
══════════════════════════════════════════════════════════════ */
.res-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 32px 64px;
  gap: 16px;
  min-height: 100vh;
}

.res-lock__round {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--purple-400);
}

.res-lock__progress {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -8px;
}

.res-lock__icon {
  font-size: 72px;
  margin: 8px 0;
}

.res-lock__name {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-primary);
}

.res-lock__sub {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════════
   VOTE PICK SCREEN
══════════════════════════════════════════════════════════════ */
.res-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 40px;
  gap: 16px;
  min-height: 100%;
}

.res-pick__header {
  text-align: center;
  padding: 0 24px;
}

.res-pick__round {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--purple-400);
  margin-bottom: 6px;
}

.res-pick__question {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.res-pick__voter {
  font-size: 14px;
  color: var(--text-secondary);
}

.res-pick__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  width: 100%;
  max-width: 400px;
}

.res-pick__hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   RANKING SCREEN
══════════════════════════════════════════════════════════════ */
.res-ranking {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 48px;
  gap: 24px;
}

.res-ranking__header {
  text-align: center;
}

.res-ranking__title {
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple-300) 0%, var(--pink-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.res-ranking__sub {
  font-size: 15px;
  color: var(--text-secondary);
}

.res-ranking__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
}

/* podium */
.res-podium {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}

.res-podium__card {
  border-radius: 18px;
  padding: 16px;
  border: 1.5px solid;
}

.res-podium__card--best {
  background: rgba(124,58,237,0.1);
  border-color: rgba(124,58,237,0.3);
}

.res-podium__card--worst {
  background: rgba(239,68,68,0.07);
  border-color: rgba(239,68,68,0.22);
}

.res-podium__badge {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.res-podium__ship {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.res-podium__img {
  width: 60px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.res-podium__info {
  flex: 1;
  min-width: 0;
}

.res-podium__player {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.res-podium__char {
  font-size: 14px;
  color: var(--purple-300);
  margin-bottom: 4px;
}

.res-podium__attrs {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.res-podium__score {
  display: flex;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

/* ranked list */
.res-ranked-list {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.res-ranked-list__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.res-ranked-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 10px 12px;
}

.res-ranked-row--first {
  border-color: rgba(124,58,237,0.35);
  background: rgba(124,58,237,0.08);
}

.res-ranked-row--last {
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.05);
}

.res-ranked-row__pos {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
  text-align: center;
}

.res-ranked-row__img {
  width: 38px;
  height: 52px;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
}

.res-ranked-row__names {
  flex: 1;
  min-width: 0;
}

.res-ranked-row__player {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.res-ranked-row__char {
  font-size: 12px;
  color: var(--purple-300);
  display: block;
}

.res-ranked-row__tally {
  display: flex;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.res-tally-best  { color: var(--purple-300); }
.res-tally-worst { color: var(--red-500); }
.res-tally-meh   { color: var(--text-muted); }

/* unshipped players */
.res-unshipped {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}

.res-unshipped__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  width: 100%;
}

.res-unshipped__name {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
  padding: 3px 10px;
  border-radius: 6px;
}

/* ── confetti keyframe (referenced by .results__confetti-piece) ── */
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}


/* Ship summary (used in players panel) */
.sh-ship-summary {
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: 8px;
  padding: 8px;
}

.sh-ship-summary__empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.sh-ship-summary__char {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sh-ship-summary__img {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
}

.sh-ship-summary__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-300);
}

.sh-ship-summary__attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sh-ship-attr {
  font-size: 10px;
  background: rgba(59,130,246,0.12);
  color: var(--blue-400);
  padding: 2px 6px;
  border-radius: 4px;
}

.sh-ship-attr--empty {
  color: var(--text-muted);
  background: transparent;
}

/* ── PENDING ATTRIBUTES IN CENTER (no character yet) ─────────── */
.game__center-card--waiting {
  display: flex;
  align-items: stretch;
}

.game__center-waiting {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.game__center-waiting-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-300);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.8;
}

.game__center-waiting-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.game__attr-card--pending {
  opacity: 0.85;
  border: 1px dashed rgba(168,85,247,0.4) !important;
  animation: pending-pulse 2s ease-in-out infinite;
}

@keyframes pending-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(168,85,247,0.15); }
  50%       { box-shadow: 0 0 16px rgba(168,85,247,0.4); }
}

/* ── DEV LOG PANEL ──────────────────────────────────────────── */
.game__dev-toggle {
  position: absolute;
  bottom: 80px;
  right: 12px;
  z-index: 120;
  background: rgba(30,24,60,0.9);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--text-secondary);
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.game__dev-toggle:hover {
  background: rgba(124,58,237,0.2);
  border-color: rgba(124,58,237,0.6);
  color: var(--text-primary);
}

.game__dev-toggle--error {
  border-color: rgba(239,68,68,0.6);
  color: #f87171;
  animation: pulse-error 1.5s ease-in-out infinite;
}

@keyframes pulse-error {
  0%, 100% { box-shadow: 0 2px 12px rgba(239,68,68,0.3); }
  50%       { box-shadow: 0 2px 20px rgba(239,68,68,0.6); }
}

.game__dev-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998; /* below nothing — always visible when open */
  background: rgba(10,8,24,0.97);
  border-top: 1px solid rgba(124,58,237,0.25);
  transform: translateY(100%);
  transition: transform var(--transition-med);
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 11px;
}

.game__dev-panel--visible {
  transform: translateY(0);
}

.game__dev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-300);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.game__dev-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.game__dev-empty {
  color: var(--text-muted);
  padding: 12px;
  text-align: center;
  font-style: italic;
}

.game__dev-entry {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 5px;
  line-height: 1.4;
  flex-wrap: wrap;
}

.game__dev-entry--draw {
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.12);
}

.game__dev-entry--error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
}

.game__dev-ts {
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

.game__dev-player {
  color: var(--purple-300);
  font-weight: 700;
}

.game__dev-card {
  font-weight: 600;
}

.game__dev-card--character { color: #f9a8d4; }
.game__dev-card--attribute { color: var(--blue-400); }
.game__dev-card--event     { color: var(--amber-500); }
.game__dev-card--mine      { color: #f87171; }

.game__dev-meta {
  color: var(--text-muted);
  font-size: 10px;
}

.game__dev-error-label {
  color: #f87171;
  font-weight: 700;
  font-size: 10px;
  background: rgba(239,68,68,0.2);
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.game__dev-error-msg {
  color: #fca5a5;
  word-break: break-all;
}

/* ════════════════════════════════════════════════════════════════
   MINE ACTIVATION ANIMATION OVERLAY
   Full-screen dramatic sequence when a mine fires.
════════════════════════════════════════════════════════════════ */

.mine-anim__overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 3, 20, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  transition: opacity 0.4s ease;
  overflow: hidden;
  padding: 24px;
}

.mine-anim__overlay--visible {
  opacity: 1;
}

.mine-anim__overlay--exit {
  opacity: 0;
}

/* Stage: flex row — cards sit side by side aligned at their bottoms.
   When char is present, both cards are in the row; char's visibility:hidden
   placeholder holds flex space so mine is naturally left-of-center.
   Transform-origins on the wrappers make their touching inner bottom
   corners the shared heart point. */
.mine-anim__stage {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  z-index: 2;
  flex-shrink: 0;
  /* Extra top padding so leaning tops don't clip */
  padding-top: 24px;
  margin-bottom: 20px;
}

.mine-anim__card-wrap {
  width: 144px;
  flex-shrink: 0;
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Mine: pivot = bottom-right corner = touching point with char → heart point */
.mine-anim__mine-wrap {
  transform-origin: bottom right;
  z-index: 1;
}

/* Char: pivot = bottom-left corner = touching point with mine → heart point */
.mine-anim__char-wrap {
  transform-origin: bottom left;
  z-index: 2;
  transform-style: preserve-3d; /* lets char-spin-in reveal back/front faces alternately */
}

/* 3-D card flip container */
.mine-anim__card-flipper {
  width: 144px;
  height: 204px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

.mine-anim__flipped {
  transform: rotateY(180deg);
}

.mine-anim__card-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mine-anim__card-front {
  background: linear-gradient(160deg, #1c1840, #2d1569);
  border: 2px solid rgba(255,77,166,0.4);
  box-shadow: 0 0 20px rgba(255,77,166,0.3);
}

.mine-anim__card-back {
  background: linear-gradient(160deg, #1e0a3c, #4c1d95);
  border: 2px solid rgba(168,85,247,0.5);
  box-shadow: 0 0 24px rgba(168,85,247,0.4);
  transform: rotateY(180deg);
}

.mine-anim__card-art {
  font-size: 36px;
  line-height: 1;
}

.mine-anim__card-hit-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}

.mine-anim__card-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  word-break: break-word;
  line-height: 1.3;
}

/* Character card 3D flipper — back.png during spin, char image after */
.mine-anim__char-flipper {
  width: 144px;
  height: 204px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
}

.mine-anim__char-face-back {
  /* no extra transform — back.png visible by default */
}

.mine-anim__char-face-front {
  transform: rotateY(180deg); /* hidden until revealed */
}

.mine-anim__char-flipper--revealed {
  transform: rotateY(180deg); /* flips to show char face */
}

.mine-anim__char-back-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

/* Character image in the right card */
.mine-anim__char-img-wrap {
  width: 144px;
  height: 204px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(168,85,247,0.4);
  box-shadow: 0 0 20px rgba(168,85,247,0.3);
  background: #1c1840;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mine-anim__char-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mine-anim__char-placeholder {
  font-size: 48px;
}

/* Char name below character image */
.mine-anim__char-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  word-break: break-word;
  line-height: 1.3;
  max-width: 110px;
}

/* Shipped label — fades in after mine flip */
.mine-anim__shipped-label {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.mine-anim__shipped-name {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 24px rgba(168,85,247,0.8), 0 0 8px rgba(255,77,166,0.6);
}

.mine-anim__shipped-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Continue button inside mine overlay */
.mine-anim__continue {
  position: relative;
  z-index: 4;
}

/* White flash overlay — covers entire screen on Continue tap */
.mine-anim__flash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9500;
  opacity: 0;
  pointer-events: none;
}

/* Mini confetti dots that burst from center on Continue */
.mine-anim__mini-confetti {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9400;
  margin-left: -4px;
  margin-top: -4px;
  animation: mini-confetti-fall 0.75s ease-out both;
}

/* ── Mute panel (fixed, always on top) ──────────────────────── */
#sh-mute-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.sh-mute-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(13, 11, 26, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
  padding: 0;
}

.sh-mute-btn:hover {
  background: rgba(124, 58, 237, 0.28);
  border-color: rgba(168, 85, 247, 0.7);
  transform: scale(1.08);
}

.sh-mute-btn:active {
  transform: scale(0.94);
}

.sh-mute-btn--off {
  opacity: 0.45;
  border-color: rgba(168, 85, 247, 0.15);
}

.sh-mute-icon {
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}


/* ============================================================
   MUTE PANEL ADDITIONS — admin link + card log button
   ============================================================ */

#sh-mute-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sh-mute-btn--admin,
.sh-mute-btn--log {
  text-decoration: none;
  color: inherit;
}

/* ============================================================
   HOW TO PLAY MODAL
   ============================================================ */

.htp__overlay {
  position: fixed;
  inset: 0;
  z-index: 8200;
  background: rgba(7, 6, 15, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.htp__overlay--visible {
  opacity: 1;
  pointer-events: all;
}

.htp__modal {
  position: relative;
  background: linear-gradient(160deg, #14102a 0%, #1a1440 100%);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 20px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.htp__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  z-index: 2;
  transition: color 0.15s;
}
.htp__close:hover { color: #fff; }

.htp__body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px 16px;
  text-align: center;
}

.htp__slide-emoji {
  font-size: 2.8rem;
  margin-bottom: 10px;
}

.htp__slide-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e8d5ff;
  margin: 0 0 12px;
  line-height: 1.3;
}

.htp__slide-content {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  text-align: left;
}

.htp__slide-content p { margin: 0 0 10px; }
.htp__slide-content p:last-child { margin-bottom: 0; }

.htp__highlight {
  background: rgba(124, 58, 237, 0.18);
  border-left: 3px solid #7c3aed;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  color: #c4a0ff !important;
  font-weight: 600;
}

.htp__intro-note {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 10px 13px;
}

.htp__types { display: flex; flex-direction: column; gap: 12px; }

.htp__type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  text-align: left;
}

.htp__type-ico {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.htp__steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.htp__steps li {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.8);
}

.htp__list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.htp__list li {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  padding-left: 4px;
}

.htp__footer {
  padding: 12px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.htp__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.htp__nav-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  min-width: 90px;
  text-align: center;
}
.htp__nav-btn:hover { background: rgba(255,255,255,0.13); color: #fff; }
.htp__nav-btn.sh-btn--primary {
  background: linear-gradient(135deg, #7c3aed, #b44fff);
  border-color: transparent;
  color: #fff;
}

.htp__dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.htp__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.2s, transform 0.2s;
}

.htp__dot--active {
  background: #7c3aed;
  transform: scale(1.3);
}

.htp__never {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 0;
  text-align: center;
  transition: color 0.15s;
}
.htp__never:hover { color: rgba(255,255,255,0.6); }

/* ============================================================
   FEEDBACK POPUP
   ============================================================ */

.fb__overlay {
  position: fixed;
  inset: 0;
  z-index: 8300;
  background: rgba(7, 6, 15, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.fb__overlay--visible {
  opacity: 1;
  pointer-events: all;
}

/* fullscreen variant (end-screen) — same centering, kept for compatibility */
.fb__overlay--fullscreen {
  align-items: center;
  padding: 20px;
}

.fb__modal {
  position: relative;
  background: linear-gradient(160deg, #14102a 0%, #1c1640 100%);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 20px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 22px 32px;
}

.fb__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  transition: color 0.15s;
  z-index: 2;
}
.fb__close:hover { color: #fff; }

.fb__logo {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 8px;
}

.fb__heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e8d5ff;
  text-align: center;
  margin: 0 0 6px;
}

.fb__sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.5;
}

.fb__rating {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.fb__emoji-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 8px 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  min-width: 58px;
  color: rgba(255,255,255,0.6);
}
.fb__emoji-btn:active { transform: scale(0.94); }
.fb__emoji-btn--active {
  background: rgba(124, 58, 237, 0.22);
  border-color: #7c3aed;
  color: #fff;
}

.fb__emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.fb__emoji-label {
  font-size: 0.68rem;
  white-space: nowrap;
  line-height: 1.2;
}

.fb__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.fb__input,
.fb__textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: #fff;
  font-size: 0.92rem;
  padding: 12px 14px;
  font-family: inherit;
  transition: border-color 0.15s;
  resize: none;
}
.fb__input::placeholder,
.fb__textarea::placeholder { color: rgba(255,255,255,0.3); }
.fb__input:focus,
.fb__textarea:focus {
  outline: none;
  border-color: #7c3aed;
}

.fb__char-count {
  text-align: right;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  margin-top: -4px;
}

.fb__error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.fb__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.fb__skip {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: rgba(255,255,255,0.4);
  font-size: 0.88rem;
  padding: 11px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.fb__skip:hover { color: rgba(255,255,255,0.65); border-color: rgba(255,255,255,0.28); }

.fb__submit {
  flex: 1;
}

/* ── Success state ── */
.fb__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 0 8px;
  min-height: 220px;
}

.fb__check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb__check-svg {
  width: 72px;
  height: 72px;
}

.fb__check-circle {
  stroke: #7c3aed;
  stroke-width: 2;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: fb-circle-draw 0.5s ease forwards 0.1s;
}

.fb__check-tick {
  stroke: #a855f7;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: fb-tick-draw 0.4s ease forwards 0.55s;
}

@keyframes fb-circle-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes fb-tick-draw {
  to { stroke-dashoffset: 0; }
}

.fb__success-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #e8d5ff;
  margin: 0;
}

.fb__success-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* ============================================================
   GAME LOGO TAP MENU
   ============================================================ */

.game__logo-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 8100;
  background: rgba(7, 6, 15, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.game__logo-menu-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

.game__logo-menu {
  background: linear-gradient(160deg, #14102a 0%, #1a1440 100%);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 20px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  width: 100%;
  max-width: 320px;
}

.game__logo-menu__item {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  padding: 18px 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  font-family: inherit;
}

.game__logo-menu__item:last-child {
  border-bottom: none;
}

.game__logo-menu__item:hover,
.game__logo-menu__item:active {
  background: rgba(124, 58, 237, 0.15);
  color: #fff;
}

.game__logo-menu__item--cancel {
  color: rgba(255,255,255,0.35);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 14px 20px;
}

.game__logo-menu__item--cancel:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
}

/* ── Setup screen HTP button positioning ── */
.setup__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setup__header .sh-btn--back {
  margin-right: auto;
}

.setup__header .setup__title {
  flex: 1;
  text-align: center;
}

/* ── Mode select — simple tap-to-choose cards ─────────────────── */
.ms2__cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 16px;
  flex: 1 1 auto;
  justify-content: center;
}
.ms2__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
  padding: 20px 22px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.ms2__card:hover { background: rgba(255, 255, 255, 0.07); }
.ms2__card:active { transform: scale(0.99); }
.ms2__card--selected {
  border-color: var(--mode-color, #a855f7);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 1px var(--mode-color, #a855f7), 0 8px 28px rgba(0, 0, 0, 0.35);
}
.ms2__emoji { font-size: 30px; line-height: 1; }
.ms2__name { font-size: 22px; font-weight: 800; }
.ms2__tagline { font-size: 14px; opacity: 0.85; font-style: italic; }
.ms2__explainer { font-size: 13px; opacity: 0.7; line-height: 1.45; margin-top: 4px; }
.ms2__check {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mode-color, #a855f7);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.ms2__card--selected .ms2__check { opacity: 1; }
@media (min-width: 640px) {
  .ms2__cards { flex-direction: row; max-width: 760px; align-items: stretch; }
  .ms2__card { flex: 1; }
}
