/* ── Language switcher ── */
.lang-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 3;
}

.flag-icon {
  width: 28px;
  height: 28px;
  display: block;
  margin: 0;
  border-radius: 0;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  image-rendering: auto;
}

.lang-switch a:hover .flag-icon {
  opacity: 0.9;
  transform: scale(1.15);
}

.lang-switch a.active .flag-icon {
  opacity: 1;
  box-shadow: 0 0 8px rgba(173, 59, 222, 0.5);
}

@font-face {
  font-family: 'PaperCut';
  src: url('paper-cut.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: #0d1112;
}

#balatro-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
#balatro-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#page-content {
  position: relative;
  z-index: 1;
  color: white;
  font-family: sans-serif;
  min-height: 100vh;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  padding: 3rem 1rem 1rem;
}

.title {
  font-family: 'PaperCut';
  margin-bottom: 0.5rem;
}
.title h1 {
  font-size: 5rem;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.95), 
    0 4px 12px rgba(0, 0, 0, 0.9), 
    0 0 20px rgba(173, 59, 222, 0.85);
  display: inline-flex;
  gap: 0.1rem;
}
.title h1 span {
  display: inline-block;
  transform-origin: bottom center;
}

.title h1 span:nth-child(1) { animation: float-letter 3.7s ease-in-out -0.5s infinite; }
.title h1 span:nth-child(2) { animation: float-letter 4.9s ease-in-out -2.1s infinite; }
.title h1 span:nth-child(3) { animation: float-letter 3.2s ease-in-out -0.9s infinite; }
.title h1 span:nth-child(4) { animation: float-letter 5.3s ease-in-out -3.4s infinite; }
.title h1 span:nth-child(5) { animation: float-letter 4.1s ease-in-out -1.2s infinite; }
.title h1 span:nth-child(6) { animation: float-letter 3.5s ease-in-out -2.7s infinite; }
.title h1 span:nth-child(7) { animation: float-letter 4.6s ease-in-out -0.2s infinite; }
.title h1 span:nth-child(8) { animation: float-letter 3.9s ease-in-out -1.8s infinite; }
.title h1 span:nth-child(9) { animation: float-letter 5.1s ease-in-out -4.0s infinite; }
.title h1 span:nth-child(10) { animation: float-letter 3.4s ease-in-out -0.7s infinite; }

@keyframes float-letter {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

.subtitle {
  font-family: cursive;
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 1.2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.5);
}

nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
}
nav a {
  color: #d8b2ff;
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}
nav a:hover {
  color: #ffffff;
}

section {
  max-width: 960px;
  margin: 3rem auto;
  text-align: center;
  background: #0d1112;
  border: 1px solid #1e2638;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

section::before {
  content: '●  ●  ●';
  display: block;
  height: 28px;
  line-height: 28px;
  padding: 0 14px;
  background: #111820;
  border-bottom: 1px solid #1e2638;
  font-size: 10px;
  color: #3a4a5a;
  letter-spacing: 5px;
  text-align: left;
}

section h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
  padding: 1.5rem 2rem 0;
  margin-bottom: 0;
  color: #ad3bde;
  text-align: left;
  text-shadow: 0 0 12px rgba(173, 59, 222, 0.35);
}

section p {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  color: #a0b0c0;
  padding: 1.5rem 2rem 2rem;
  line-height: 1.6;
}

/* ── Cards ── */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  padding: 1.5rem 2rem 2rem;
}

.card {
  flex: 1 1 260px;
  max-width: 320px;
  background: #0d1112;
  border: 1px solid #1a2230;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: #ad3bde;
  box-shadow: 0 0 24px rgba(173, 59, 222, 0.12);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid #1a2230;
  filter: saturate(0.85) contrast(1.1);
}

.card-body {
  padding: 1rem 1.2rem 1.2rem;
}

.card-body h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: #ad3bde;
  margin-bottom: 0.6rem;
  line-height: 1.5;
  text-shadow: 0 0 8px rgba(173, 59, 222, 0.3);
}

.card-body p {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #a0b0c0;
  opacity: 0.85;
  padding: 0;
}

.text {
  text-align: center;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  opacity: 0.95;
  margin: 1rem 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

.repolink {
  text-align: center;
  font-style: oblique;
  margin: 1.5rem 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

a {
  color: #aae0ff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

img {
  display: block;
  margin: 1rem auto;
  border-radius: 8px;
}

.social-links {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 0.5rem;
  padding: 0 2rem 0.5rem;
}

.social-icon {
  width: 36px;
  height: 36px;
  display: block;
  margin: 0;
  border-radius: 0;
  animation: float-logo 4s ease-in-out infinite;
  transition: filter 0.2s;
}

.social-icon:hover {
  filter: brightness(1.4);
}

.social-links a:nth-child(1) .social-icon {
  animation-delay: -1.2s;
}

.social-links a:nth-child(2) .social-icon {
  animation-delay: -2.8s;
}

@keyframes float-logo {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
