/* Root styles and variables */
:root {
  --primary-dark: #1a1a1a;
  --primary-gray: #2c2c2c;
  --accent-green: #28a745;
  --accent-blue: #007bff;
  --light-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --white: #ffffff;
  --font-family-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  
  /* Enhanced color variables for better predictions visibility */
  --success-bg: rgba(40, 167, 69, 0.25);
  --success-text: #155724;
  --success-border: #28a745;
  --danger-bg: rgba(220, 53, 69, 0.25);
  --danger-text: #721c24;
  --danger-border: #dc3545;
}

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
  /* Safari-only styles */
  .results-table {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  
  /* Fix for Safari orientation change issues */
  @media (orientation: landscape) {
    .table {
      -webkit-overflow-scrolling: touch;
    }
  }
}

/* Global typography */
body {
  font-family: var(--font-family-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-family-base);
  font-weight: 500;
  line-height: 1.2;
}

/* Ensure consistent font in tables */
.table {
  font-family: var(--font-family-base);
}

/* Ensure consistent font in form elements */
input,
select,
textarea,
button {
  font-family: var(--font-family-base);
}

/* Ensure consistent font in badges and alerts */
.badge,
.alert {
  font-family: var(--font-family-base);
}

/* Ensure consistent font in navigation */
.navbar,
.nav-link {
  font-family: var(--font-family-base);
}

/* Ensure consistent font in modals */
.modal {
  font-family: var(--font-family-base);
}

/* Prevent horizontal scrolling + paint the root dark */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--primary-dark);
}


/* Main content background */
.bg-light {
  background: #f8f9fa !important;
  margin: 0;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Essential custom styles that Bootstrap doesn't cover */
.team-selection img {
  height: 40px;
  width: auto;
  margin-right: 0.5rem;
  object-fit: contain;
}

.team-selection .form-check {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.team-selection .form-check:hover {
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

.team-selection .form-check-input:checked + .form-check-label {
  font-weight: bold;
}

.team-selection .form-check.selected {
  background-color: #e9ecef;
  border-color: #0d6efd;
}

/* Confetti canvas for celebrations */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  pointer-events: none;
}

/* Simple separator for login page */
.separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #dee2e6;
}

.separator span {
  padding: 0 1rem;
  color: #6c757d;
}

/* Team Selection Styling */
.team-selection .form-check.game-option {
  margin-bottom: 1rem;
  position: relative;
  padding: 0;
  border: 2px solid #dee2e6;
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
  background: white;
}

.team-selection .form-check-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.team-selection .form-check-label {
  width: 100%;
  margin: 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

.team-selection .game-option:hover {
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
  border-color: var(--nhl-blue);
}

.team-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.team-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.team-name {
  font-weight: 500;
  margin-right: 1rem;
}

.seed {
  background: var(--nhl-blue);
  color: var(--nhl-white);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: bold;
  min-width: 2.5rem;
  text-align: center;
}

/* Selected team styling */
.team-selection .form-check-input:checked ~ .form-check-label {
  font-weight: 700;
}

.team-selection .form-check-input:checked + .form-check-label .seed {
  background: var(--nhl-black);
  color: var(--nhl-white);
}

.team-selection .form-check-input:checked ~ .form-check-label .team-name {
  font-weight: 700;
}

.team-selection .form-check.game-option:has(.form-check-input:checked) {
  background-color: #f8f9fa;
  transform: translateY(-2px);
  border: 3px solid var(--nhl-black);
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

/* Theme Colors */
.card-header {
  background: linear-gradient(45deg, var(--primary-dark), var(--primary-gray)) !important;
}

.card-header small {
  opacity: 0.8;
  display: block;
  margin-top: 0.25rem;
}

/* Submit button styling */
.mega-pool-button {
  transition: all 0.3s ease;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
  background: linear-gradient(45deg, var(--accent-green), var(--accent-blue));
  border: none;
  color: var(--white) !important;
}

.mega-pool-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 1rem 2rem rgba(0,0,0,.15);
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-green));
  color: var(--white) !important;
}

.submit-predictions {
  composes: mega-pool-button;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .team-name {
    font-size: 0.875rem;
  }
  
  .seed {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }
  
  .team-logo {
    width: 30px;
    height: 30px;
  }
  
  .team-selection .form-check-label {
    padding: 0.75rem;
  }
}

/* Home page styles */
.team-logo-sm {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
}

.upcoming-game {
  background-color: #fff;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  border: 1px solid #dee2e6 !important;
}

.upcoming-game:hover {
  transform: translateY(-2px);
  box-shadow: 0 .25rem .5rem rgba(0,0,0,.1);
}

.upcoming-game .team-logo-sm {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  margin: 0 4px;
}

.upcoming-game small {
  color: #6c757d;
  font-size: 0.75rem;
}

.display-4 {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--primary-dark);
}

@media (min-width: 768px) {
  .display-4 {
    font-size: 3.5rem;
  }
}

/* Button hover effects */
.btn-secondary {
  background: linear-gradient(45deg, var(--primary-gray), var(--primary-dark));
  border: none;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: linear-gradient(45deg, var(--primary-dark), var(--primary-gray));
  transform: translateY(-2px);
}

/* Game selection styling */
.game-option {
  border: 1px solid #dee2e6;
  background: #fff;
}

.game-option:hover {
  background-color: #f8f9fa;
  border-color: var(--nhl-blue);
}

.form-check-input:checked + .form-check-label .game-option {
  border-color: var(--nhl-blue);
  background-color: #f8f9fa;
  box-shadow: 0 0 0 0.25rem rgba(0,62,126,0.25);
}

/* Seed badges */
.seed {
  background: var(--nhl-blue);
  color: var(--nhl-white);
}

.form-check-input:checked + .form-check-label .seed {
  background: var(--nhl-black);
  color: var(--nhl-white);
}

/* Table headers */
.table-dark {
  background: linear-gradient(45deg, var(--primary-dark), var(--primary-gray));
}

/* User info bar */
.user-info {
  background: linear-gradient(45deg, var(--primary-dark), var(--primary-gray)) !important;
}

/* Card shadows */
.card.shadow-sm {
  box-shadow: 0 .125rem .25rem rgba(0,0,0,0.075) !important;
}

.card.shadow-sm:hover {
  box-shadow: 0 .5rem 1rem rgba(0,0,0,0.15) !important;
}

/* Navigation styles */
.nav-link {
  position: relative;
  color: rgba(255,255,255,.75) !important;
  padding: 0.75rem 1rem !important;
  transition: all 0.2s ease-in-out;
}

.nav-link:hover {
  color: rgba(255,255,255,.95) !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link.active {
  background-color: transparent !important;
  color: #ffffff !important;
  font-weight: 500;
}

.nav-link.active::after {
  width: 80%;
  background: #ffffff;
}

/* Navbar */
.navbar {
  padding: 0.5rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  background-color: var(--primary-dark) !important;
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ffffff !important;
}

/* Mobile navigation */
@media (max-width: 991.98px) {
  .navbar-nav {
    padding: 1rem 0;
  }
  
  .nav-link {
    padding: 0.5rem 1rem !important;
  }
  
  .nav-link::after {
    display: none;
  }
  
  .nav-link.active {
    background-color: rgba(255,255,255,.1) !important;
    border-radius: 0.25rem;
  }
}

/* Prevent horizontal scrolling */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Series prediction styles */
.series-length-select {
  background-color: var(--nhl-white);
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.5rem;
  width: 100%;
  transition: all 0.2s ease-in-out;
}

.series-length-select:focus {
  border-color: var(--nhl-blue);
  box-shadow: 0 0 0 0.25rem rgba(0,62,126,0.25);
}

/* Results table styles - Enhanced for better visibility */
.table-success {
  background-color: var(--success-bg) !important;
  color: var(--success-text) !important;
  font-weight: 600 !important;
  border-left: 3px solid var(--success-border) !important;
}

.table-danger {
  background-color: var(--danger-bg) !important;
  color: var(--danger-text) !important;
  font-weight: 600 !important;
  border-left: 3px solid var(--danger-border) !important;
}

/* Ensure text remains readable on colored backgrounds */
.table-success .result-indicator {
  color: var(--success-text) !important;
  font-weight: bold;
}

.table-danger .result-indicator {
  color: var(--danger-text) !important;
  font-weight: bold;
}

.badge.bg-secondary {
  background: var(--primary-gray) !important;
}

/* Override Bootstrap's striped table */
.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: transparent !important;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02) !important;
}

/* NHL Predictions Styling */
.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.prediction-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.prediction-item strong {
    color: #0d6efd;
    display: block;
    margin-bottom: 0.5rem;
}

.prediction-item p {
    margin: 0.25rem 0;
    color: #212529;
}

/* Modal styling */
.modal-header {
    background: linear-gradient(45deg, var(--nhl-black), var(--nhl-blue)) !important;
    color: var(--nhl-white) !important;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Participants list styling */
.participant-item {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.participant-item:last-child {
    border-bottom: none;
}

.participant-info {
    display: flex;
    align-items: center;
}

.participant-name {
    font-weight: 500;
    color: #212529;
    margin: 0;
}

.participant-name .text-muted {
    font-weight: normal;
}

.participant-email {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

.participant-team {
    font-weight: 500;
    color: #495057;
}

/* Result indicators for both desktop and mobile */
.result-indicator {
  margin-left: 0.5rem;
  font-weight: bold;
}

.table-success .result-indicator {
  color: #28a745;
}

.table-danger .result-indicator {
  color: #dc3545;
}

/* Desktop table styles */
@media (min-width: 768px) {
  .table td {
    text-align: center;
  }
}

/* Mobile Portrait - Card-based layout for narrow screens */
@media (max-width: 767px) and (orientation: portrait) {
  .results-table {
    margin-bottom: 2rem;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  }

  .table {
    margin-bottom: 0;
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    display: block;
    padding: 1.25rem;
    border-bottom: 1px solid #dee2e6;
  }

  .table tbody tr:last-child {
    border-bottom: none;
  }

  /* Hide results row on mobile portrait */
  .table tbody tr.table-secondary {
    display: none;
  }

  /* Pooler name styling */
  .table td:first-child {
    display: block;
    border: none;
    padding: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--nhl-black);
  }

  /* Grid for matches */
  .table td:not(:first-child) {
    display: inline-block;
    width: calc(50% - 0.5rem);
    margin: 0.25rem;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    text-align: left;
    position: relative;
    background: #f8f9fa;
    vertical-align: top;
    min-height: 4.5rem;
  }

  .table td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.25rem;
  }

  /* Results styling - Enhanced for mobile portrait */
  .table-success {
    background: rgba(40, 167, 69, 0.3) !important;
    border: 2px solid rgba(40, 167, 69, 0.6) !important;
    color: #155724 !important;
    font-weight: 600 !important;
  }

  .table-danger {
    background: rgba(220, 53, 69, 0.3) !important;
    border: 2px solid rgba(220, 53, 69, 0.6) !important;
    color: #721c24 !important;
    font-weight: 600 !important;
  }

  /* Mobile result indicator positioning */
  .table td .result-indicator {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
  }

  /* Remove hover effects */
  .table-hover tbody tr:hover {
    background-color: transparent !important;
  }

  .table td:hover {
    background: #f8f9fa !important;
  }
}

/* Mobile Landscape - Show horizontal table view like desktop */
@media (max-width: 1024px) and (orientation: landscape) {
  /* Force horizontal scrolling for landscape mobile */
  .results-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Safari smooth scrolling */
    margin-bottom: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    position: relative;
    /* Safari-specific fixes */
    -webkit-transform: translateZ(0); /* Hardware acceleration */
    transform: translateZ(0);
  }
  
  /* Add scroll indicator for landscape mode */
  .results-table::after {
    content: "← Faites défiler horizontalement →";
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--medium-gray);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.8;
  }
  
  /* Enhanced color coding for landscape mode */
  .table .table-success {
    background-color: rgba(40, 167, 69, 0.35) !important;
    color: #155724 !important;
    font-weight: 600 !important;
    border-left: 3px solid #28a745 !important;
  }
  
  .table .table-danger {
    background-color: rgba(220, 53, 69, 0.35) !important;
    color: #721c24 !important;
    font-weight: 600 !important;
    border-left: 3px solid #dc3545 !important;
  }
  
  /* Ensure table displays normally in landscape */
  .table {
    margin-bottom: 0;
    min-width: 800px; /* Minimum width to ensure all columns are visible */
    font-size: 0.85rem; /* Slightly smaller font for better fit */
  }
  
  .table thead {
    display: table-header-group !important;
  }
  
  .table tbody tr {
    display: table-row !important;
    padding: 0 !important;
    border-bottom: 1px solid #dee2e6;
  }
  
  .table td {
    display: table-cell !important;
    padding: 0.5rem 0.25rem !important;
    border: none;
    text-align: center;
    vertical-align: middle;
    background: transparent !important;
    width: auto !important;
    margin: 0 !important;
    min-height: auto !important;
    position: static !important;
  }
  
  .table td:first-child {
    text-align: left !important;
    font-weight: 500;
    padding-left: 0.5rem !important;
    font-size: 0.8rem !important;
  }
  
  /* Remove mobile-specific styling */
  .table td[data-label]:not(:first-child)::before {
    display: none !important;
  }
  
  .table td .result-indicator {
    position: static !important;
    transform: none !important;
    margin-left: 0.25rem;
  }
  
  /* Show results row in landscape */
  .table tbody tr.table-secondary {
    display: table-row !important;
  }
  
  /* Compact header styling for landscape */
  .table th {
    padding: 0.5rem 0.25rem !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
  }
  
  .table th:first-child {
    text-align: left !important;
    padding-left: 0.5rem !important;
  }
}

/* Very small screens in landscape (phones) - even more compact */
@media (max-width: 767px) and (orientation: landscape) {
  .table {
    font-size: 0.75rem !important;
    min-width: 700px;
  }
  
  .table th {
    font-size: 0.65rem !important;
    padding: 0.4rem 0.2rem !important;
  }
  
  .table td {
    padding: 0.4rem 0.2rem !important;
  }
  
  .table td:first-child {
    font-size: 0.7rem !important;
  }
}

/* Standings specific styles */
#Standings .table {
  margin-bottom: 0;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

#Standings .table th,
#Standings .table td {
  padding: 1rem;
  vertical-align: middle;
  text-align: center;
}

#Standings .table td:nth-child(2) {
  text-align: left;
}

#Standings .table th {
  background: var(--primary-dark);
  color: white;
  font-weight: 500;
  border: none;
}

#Standings .table thead tr {
  background: var(--primary-dark);
}

/* Mobile Portrait - Card layout for Standings */
@media (max-width: 767px) and (orientation: portrait) {
  #Standings .table {
    display: none; /* Hide the traditional table on mobile portrait */
  }
  
  /* Create a mobile-friendly card layout */
  #Standings .card-body {
    padding: 0;
  }
  
  #Standings .mobile-standings {
    display: block;
  }
  
  .mobile-standing-card {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem;
    margin: 0;
  }
  
  .mobile-standing-card:last-child {
    border-bottom: none;
  }
  
  .mobile-standing-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
  }
  
  .mobile-position {
    background: var(--primary-dark);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
  }
  
  .mobile-participant {
    flex: 1;
    line-height: 1.2;
  }
  
  .mobile-team-name {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.9rem;
    display: inline;
  }
  
  .mobile-pooler-name {
    color: var(--medium-gray);
    font-size: 0.85rem;
    display: inline;
    margin-left: 0.5rem;
  }
  
  .mobile-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 2.25rem;
  }
  
  .mobile-stat {
    text-align: center;
    flex: 1;
  }
  
  .mobile-stat-value {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-dark);
    display: block;
  }
  
  .mobile-stat-label {
    font-size: 0.7rem;
    color: var(--medium-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .mobile-percentage {
    background: linear-gradient(45deg, var(--accent-green), var(--accent-blue));
    color: white;
    padding: 0.375rem 0.625rem;
    border-radius: 0.75rem;
    font-weight: bold;
    font-size: 0.875rem;
  }
}

/* Mobile Landscape - Show table for Standings */
@media (max-width: 1024px) and (orientation: landscape) {
  #Standings .card {
    position: relative;
  }
  
  #Standings .table {
    display: table !important;
    font-size: 0.85rem;
  }
  
  #Standings .table th,
  #Standings .table td {
    padding: 0.5rem 0.25rem !important;
  }
  
  #Standings .table th {
    font-size: 0.75rem !important;
  }
  
  #Standings .mobile-standings {
    display: none !important;
  }
  
  /* Add landscape mode indicator */
  #Standings .card::after {
    content: "📱 Mode paysage activé";
    position: absolute;
    top: -1.5rem;
    right: 0;
    font-size: 0.7rem;
    color: var(--accent-green);
    font-weight: 500;
    pointer-events: none;
  }
}

/* Very small screens in landscape - even more compact for Standings */
@media (max-width: 767px) and (orientation: landscape) {
  #Standings .table {
    font-size: 0.75rem !important;
  }
  
  #Standings .table th,
  #Standings .table td {
    padding: 0.4rem 0.2rem !important;
  }
  
  #Standings .table th {
    font-size: 0.65rem !important;
  }
}

/* Desktop adjustments - keep table visible */
@media (min-width: 768px) {
  #Standings .mobile-standings {
    display: none;
  }
}

/* Results specific styles - keeping them separate */
#Resultats .results-table {
  margin-bottom: 2rem;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

/* NFL Team styling */
.team-name {
  font-weight: 600;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 0.5px;
}

.badge.bg-primary {
  background: var(--accent-blue) !important;
}

.badge.bg-secondary {
  background: var(--medium-gray) !important;
}

/* Team selection styling is now in nfl-teams.css */

/* Easter Egg Trigger Styles - Ultra Discret */
.easter-egg-trigger {
  color: inherit;
  cursor: text;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.easter-egg-trigger:hover {
  cursor: pointer;
  color: #495057;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

.easter-egg-trigger:active {
  transform: scale(0.98);
}

/* Fireworks Animation */
@keyframes explode {
  0% {
    transform: translate(0, 0);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty));
    opacity: 0;
  }
}
