/* Editorial Discovery Deck & Interactive Decision Choreography */
.tinder-discovery {
  overflow-x: clip;
  padding: 4px 2px 32px;
}

.deck-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.78fr) minmax(350px, 1.44fr) minmax(230px, 0.86fr);
  grid-template-rows: min-content 1fr;
  grid-template-areas: "intro center support" "picks center support";
  gap: 24px clamp(20px, 2.8vw, 40px);
  align-items: start;
}

.deck-intro {
  grid-area: intro;
  min-width: 0;
  align-self: start;
  padding-top: 6px;
}

.deck-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.deck-heading h1 {
  flex: 1 0 100%;
  margin: 0;
  color: var(--white);
  font: 800 clamp(2.5rem, 4.2vw, 3.6rem)/0.96 var(--display);
  letter-spacing: -0.042em;
}

.deck-heading .preferences-btn {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 0.84rem;
  border-radius: 99px;
}

.deck-preferences {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 14px 0 10px;
}

.deck-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deck-center {
  grid-area: center;
  min-width: 0;
}

#deck {
  width: 100%;
  max-width: 424px;
  margin-inline: auto;
  min-width: 0;
}

/* Unified Evening Dossier Rail */
.deck-support {
  grid-area: support;
  display: grid;
  align-content: start;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--well);
  overflow: hidden;
  box-shadow: var(--sheen), 0 18px 42px -28px rgba(0, 0, 0, 0.85);
}

.deck-support .panel {
  padding: 18px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.deck-support .panel + .panel {
  border-top: 1px solid var(--line);
}

.deck-support .panel-head {
  margin-bottom: 8px;
}

.deck-support .panel h2 {
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

.deck-support .desc {
  font-size: 0.87rem;
  line-height: 1.52;
}

.deck-support .queue-panel {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(236, 78, 48, 0.1), transparent 62%),
    var(--surface);
}

.tonight-panel .panel-head > svg {
  color: var(--green);
}

.tonight-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tonight-form > :is(p, button, .form-error) {
  grid-column: 1 / -1;
  margin: 0;
}

.tonight-form select {
  width: 100%;
  min-width: 0;
}

.tonight-form .form-error:empty {
  display: none;
}

.deck-presence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tonight-badge {
  display: inline-flex;
  justify-self: start;
  width: fit-content;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--green-soft);
  background: rgba(34, 229, 155, 0.14);
  border: 1px solid rgba(34, 229, 155, 0.36);
  font-size: 0.76rem;
  font-weight: 650;
}

.tonight-badge .ic {
  width: 14px;
  height: 14px;
}

.deck-heading .tonight-mobile {
  display: none;
}

.deck-highlights {
  grid-area: picks;
  min-width: 0;
}

.deck-highlights .daily-picks {
  margin: 0;
  padding-top: 16px;
}

.deck-highlights .section-title {
  margin-bottom: 12px;
}

.deck-highlights .section-title h2 {
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.deck-highlights .pick-grid {
  grid-template-columns: 1fr;
  gap: 6px;
}

.deck-highlights .pick-card {
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--well);
}

.deck-highlights .pick-card:hover {
  background: var(--surface);
}

.deck-highlights .pick-card .avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.deck-highlights small {
  color: var(--muted);
}

.tinder-discovery .activity-strip {
  margin-top: 36px;
}

.deck-stack {
  --advance: 0;
  position: relative;
  isolation: isolate;
  margin: 4px 0 14px;
  height: clamp(445px, 64vh, 595px);
}

#deck .live-candidate.decision-card,
.deck-empty {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  transform-origin: 50% 65%;
  margin: 0;
  padding: 0;
  background: var(--surface);
  box-shadow: var(--sheen), 0 28px 64px -22px rgba(0, 0, 0, 0.94);
}

#deck .live-candidate {
  display: block;
  touch-action: auto;
  user-select: none;
  -webkit-user-select: none;
}

#deck .live-candidate .deck-photograph {
  touch-action: pan-up pinch-zoom;
}

#deck .live-candidate .identity-block {
  touch-action: pan-y pinch-zoom;
}

.deck-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#deck .live-candidate::before {
  display: none;
}

#deck .live-candidate[data-position="front"] {
  z-index: 2;
}

#deck .live-candidate[data-position="next"] {
  z-index: 1;
  pointer-events: none;
  transform: translateY(calc((1 - var(--advance)) * 12px))
    translateX(calc((1 - var(--advance)) * 4px))
    rotate(calc((1 - var(--advance)) * 2deg))
    scale(calc(0.972 + var(--advance) * 0.028));
  filter: brightness(calc(0.66 + var(--advance) * 0.34));
}

.deck-stack:not(.tracking) .live-candidate[data-position="next"] {
  transition:
    transform 0.2s ease-out,
    filter 0.2s ease-out;
}

#deck .live-candidate .deck-photograph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

#deck .deck-photograph::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      0deg,
      rgba(9, 9, 11, 0.98) 0%,
      rgba(9, 9, 11, 0.82) 26%,
      rgba(15, 13, 16, 0.22) 48%,
      transparent 66%
    ),
    linear-gradient(180deg, rgba(9, 9, 11, 0.4), transparent 22%);
}

#deck .deck-cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

#deck .portrait-only .deck-photograph {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(207, 169, 114, 0.18), transparent 58%),
    var(--well);
}

#deck .portrait-only .deck-photograph::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

#deck .portrait-only .deck-cover {
  width: clamp(106px, 34%, 168px);
  height: auto;
  aspect-ratio: 1;
  inset: 34% auto auto 50%;
  transform: translate(-50%, -50%);
  border-radius: 28%;
  padding: 2.5px;
  background: var(--brand-grad);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72);
}

#deck .identity-block {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: block;
  z-index: 3;
  padding: clamp(18px, 3vw, 24px);
  color: var(--white);
  pointer-events: auto;
}

.identity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

#deck .identity-block h2 {
  font: 800 clamp(1.9rem, 3.2vw, 2.5rem)/1.04 var(--display);
  letter-spacing: -0.04em;
  margin: 0;
  overflow-wrap: anywhere;
}

#deck .identity-block h2 span {
  font-size: 0.78em;
  color: #dfdde9;
  font-weight: 500;
}

.deck-info-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 13, 16, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: var(--white);
}

.deck-info-btn:hover {
  background: var(--white);
  color: #09090b;
  border-color: var(--white);
  transform: scale(1.08);
}

#deck .card-identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.77rem;
  color: var(--white);
}

#deck .card-identity-meta span {
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 13, 16, 0.8);
  backdrop-filter: blur(6px);
}

#deck .deck-bio {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 9px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e6e4f0;
}

.deck-presence .on-site {
  background: rgba(10, 28, 21, 0.9);
  border: 1px solid rgba(34, 229, 155, 0.48);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.72rem;
  margin-bottom: 8px;
}

.deck-photo-meter {
  display: flex;
  gap: 5px;
  position: absolute;
  z-index: 4;
  left: 16px;
  right: 16px;
  top: 12px;
  pointer-events: none;
}

.deck-photo-meter i {
  flex: 1;
  height: 3.5px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.3);
}

.deck-photo-meter .current {
  background: var(--white);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}

.deck-photo-tools {
  position: absolute;
  z-index: 4;
  top: 24px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 13, 16, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 99px;
}

.deck-photo-tools button {
  position: relative;
  inset: auto;
  transform: none;
  color: var(--white);
  background: transparent;
  padding: 4px 7px;
  width: 34px;
  height: 32px;
  line-height: 1;
  border-radius: 99px;
  font-size: 1.3rem;
}

.deck-photo-tools button:disabled {
  opacity: 0.35;
  cursor: default;
}

.deck-photo-count {
  color: var(--white);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

#deck .gesture-label {
  position: absolute;
  top: 18%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 800 clamp(1.4rem, 3vw, 2.1rem)/1 var(--display);
  text-transform: uppercase;
  background: rgba(9, 9, 11, 0.92);
  border: 3px solid currentColor;
  border-radius: 12px;
  padding: 8px 14px;
  opacity: 0;
  pointer-events: none;
}

#deck .gesture-label svg {
  width: 0.85em;
  height: 0.85em;
}

#deck .like-label {
  left: clamp(14px, 4%, 24px);
  color: var(--like);
  transform: rotate(-8deg);
}

#deck .deny-label {
  right: clamp(14px, 4%, 24px);
  color: var(--nope);
  transform: rotate(8deg);
}

#deck .gesture-label.super-label {
  left: 50%;
  transform: translateX(-50%);
  top: auto;
  bottom: 32%;
  color: var(--superlike);
  white-space: nowrap;
}

#deck .live-candidate[data-drag="left"] .deny-label,
#deck .live-candidate[data-drag="right"] .like-label,
#deck .live-candidate[data-drag="up"] .super-label {
  opacity: var(--gesture-progress, 0);
}

#deck .live-candidate[data-drag] {
  cursor: grabbing;
}

/* Tactile Decision Controls With Design-Spells Icon Physics */
#deck .deck-commandbar {
  display: flex;
  position: relative;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vw, 18px);
  margin: 6px 0 8px;
}

#deck .deck-undo,
#deck .deck-boost-btn {
  position: static;
  flex: none;
}

#deck .card-decisions {
  width: auto;
}

#deck .deck-actions {
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vw, 18px);
}

#deck .swipe-button {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 48px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
}

#deck .swipe-button kbd {
  display: none;
}

@media (min-width: 761px) and (hover: hover) {
  #deck .swipe-button:is(:hover, :focus-visible) kbd {
    display: block;
    position: absolute;
    top: -6px;
    right: -6px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    padding: 1px 5px;
    background: var(--well);
    color: var(--white);
    font: 650 10px/1.25 var(--body, sans-serif);
  }
}

#deck .swipe-button:hover:not(:disabled) {
  color: var(--white);
}

#deck .swipe-button:disabled {
  opacity: 0.34;
  cursor: default;
}

#deck .decision-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  box-shadow: var(--sheen), 0 10px 24px -12px rgba(0, 0, 0, 0.9);
  transition:
    transform 240ms var(--ease-spring),
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms ease,
    color 180ms ease;
}

#deck .decision-icon svg {
  width: 23px;
  height: 23px;
  transition: transform 240ms var(--ease-spring);
}

#deck .rewind .decision-icon {
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--rewind);
  border-color: rgba(245, 184, 61, 0.5);
}

#deck .rewind:hover:not(:disabled) .decision-icon {
  background: var(--rewind);
  border-color: var(--rewind);
  color: #09090b;
  transform: translateY(-3px) rotate(-22deg);
}

#deck .pass .decision-icon {
  width: 58px;
  height: 58px;
  color: var(--nope);
  border-color: rgba(255, 71, 105, 0.56);
}

#deck .pass .decision-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.35;
}

#deck .pass:hover:not(:disabled) .decision-icon {
  background: var(--nope);
  border-color: var(--nope);
  color: #ffffff;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 14px 28px -10px rgba(255, 71, 105, 0.6);
}

#deck .pass:hover:not(:disabled) .decision-icon svg {
  transform: rotate(-12deg) scale(1.08);
}

#deck .superlike .decision-icon {
  width: 48px;
  height: 48px;
  color: var(--superlike);
  border-color: rgba(56, 189, 248, 0.56);
}

#deck .superlike .decision-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

#deck .superlike:hover:not(:disabled) .decision-icon {
  background: var(--superlike);
  border-color: var(--superlike);
  color: #09090b;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 28px -10px rgba(56, 189, 248, 0.6);
}

#deck .superlike:hover:not(:disabled) .decision-icon svg {
  transform: rotate(18deg) scale(1.1);
}

#deck .like .decision-icon {
  width: 58px;
  height: 58px;
  color: var(--like);
  border-color: rgba(34, 229, 155, 0.58);
}

#deck .like .decision-icon svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

#deck .like:hover:not(:disabled) .decision-icon {
  background: var(--like);
  border-color: var(--like);
  color: #061811;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 28px -10px rgba(34, 229, 155, 0.6);
}

#deck .like:hover:not(:disabled) .decision-icon svg {
  transform: scale(1.14);
}

#deck .boost .decision-icon {
  width: 46px;
  height: 46px;
  color: var(--boost);
  border-color: rgba(229, 153, 52, 0.54);
}

#deck .boost .decision-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#deck .boost:hover:not(:disabled) .decision-icon {
  background: var(--boost);
  border-color: var(--boost);
  color: #140c06;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 12px 26px -10px rgba(229, 153, 52, 0.58);
}

.deck-limits {
  margin: 4px 0 6px;
  text-align: center;
  font-size: 0.79rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.deck-limits strong {
  color: var(--muted);
}

.deck-empty {
  display: grid;
  justify-items: center;
  place-content: center;
  gap: 12px;
  padding: 32px;
  color: var(--white);
  text-align: center;
  background: var(--well);
}

.deck-empty > svg {
  width: 42px;
  height: 42px;
  color: var(--coral-soft);
}

.deck-empty p {
  max-width: 28ch;
  color: var(--muted);
}

.deck-detail-panel {
  display: grid;
  gap: 13px;
  max-width: 424px;
  margin-inline: auto;
  padding: 18px 2px 0;
  border-top: 1px solid var(--line);
}

.deck-detail-panel > .between h2 {
  font-size: 1.12rem;
}

.deck-detail-panel > .text-link {
  justify-self: start;
}

@media (max-width: 990px) and (min-width: 761px) {
  .deck-layout {
    grid-template-columns: minmax(320px, 1.55fr) minmax(220px, 0.85fr);
    grid-template-areas: "intro intro" "center support" "center picks";
  }
  .deck-intro {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0;
  }
  .deck-heading h1 {
    flex: auto;
    font-size: 2.8rem;
  }
  .deck-preferences {
    margin: 0;
  }
  .deck-filters {
    margin-left: auto;
  }
  .deck-stack {
    height: clamp(410px, 58vh, 550px);
  }
}

/* Mobile Viewport Optimization — Card + All 5 Action Buttons Fit Above Bottom Dock */
@media (max-width: 760px) {
  .tinder-discovery {
    padding: 0 0 18px;
  }
  .deck-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "center" "support" "picks";
    grid-template-rows: auto;
    gap: 12px;
  }
  .deck-intro {
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 6px;
  }
  .deck-heading {
    grid-column: 1 / -1;
    gap: 6px;
    justify-content: space-between;
  }
  .deck-heading h1 {
    font-size: 1.95rem;
    flex: auto;
  }
  .deck-heading .preferences-btn {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .deck-heading .tonight-mobile {
    display: inline-flex;
  }
  .deck-support .tonight-panel {
    display: none;
  }
  .deck-preferences {
    margin: 0;
    align-self: center;
    font-size: 0.76rem;
  }
  .deck-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
    align-items: center;
    padding-bottom: 2px;
  }
  .deck-filters::-webkit-scrollbar {
    display: none;
  }
  .deck-filters .chip {
    flex: none;
    padding: 4px 10px;
    min-height: 31px;
    font-size: 0.75rem;
  }
  .deck-stack {
    height: clamp(250px, calc(100svh - 332px - var(--member-dock-space, 74px)), 460px);
    margin: 2px 0 10px;
  }
  #deck .live-candidate.decision-card,
  .deck-empty {
    border-radius: 20px;
  }
  #deck .identity-block {
    padding: 14px 16px;
  }
  #deck .identity-block h2 {
    font-size: 1.8rem;
  }
  #deck .deck-bio {
    margin-top: 5px;
    font-size: 0.84rem;
  }
  #deck .card-identity-meta {
    font-size: 0.74rem;
  }
  #deck .deck-commandbar {
    min-height: 62px;
    gap: 10px;
    margin: 2px 0 4px;
  }
  #deck .deck-actions {
    gap: 10px;
  }
  #deck .swipe-button {
    font-size: 0.66rem;
    min-width: 44px;
  }
  #deck .rewind .decision-icon,
  #deck .boost .decision-icon {
    width: 40px;
    height: 40px;
  }
  #deck .superlike .decision-icon {
    width: 44px;
    height: 44px;
  }
  #deck .pass .decision-icon,
  #deck .like .decision-icon {
    width: 52px;
    height: 52px;
  }
  .deck-highlights .pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .deck-detail-panel {
    padding-top: 14px;
  }
}

@media (min-width: 761px) and (max-width: 990px) and (max-height: 640px) {
  .deck-layout {
    grid-template-areas: "center intro" "center support" "center picks";
    grid-template-rows: auto auto 1fr;
  }
  .deck-intro {
    display: grid;
    gap: 10px;
  }
  .deck-filters {
    margin-left: 0;
  }
}

@media (min-width: 761px) and (max-height: 700px) {
  .deck-stack {
    height: clamp(250px, calc(100svh - 224px), 445px);
  }
}

@media (max-width: 360px) {
  .deck-heading {
    gap: 4px;
  }
  .deck-heading h1 {
    font-size: 1.75rem;
  }
  .deck-heading .preferences-btn {
    gap: 4px;
    padding-inline: 7px;
  }
  .deck-stack {
    height: clamp(235px, calc(100svh - 342px - var(--member-dock-space, 74px)), 440px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .deck-stack .live-candidate {
    transition: none !important;
  }
}

.cm-still .deck-stack .live-candidate {
  transition: none !important;
}
