/* ============================================================
   ANIME MATCH (АНИМЕ-ТИНДЕР) DEDICATED STYLES — Anilore
   Glassmorphism cards, responsive 3D swipe physics, custom controls,
   history pool modal, and expandable synopsis.
   ============================================================ */

.match-page-container {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  padding: 10px 12px calc(80px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.match-ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 800px;
  height: 520px;
  pointer-events: none;
  filter: blur(90px);
  z-index: 0;
  opacity: 0.85;
  background: radial-gradient(circle at 50% 35%, rgba(230, 57, 70, 0.16) 0%, rgba(255, 77, 109, 0.04) 45%, transparent 72%);
  transition: background 0.8s ease;
}

.match-top-bar {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px 6px;
}

.match-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.match-fire-icon {
  font-size: 20px;
  animation: pulse-fire 1.8s infinite ease-in-out;
}

@keyframes pulse-fire {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(4deg); }
}

.match-brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary, #ffffff) 40%, var(--accent-secondary, #ff4d6d) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.4px;
}

.match-brand-beta {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-subtle, rgba(230, 57, 70, 0.15));
  color: var(--accent-primary, #e63946);
  border: 1px solid var(--border-hover, rgba(230, 57, 70, 0.35));
  padding: 1px 7px;
  border-radius: var(--radius-sm, 6px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.match-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.match-counters {
  display: flex;
  gap: 6px;
}

.match-counter-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.match-counter-pill--like {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.match-counter-pill--skip {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.18);
}

.match-history-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #94a3b8);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.match-history-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.match-history-badge {
  background: var(--accent-primary, #e63946);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}

.match-reset-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted, #a1a1aa);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.match-reset-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.match-stage-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  height: min(540px, calc(100dvh - 220px));
  min-height: 360px;
  margin: 0 auto;
}

.match-cards-stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.match-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 11, 15, 0.88);
  backdrop-filter: blur(10px);
  border-radius: 26px;
  z-index: 15;
}

.match-card {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  overflow: hidden;
  background: #0d0e13;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
  user-select: none;
  touch-action: none;
  cursor: grab;
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  transition: box-shadow 0.25s ease;
}

.match-card:active {
  cursor: grabbing;
}

.match-card--current {
  z-index: 3;
}

.match-card--next {
  z-index: 2;
  transform: translate3d(0, 20px, 0) scale(0.94);
  opacity: 0.65;
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.match-media-wrap {
  position: relative;
  width: 100%;
  height: 70%;
  background: #07070a;
  overflow: hidden;
}

.match-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform, opacity;
}

.match-story-bars {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 5px;
  z-index: 5;
}

.match-story-bar {
  flex: 1;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  transition: all 0.25s ease;
}

.match-story-bar.active {
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
}

.match-story-bar.passed {
  background: rgba(255, 255, 255, 0.7);
}

.match-tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  cursor: pointer;
}

.match-tap-zone--left {
  left: 0;
  width: 35%;
}

.match-tap-zone--right {
  right: 0;
  width: 65%;
}

.match-card-top-badges {
  position: absolute;
  top: 22px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 5;
  pointer-events: none;
}

.match-image-scrim {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, #0d0e13 0%, rgba(13, 14, 19, 0.78) 45%, transparent 100%);
  pointer-events: none;
}

.match-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 28%;
  max-height: 80%;
  padding: 14px 18px 18px;
  background: linear-gradient(to top, #0d0e13 84%, rgba(13, 14, 19, 0.96) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 5;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-card-title-row {
  margin-bottom: 6px;
}

.match-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.match-card-subtitle {
  font-size: 12px;
  color: var(--text-muted, #a1a1aa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.match-card-genres {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.match-genre-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #d4d4d8);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.match-card-synopsis-wrapper {
  position: relative;
  margin-top: 4px;
}

.match-card-synopsis {
  font-size: 12.5px;
  color: var(--text-secondary, #d4d4d8);
  line-height: 1.45;
  margin: 0;
  max-height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  pointer-events: none;
}

.match-card-synopsis--short {
  max-height: 56px;
  -webkit-line-clamp: 3;
}

.match-synopsis-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-primary, #e63946);
  background: var(--accent-subtle, rgba(230, 57, 70, 0.08));
  border: 1px solid var(--border-hover, rgba(230, 57, 70, 0.2));
  border-radius: 6px;
  padding: 3px 8px;
  margin-top: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.match-synopsis-hint:hover {
  background: var(--accent-subtle, rgba(230, 57, 70, 0.18));
  color: var(--text-accent, var(--accent-secondary, #ff6b7a));
  transform: translateY(-1px);
}

.match-synopsis-hint svg {
  transition: transform 0.2s ease;
}

.match-synopsis-hint:hover svg {
  transform: translateX(2px);
}

/* Tinder Stamps */
.match-stamp {
  position: absolute;
  top: 36px;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.08s ease;
}

.match-stamp--like {
  right: 20px;
  transform: rotate(14deg);
  color: #10b981;
  border: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.match-stamp--nope {
  left: 20px;
  transform: rotate(-14deg);
  color: #ef4444;
  border: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.match-stamp--info {
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-3deg);
  color: #ffffff;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background: rgba(13, 14, 19, 0.92);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.2);
  font-size: 20px;
}

/* Control Bar (Intuitive 3-button layout) */
.match-control-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin-top: 20px;
  width: 100%;
}

.match-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.match-btn:active {
  transform: scale(0.88);
}

.match-btn--nope {
  width: 64px;
  height: 64px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.28);
}
.match-btn--nope:hover {
  background: rgba(239, 68, 68, 0.28);
  transform: scale(1.1);
  box-shadow: 0 10px 32px rgba(239, 68, 68, 0.48);
}

.match-btn--info {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.match-btn--info:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
}

.match-btn--like {
  width: 68px;
  height: 68px;
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1.5px solid rgba(16, 185, 129, 0.48);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.35);
}
.match-btn--like:hover {
  background: rgba(16, 185, 129, 0.32);
  transform: scale(1.12);
  box-shadow: 0 12px 38px rgba(16, 185, 129, 0.54);
}

/* History Card Modal (Pool of last 10 swiped anime) */
.match-history-card {
  max-height: 75vh;
}

.match-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  overflow-y: auto;
  max-height: 52vh;
  padding-right: 4px;
}

.match-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.2s ease;
}

.match-history-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.match-history-item__poster {
  width: 42px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0d111a;
}

.match-history-item__info {
  flex: 1;
  min-width: 0;
}

.match-history-item__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.match-history-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted, #a1a1aa);
}

.match-history-badge--like {
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 10.5px;
}

.match-history-badge--skip {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 10.5px;
}

.match-history-item__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-primary, #fff);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.match-history-item__btn:hover {
  background: var(--accent-primary, #e63946);
  border-color: var(--accent-primary, #e63946);
  color: #fff;
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35);
}

/* Body scroll lock when modal or lightbox is open */
body.match-modal-open {
  overflow: hidden !important;
  touch-action: none;
}
/* Screenshots Gallery in Details Sheet */
.match-sheet-shots-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.match-sheet-shots-strip::-webkit-scrollbar {
  display: none;
}

.match-sheet-shot-thumb {
  width: 124px;
  height: 74px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  background: #111319;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease;
}

.match-sheet-shot-thumb:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: var(--accent-primary, #e63946);
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.3);
}

/* Lightbox preview modal for full images */
.match-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  touch-action: none;
}

.match-lightbox-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Top bar with counter pill and fixed close button */
.match-lightbox-topbar {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  left: 0;
  right: 0;
  padding: 0 max(20px, env(safe-area-inset-right, 20px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10020;
  pointer-events: none;
}

.match-lightbox-counter-pill {
  pointer-events: auto;
  background: rgba(18, 19, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary, #ffffff);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.match-lightbox-close-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(18, 19, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  margin-left: auto;
}

.match-lightbox-close-btn:hover {
  background: var(--accent-primary, #e63946);
  border-color: var(--accent-primary, #e63946);
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.45);
}

.match-lightbox-close-btn:active {
  transform: scale(0.95);
}

/* Stage: Full viewport centered click-dismiss container */
.match-lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 70px 85px;
  box-sizing: border-box;
  cursor: pointer;
}

@media (max-width: 768px) {
  .match-lightbox-stage {
    padding: 55px 12px 75px;
  }
}

/* Image wrapper */
.match-lightbox-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  cursor: default;
}

.match-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  border-radius: 14px;
  box-shadow: 0 24px 70px -10px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform, opacity;
  cursor: grab;
  transition: box-shadow 0.25s ease;
}

.match-lightbox-img:active {
  cursor: grabbing;
}

/* Navigation buttons (ONLY ONE CLEAN PAIR!) */
.match-lightbox-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(18, 19, 25, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10015;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.match-lightbox-nav-btn:hover {
  background: var(--accent-primary, #e63946);
  border-color: var(--accent-primary, #e63946);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 26px rgba(230, 57, 70, 0.45);
}

.match-lightbox-nav-btn:active {
  transform: translateY(-50%) scale(0.94);
}

.match-lightbox-nav-btn--prev {
  left: max(16px, env(safe-area-inset-left, 16px));
}

.match-lightbox-nav-btn--next {
  right: max(16px, env(safe-area-inset-right, 16px));
}

@media (max-width: 600px) {
  .match-lightbox-nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(18, 19, 25, 0.7);
  }
  .match-lightbox-nav-btn--prev { left: 8px; }
  .match-lightbox-nav-btn--next { right: 8px; }
}

/* Miniature Thumbnails Strip at bottom */
.match-lightbox-thumbs-bar {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(12, 13, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  z-index: 10020;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
}

.match-lightbox-thumbs-bar::-webkit-scrollbar {
  display: none;
}

.match-lightbox-thumb-btn {
  width: 44px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid transparent;
  background: #08080c;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.55;
  transition: all 0.2s ease;
}

.match-lightbox-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.match-lightbox-thumb-btn:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.match-lightbox-thumb-btn.active {
  opacity: 1;
  border-color: var(--accent-primary, #e63946);
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.5);
  transform: scale(1.08);
}
@media (max-width: 600px) {
  .match-page-container {
    padding: 6px 10px calc(76px + env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - var(--header-h));
  }
  .match-top-bar {
    padding: 0 4px;
    margin-bottom: 8px;
    gap: 6px;
  }
  .match-brand-title {
    font-size: 17px;
  }
  .match-brand-beta {
    font-size: 8px;
    padding: 1px 4px;
  }
  .match-top-actions {
    gap: 4px;
  }
  .match-counter-pill, .match-history-pill, .match-reset-pill {
    font-size: 10.5px;
    padding: 2px 7px;
  }
  .match-stage-wrapper {
    max-width: calc(100vw - 20px);
    height: min(480px, calc(100dvh - 200px));
    min-height: 340px;
  }
  .match-card {
    border-radius: 18px;
  }
  .match-card-info {
    padding: 10px 14px 12px;
  }
  .match-card-title {
    font-size: 18px;
  }
  .match-card-subtitle {
    font-size: 11.5px;
  }
  .match-control-bar {
    margin-top: 10px;
    gap: 20px;
  }
  .match-btn--nope, .match-btn--like {
    width: 56px;
    height: 56px;
  }
  .match-btn--info {
    width: 46px;
    height: 46px;
  }

}

@media (max-height: 700px) {
  .match-stage-wrapper {
    height: calc(100dvh - 190px);
    min-height: 300px;
  }
  .match-control-bar {
    margin-top: 6px;
  }
  .match-btn--nope, .match-btn--like {
    width: 50px;
    height: 50px;
  }
  .match-btn--info {
    width: 40px;
    height: 40px;
  }
}



/* Empty State */
.match-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 30px 20px;
  background: rgba(20, 25, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
}

.match-empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

/* Details Sheet */
.match-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1150;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.match-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.match-sheet-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  padding: 16px 22px 28px;
  background: #0f1015;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.8);
  max-height: 82vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-sheet-backdrop.active .match-sheet-card {
  transform: translateY(0);
}

.match-sheet-drag-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin: 0 auto 14px;
  cursor: pointer;
}

.match-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.match-sheet-trailer {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card, #090c14);
  margin-top: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  cursor: pointer;
  user-select: none;
}

.match-sheet-trailer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  border-radius: 14px;
  outline: none;
  /* Visual clarity enhancement: sharpen line contours, deepen dark outlines, and eliminate blur */
  filter: contrast(1.08) brightness(1.02) saturate(1.08);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.match-sheet-trailer canvas.match-upscale-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  pointer-events: none;
  z-index: 2;
  filter: contrast(1.06) brightness(1.02) saturate(1.06);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateZ(0);
}

.match-sheet-trailer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Play button overlay */
.match-trailer-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.28s ease;
  z-index: 5;
  pointer-events: none;
}

.match-trailer-play-overlay.playing {
  opacity: 0;
}

.match-trailer-play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-primary, #e63946);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px var(--accent-subtle, rgba(230, 57, 70, 0.65));
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.match-sheet-trailer:hover .match-trailer-play-btn {
  transform: scale(1.12);
}

/* Custom Minimalist Controls Bar */
.match-trailer-custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 65%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.match-sheet-trailer:hover .match-trailer-custom-controls,
.match-sheet-trailer.controls-active .match-trailer-custom-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Timeline scrubber */
.match-trailer-timeline-container {
  width: 100%;
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.match-trailer-timeline-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  position: relative;
  overflow: visible;
  transition: height 0.15s ease;
}

.match-trailer-timeline-container:hover .match-trailer-timeline-track {
  height: 6px;
}

.match-trailer-timeline-buffered {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
}

.match-trailer-timeline-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--accent-primary, #e63946);
  border-radius: 3px;
  box-shadow: 0 0 8px var(--accent-primary, #e63946);
}

.match-trailer-timeline-thumb {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.match-trailer-timeline-container:hover .match-trailer-timeline-thumb {
  transform: translateY(-50%) scale(1);
}

/* Controls bottom row */
.match-trailer-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-trailer-controls-left,
.match-trailer-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-trailer-ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.match-trailer-ctrl-btn:hover {
  color: var(--accent-primary, #e63946);
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
}

.match-trailer-time-display {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* Volume Slider */
.match-trailer-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.match-trailer-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.match-trailer-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.match-trailer-badge-upscale {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.match-trailer-badge-upscale.active {
  background: var(--accent-subtle, rgba(230, 57, 70, 0.18));
  color: var(--accent-primary, #ff4d6d);
  border-color: var(--accent-primary, #e63946);
}

/* Light Theme overrides */
[data-theme="light"] .match-sheet-card {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .match-sheet-drag-handle {
  background: rgba(0, 0, 0, 0.16) !important;
}

[data-theme="light"] .match-genre-pill {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #374151 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .match-tag-pill {
  background: rgba(0, 0, 0, 0.03) !important;
  color: #4b5563 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .match-details-section-label {
  color: #6b7280 !important;
}

[data-theme="light"] .match-sheet-trailer {
  background: #e5e7eb !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12) !important;
}

.match-sheet-footer {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.match-sheet-footer button {
  flex: 1;
}

/* Infinite Feed Loading Card */
.match-card--loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(160deg, #181d2c 0%, #0d101a 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  cursor: default;
  pointer-events: auto;
  min-height: 480px;
}

.match-loading-pulse {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px 20px;
}

.match-spinner {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary, #e63946);
  border-right-color: var(--accent-secondary, #ff4d6d);
  border-radius: 50%;
  animation: match-spin 0.85s linear infinite;
}

@keyframes match-spin {
  to { transform: rotate(360deg); }
}

.match-loading-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.match-loading-subtext {
  font-size: 13px;
  color: var(--text-muted, #8e95a5);
  max-width: 280px;
  line-height: 1.45;
}

/* Details Sheet Tags & Genres */
.match-details-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted, #8e95a5);
  margin-bottom: 6px;
}

.match-details-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.match-tag-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  color: var(--text-secondary, #cfd4dc);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.match-tag-pill:hover {
  background: var(--accent-subtle, rgba(230, 57, 70, 0.12));
  border-color: var(--accent-primary, #e63946);
  color: var(--text-primary, #fff);
  transform: translateY(-1px);
}

.match-genre-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg-card, rgba(255, 255, 255, 0.08));
  color: var(--text-secondary, #d4d4d8);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

/* ============================================================
   LIGHT THEME SYNCHRONIZATION ([data-theme="light"])
   ============================================================ */
[data-theme="light"] .match-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.09);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .match-card-info {
  background: linear-gradient(to top, #ffffff 82%, rgba(255, 255, 255, 0.95) 100%);
}

[data-theme="light"] .match-card-title {
  color: #111827;
}

[data-theme="light"] .match-card-subtitle {
  color: #6b7280;
}

[data-theme="light"] .match-genre-pill {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .match-card-synopsis {
  color: #4b5563;
}

[data-theme="light"] .match-synopsis-hint {
  background: var(--accent-subtle, rgba(211, 47, 47, 0.08));
  border-color: var(--border-hover, rgba(211, 47, 47, 0.25));
  color: var(--accent-primary, #d32f2f);
}

[data-theme="light"] .match-synopsis-hint:hover {
  background: var(--accent-subtle, rgba(211, 47, 47, 0.16));
  color: var(--text-accent, var(--accent-secondary, #b71c1c));
}

[data-theme="light"] .match-sheet-card {
  background: #ffffff;
  border-top-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.18);
  color: #111827;
}

[data-theme="light"] .match-sheet-drag-handle {
  background: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .match-tag-pill {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .match-tag-pill:hover {
  background: var(--accent-subtle, rgba(211, 47, 47, 0.08));
  border-color: var(--accent-primary, #d32f2f);
  color: var(--accent-primary, #d32f2f);
}

[data-theme="light"] .match-sheet-shot-thumb {
  background: #f3f4f6;
  border-color: #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .match-history-card {
  background: #ffffff;
  color: #111827;
}

[data-theme="light"] .match-history-item {
  background: #f9fafb;
  border-color: #e5e7eb;
}

[data-theme="light"] .match-history-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

[data-theme="light"] .match-history-item__title {
  color: #111827;
}

[data-theme="light"] .match-history-item__btn {
  background: #ffffff;
  border-color: #d1d5db;
  color: #374151;
}

[data-theme="light"] .match-history-item__btn:hover {
  background: var(--accent-primary, #d32f2f);
  border-color: var(--accent-primary, #d32f2f);
  color: #ffffff;
}

[data-theme="light"] .match-reset-pill {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: #4b5563;
}

[data-theme="light"] .match-reset-pill:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #111827;
}

[data-theme="light"] .match-history-pill {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: #374151;
}

[data-theme="light"] .match-history-pill:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #111827;
}

[data-theme="light"] .match-btn--info {
  background: rgba(0, 0, 0, 0.05);
  color: #1e293b;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .match-btn--info:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.22);
  color: #0f172a;
}

[data-theme="light"] .match-counter-pill--like {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .match-counter-pill--skip {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.22);
}

[data-theme="light"] .match-empty-state {
  background: #ffffff;
  border-color: #e5e7eb;
}

[data-theme="light"] .match-card--loading {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .match-loading-text {
  color: #111827;
}

[data-theme="light"] .match-loading-subtext {
  color: #6b7280;
}

[data-theme="light"] .match-loading-overlay {
  background: rgba(255, 255, 255, 0.88);
}


