:root {
  --bg: #15181c;
  --text: #f1f1f1;
  --accent: #ff5e5b;
  --accent2: #00cecb;
  --card-bg: #1f242b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

#smoke-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1500;
}

#entry-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s ease;
  cursor: none;
}

#entry-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.entry-content {
  text-align: center;
  padding: 0 1.5rem;
}

.entry-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.entry-content p {
  opacity: 0.8;
  margin-bottom: 2rem;
}

#enter-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.9rem 2.2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#enter-btn:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}

.hero {
  text-align: center;
  padding: 4rem 1rem 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 3rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 3rem 4rem;
  align-items: start;
}

.block {
  margin-bottom: 0;
}

.block.wide {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  main {
    padding: 0 1.25rem 4rem;
    gap: 2.5rem;
  }
}

.block h2 {
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.2rem;
}

/* Atelier sonore */
.sequencer {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
  max-width: 340px;
}

.step {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 2px solid var(--card-bg);
  background: var(--card-bg);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease, border-color 0.2s ease;
}

.step:hover {
  transform: scale(1.08);
}

.step.active {
  background: var(--accent2);
  border-color: var(--accent2);
}

.step.current {
  border-color: var(--accent);
}

.sequencer-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

#seq-play,
#pottery-reset {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

#seq-play:hover,
#pottery-reset:hover {
  background: var(--accent2);
}

/* Atelier de poterie */
canvas#pottery {
  background: var(--card-bg);
  border: 2px dashed #ccc;
  border-radius: 12px;
  display: block;
  margin-top: 1rem;
  width: 100%;
  max-width: 280px;
  height: auto;
  aspect-ratio: 7 / 9;
  touch-action: none;
  cursor: ns-resize;
}

/* Card */
.card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 300px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin-top: 1rem;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Canvas */
canvas#playground,
canvas#fireworks,
canvas#zen {
  background: var(--card-bg);
  border: 2px dashed #ccc;
  border-radius: 12px;
  display: block;
  margin-top: 1rem;
  width: 100%;
  max-width: 1100px;
  height: auto;
  aspect-ratio: 2 / 1;
  touch-action: none;
}

canvas#zen {
  background: linear-gradient(135deg, #cdb078, #ddc292);
  cursor: crosshair;
}

/* Bulles à éclater */
.bubble-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
  max-width: 320px;
}

.bubble {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4dd9d6, var(--accent2));
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.25), 0 3px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.bubble:hover {
  transform: scale(1.05);
}

.bubble.popped {
  background: var(--bg);
  box-shadow: inset 0 3px 5px rgba(0,0,0,0.5);
  cursor: default;
  transform: scale(0.85);
}

/* Interrupteurs */
.switch-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1rem;
}

.switch-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.switch-bulb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3a3f46;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.switch-bulb.lit {
  background: #ffed66;
  box-shadow: 0 0 10px 3px rgba(255, 237, 102, 0.8);
}

.switch-toggle {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #3a3f46;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.switch-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1f1f1;
  transition: transform 0.2s ease;
}

.switch-toggle.on {
  background: var(--accent2);
}

.switch-toggle.on::before {
  transform: translateX(20px);
}

/* Bouton gélatineux */
.jelly-button {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: none;
  font-size: 2.5rem;
  margin-top: 1rem;
  cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ff8d8a, var(--accent));
  box-shadow: inset 0 -8px 12px rgba(0,0,0,0.25), 0 6px 10px rgba(0,0,0,0.3);
}

.jelly-button.squish {
  animation: jelly-squish 0.4s ease;
}

@keyframes jelly-squish {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.25, 0.75); }
  55% { transform: scale(0.85, 1.15); }
  75% { transform: scale(1.08, 0.94); }
  100% { transform: scale(1, 1); }
}

.hint {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Text effects */
.text-gradient {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0.5rem 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2), #ffed66);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.text-glitch {
  position: relative;
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0.5rem 0;
  color: var(--text);
}

.text-glitch::before,
.text-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
}

.text-glitch::before {
  color: var(--accent);
  animation: glitch-1 2.5s infinite linear alternate-reverse;
}

.text-glitch::after {
  color: var(--accent2);
  animation: glitch-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
  0% { clip-path: inset(0 0 80% 0); transform: translate(-2px, -1px); }
  25% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 1px); }
  50% { clip-path: inset(20% 0 60% 0); transform: translate(-1px, 1px); }
  75% { clip-path: inset(80% 0 2% 0); transform: translate(1px, -1px); }
  100% { clip-path: inset(40% 0 40% 0); transform: translate(-2px, 2px); }
}

@keyframes glitch-2 {
  0% { clip-path: inset(30% 0 45% 0); transform: translate(2px, 0); }
  25% { clip-path: inset(5% 0 85% 0); transform: translate(-2px, 1px); }
  50% { clip-path: inset(70% 0 15% 0); transform: translate(1px, -1px); }
  75% { clip-path: inset(10% 0 70% 0); transform: translate(-1px, 2px); }
  100% { clip-path: inset(55% 0 25% 0); transform: translate(2px, -2px); }
}

.text-outline {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0.5rem 0;
  color: transparent;
  -webkit-text-stroke: 2px var(--text);
}

/* Animated gradient background */
.gradient-box {
  height: 180px;
  border-radius: 12px;
  margin-top: 1rem;
  background: linear-gradient(-45deg, var(--accent), #ffed66, var(--accent2), #ff9ab0);
  background-size: 400% 400%;
  animation: mesh-move 8s ease infinite;
}

@keyframes mesh-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Generative art */
canvas#generative {
  background: var(--card-bg);
  border: 2px dashed #ccc;
  border-radius: 12px;
  display: block;
  margin-top: 1rem;
  width: 100%;
  max-width: 1100px;
  height: auto;
  aspect-ratio: 2 / 1;
}

button#generate-btn {
  background: var(--accent2);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s ease;
}

button#generate-btn:hover {
  background: var(--accent);
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  opacity: 0.6;
  font-size: 0.9rem;
}
