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

:root {
  --bg: #2d7a3a;
  --bg-dark: #256b30;
  --surface: rgba(0, 0, 0, 0.45);
  --border: rgba(255, 255, 255, 0.25);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --accent: #ffffff;
  --accent-hover: #e0e0e0;
  --green: #1b5e20;
  --radius: 12px;
  --line-color: rgba(255, 255, 255, 0.35);
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: repeating-linear-gradient(
    180deg,
    var(--bg) 0px,
    var(--bg) 40px,
    var(--bg-dark) 40px,
    var(--bg-dark) 80px
  );
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
  background:
    /* center circle */
    radial-gradient(circle at 50% 50%, transparent 119px, var(--line-color) 119px, var(--line-color) 122px, transparent 122px),
    /* center line */
    linear-gradient(0deg, transparent calc(50% - 1.5px), var(--line-color) calc(50% - 1.5px), var(--line-color) calc(50% + 1.5px), transparent calc(50% + 1.5px)),
    /* center dot */
    radial-gradient(circle at 50% 50%, var(--line-color) 5px, transparent 5px),
    /* border lines */
    linear-gradient(0deg, var(--line-color) 3px, transparent 3px),
    linear-gradient(180deg, var(--line-color) 3px, transparent 3px),
    linear-gradient(90deg, var(--line-color) 3px, transparent 3px),
    linear-gradient(270deg, var(--line-color) 3px, transparent 3px);
  z-index: 0;
}

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

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.25rem;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.header-example {
  display: block;
  width: 120px;
  height: 120px;
  margin: 1.5rem auto 0;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.controls {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.input-row {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.input-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--text-muted);
  font-size: 1rem;
  font-family: inherit;
  user-select: none;
}

.input-row input {
  border-radius: 8px;
}

.input-row.drag-over {
  outline: 2px dashed #ffd600;
  outline-offset: 3px;
  border-radius: 8px;
}

.input-row.drag-over input {
  border-color: #ffd600;
  background: rgba(255, 214, 0, 0.1);
}

/* Avoid dragleave flicker when hovering over child elements */
.input-row.drag-over * {
  pointer-events: none;
}

.input-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.upload-link {
  width: auto;
  padding: 0;
  background: none;
  border: none;
  color: #ffd600;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.upload-link:hover {
  color: #ffea00;
}

input, select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--accent);
}

select option {
  background: #1b5e20;
  color: var(--text);
}

.options-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: #ffd600;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: #ffd600;
  color: #1b5e20;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: #ffea00;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.preview-section {
  margin-top: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.preview-section.hidden {
  display: none;
}

canvas {
  width: 300px;
  height: 300px;
}

.example-card canvas {
  border-radius: 50%;
}

.btn-download {
  padding: 0.75rem 2rem;
  background: #ffd600;
  color: #1b5e20;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-download:hover {
  opacity: 0.9;
}

.btn-download:active {
  transform: scale(0.98);
}

.error-msg {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #37003c, #5a189a);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.var-heading {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
}

.var-decision {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.var-decision-label {
  font-weight: 800;
  color: #c084fc;
}

.examples-section {
  margin-top: 2rem;
  text-align: center;
}

.examples-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.examples-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.example-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.example-card canvas {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.example-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading .btn-primary {
  pointer-events: none;
  opacity: 0.6;
}

.how-it-works {
  margin-top: 2.5rem;
  text-align: center;
}

.how-it-works h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.how-it-works ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.how-it-works li::before {
  font-weight: 700;
  color: #ffd600;
  margin-right: 0.5rem;
}

.how-it-works li:nth-child(1)::before { content: "1."; }
.how-it-works li:nth-child(2)::before { content: "2."; }
.how-it-works li:nth-child(3)::before { content: "3."; }

#footer {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.8rem;
}

#footer svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#footer .heart {
  color: #ff4d6d;
}

#footer a {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

#footer a:hover {
  text-decoration: underline;
}

/* Page layout — main content centered, promo on the right */
.page-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  position: relative;
  z-index: 1;
}

.page-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  max-width: 900px;
}

.promo-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 6rem;
  flex-shrink: 0;
  width: 260px;
}

/* --- Fake PR promo sidebar --- */
.pr-promo {
  width: 260px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.50);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 0.85;
  pointer-events: none;
}

.pr-promo-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.pr-icon {
  color: #3fb950;
}

.slack-icon {
  color: #E01E5A;
}


.pr-comment {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.pr-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pr-comment-body {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.pr-username {
  font-weight: 700;
  color: var(--text);
  margin-right: 0.25rem;
}

.pr-team-badge {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.pr-badge-sco { background: #003078; color: #fff; }
.pr-badge-usa { background: #002868; color: #fff; }
.pr-badge-eng { background: #CF081F; color: #fff; }

.pr-comment-body p {
  margin-top: 0.2rem;
}

.pr-promo-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.pr-btn {
  font-size: 0.6rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: default;
  white-space: nowrap;
}

.pr-btn-approve { background: #238636; color: #fff; border-color: #238636; }
.pr-btn-comment { background: rgba(255,255,255,0.1); color: var(--text-muted); }
.pr-btn-request { background: rgba(255,255,255,0.1); color: var(--text-muted); }

@media (max-width: 800px) {
  .promo-column { display: none; }
  .page-layout { max-width: 480px; }
}

@media (max-width: 500px) {
  header h1 {
    font-size: 1.6rem;
  }
  canvas {
    width: 260px;
    height: 260px;
  }
}
