@font-face {
  font-family: 'Quicksand';
  src: url('../fonts/Quicksand-Light.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

:root {
  --bg-dark: #1f1a2e;
  --bg-card: #2b223a;
  --accent: #caa0ff;
  --accent-light: #e9d4ff;
  --text: #f5f5f5;
  --muted: #bbaacc;
  --border: #3e3253;
  --shadow: 0 8px 16px rgba(0,0,0,0.3);
  --radius: 20px;
  --font: 'Quicksand', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background-color: var(--bg-dark);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  min-height: 100vh;
}

.app-container {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 720px;
  width: 100%;
  padding: 24px;
  align-items: center;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: auto;
}

.splash-screen,
.game-screen,
.end-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#splashScreen {
  display: flex;
}

h1, h2 {
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 20px;
}

.subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 25px;
}

button {
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button:hover {
  background: var(--accent-light);
}

.challenge-description {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  color: var(--text);
}

.challenge-description h2 {
  color: var(--accent);
  margin-bottom: 12px;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px 0;
  width: 100%;
  max-width: 450px;
}

.card {
  background: #33274a;
  border-radius: 14px;
  border: 2px solid #44375b;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  aspect-ratio: 1 / 1;
  perspective: 1000px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
  min-height: 120px;
}

.card:hover {
  transform: scale(1.03);
}

.card-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.card.flipped .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: 14px;
}

.card-front {
  background: url('../images/card-back.jpg') center center no-repeat;
  background-size: cover;
  border-radius: 14px;
  backface-visibility: hidden;
}

.card-back {
  transform: rotateY(180deg);
  padding: 3px;
}

.card-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.status {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.end-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  min-width: 300px;
  max-width: 500px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 10;
  padding: 30px 25px;
  text-align: center;
}

.chosen-cards {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  justify-content: center;
  flex-wrap: wrap;
  animation: zoomIn 0.4s ease forwards;
}

.chosen-cards img {
  width: 150px;
  max-width: 40vw;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid var(--accent);
}

.end-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.social-widget {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  padding: 10px 16px;
  border-radius: 14px;
  z-index: 1000;
}

.social-widget img {
  display: block;
  width: 24px;
  height: 24px;
  filter: brightness(1.2);
  transition: transform 0.2s ease;
}

.social-widget a:hover img {
  transform: scale(1.1);
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
  color: var(--accent-light);
}

a:focus {
  outline: none;
  text-shadow: 0 0 8px var(--accent-light);
}
