/* === Galactic Customs — UI shell, HUD, decisions, results === */

.sw-brand {
  display: flex;
  align-items: flex-end;     /* pipe + words baseline-align with logo bottom */
  gap: 14px;
  padding: 8px 0;
  color: var(--sw-ink);
  flex-wrap: wrap;
}
.sw-brand__logo {
  /* 96×35 → 130×47 (+35 %) → 156×57 (+20 % more, May 3). */
  width: 156px; height: 57px; display: block;
  cursor: pointer;
  filter:
    drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 0 rgba(80, 180, 255, 0))
    drop-shadow(0 0 0 rgba(180, 220, 255, 0));
  /* Periodic affordance pulse — three slow blue blooms over 3 s, then
   * 30 s of rest. Total cycle 33 s. Each pulse ramps intensity through
   * a stacked drop-shadow (wide outer halo + tighter inner bloom). */
  animation: sw-logo-pulse 33s ease-in-out infinite;
}
.sw-brand__logo:hover,
.sw-brand__logo:focus-visible {
  filter:
    drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 22px rgba(80, 180, 255, 1))
    drop-shadow(0 0 8px rgba(180, 220, 255, 0.9));
}
@keyframes sw-logo-pulse {
  0%, 3%, 6%, 9%, 100% {
    filter:
      drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5))
      drop-shadow(0 0 0 rgba(80, 180, 255, 0))
      drop-shadow(0 0 0 rgba(180, 220, 255, 0));
  }
  1.5%, 4.5%, 7.5% {
    filter:
      drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5))
      drop-shadow(0 0 26px rgba(80, 180, 255, 1))
      drop-shadow(0 0 10px rgba(180, 220, 255, 0.95));
  }
}
@media (prefers-reduced-motion: reduce) {
  .sw-brand__logo { animation: none; }
}
.sw-brand__divider {
  width: 1px;
  height: 26px;
  background: rgba(255,255,255,0.35);
  margin-bottom: 4px;        /* line up with bottom of "ID.me" letters */
}
.sw-brand__tag {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--sw-ink-dim);
  line-height: 1;
  padding-bottom: 6px;       /* baseline-align with logo */
}

/* Public CDO version (body.is-public) centers the tag + divider on
 * the logo instead of baseline-aligning to its bottom. The ID.me
 * version keeps the baseline alignment because the ID.me wordmark
 * sits at the same baseline as the tag text. The +20 % logo size
 * exposed how much vertical asymmetry the baseline alignment had
 * on the public version, where there's no wordmark anchor. */
body.is-public .sw-brand { align-items: center; }
body.is-public .sw-brand__divider { margin-bottom: 0; }
body.is-public .sw-brand__tag    { padding-bottom: 0; }
.sw-brand__divider {
  width: 1px; height: 24px; background: rgba(255,255,255,0.25);
}
.sw-brand__tag {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--sw-ink-dim);
}
.sw-brand__ring {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.sw-brand__sibling {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--sw-jedi);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(127,214,255,0.35);
  border-radius: 999px;
  background: rgba(127,214,255,0.05);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.sw-brand__sibling:hover,
.sw-brand__sibling:focus-visible {
  background: rgba(127,214,255,0.18);
  color: #cfeaff;
  border-color: rgba(127,214,255,0.55);
  outline: none;
}
/* Sound toggle — pill button matching the cross-game pill, sits to its
 * left in the brand-strip ring. Default state shows the speaker icon;
 * .sound-off on <body> swaps to the muted-X icon and dims the button. */
.sw-brand__mute {
  appearance: none;
  border: 1px solid rgba(127,214,255,0.35);
  background: rgba(127,214,255,0.05);
  color: var(--sw-jedi);
  width: 32px; height: 28px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.sw-brand__mute:hover,
.sw-brand__mute:focus-visible {
  background: rgba(127,214,255,0.18);
  color: #cfeaff;
  border-color: rgba(127,214,255,0.55);
  outline: none;
}
.sw-brand__mute-icon { width: 16px; height: 16px; display: none; }
.sw-brand__mute-icon--on  { display: block; }
.sw-brand__mute-icon--off { display: none; }
body.sound-off .sw-brand__mute-icon--on  { display: none; }
body.sound-off .sw-brand__mute-icon--off { display: block; }
body.sound-off .sw-brand__mute {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
}
@media (max-width: 720px) {
  .sw-brand__ring { margin-left: 0; flex-wrap: wrap; }
  .sw-brand__sibling { padding: 5px 9px; letter-spacing: 1.2px; }
}
/* Mobile: shrink the brand logo so the strip fits on a 375 px
 * viewport without horizontal scroll. (156→128). */
@media (max-width: 480px) {
  .sw-brand__logo { width: 128px; height: 47px; }
  .sw-brand { gap: 10px; }
  .sw-brand__tag { font-size: 11px; letter-spacing: 2px; }
  .sw-brand__divider { height: 22px; }
}

/* Mobile / touch: drop the R2-D2 and BB-8 easter-egg rigs entirely.
 * Same reasoning as the bounty Mando/Boba: trigger zones are
 * pointer-events:none, but the auto-peek + roll-in animations
 * cover the game-board area touch users need for tap targets.
 * Easter eggs are a desktop-pointer flourish; touch users don't
 * discover them and they're in the way. */
@media (max-width: 720px), (pointer: coarse) {
  .sw-r2-zone, .sw-r2,
  .sw-bb8-zone, .sw-bb8 { display: none !important; }
}

.sw-h1 {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.8px;
  color: var(--sw-ink);
  text-wrap: balance;
}

/* ---- Landing ---- */
.sw-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: clamp(20px, 5vw, 56px) 8px;
}
.sw-landing__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: clamp(11px, 1.2vw, 13px);
  color: var(--sw-accent-2);
}
.sw-landing__title {
  margin: 0;
  font-size: clamp(38px, 8vw, 78px);
  line-height: 1.0;
  letter-spacing: -2px;
  /* Inter at 900 reads heavier than the previous system-ui fallback;
   * dropped to 800 so the headline matches the prior visual weight
   * now that the webfont is actually being loaded. */
  font-weight: 800;
  color: var(--sw-ink);
  text-wrap: balance;
}
.sw-landing__title sup {
  font-size: 0.45em;
  vertical-align: super;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--sw-ink-dim);
}
.sw-landing__lede {
  margin: 6px 0 14px;
  max-width: 56ch;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  color: var(--sw-ink-dim);
}
.sw-btn--start {
  background: linear-gradient(135deg, #7be3a3, #3eb878);
  color: #06190d;
  font-weight: 900;
  font-size: clamp(16px, 1.8vw, 19px);
  padding: 18px 32px;
  letter-spacing: 0.4px;
  box-shadow:
    0 18px 40px rgba(123, 227, 163, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  animation: sw-start-pulse 2.4s ease-in-out infinite;
}
.sw-btn--start:hover { filter: brightness(1.06); transform: translateY(-1px); }
.sw-btn--start .sw-btn__icon { display: inline-flex; }
@keyframes sw-start-pulse {
  0%, 100% { box-shadow: 0 18px 40px rgba(123, 227, 163, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
  50%      { box-shadow: 0 18px 50px rgba(123, 227, 163, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
}

/* ---- Sign-in: avatar capture + identity ---- */
.sw-signin {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  align-items: center;
  grid-template-columns: minmax(180px, 220px) 1fr;
  grid-template-areas:
    "avatar fields"
    "avatar consent"
    "avatar error"
    "avatar submit";
}
.sw-signin > .sw-avatar       { grid-area: avatar; }
.sw-signin__fields            { grid-area: fields; display: grid; gap: 12px; }
.sw-signin__consent           { grid-area: consent;
                                display: flex;
                                gap: 10px;
                                align-items: flex-start;
                                font-size: 13px;
                                color: var(--sw-ink-dim);
                                line-height: 1.4;
                                cursor: pointer;
                              }
/* Custom checkbox — see bounty/assets/game.css for rationale.
 * Bright contrasted check-mark so checked state reads at a glance. */
.sw-signin__consent input     { appearance: none;
                                -webkit-appearance: none;
                                width: 22px;
                                height: 22px;
                                margin: 1px 0 0;
                                flex: 0 0 auto;
                                border: 2px solid rgba(255,255,255,0.45);
                                border-radius: 4px;
                                background: rgba(255,255,255,0.05);
                                cursor: pointer;
                                position: relative;
                                display: inline-grid;
                                place-content: center;
                                transition: background-color 120ms ease, border-color 120ms ease;
                              }
.sw-signin__consent input:checked {
                                background: var(--sw-accent);
                                border-color: var(--sw-accent);
                              }
.sw-signin__consent input:checked::after {
                                content: '';
                                width: 12px;
                                height: 6px;
                                border-left: 2.5px solid #052914;
                                border-bottom: 2.5px solid #052914;
                                transform: rotate(-45deg) translate(1px, -1px);
                              }
.sw-signin__consent input:focus-visible {
                                outline: 2px solid var(--sw-accent-2);
                                outline-offset: 2px;
                              }
.sw-signin__consent input[aria-invalid="true"] {
                                outline: 2px solid var(--sw-warn);
                                outline-offset: 2px;
                              }
.sw-signin__error             { grid-area: error;
                                margin: 0;
                                min-height: 1.2em;
                                font-size: 13px;
                                color: var(--sw-warn);
                              }
.sw-signin > [type="submit"]  { grid-area: submit; justify-self: start; }

@media (max-width: 640px) {
  .sw-signin {
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "fields"
      "consent"
      "error"
      "submit";
    justify-items: center;
  }
  .sw-signin__fields { width: 100%; }
  .sw-signin__consent { width: 100%; }
  .sw-signin > [type="submit"] { justify-self: stretch; }
}

/* ---- Avatar component ---- */
.sw-avatar {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.sw-avatar__frame {
  position: relative;
  width: 180px; height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), rgba(0,0,0,0.4) 70%),
    rgba(255,255,255,0.04);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.18),
    inset 0 0 0 6px rgba(0,0,0,0.4),
    0 12px 32px rgba(0,0,0,0.5);
  overflow: hidden;
  isolation: isolate;
}
.sw-avatar[data-avatar-state="filled"] .sw-avatar__frame {
  box-shadow:
    inset 0 0 0 1px rgba(123,227,163,0.6),
    inset 0 0 0 6px rgba(0,0,0,0.4),
    0 12px 32px rgba(0,0,0,0.5),
    0 0 0 1px rgba(123,227,163,0.4);
}
.sw-avatar__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;  /* enable our own touch handlers */
}
.sw-avatar__canvas:active { cursor: grabbing; }
.sw-avatar[data-avatar-state="empty"] .sw-avatar__canvas { display: none; }
.sw-avatar__placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  color: var(--sw-ink-dim);
  font-size: 13px;
  letter-spacing: 0.5px;
  pointer-events: none;
}
.sw-avatar[data-avatar-state="filled"] .sw-avatar__placeholder { display: none; }
.sw-avatar__hit {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; background: transparent; cursor: pointer;
  border-radius: 50%;
}
.sw-avatar[data-avatar-state="filled"] .sw-avatar__hit { display: none; }
.sw-avatar__controls {
  width: 180px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.sw-avatar__zoom-label {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  font-size: 14px;
  color: var(--sw-ink-dim);
}
.sw-avatar__zoom-icon {
  width: 16px; text-align: center;
  font-weight: 800;
}
.sw-avatar__zoom {
  flex: 1; min-width: 0;
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.18);
  outline: none;
}
.sw-avatar__zoom:disabled { opacity: 0.4; }
.sw-avatar__zoom::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--sw-accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.sw-avatar__zoom::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--sw-accent);
  border: 0; border-radius: 50%;
  cursor: pointer;
}
.sw-avatar__hint {
  margin: 0; font-size: 12px;
  color: var(--sw-ink-dim);
  text-align: center;
}
.sw-avatar.is-invalid .sw-avatar__frame {
  box-shadow:
    inset 0 0 0 1px rgba(255,93,108,0.8),
    inset 0 0 0 6px rgba(0,0,0,0.4),
    0 12px 32px rgba(0,0,0,0.5),
    0 0 0 4px rgba(255,93,108,0.18);
}

/* Result flavor line — Star Wars wisdom under the score */
.sw-result__flavor {
  margin: 0;
  font-size: clamp(15px, 1.6vw, 18px);
  font-style: italic;
  color: var(--sw-accent-2);
  text-wrap: balance;
}

.sw-accent { color: var(--sw-accent); }
.sw-lede {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.5;
  color: var(--sw-ink-dim);
  max-width: 56ch;
  margin: 12px 0 0;
}

/* ---- View shells ---- */
.sw-view {
  display: flex; flex-direction: column;
  gap: clamp(14px, 2.5vw, 22px);
  animation: sw-view-in 380ms ease both;
}
.sw-view[hidden] { display: none !important; }
@keyframes sw-view-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- Card ---- */
.sw-card {
  background: rgba(8, 12, 22, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 28px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sw-card__row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 16px;
}
.sw-card__or {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: var(--sw-ink-dim);
}
.sw-card__note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--sw-ink-dim);
}
.sw-card__warn {
  margin: 8px 0 0;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #ffd9a8;
  background: rgba(255, 165, 0, 0.12);
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-radius: 8px;
}
.sw-card__warn strong { color: #ffae3a; }

/* ---- Buttons ---- */
.sw-btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.sw-btn:active { transform: translateY(1px); }
.sw-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.sw-btn:focus-visible { outline: 3px solid var(--sw-accent-2); outline-offset: 3px; }

.sw-btn--okta {
  background: linear-gradient(135deg, #1d3a8a, #4a78c4);
  color: #fff;
  width: 100%;
  margin-bottom: 10px;
  box-shadow: 0 8px 18px rgba(40, 100, 220, 0.35), inset 0 0 0 1px rgba(255,255,255,0.15);
}
.sw-btn--okta:hover { filter: brightness(1.08); }
.sw-btn--okta[data-state="dormant"] { opacity: .65; }

.sw-card__sep {
  margin: 4px 0 14px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sw-ink-dim);
}

.sw-btn--ghost {
  background: rgba(255,255,255,0.08);
  color: var(--sw-ink);
  border: 1px solid rgba(255,255,255,0.18);
}
.sw-btn--ghost:hover { background: rgba(255,255,255,0.14); }

.sw-btn--primary {
  background: var(--sw-accent);
  color: #07210e;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(123, 227, 163, 0.35);
}
.sw-btn--primary:hover { filter: brightness(1.05); }

.sw-btn--text {
  background: transparent;
  color: var(--sw-ink-dim);
  padding: 10px 14px;
}
.sw-btn--text:hover { color: var(--sw-ink); }

.sw-btn--sm { padding: 8px 14px; font-size: 13px; }

/* ---- Form ---- */
.sw-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.sw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sw-field__label {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--sw-ink-dim);
}
.sw-field input {
  font-family: inherit; font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  color: var(--sw-ink);
  outline: none;
  min-width: 0; width: 100%;
}
.sw-field input:focus-visible {
  border-color: var(--sw-accent-2);
  box-shadow: 0 0 0 4px rgba(93, 212, 255, 0.18);
}
.sw-field input[aria-invalid="true"] {
  border-color: var(--sw-warn);
  box-shadow: 0 0 0 4px rgba(255, 93, 108, 0.18);
}

/* ---- Rules list ---- */
.sw-rules {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
}
.sw-rules li {
  position: relative;
  padding: 12px 14px 12px 38px;
  background: rgba(8, 12, 22, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 14px;
  color: var(--sw-ink);
}
.sw-rules li::before {
  content: "";
  position: absolute;
  left: 14px; top: 50%; width: 14px; height: 14px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--sw-accent);
  box-shadow: 0 0 0 3px rgba(123, 227, 163, 0.18);
}

/* ---- Actions row ---- */
.sw-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-top: 10px;
}

/* ---- Gameplay HUD ---- */
.sw-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
.sw-hud__cell {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.sw-hud__label {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--sw-ink-dim);
}
.sw-hud__value {
  font-size: clamp(14px, 1.6vw, 17px);
  font-weight: 700;
  color: var(--sw-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sw-hud__value--score { color: var(--sw-accent); }
.sw-hud__cell--clock .sw-hud__value--clock { font-variant-numeric: tabular-nums; }
.sw-hud__cell--clock.is-warning .sw-hud__value--clock { color: var(--sw-gold); }
.sw-hud__cell--clock.is-critical .sw-hud__value--clock { color: var(--sw-warn); animation: sw-pulse 800ms ease-in-out infinite; }
@keyframes sw-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .65; }
}

/* ---- Deck ----
 * Locked min-height so the passport row always occupies the same
 * vertical space regardless of its content. Compacted in v5 so the
 * HUD + passport + decisions + feedback all fit above the fold on a
 * typical ~900 px viewport. */
.sw-deck {
  position: relative;
  min-height: 360px;
  perspective: 1500px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 720px) {
  .sw-deck { min-height: 340px; }
}
@media (max-width: 420px) {
  .sw-deck { min-height: 320px; }
}

/* Reinforce the passport's own height baseline so cards with short
 * occupations don't visibly shrink. */
.sw-passport {
  min-height: 340px;
}

/* ---- Decision buttons ---- */
.sw-decisions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.sw-decision {
  appearance: none; border: 0; cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  font-size: clamp(15px, 1.8vw, 17px);
  font-weight: 800;
  padding: 14px 28px;
  border-radius: 999px;       /* fully pill — matches the rest of the UI */
  color: #fff;
  letter-spacing: 0.4px;
  transition: transform 80ms ease, filter 120ms ease, box-shadow 120ms ease;
  position: relative;
}
.sw-decision:focus-visible { outline: 3px solid var(--sw-accent-2); outline-offset: 3px; }
.sw-decision:active { transform: translateY(1px) scale(.99); }
.sw-decision[disabled] { filter: grayscale(.3); opacity: .6; cursor: not-allowed; }
.sw-decision kbd {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
}
.sw-decision--approve {
  background: linear-gradient(135deg, #1aa463, #2bd182);
  box-shadow: 0 12px 30px rgba(43, 209, 130, 0.35), inset 0 0 0 1px rgba(255,255,255,0.18);
}
.sw-decision--reject {
  background: linear-gradient(135deg, #c12b3a, #ff5d6c);
  box-shadow: 0 12px 30px rgba(255, 93, 108, 0.30), inset 0 0 0 1px rgba(255,255,255,0.18);
}

/* ---- Persistent feedback panel ---- */
.sw-feedback {
  display: grid;
  grid-template-columns: 36px 36px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(193, 43, 58, 0.18);
  border: 1px solid rgba(193, 43, 58, 0.45);
  color: #ffe2e6;
  margin-top: 14px;
  animation: sw-view-in 280ms ease both;
}
/* Override the parent grid display when [hidden] is set —
   otherwise [hidden]'s default display:none is silently ignored. */
.sw-feedback[hidden] { display: none !important; }
.sw-feedback[data-kind="correct"] {
  background: rgba(26, 164, 99, 0.18);
  border-color: rgba(43, 209, 130, 0.5);
  color: #d4ffe6;
}
.sw-feedback__icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.35);
  font-weight: 900; font-size: 18px;
}
.sw-feedback[data-kind="wrong"] .sw-feedback__icon::before {
  content: "✕"; color: #ff8b97;
}
.sw-feedback[data-kind="correct"] .sw-feedback__icon::before {
  content: "✓"; color: #7be3a3;
}
/* Small thumbnail of the just-judged character — anchors the
   feedback to the previous traveler so it can't be confused with
   the passport now on screen. */
.sw-feedback__thumb {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.sw-feedback__text {
  margin: 0; font-size: 14px; line-height: 1.45;
}

/* ---- Results ---- */
.sw-result {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  background: rgba(8, 12, 22, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 28px);
}
.sw-result__final {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}
.sw-result__label {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--sw-ink-dim);
}
.sw-result__score {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  color: var(--sw-accent);
  letter-spacing: -1px;
}
.sw-result__rank {
  font-size: 14px; color: var(--sw-ink-dim);
}
.sw-result__breakdown {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 14px; color: var(--sw-ink);
}
.sw-pip { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.sw-pip--correct { background: var(--sw-accent); }
.sw-pip--wrong   { background: var(--sw-warn); }
.sw-pip--skip    { background: var(--sw-ink-dim); }

/* ---- Leaderboard ---- */
.sw-board {
  background: rgba(8, 12, 22, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: clamp(16px, 3vw, 24px);
}
.sw-board__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.sw-board__head h2 {
  font-size: 16px; letter-spacing: 0.6px; margin: 0;
  color: var(--sw-ink);
}
.sw-board__list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 6px;
  max-height: 360px; overflow: auto;
}
.sw-board__row {
  display: grid;
  grid-template-columns: 28px 36px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.sw-board__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #1a2434 center / cover no-repeat;
  display: grid; place-items: center;
  color: var(--sw-ink-dim);
  font-weight: 800; font-size: 11px; letter-spacing: 0.5px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.sw-board__who    { min-width: 0; }
.sw-board__time   { color: var(--sw-ink-dim); font-size: 12px; }
.sw-board__row--me {
  background: rgba(123, 227, 163, 0.16);
  border-color: rgba(123, 227, 163, 0.5);
  color: var(--sw-ink);
}
.sw-board__row--placeholder {
  display: block;
  color: var(--sw-ink-dim);
  text-align: center;
  font-style: italic;
}
.sw-board__rank { font-weight: 800; color: var(--sw-accent); }
.sw-board__name { color: var(--sw-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-board__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  border-radius: 999px;
  vertical-align: middle;
}
.sw-board__badge--ok   { background: rgba(123,227,163,.18); color: #7be3a3; border: 1px solid rgba(123,227,163,.5); }
.sw-board__badge--demo { background: rgba(255,170,60,.14);  color: #ffae3a; border: 1px solid rgba(255,170,60,.4); }
.sw-board__email { color: var(--sw-ink-dim); font-size: 12px; }
.sw-board__score { font-weight: 800; color: var(--sw-ink); }

/* ---- Avatar lightbox ---- */
.sw-lightbox {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(2, 4, 12, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: zoom-out;
  animation: sw-fade-in 200ms ease both;
}
.sw-lightbox[hidden] { display: none !important; }
@keyframes sw-fade-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
.sw-lightbox__close {
  position: absolute; top: clamp(12px, 2vw, 24px); right: clamp(12px, 2vw, 24px);
  width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.4); color: var(--sw-ink);
  font-size: 28px; font-weight: 300; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 120ms ease;
}
.sw-lightbox__close:hover { background: rgba(255,255,255,0.12); }
.sw-lightbox__figure {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px;
  cursor: default;
  text-align: center;
}
.sw-lightbox__photo {
  width: clamp(240px, 50vmin, 480px);
  height: clamp(240px, 50vmin, 480px);
  border-radius: 50%;
  background: #1a2434 center / cover no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.18),
    0 24px 60px rgba(0,0,0,0.6),
    0 0 80px rgba(123,227,163,0.18);
}
.sw-lightbox__cap {
  display: flex; flex-direction: column; gap: 4px;
  color: var(--sw-ink);
}
.sw-lightbox__rank {
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--sw-accent);
  font-weight: 800;
}
.sw-lightbox__name { font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; }
.sw-lightbox__score { font-size: 14px; color: var(--sw-ink-dim); font-variant-numeric: tabular-nums; }

/* Make leaderboard avatars feel clickable. */
.sw-board__avatar {
  cursor: zoom-in;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.sw-board__avatar:hover {
  transform: scale(1.08);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.25),
    0 0 0 3px rgba(123,227,163,0.3);
}

/* ---- Mobile ---- */
@media (max-width: 720px) {
  .sw-card__row { grid-template-columns: 1fr; }
  .sw-card__or { display: none; }
  .sw-form { grid-template-columns: 1fr; }
  .sw-hud { grid-template-columns: repeat(4, 1fr); gap: 4px 8px; padding: 6px 10px; }
  .sw-hud__label { font-size: 9px; letter-spacing: 1px; }
  .sw-hud__value { font-size: 13px; }
  .sw-decisions { gap: 8px; }
  .sw-decision { padding: 12px 10px; min-height: 48px; font-size: 14px; }
  .sw-feedback { padding: 8px 12px; gap: 8px; }
  .sw-feedback__icon, .sw-feedback__thumb { width: 28px; height: 28px; }
  .sw-feedback__text { font-size: 12px; line-height: 1.35; }
  .sw-board__row { grid-template-columns: 24px 32px 1fr auto; gap: 8px; }
  .sw-board__avatar { width: 32px; height: 32px; }
  .sw-board__time   { display: none; }
  /* A / R keyboard hints are only useful with a physical keyboard.
   * Hide on mobile + tablet so they don't crowd the touch button. */
  .sw-decision kbd { display: none; }
}
/* Touch-input devices regardless of viewport width — covers tablets
 * over 720 px. */
@media (pointer: coarse) {
  .sw-decision kbd { display: none; }
}
@media (max-width: 420px) {
  .sw-hud { grid-template-columns: repeat(4, 1fr); gap: 2px 6px; padding: 5px 8px; }
  .sw-hud__cell { gap: 0; min-width: 0; }
  .sw-hud__label { font-size: 8.5px; }
  .sw-hud__value { font-size: 12px; }
  .sw-decision span:first-of-type { flex: 0 0 auto; }
  .sw-decision kbd { display: none; }
}

