@font-face {
  font-family: 'KoreanKPNBR';
  src: url('../font/KoreanKPNBR.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'KoreanKPNBR', sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #D1E1EB;
  position: relative;
}

/* Navigation Links */
.nav-links {
  position: absolute;
  top: 20px;
  right: 30px;
  display: flex;
  gap: 20px;
  z-index: 10;
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 18px;
  font-weight: 400;
  transition: opacity 0.3s;
}

.nav-link:hover {
  opacity: 0.7;
}

/* Game info styles */
.game-info {
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  pointer-events: none;
  z-index: 100;
}

.time, .flips {
  font-size: 20px;
  color: #2A0000;
  background: #D1E1EB;
  padding: 5px 10px;
  border-radius: 5px;
  pointer-events: all;
}

/* Styles for the main game container */
.box {
  width: 800px;
  height: 500px;
  padding: 35px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: visible;
  background: transparent;
  margin-top: 80px;
}

/* Card styles */
.cards, .card, .view {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cards {
  height: 500px;
  width: 700px;
  display: grid;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  place-items: center;
}

.cards .card {
  cursor: pointer;
  list-style: none;
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  width: 100%;
  height: 100%;
  min-height: 200px;
  pointer-events: auto;
  z-index: 1;
}

/* Animation for shaking card */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-13px); }
  40% { transform: translateX(13px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}

.card.shake {
  animation: shake 0.35s ease-in-out;
}

/* Card face styles */
.card .view {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 7px;
  background: #FFFFFF;
  backface-visibility: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: transform 0.25s linear;
  border: 2px solid #D1E1EB;
  pointer-events: none;
}

.card .front-view {
  transform: rotateY(0deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card .front-view::after {
  content: '?';
  font-size: 48px;
  color: #D1E1EB;
  font-weight: bold;
}

.card .back-view img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.card .back-view {
  transform: rotateY(-180deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card.flip .front-view {
  transform: rotateY(180deg);
}

.card.flip .back-view {
  transform: rotateY(0deg);
}

.card.flip .front-view {
  transform: rotateY(180deg);
}

/* Responsive styles */
@media screen and (max-width: 700px) {
  .cards {
    height: 350px;
    width: 350px;
  }
  
  .card .front-view img {
    width: 17px;
  }
  
  .card .back-view img {
    max-width: 40px;
  }
}

@media screen and (max-width: 530px) {
  .cards {
    height: 300px;
    width: 300px;
  }
  
  .card .front-view img {
    width: 15px;
  }
  
  .card .back-view img {
    max-width: 35px;
  }
}

/* Message display styles */
.message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 18px;
  color: #2A0000;
  z-index: 2;
  width: 100%;
}

.box.game-over {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}