/**
 * deploy/slash/forge/forge.css
 * Daylight Field styling for Viral Forge vertical player surfaces.
 * Conforms to GOLD 1.4: Daylight #F4F4F2, no emoji, Lucide SVG, precise safe-zones.
 */

:root {
  --os-ground: #F4F4F2;
  --os-card: #FFFFFF;
  --os-ink: #0A0A0F;
  --os-muted: #6B7280;
  --os-rule: #E5E7EB;
  --os-blue: #0055FF;
  --os-blue-wash: rgba(0, 85, 255, 0.08);
  --os-ice: #E0F2FE;
  --os-teal: #0D9488;
  --os-danger: #EF4444;
  --os-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --os-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --os-radius-sm: 6px;
  --os-radius-md: 10px;
  --os-radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--os-ground);
  color: var(--os-ink);
  font-family: var(--os-font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.forge-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .forge-shell {
    grid-template-columns: 1fr;
  }
}

/* Left Panel: 9:16 Stage */
.stage-container {
  background: #000000;
  border-radius: var(--os-radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25);
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#forgeCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Safe Zone HUD Overlay */
.safe-zone-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

.safe-zone-overlay.active {
  display: block;
}

.safe-band-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(260 / 1920 * 100%);
  background: rgba(239, 68, 68, 0.15);
  border-bottom: 1px dashed rgba(239, 68, 68, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--os-font-mono);
  font-size: 11px;
  color: #EF4444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.safe-band-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(480 / 1920 * 100%);
  background: rgba(239, 68, 68, 0.15);
  border-top: 1px dashed rgba(239, 68, 68, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--os-font-mono);
  font-size: 11px;
  color: #EF4444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.safe-band-right {
  position: absolute;
  top: calc(260 / 1920 * 100%);
  bottom: calc(480 / 1920 * 100%);
  right: 0;
  width: calc(144 / 1080 * 100%);
  background: rgba(239, 68, 68, 0.1);
  border-left: 1px dashed rgba(239, 68, 68, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-family: var(--os-font-mono);
  font-size: 10px;
  color: #EF4444;
}

.safe-band-left {
  position: absolute;
  top: calc(260 / 1920 * 100%);
  bottom: calc(480 / 1920 * 100%);
  left: 0;
  width: calc(120 / 1080 * 100%);
  background: rgba(239, 68, 68, 0.1);
  border-right: 1px dashed rgba(239, 68, 68, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-family: var(--os-font-mono);
  font-size: 10px;
  color: #EF4444;
}

.safe-box {
  position: absolute;
  top: calc(260 / 1920 * 100%);
  bottom: calc(480 / 1920 * 100%);
  left: calc(120 / 1080 * 100%);
  right: calc(144 / 1080 * 100%);
  border: 1px solid rgba(0, 85, 255, 0.5);
  pointer-events: none;
}

/* Right Panel: Controls & Telemetry */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--os-card);
  border: 1px solid var(--os-rule);
  border-radius: var(--os-radius-md);
  padding: 20px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.badge {
  font-family: var(--os-font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--os-radius-sm);
  background: var(--os-blue-wash);
  color: var(--os-blue);
  font-weight: 600;
}

.desc {
  font-size: 13px;
  color: var(--os-muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

/* Transport Controls */
.transport-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.btn {
  font-family: var(--os-font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--os-radius-sm);
  border: 1px solid var(--os-rule);
  background: var(--os-card);
  color: var(--os-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--os-ground);
  border-color: var(--os-muted);
}

.btn.primary {
  background: var(--os-blue);
  color: #FFFFFF;
  border-color: var(--os-blue);
}

.btn.primary:hover {
  background: #0044CC;
}

.btn.active {
  background: var(--os-blue-wash);
  color: var(--os-blue);
  border-color: var(--os-blue);
}

.scrubber-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--os-blue);
}

.scrubber-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--os-font-mono);
  font-size: 11px;
  color: var(--os-muted);
}

/* Scene Selector Chips */
.scene-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  font-family: var(--os-font-mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: var(--os-radius-sm);
  border: 1px solid var(--os-rule);
  background: var(--os-card);
  color: var(--os-muted);
  cursor: pointer;
}

.chip.active {
  border-color: var(--os-blue);
  color: var(--os-blue);
  background: var(--os-blue-wash);
  font-weight: 600;
}

/* Physics & Telemetry Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.telemetry-item {
  background: var(--os-ground);
  padding: 10px 12px;
  border-radius: var(--os-radius-sm);
  border: 1px solid var(--os-rule);
}

.telemetry-label {
  font-family: var(--os-font-mono);
  font-size: 10px;
  color: var(--os-muted);
  text-transform: uppercase;
}

.telemetry-val {
  font-family: var(--os-font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--os-ink);
  margin-top: 4px;
}

.footer-nav {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-family: var(--os-font-mono);
}

.footer-nav a {
  color: var(--os-blue);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}
