/* Google fonts are loaded via <link rel="preload"> and preconnect in the HTML head for better performance */

.rubik-bubbles-regular {
  font-family: "Rubik Bubbles", system-ui;
  font-weight: 400;
  font-style: normal;
  text-transform: uppercase;
}

/* Root variables */

:root {
  --primary-font: "Space Grotesk", sans-serif;
  --secondary-font: "Inter", cursive;
  --primary-color: rgb(24, 24, 24);
  --secondary-color: rgb(119, 119, 119);

  --color-RGB-01: #ee3636;
  --color-RGB-02: #fced21;
  --color-RGB-03: #4ef02a;
  --color-RGB-04: #2ff0e6;
  --color-RGB-05: #2a4ef0;
  --color-RGB-06: #d72af0;
  --font-family: "Arial, sans-serif";
}

@keyframes colorChange {
  0% {
    color: var(--color-RGB-01);
  }
  15% {
    color: var(--color-RGB-02);
  }
  30% {
    color: var(--color-RGB-03);
  }
  45% {
    color: var(--color-RGB-04);
  }
  60% {
    color: var(--color-RGB-05);
  }
  75% {
    color: var(--color-RGB-06);
  }
  100% {
    color: var(--color-RGB-01);
  }
}

html {
  height: 100%;
}
/* body styling */
body {
  color: var(--color-01);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  background-color: #e7e7e7;
  display: flex;
  flex-direction: column;
  height: 100%;
}

main {
  flex: 1;
}

header {
  color: var(--color-02);
  background-color: var(--color-01);
}

header h1 {
  font-size: 4.5rem;
  margin: 0;
  padding: 0;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 3.5rem;
  }
}

@media (max-width: 520px) {
  header h1 {
    font-size: 2rem;
  }
}

Footer {
  background-color: var(--color-01);
  color: var(--color-02);
}

footer a {
  color: var(--color-02);
  text-decoration: none;
  animation: colorChange 2s infinite;
}

#Terence {
  animation-delay: 0s;
}

#Giovanni {
  animation-delay: -0.4s;
}

#Iain {
  animation-delay: -0.8s;
}

#Viktor {
  animation-delay: -1.2s;
}

#Valentino {
  animation-delay: -1.6s;
}

/* Game area styling */
#game-section .row {
  max-width: 350px;
  margin: auto;
}

/* Memory game grid and card styles */
.game-container {
  margin-top: 18px;
  position: relative;
  overflow: hidden;
}
.grid {
  max-width: 380px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  contain: layout style paint;
}
.card {
  width: 70px;
  height: 90px;
  perspective: 600px;
  cursor: pointer;
  margin: 0 auto;
}
.card .card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.45s;
  transform-style: preserve-3d;
}
.card .card-front,
.card .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 6px;
  overflow: hidden;
}
.card .card-front {
  background-size: cover;
  background-position: center;
  transform: rotateY(0deg);
}
.card .card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card .card-back {
  transform: rotateY(180deg);
}
.card.flipped .card-inner {
  transform: rotateY(180deg);
}
.card.matched {
  outline: 3px solid #28a745;
}

/* Start of Auto card swap and move feature styling -------------------*/
/* Card swap preview animation */
/* test */
@keyframes swapPreview {
  10%,
  90% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1) rotate(-1.5deg);
  }
  75% {
    transform: scale(1.1) rotate(1.5deg);
  }
}

.card.swap-preview {
  animation: swapPreview 0.5s ease-in-out;
  z-index: 10;
  position: relative;
}

/* Card swap position animation */
.col-3 {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
  position: relative;
}

.col-3.swapping {
  z-index: 5;
  position: relative;
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
/* End of Auto card swap and move feature styling -------------------*/

@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(5, 65px);
    grid-auto-rows: 85px;
    gap: 10px;
  }
  .card {
    width: 65px;
    height: 85px;
  }
  header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: repeat(4, 60px);
    grid-auto-rows: 80px;
    gap: 8px;
  }
  .card {
    width: 60px;
    height: 80px;
  }
  header h1 {
    font-size: 1.5em;
  }
}

/* Timer display */
.game-timer {
  display: inline-block;
  font-weight: 700;
  font-family: inherit;
  background: #ffffff;
  border: 2px solid var(--color-01);
  color: var(--color-01);
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 64px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: all 200ms ease;
}

/* Low-time warning (apply when timeLeft <= 10) */
.game-timer.timer-warning {
  background: #fff7e6;
  border-color: #ffb703;
  color: #8a5200;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(255, 183, 3, 0.12);
}

/* Expired/disabled look */
.game-timer.timer-expired {
  background: #f5f5f5;
  border-color: #d1d1d1;
  color: #8a8a8a;
  opacity: 0.95;
}

/* Responsive tweaks */
@media (max-width: 420px) {
  .game-timer {
    padding: 4px 8px;
    font-size: 0.95rem;
    min-width: 52px;
  }
}

/* end of game modal styling -------------------*/

.modal-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  margin: 0 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  max-width: 400px;
}

/* //////////////////////////////////////////////////////////////////////////// */
/* Navbar Styles */
/* //////////////////////////////////////////////////////////////////////////// */
.modern-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.modern-header .navbar {
  padding: 1.5rem 0;
}

.studio-logo {
  font-family: var(--primary-font);
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #218de6 0%, #ff006e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.modern-header .navbar-nav {
  gap: 2rem;
}

.modern-header .nav-link {
  font-family: var(--secondary-font);
  font-size: 12px;
  font-weight: 300;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  transition: color 0.3s ease;
}

.modern-header .nav-link::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #218de6, #ff006e);
  transition: width 0.3s ease;
}

.modern-header .nav-link:hover {
  color: #218de6;
}

.modern-header .nav-link:hover::after {
  width: 100%;
}

.modern-header .nav-link.active {
  color: #218de6;
}

.modern-header .navbar-toggler {
  border: none;
  box-shadow: none;
}

.modern-header .navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(33, 141, 230, 0.25);
}

/* Difficulty label styling  */
#game-section label {
  font-family: var(--secondary-font);
  font-size: 12px;
  font-weight: 300;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: 0.5rem;
  cursor: pointer;
}

/* Subtitle styling */
header .lead {
  font-family: var(--secondary-font);
  font-size: 14px;
  font-weight: 300;
  color: var(--color-02);
  text-transform: none;
  letter-spacing: 2px;
}
