/* CSS Custom Properties - 1-bit Monochrome */
:root {
  --bg: #000;
  --fg: #fff;
  --block-size: 100px;
  --grid-gap: 16px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas - full screen container */
.canvas {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

/* Background grid pattern */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--fg) 1px, transparent 1px),
    linear-gradient(90deg, var(--fg) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.06;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
}

/* Particle container */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--fg);
  pointer-events: none;
}

/* Stage */
.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 400px;
  min-height: 400px;
}

/* Initiate Button */
.initiate-btn {
  position: absolute;
  width: 220px;
  height: 70px;
  background: var(--fg);
  border: 3px solid var(--fg);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--bg);
  letter-spacing: 4px;
  text-transform: uppercase;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.1s ease;
}

.initiate-btn:hover {
  transform: scale(1.05);
  background: var(--bg);
  color: var(--fg);
}

.initiate-btn:active {
  transform: scale(0.98);
}

.initiate-btn.hidden {
  pointer-events: none;
}

.btn-text {
  position: relative;
  z-index: 2;
}

.btn-glow {
  display: none;
}

.btn-ripple {
  display: none;
}

/* Grid Container */
.grid-container {
  display: grid;
  grid-template-columns: repeat(3, var(--block-size));
  grid-template-rows: repeat(3, var(--block-size));
  gap: var(--grid-gap);
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.grid-container.active {
  pointer-events: all;
}

/* Individual Blocks */
.block {
  width: var(--block-size);
  height: var(--block-size);
  background: var(--bg);
  border: 2px solid var(--fg);
  border-radius: 0;
  cursor: pointer;
  transform: scale(0);
  opacity: 0;
  overflow: visible;
  position: relative;
  transition: background 0.1s ease, color 0.1s ease;
}

/* Seed state - hollow circle */
.block.seed {
  background: transparent !important;
  border-width: 2px !important;
  border-radius: 50% !important;
  overflow: hidden;
  border-color: var(--fg) !important;
}

/* Remove color variations - all blocks same */
.block[data-index="0"].seed,
.block[data-index="1"].seed,
.block[data-index="2"].seed,
.block[data-index="3"].seed,
.block[data-index="4"].seed,
.block[data-index="5"].seed,
.block[data-index="6"].seed,
.block[data-index="7"].seed,
.block[data-index="8"].seed {
  border-color: var(--fg) !important;
  color: var(--fg);
}

.block::before {
  display: none;
}

.block:hover {
  transform: scale(1.08) !important;
  background: var(--fg);
  color: var(--bg);
}

.block:hover .block-label {
  color: var(--bg);
}

.block:active {
  transform: scale(0.95) !important;
}

/* Remove color variations for blocks */
.block[data-index="0"],
.block[data-index="1"],
.block[data-index="2"],
.block[data-index="3"],
.block[data-index="4"],
.block[data-index="5"],
.block[data-index="6"],
.block[data-index="7"],
.block[data-index="8"] {
  background: var(--bg);
  border-color: var(--fg);
}

.block-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.block-icon {
  font-size: 32px;
  line-height: 1;
  filter: grayscale(100%) contrast(200%);
}

.block-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg);
}

/* Reset Button */
.reset-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  padding: 14px 28px;
  background: var(--bg);
  border: 2px solid var(--fg);
  color: var(--fg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: background 0.1s ease, color 0.1s ease;
}

.reset-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.reset-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
  :root {
    --block-size: 80px;
    --grid-gap: 12px;
  }
  
  .initiate-btn {
    width: 180px;
    height: 60px;
    font-size: 14px;
  }
  
  .block-icon {
    font-size: 26px;
  }
  
  .block-label {
    font-size: 8px;
  }
}
