/* ============================================================================
   UNIVERSAL CSS — Shared Layout, Utilities, and Card Preview System
   Syndicate Protocol: 2095 — Generator Framework
   ============================================================================ */

/* ============================================================================
   GLOBAL RESET & BASE
   ============================================================================ */

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

body {
  font-family: "Inter", sans-serif;
  background: #1a1a1a;
  color: #fff;
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* ============================================================================
   GENERATOR LAYOUT
   ============================================================================ */

.generator {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
}

/* ============================================================================
   FORM PANEL
   ============================================================================ */

.form-panel {
  width: 300px;
  background: #222;
  padding: 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-panel h2 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.form-panel label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.form-panel button {
  width: 100%;
  padding: 6px 8px;
  border-radius: 4px;
  border: none;
  font-size: 0.85rem;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
  background: #333;
  color: #fff;
}

.form-panel textarea {
  min-height: 60px;
  resize: vertical;
}

.form-panel button {
  background: #4a90e2;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

.form-panel button:hover {
  background: #6ab0ff;
}

/* ============================================================================
   PREVIEW WRAPPER — HOLDS SCALED CARD
   ============================================================================ */

.preview-wrapper {
  width: 500px;  /* 250px * 2 for scale */
  height: 700px; /* 350px * 2 for scale */
  overflow: visible;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ============================================================================
   CARD PREVIEW — INTERNAL 250×350 LAYOUT (SCALED VISUALLY 2X)
   ============================================================================ */

.card-preview {
  width: 250px;
  height: 350px;
  aspect-ratio: 250 / 350;

  background: #fff;
  color: #000;

  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);

  display: flex;
  flex-direction: column;
  padding: 10px 8px;
  gap: 6px;
  box-sizing: border-box;

  /* 200% visual scaling */
  transform: scale(2);
  transform-origin: top left;
}

/* ============================================================================
   PORTRAIT AREAS
   ============================================================================ */

.armor-portrait,
.tactic-portrait,
.operator-portrait,
.weapon-portrait,
.movement-portrait {
  width: 100%;
  height: 105px;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 0.8rem;
  color: #666;
  background-color: #ddd;

  border-radius: 4px;
  flex-shrink: 0;
}

/* ============================================================================
   TITLES & CATEGORY LINE
   ============================================================================ */

.armor-name,
.tactic-name,
.operator-name,
.weapon-name,
.movement-name {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-top: 2px;
  line-height: 1.1;
}

.category-line {
  font-size: 0.75rem;
  text-align: center;
  margin-bottom: 2px;
  opacity: 0.8;
  line-height: 1.1;
}

/* ============================================================================
   STAT BAR — NON-COLLAPSING, CONSISTENT LAYOUT
   ============================================================================ */

.stat-bar {
  width: 100%;
  padding: 4px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  flex-shrink: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 40px;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 2px;
}

.stat span {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

/* ============================================================================
   TRAIT BLOCK
   ============================================================================ */

.trait-block {
  padding: 4px;
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
  font-size: 0.75rem;
  line-height: 1.15;
  flex-shrink: 0;
}

/* ============================================================================
   NOTES BLOCK
   ============================================================================ */

.notes-block {
  font-size: 0.7rem;
  line-height: 1.2;
  opacity: 0.9;

  word-wrap: break-word;
  overflow-wrap: break-word;

  flex-shrink: 1;
  min-height: 20px;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
  display: none !important;
}

.center {
  text-align: center;
}

.flex {
  display: flex;
}

.column {
  flex-direction: column;
}

.gap-sm {
  gap: 6px;
}

.gap-md {
  gap: 12px;
}