/* Ironman OT — shared base styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }
body {
  font-family: 'VT323', 'Silkscreen', ui-monospace, monospace;
  background: #0a0806;
  color: #e8dcc0;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: none;
  font-smooth: never;
  image-rendering: pixelated;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
}

img, canvas { image-rendering: pixelated; }

a { color: inherit; text-decoration: none; }

/* Variation switcher — top bar, always visible */
.variation-bar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex; align-items: center; gap: 0;
  background: #000;
  border-bottom: 2px solid #2a1f14;
  font-family: 'VT323', monospace;
  font-size: 20px;
  height: 40px;
}
.variation-bar .brand {
  padding: 0 16px; height: 100%;
  display: flex; align-items: center;
  color: #d4a656;
  letter-spacing: 1px;
  border-right: 2px solid #2a1f14;
}
.variation-bar .brand::before {
  content: '◆';
  margin-right: 8px;
  color: #8b1a1a;
}
.variation-bar .tabs { display: flex; height: 100%; flex: 1; }
.variation-bar .tab {
  padding: 0 20px; height: 100%;
  display: flex; align-items: center;
  color: #6b5a3e;
  border-right: 1px solid #2a1f14;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  user-select: none;
}
.variation-bar .tab:hover { color: #e8dcc0; background: #1a1410; }
.variation-bar .tab.active {
  color: #000; background: #d4a656;
}
.variation-bar .tab .num { opacity: 0.6; margin-right: 8px; }
.variation-bar .tab.active .num { opacity: 1; }
.variation-bar .meta {
  padding: 0 16px; color: #6b5a3e; font-size: 16px;
  display: flex; align-items: center; gap: 12px;
}
.variation-bar .status-dot {
  width: 8px; height: 8px; background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  display: inline-block;
  animation: dot-pulse 2s infinite;
}
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Responsive: tablet & mobile ── */
@media (max-width: 900px) {
  .variation-bar .meta { display: none; }
  .variation-bar .tab { padding: 0 14px; font-size: 11px; }
}
@media (max-width: 640px) {
  .variation-bar { height: 36px; }
  .variation-stage { padding-top: 36px; }
  .variation-bar .brand { padding: 0 10px; font-size: 10px; }
  .variation-bar .brand::before { margin-right: 6px; }
  .variation-bar .tabs {
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .variation-bar .tabs::-webkit-scrollbar { display: none; }
  .variation-bar .tab {
    padding: 0 10px;
    font-size: 10px;
    flex: 1 0 auto;
    justify-content: center;
    letter-spacing: 1px;
  }
  .variation-bar .tab .num { margin-right: 5px; opacity: 0.7; }
}
@media (max-width: 420px) {
  .variation-bar .brand .brand-text { display: none; }
  .variation-bar .brand { padding: 0 8px; }
  .variation-bar .tab { padding: 0 8px; font-size: 9px; letter-spacing: 0.5px; }
  .variation-bar .tab .num { display: none; }
}

.variation-stage { padding-top: 40px; min-height: 100vh; }
.variation { display: none; }
.variation.active { display: block; }

/* Tweaks panel */
.tweaks-panel {
  position: fixed; right: 16px; bottom: 16px;
  z-index: 1100;
  width: 280px;
  background: #0f0a06;
  border: 2px solid #d4a656;
  box-shadow: 0 0 0 2px #000, 4px 4px 0 2px #000;
  padding: 12px 14px;
  font-family: 'VT323', monospace;
  color: #e8dcc0;
  font-size: 18px;
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h3 {
  font-size: 16px;
  letter-spacing: 2px;
  color: #d4a656;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #2a1f14;
  text-transform: uppercase;
}
.tweaks-panel .row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0;
}
.tweaks-panel .row label { color: #a89068; font-size: 16px; }
.tweaks-panel .row .value { color: #e8dcc0; }
.tweaks-panel button.tw-btn {
  background: transparent;
  border: 1px solid #d4a656;
  color: #d4a656;
  font-family: inherit; font-size: 14px;
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: 1px;
}
.tweaks-panel button.tw-btn:hover { background: #d4a656; color: #000; }
.tweaks-panel .swatches { display: flex; gap: 6px; }
.tweaks-panel .swatch {
  width: 20px; height: 20px; border: 2px solid #2a1f14; cursor: pointer;
}
.tweaks-panel .swatch.active { border-color: #fff; }

/* CRT scanlines overlay (toggleable) */
body.scanlines::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0) 0,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0.18) 3px,
      rgba(0,0,0,0) 4px
    );
  mix-blend-mode: multiply;
}
body.scanlines::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 998;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0) 55%,
    rgba(0,0,0,0.55) 100%
  );
}

/* Utility: pixel borders */
.pixel-frame {
  position: relative;
  background: #0f0a06;
  border: 2px solid #d4a656;
  box-shadow:
    inset 0 0 0 2px #0f0a06,
    inset 0 0 0 4px #5c4420,
    4px 4px 0 0 #000;
}

/* Placeholder (media) */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      #1a1410 0 10px,
      #221a12 10px 20px
    );
  border: 2px solid #3a2a1a;
  display: flex; align-items: center; justify-content: center;
  color: #8b7650;
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}
.placeholder .ph-inner {
  padding: 16px;
  max-width: 80%;
}
.placeholder .ph-kind {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  background: #000;
  color: #d4a656;
  border: 1px solid #d4a656;
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.placeholder .ph-label { font-size: 13px; color: #c9b892; margin-bottom: 4px; font-weight: bold; }
.placeholder .ph-note { font-size: 11px; color: #8b7650; line-height: 1.4; }
.placeholder::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(212, 166, 86, 0.02), transparent 40%),
    radial-gradient(circle at 30% 20%, rgba(212,166,86,0.05), transparent 50%);
  pointer-events: none;
}

/* Scrollbar — themed */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #0a0806; }
::-webkit-scrollbar-thumb { background: #3a2a1a; border: 2px solid #0a0806; }
::-webkit-scrollbar-thumb:hover { background: #5c4420; }

/* Selection */
::selection { background: #d4a656; color: #000; }
