:root {
  --flap-height: 40px;
  --flap-width: 20px;
  --flap-gap: 2px;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background: #111;
  color: white;
  font-family: monospace;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

section#qr-section {
  width: 100%;
  padding: 1em 0;
  text-align: center;
}

.qr-card {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1em;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 5px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.05);
}

.qr-card h2 {
  color: #FFD700;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 1em;
  letter-spacing: 0.05em;
}

/* Section QR jaune */
.qr-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2em;
}

.yellow-bg {
  background-color: #FFD700;
  border-radius: 5px;
  margin: 1em auto;
  max-width: 500px;
}

/* QR Code */
canvas#qr {
  background: #111;
  image-rendering: pixelated;
  max-width: 90vw;
  height: auto;
  border: 1px solid #000;
}

/* Splitflap layout */
.splitflap-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0;
  overflow-x: auto;
}

.line-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.line {
  display: flex;
  gap: var(--flap-gap);
}

.flap {
  width: var(--flap-width);
  height: var(--flap-height);
  background: black;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
  perspective: 600px;
  position: relative;
  flex: 0 0 auto;
}

.half {
  width: 100%;
  height: 50%;
  position: relative;
  overflow: hidden;
}

.top {
  border-bottom: 1px solid #222;
}

.bottom {
  border-top: 1px solid #222;
}

.letter {
  position: absolute;
  width: 100%;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--flap-height) * 0.5);
  top: 0;
}

.top .letter {
  transform: translateY(0%);
}

.bottom .letter {
  transform: translateY(-50%);
}

.flipper {
  position: absolute;
  top: 0;
  width: 100%;
  height: 50%;
  background: black;
  transform-origin: bottom;
  z-index: 10;
  overflow: hidden;
}

.flipper.animate {
  animation: flip 0.05s ease-in forwards;
}

@keyframes flip {
  from { transform: rotateX(0); }
  to { transform: rotateX(-90deg); }
}

.white { color: white; }
.yellow { color: #FFD700; }

/* Responsive */
@media screen and (max-width: 768px) {
  .qr-card {
    padding: 1em 0.5em;
  }

  .line {
    gap: 1px;
  }

  canvas#qr {
    max-width: 80vw;
  }

  .splitflap-card {
    padding: 0.5em;
  }
}