@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --ink: #0b0b10;
  --paper: #f7f3ea;
  --panel: rgba(255, 255, 255, 0.88);
  --accent: #1f4fd8;
  --accent-dark: #0f2b7a;
  --red: #e10600;
  --muted: #6e7380;
  --shadow: 0 18px 50px rgba(10, 10, 25, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fde9c7 0%, #f6d6c9 35%, #d2d9ff 70%, #b8c4ff 100%);
  min-height: 100vh;
}

body::before,
body::after {
  content: '';
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(0);
  z-index: -1;
}

body::before {
  top: -120px;
  right: -120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
}

body::after {
  bottom: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(31, 79, 216, 0.35), rgba(31, 79, 216, 0));
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 26px;
  gap: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: var(--accent-dark);
  margin: 0 0 6px 2px;
}

h1 {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin: 0;
  color: var(--ink);
}

.subhead {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 420px;
}

.hero-chip {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.stepper-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.story-stepper {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  position: relative;
  flex: 1;
}


.stepper-item {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding-left: 24px;
  z-index: 1;
}

.stepper-item::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(15, 43, 122, 0.35);
  background: #fff;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.stepper-item button {
  border: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.stepper-item.is-active::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 79, 216, 0.18);
}

.stepper-item.is-active button {
  color: var(--accent-dark);
  font-weight: 600;
}

.stepper-item.is-complete::before {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.stepper-item.is-complete button {
  color: var(--ink);
}

.stepper-actions {
  display: flex;
  gap: 10px;
}


.panel[data-step][data-step-state="hidden"],
.preview[data-step][data-step-state="hidden"] {
  display: none;
}

.panel[data-step="1"][data-step-state="active"],
.panel[data-step="2"][data-step-state="active"],
.panel[data-step="4"][data-step-state="active"] {
  grid-column: 1 / -1;
  width: 50%;
  max-width: 720px;
  min-width: 320px;
  margin: 0 auto;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(260px, 1.1fr);
  grid-auto-rows: min-content;
  gap: 20px;
}

.panel {
  background: var(--panel);
  padding: 18px 18px 20px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.field span {
  color: var(--muted);
}

input,
select {
  border: 1px solid rgba(15, 43, 122, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

input[type="file"] {
  display: none;
}

.file-field .file-ui {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 43, 122, 0.2);
  background: linear-gradient(135deg, #ffffff, #f5f3ff);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-field input[type="file"]:focus + .file-ui {
  outline: 2px solid rgba(31, 79, 216, 0.4);
  outline-offset: 2px;
}

.file-field .file-ui:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(31, 79, 216, 0.15);
}

.file-field .file-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.file-field .file-name {
  font-size: 0.85rem;
  color: var(--muted);
}

.file-ui-center {
  justify-content: center;
}

textarea {
  border: 1px solid rgba(15, 43, 122, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(31, 79, 216, 0.4);
  border-color: rgba(31, 79, 216, 0.6);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(31, 79, 216, 0.28);
}

button.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid rgba(15, 43, 122, 0.2);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 43, 122, 0.18);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 12px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 6px;
  color: var(--accent-dark);
  font-size: 0.9rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(15, 43, 122, 0.2);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.progress[hidden] {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hint {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.logo-editor {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: #10121b;
  color: #f1f1fb;
  box-shadow: var(--shadow);
}

.logo-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-editor-hint {
  font-size: 0.7rem;
  color: #8b90a5;
  letter-spacing: 0.05em;
}

#awayLogoCanvas {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  margin: 0 auto;
  background: repeating-conic-gradient(from 45deg, #1b1e2b 0 25%, #151827 0 50%) 0 / 24px 24px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.debug {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #11121a;
  color: #e6e6f0;
  font-size: 0.78rem;
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
}

.preview {
  grid-column: 1 / -1;
}

.preview-frame {
  background: #0b0b10;
  border-radius: 24px;
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
}

#previewCanvas {
  border-radius: 18px;
  background: #000;
  max-width: 100%;
  height: auto;
}

@media (max-width: 980px) {
  .stepper-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .story-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
