/* Mario Clock Simulator — Cyberpunk Dark Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #0a0a0f;
  --bg-card: #12121a;
  --bg-input: #1a1a24;
  --border: #2a2a3a;
  --text: #c8c8d8;
  --text-dim: #6a6a7a;
  --accent-red: #ff3864;
  --accent-blue: #4ecdc4;
  --accent-yellow: #ffd66e;
  --accent-purple: #b388ff;
  --glow-red: rgba(255, 56, 100, 0.3);
  --glow-blue: rgba(78, 205, 196, 0.2);
}

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
  min-height: 100vh;
  padding: 2rem 1rem;
}

/* CRT scanlines overlay */
.scanlines {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1000;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
}

.header h1 {
  font-size: 1.8rem;
  color: var(--accent-yellow);
  text-shadow: 0 0 20px rgba(255, 214, 110, 0.4);
  font-weight: 700;
}

.buy-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-red);
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  box-shadow: 0 0 15px var(--glow-red);
}

.buy-link:hover {
  background: #ff5070;
  box-shadow: 0 0 25px var(--glow-red);
  transform: translateY(-1px);
}

.buy-arrow {
  transition: transform 0.2s;
}

.buy-link:hover .buy-arrow {
  transform: translateX(3px);
}

/* Main Grid Layout */
.main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 800px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Screen Section */
.screen-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  position: sticky;
  top: 2rem;
}

.screen-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* LED Matrix – black bezel */
.screen-frame {
  background: #000;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #333;
  box-shadow:
    0 0 30px rgba(0, 0, 0, 0.8),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#ledCanvas {
  width: 384px;
  height: 384px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  border-radius: 4px;
  background: #000;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
}

.screen-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.mini-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.mini-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.mini-btn.active {
  background: var(--accent-blue);
  color: #000;
  border-color: var(--accent-blue);
}

/* Config Section */
.config-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.config-section h2 {
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  color: var(--accent-blue);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.config-group {
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

.config-group:last-child {
  border-bottom: none;
}

.config-group h3 {
  font-size: 0.95rem;
  color: var(--accent-yellow);
  margin-bottom: 0.8rem;
}

.param-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}

.param-row label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.input-with-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.num-input {
  width: 70px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  text-align: center;
}

.num-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.text-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  box-shadow: 0 0 6px var(--glow-blue);
}

.time-sep {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.checkbox-row label {
  color: var(--text);
  font-size: 0.8rem;
}

input[type="checkbox"] {
  accent-color: var(--accent-blue);
  width: 14px;
  height: 14px;
}

.brightness-display {
  background: rgba(78, 205, 196, 0.05);
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: 5px;
  padding: 0.5rem;
  margin-top: 0.3rem;
}

.value-display {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-shadow: 0 0 10px var(--glow-blue);
}

/* Features section */
.features {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.features h2 {
  font-size: 1.3rem;
  color: var(--accent-purple);
  margin-bottom: 1.5rem;
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  transition: all 0.2s;
}

.feature-card:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px var(--glow-blue);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
}

.feature-card h3 {
  font-size: 0.95rem;
  color: var(--accent-yellow);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.feature-pin {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.pin-item {
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--bg-input);
  padding: 0.5rem 0.8rem;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.pin-item strong {
  color: var(--accent-blue);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
}

footer a {
  color: var(--accent-blue);
  text-decoration: none;
}
