@font-face {
  font-family: 'Intro Rust G';
  src: url('./fonts/Intro Rust G Base 2 Line.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --card-size: 106px;
  --card-gap: 12px;
  --font-size-h1: 2.8rem;
  --font-size-card: 4.5rem;
  --font-size-info: 1.2rem;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: url('./Images/old_paper.jpg') no-repeat center center fixed;
  background-size: cover;
  margin: 0;
  padding: 20px 0 40px 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
  box-sizing: border-box;
}

/* Override the body, modal-bg, modal background */
body, .modal-bg, .modal {
  /* background: #f0f4f8 url('/Images/old_paper.jpg') no-repeat center center fixed !important;
  background-size: cover !important; */
}

/* Logo styling */
.logo-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0;
  margin-bottom: 20px;
  position: relative;
  z-index: 3;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.logo {
  width: auto;
  height: 55px; /* Half of original 110px size */
  max-width: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.game-container {
  background: rgba(253, 250, 251, 1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(124, 76, 56, 1);
  border-radius: 16px;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.05),
    0 8px 16px rgba(0,0,0,0.1),
    0 16px 32px rgba(0,0,0,0.12),
    0 32px 64px rgba(0,0,0,0.08),
    inset 0 1px 1px rgba(255,255,255,0.4);
  padding: 15px 32px 24px 32px;
  max-width: 650px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  margin-left: auto;
  margin-right: auto;
}

/* Add a pseudo-element for an additional shadow effect */
.game-container::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 6px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  z-index: -1;
}

h1 {
  font-family: 'Intro Rust G', 'Segoe UI', Arial, sans-serif;
  text-align: center;
  margin-top: 5px;
  margin-bottom: 22px;
  color: #1a1a1a;
  font-size: var(--font-size-h1);
  letter-spacing: 0.03em;
  font-weight: normal;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 18px;
  margin-top: 4px;
  font-size: calc(var(--font-size-info) * 1.5);
  padding: 0;
  box-sizing: border-box;
  max-width: calc(4 * var(--card-size) + 3 * var(--card-gap)); /* Match exact width of game board */
}

#move-counter {
  flex: 1;
  text-align: left;
  padding-left: 6px;
}

#timer {
  flex: 1;
  text-align: center;
  padding: 0 10px;
  transform: translateX(-5px);
}

#restart-btn {
  margin-left: auto;
  padding: 10px 22px;
  font-size: calc(1.1rem * 1.25);
  background: rgba(112, 22, 31, 1);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 6px;
}

#restart-btn:hover {
  background: rgba(92, 18, 26, 1);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(4, var(--card-size));
  grid-template-rows: repeat(4, var(--card-size));
  gap: var(--card-gap);
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  max-width: calc(4 * var(--card-size) + 3 * var(--card-gap)); /* Set exact width */
}

/* Add input blocking during animations */
.game-board.input-blocked {
  pointer-events: none;
}

.card {
  width: var(--card-size);
  height: var(--card-size);
  background: #e0e7ef;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-card);
  cursor: pointer;
  position: relative;
  perspective: 600px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}

.card:hover:not(.flipped):not(.matched) {
  box-shadow: 0 4px 16px rgba(0,123,255,0.15);
}

.card .card-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
  position: relative;
}
.card.flipped .card-inner,
.card.matched .card-inner {
  transform: rotateY(180deg);
}
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
}
.card-back {
  background: #0a1923;
  color: #fff;
  font-size: 3rem;
}
.card-front {
  background: #fff;
  color: #333;
  transform: rotateY(180deg);
  font-size: 4rem;
}
.card-front img {
  width: 90%;
  height: 90%;
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  border-radius: 12px;
  user-select: none;
  pointer-events: none;
  backface-visibility: hidden;
}
.card.matched .card-front {
  background: #d4edda;
  color: #155724;
  border: 2px solid #28a745;
  border-radius: 20px;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  padding: 43px 43px;
  border-radius: 22px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  text-align: center;
  font-size: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#close-modal {
  margin-top: 16px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  font-size: 2rem;
  cursor: pointer;
}
#close-modal:hover {
  background: #0056b3;
}

/* Modal animation */
.animated-modal {
  animation: popIn 0.6s cubic-bezier(0.23, 1.12, 0.32, 1) both;
}
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  70% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.blue-btn, .share-btn {
  background: #0a1923;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 1.1rem;
  cursor: pointer;
  margin: 10px 8px 0 8px;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(10,25,35,0.08);
}
.blue-btn:hover, .share-btn:hover {
  background: #142c3f;
  transform: translateY(-2px) scale(1.04);
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.book-promo {
  margin: 0 0 18px 0;
  font-size: 2rem;
  text-align: center;
  font-weight: 500;
}
.book-promo a {
  color: #0a1923;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s;
}
.book-promo a:hover {
  color: #007bff;
}

@media (max-width: 900px) {
  .game-container {
    padding: 36px 28px 28px 28px;
    max-width: 650px;
  }
  
  h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
  }
}

@media (max-width: 768px) {
  .logo {
    height: 90px;
  }
  
  .logo-container {
    margin-bottom: 15px;
  }
  
  .game-container {
    padding-top: 12px;
  }
  
  h1 {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  :root {
    --card-size: 21vw;
    --card-gap: 1.5vw;
    --font-size-h1: 1.8rem;
    --font-size-card: 2.2rem;
    --font-size-info: 1.1rem;
  }
  
  body {
    background: url('./Images/old_paper.jpg') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 20px 0;
  }
  
  .logo {
    height: 40px;
  }
  
  .logo-container {
    margin-bottom: 10px;
  }
  
  .game-container {
    padding: 24px 14px 18px 14px;
    width: 92%;
    max-width: 96%;
    border-radius: 14px;
    margin: 0 auto;
    box-shadow: 
      0 2px 4px rgba(0,0,0,0.05),
      0 6px 12px rgba(0,0,0,0.1),
      0 12px 24px rgba(0,0,0,0.1),
      0 24px 48px rgba(0,0,0,0.07),
      inset 0 1px 1px rgba(255,255,255,0.4);
  }
  
  .game-container::before {
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  }
  
  h1 {
    margin-bottom: 16px;
  }
  
  .game-info {
    font-size: calc(var(--font-size-info) * 1.3);
  }
  
  #restart-btn {
    padding: 8px 18px;
    font-size: calc(1rem * 1.15);
  }
  
  #timer {
    transform: translateX(-3px);
  }
}

@media (max-width: 400px) {
  :root {
    --card-size: 21vw;
    --card-gap: 1.2vw;
  }
  
  body {
    padding: 15px 0;
  }
  
  .logo {
    height: 35px;
  }
  
  .logo-container {
    margin-bottom: 8px;
  }
  
  .game-container {
    padding: 20px 12px 16px 12px;
    width: 94%;
  }
  
  h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }
  
  .game-info {
    font-size: 0.9rem;
    gap: 12px;
  }
  
  #restart-btn {
    padding: 4px 12px;
    font-size: 0.9rem;
  }
}

.modal-content h2 {
  margin-bottom: 24px;
  margin-top: -1cm;
}

#victory-message {
  font-size: 1rem;
  margin-bottom: 18px;
  margin-top: 0;
}

#auto-complete-btn {
  /* Hide the auto-complete button but keep it accessible for programmatic use */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  margin: -1px;
  padding: 0;
}

/* Optimize confetti animations for better performance */
.confetti-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
  /* Set will-change to opacity to improve rendering performance */
  will-change: opacity;
}

.confetti-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  top: -10px;
  opacity: 0.8; /* Slightly reduced opacity */
  /* Use translate3d to trigger GPU acceleration */
  transform: translate3d(0, 0, 0);
  /* Reduce animation complexity with only one animation when possible */
  animation: confetti-fall 3s linear forwards;
  /* Using transform for animations is more performant than changing x/y positions */
  will-change: transform;
}

/* Optimize the remaining confetti color styles to be the same, just updating colors */
.confetti-dot.blue { background-color: #5d9cec; }
.confetti-dot.pink { background-color: #ec87c0; }
.confetti-dot.yellow { background-color: #ffce54; }
.confetti-dot.cyan { background-color: #4fc1e9; }
.confetti-dot.red { background-color: #ed5565; }
.confetti-dot.green { background-color: #a0d468; }
.confetti-dot.purple { background-color: #ac92ec; }
.confetti-dot.orange { background-color: #fc6e51; }

/* Simplify the star animations to be more performant */
.confetti-dot.star {
  background: none;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 12px solid gold;
  border-radius: 0;
  will-change: transform;
}

/* Use simpler animation for special confetti types to improve performance */
.confetti-dot.serpentine,
.confetti-dot.curly {
  width: 6px;
  height: 12px;
  border-radius: 2px;
  background-color: #fc6e51;
  animation: confetti-fall 3s linear forwards, confetti-wiggle 2.5s ease-in-out infinite;
}

.confetti-dot.curly {
  background-color: #ac92ec;
}

/* Optimize animations to use transform for better performance */
@keyframes confetti-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(var(--rotate, 0deg));
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 100vh, 0) rotate(calc(var(--rotate, 0deg) + 180deg));
    opacity: 0;
  }
}

/* Simplify the wiggle animation to use less resources */
@keyframes confetti-wiggle {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(var(--sway-right, 30px)); }
}

/* Remove the curl animation and replace with simpler rotation */
@keyframes confetti-curl {
  0%, 100% { transform: rotate(var(--rotate, 0deg)); }
  50% { transform: rotate(calc(var(--rotate, 0deg) + 180deg)); }
}

.victory-content {
  position: relative;
  width: 100%;
  max-width: 396px;
  margin: 0 16px;
  background: #f1f1f1;
  border: 1px solid rgba(124, 76, 56, 1);
  border-radius: 16px;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.05),
    0 8px 16px rgba(0,0,0,0.1),
    0 16px 32px rgba(0,0,0,0.12),
    0 32px 64px rgba(0,0,0,0.08),
    inset 0 1px 1px rgba(255,255,255,0.4);
  padding: 63px 22px 32px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  z-index: 1;
}

.victory-content::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 6px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  z-index: -1;
}

.victory-headline {
  font-family: 'Montserrat', 'Poppins', Arial, sans-serif;
  font-weight: 900;
  font-size: 2.16rem;
  color: #111;
  margin: 0 0 14px 0;
  text-align: center;
  z-index: 2;
}

.victory-subtitle {
  font-family: 'Montserrat', 'Poppins', Arial, sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  color: #333;
  opacity: 0.9;
  margin-bottom: 22px;
  text-align: center;
  z-index: 2;
  padding: 0 22px;
  line-height: 1.4;
}

.book-image {
  max-width: 200px;
  max-height: 250px;
  margin: 0 auto 22px;
  display: block;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  background: transparent;
  border: none;
  mix-blend-mode: normal;
  filter: none;
}

.victory-promo {
  font-size: 1.08rem;
  font-weight: 400;
  color: #333;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.4;
  z-index: 2;
  padding: 0 22px;
}

.victory-code {
  font-size: 1.08rem;
  font-weight: 400;
  color: #333;
  text-align: center;
  margin-bottom: 29px;
  line-height: 1.4;
  z-index: 2;
  padding: 0 22px;
}

.brand-blue {
  color: #0F1828;
  font-weight: 700;
  font-size: 1.17em;
}

.book-link {
  color: #0F1828;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s;
  display: block;
  margin-top: 4px;
}

.book-link:hover {
  color: #1a3fa6;
}

.victory-btns {
  display: flex;
  flex-direction: row;
  gap: 14px;
  width: 100%;
  margin-top: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-primary, .btn-outline {
  font-family: inherit;
  font-size: 1.08rem;
  border-radius: 999px;
  padding: 14px 18px;
  outline: none;
  transition: box-shadow 0.15s, background 0.15s, color 0.15s;
  cursor: pointer;
  width: 45%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: #0F1828;
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 4px rgba(15, 24, 40, 0.12);
}

.btn-primary:focus, .btn-primary:hover {
  background: #1a2740;
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 24, 40, 0.18);
}

.btn-outline {
  background: transparent;
  color: #0F1828;
  font-weight: 500;
  border: 1.5px solid #0F1828;
}

.btn-outline:focus, .btn-outline:hover {
  background: #f0f4fa;
  color: #0F1828;
}

@media (max-width: 400px) {
  .victory-headline {
    font-size: 1.5rem;
  }
  
  .victory-subtitle {
    font-size: 0.75rem;
  }
  
  .victory-promo {
    font-size: 0.9rem;
  }
  
  .victory-code {
    font-size: 0.9rem;
  }
  
  .btn-primary, .btn-outline {
    font-size: 0.9rem;
    padding: 13px 9px;
  }
}

/* Loading indicator styles */
#loading-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 100;
  transition: opacity 0.5s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #0F1828;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 1.2rem;
  color: #0F1828;
  font-weight: 500;
  text-align: center;
}

#loading-progress {
  font-weight: 700;
  font-size: 1.3rem;
  color: #0F1828;
  display: inline-block;
  min-width: 35px;
  text-align: right;
}

.fade-out {
  opacity: 0;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Add styles for the side images */
.side-image-left, .side-image-right {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  height: 90vh;
  max-height: 800px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}

.side-image-left {
  left: 50%;
  transform: translate(-575px, -50%);
}

.side-image-right {
  right: 50%;
  transform: translate(575px, -50%);
}

/* Media query for tablets and smaller screens */
@media (max-width: 1200px) {
  .side-image-left, .side-image-right {
    height: 70vh;
    max-height: 600px;
    opacity: 0.8;
  }
  
  .side-image-left {
    transform: translate(-475px, -50%);
  }
  
  .side-image-right {
    transform: translate(475px, -50%);
  }
}

/* Hide side images on very small screens */
@media (max-width: 768px) {
  .side-image-left, .side-image-right {
    display: none;
  }
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
  .logo {
    height: 90px;
  }
  
  .logo-container {
    margin-bottom: 15px;
  }
  
  .game-container {
    padding-top: 12px;
  }
  
  h1 {
    margin-top: 0;
  }
}

.debug-button {
  margin-top: 15px;
  padding: 8px 16px;
  background: #70161f;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.9;
  transition: all 0.2s;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.debug-button:hover {
  opacity: 1;
  background: #8a1a29;
  transform: translateY(-1px);
}

.transparent-img {
  isolation: isolate;
  mix-blend-mode: normal;
  filter: none;
}

.book-btn {
  background: #fff;
  color: #0F1828;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 20px;
  border-radius: 999px;
  display: block;
  text-align: center;
  margin: 0 auto 22px;
  max-width: 90%;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 4px rgba(15, 24, 40, 0.12);
  line-height: 1.4;
  font-family: 'Montserrat', 'Poppins', Arial, sans-serif;
  font-size: 1.08rem;
  border: 1.5px solid #0F1828;
}

.book-btn .normal-text {
  font-weight: 400;
}

.book-btn:hover, .book-btn:focus {
  background: #f0f4fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(15, 24, 40, 0.18);
}

/* Share button should be the same style as the primary button */
#share-facebook {
  background: #0F1828;
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 4px rgba(15, 24, 40, 0.12);
}

#share-facebook:focus, #share-facebook:hover {
  background: #1a2740;
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 24, 40, 0.18);
}

/* Share overlay styles */
.share-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.share-modal {
  background: #f1f1f1;
  border: 1px solid rgba(124, 76, 56, 1);
  border-radius: 16px;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.05),
    0 8px 16px rgba(0,0,0,0.1),
    0 16px 32px rgba(0,0,0,0.12),
    0 32px 64px rgba(0,0,0,0.08),
    inset 0 1px 1px rgba(255,255,255,0.4);
  padding: 30px;
  width: 90%;
  max-width: 450px;
  text-align: center;
}

.share-modal h3 {
  margin-top: 0;
  font-size: 1.8rem;
  color: #0F1828;
  margin-bottom: 15px;
}

.share-modal p {
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #333;
}

.share-text {
  width: 100%;
  height: 80px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 20px;
  font-family: inherit;
  resize: none;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.copy-btn, .continue-btn, .cancel-btn {
  padding: 12px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.copy-btn {
  background: #0F1828;
  color: white;
  flex: 1;
}

.copy-btn:hover {
  background: #1a2740;
  transform: translateY(-2px);
}

.continue-btn {
  background: #4267B2; /* Facebook blue */
  color: white;
  flex: 1;
}

.continue-btn:hover {
  background: #365899;
  transform: translateY(-2px);
}

.cancel-btn {
  background: transparent;
  color: #0F1828;
  border: 1px solid #0F1828;
  flex: 1;
}

.cancel-btn:hover {
  background: #f5f5f5;
}

@media (max-width: 480px) {
  .share-buttons {
    flex-direction: column;
  }
  
  .copy-btn, .continue-btn, .cancel-btn {
    width: 100%;
  }
}

/* Clear all existing swap animations */
.card.will-swap .card-inner,
.card.float-out-right .card-front img,
.card.float-out-left .card-front img,
.card.float-in-right .card-front img,
.card.float-in-left .card-front img,
.card-front img.float-out-right,
.card-front img.float-out-left,
.card-front img.float-in-right,
.card-front img.float-in-left {
  animation: none !important;
}

/* New, simple transition-based animation */
.card-front img {
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.3, 1.2);
  will-change: transform;
  transform-origin: center center;
  position: relative;
  z-index: 5;
  transform: translateZ(0);
  width: 90%;
  height: 90%;
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  border-radius: 12px;
  user-select: none;
  pointer-events: none;
}

/* Arc path transformation classes - no opacity changes, just movement */
.img-arc-right {
  transform: translate(150%, -100px) rotateY(180deg) !important;
}

.img-arc-left {
  transform: translate(-150%, -100px) rotateY(180deg) !important;
}

/* Make sure the z-index is high enough to be visible throughout animation */
.animating-img {
  z-index: 100 !important;
}

/* Simple flip animation */
@keyframes flip-back {
  0% { 
    transform: rotateY(180deg);
  }
  100% { 
    transform: rotateY(0);
  }
}

.card.flip-back .card-inner {
  animation: flip-back 0.5s ease-out forwards;
}

.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0 0 0;
  gap: 16px;
}
.theme-label {
  font-size: 1.1rem;
  font-family: 'Montserrat', Arial, sans-serif;
  color: #6d4c2c !important;
  font-weight: 600;
}
.theme-toggle-row .theme-label:first-child {
  color: #6d4c2c !important;
}
.theme-toggle-row .theme-label:last-child {
  color: #1a2233 !important;
}
body.dark-theme .theme-label,
body.dark-theme .theme-toggle-row .theme-label:last-child {
  color: inherit;
}
.switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #e0c9a6;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}
input:checked + .slider {
  background-color: #1a2233;
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* Dark theme overrides (to be toggled with a class) */
body.dark-theme {
  background: url('./Images/dark_blue.jpg') no-repeat center center fixed !important;
  background-size: cover !important;
}
body.dark-theme .theme-label {
  color: #b8c6e0;
}
body.dark-theme .theme-toggle-row .theme-label:last-child {
  color: #e0c9a6;
}

/* Add the logo filter for dark theme */
body.dark-theme .logo {
  filter: brightness(0) saturate(100%) invert(70%) sepia(5%) saturate(246%) hue-rotate(179deg) brightness(87%) contrast(88%);
  /* This filter changes the logo color to rgba(155, 159, 164, 1) */
}

/* Keep the label color overrides */
.theme-toggle-row .theme-label:first-child {
  color: #6d4c2c !important;
}
.theme-toggle-row .theme-label:last-child {
  color: #1a2233 !important;
}

/* Remove the body::before gradient overlay */
body::before {
  display: none;
}

/* Media query for tablets and smaller screens */
.underline {
  text-decoration: underline;
}

.free-text {
  color: rgb(112, 22, 31);
  font-weight: bold;
} 