:root {
  --primary: #9b59b6;
  --secondary: #8e44ad;
  --bg: #1a0d2c;
  --text: #ffffff;
  --highlight: #b39ddb;
}

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

body {
  font-family: 'Azeret Mono', monospace;
  color: var(--text);
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  min-height: 100vh;
  padding: 20px;
}

/* Background Canvas */
canvas#bgCanvas {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  z-index:-1;
}

/* Floating window styling */
.floating-window {
  background: linear-gradient(135deg, rgba(26,13,44,0.85), rgba(46,20,66,0.85));
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--primary);
  padding: 25px 30px;
  margin-top: 50px;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  box-shadow: 0 0 25px rgba(155, 89, 182, 0.4);
  transition: transform 0.3s ease;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 2em;
  letter-spacing: 3px;
  color: var(--primary);
}

.toggle-btn {
  cursor: pointer;
  color: var(--primary);
  font-size: 1em;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.3s ease;
}
.toggle-btn:hover { 
  color: var(--secondary);
  transform: scale(1.05);
}

/* Container for grid and controls */
.container {
  display: flex;
  gap: 40px;
  justify-content: space-between;
}

/* Grid */
.holder {
  display: grid;
  grid-template-columns: repeat(23, 1fr);
  grid-template-rows: repeat(23, 1fr);
  gap: 3px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 10px;
  background: rgba(26,13,44,0.3);
  transition: transform 0.3s ease;
  width: 380px; /* Fixed width for better control */
  height: 380px;
}
.holder:hover { transform: scale(1.02); }

.inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: all 0.3s ease, transform 0.3s ease;
  background-color: transparent;
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  min-width: 200px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  word-break: break-word;
  overflow-wrap: break-word;
}

input[type=text] {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: rgba(26,13,44,0.3);
  color: var(--text);
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.3s ease, background 0.3s ease;
}
input[type=text]:focus {
  border-color: var(--secondary);
  background: rgba(46,20,66,0.5);
}

/* Output & seed boxes */
#output, #seed {
  display: block;
  padding: 8px;
  background: rgba(26,13,44,0.3);
  border-radius: 6px;
  border: 1px solid var(--primary);
  max-width: 100%;
  min-height: 30px;
  overflow-x: auto;
  white-space: nowrap;
  word-break: break-all;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Buttons */
button {
  margin-top: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: var(--secondary);
  color: var(--text);
  cursor: pointer;
  transition: 0.2s ease, transform 0.2s ease;
}
button:hover { background: var(--primary); transform: scale(1.05); }

/* Seed window */
.seed-window {
  position: fixed;
  left: -350px;
  top: 100px;
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(26,13,44,0.95), rgba(46,20,66,0.95));
  border-radius: 12px;
  border: 1px solid var(--primary);
  display: grid;
  place-items: center;
  z-index: 20;
}

.seed-window textarea {
  width: 90%;
  height: 90%;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background-color: transparent;
  color: #aaa;
  padding: 15px;
  font-family: 'Azeret Mono';
  resize: none;
}

/* Credit animation */
.ml12 {
  display: inline-block;
  font-weight: 400;
  font-size: 1em; 
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--highlight);
}
.ml12 .letter {
  display: inline-block;
  line-height: 1em;
  opacity: 0;
  transform: translateY(10px);
}

/* About section */
.about {
  margin-top: 50px;
  margin-bottom: 50px;
  padding: 30px;
  width: 100%;
  max-width: 900px;
  background: linear-gradient(135deg, rgba(26,13,44,0.85), rgba(46,20,66,0.85));
  border-radius: 20px;
  border: 1px solid var(--primary);
}
.about h2 { color: var(--primary); margin-bottom: 10px; }
.about h3 { color: var(--secondary); margin-top: 15px; }
.about ul { list-style-type: disc; margin-left: 20px; }
.credit { margin-top: 20px; font-style: italic; color: #ccc; }

/* Responsive adjustments */
@media (max-width: 900px) {
  .container { 
      flex-direction: column; 
      gap: 25px; 
      align-items: center;
  }
  .holder {
      width: 100%;
      height: auto;
      aspect-ratio: 1 / 1; /* Keep it square */
      grid-template-columns: repeat(23, 1fr);
      grid-template-rows: repeat(23, 1fr);
  }
  .controls { width: 100%; }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        gap: 10px;
    }
    .header h1 {
        font-size: 1.5em;
    }
}

