:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.12);
  --radius: 14px;
}

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

[hidden] {
  display: none !important;
}

html {
  background-color: var(--bg);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1rem 3rem;
}

.page {
  max-width: 640px;
  margin-inline: auto;
}

.hero {
  text-align: center;
  margin-block-end: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #60a5fa;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.15;
}

.subtitle {
  margin: 0.5rem auto 0;
  color: var(--muted);
  max-width: 46ch;
  font-size: 0.95rem;
}

.card,
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.card-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.result-card {
  margin-block-start: 1.25rem;
}

.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-block-end: 1.25rem;
}

.saved-id-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  margin-block-end: 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.saved-id-text {
  font-size: 0.95rem;
  color: var(--muted);
}

.saved-id-text strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.field > label {
  font-weight: 600;
  font-size: 0.95rem;
}

input[type="text"] {
  font: inherit;
  font-size: max(1rem, 1em);
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
}

input[type="text"]:focus-visible,
.primary-btn:focus-visible,
.link-btn:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

input[type="text"]:user-invalid,
input[type="text"][aria-invalid="true"] {
  border-color: var(--error);
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.field-error {
  font-size: 0.85rem;
  color: var(--error);
  font-weight: 500;
}

.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.dropzone:has(input:focus-visible) {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

.dropzone-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.25rem;
  min-height: 120px;
  padding: 1rem;
  cursor: pointer;
}

.dropzone-icon {
  font-size: 1.5rem;
}

.dropzone-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.dropzone-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.options-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-block-end: 1.25rem;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-field input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-field label {
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.preview-wrap {
  margin-block-end: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem;
  background: var(--bg);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.preview-img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 6px;
}

.link-btn {
  background: none;
  border: none;
  color: #60a5fa;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.primary-btn {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.primary-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status-text {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.result-banner {
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
}

.result-banner.is-success {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.35);
}

.result-banner.is-warn {
  background: var(--warn-bg);
  border-color: rgba(245, 158, 11, 0.35);
}

.result-banner.is-error {
  background: var(--error-bg);
  border-color: rgba(248, 113, 113, 0.35);
}

.result-headline {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
}

.studio-crop {
  display: inline-block;
  vertical-align: middle;
  height: 1.75em;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  border-radius: 5px;
  border: 1px solid rgba(96, 165, 250, 0.7);
  margin-inline: 0.25rem;
}

.result-meta {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.roster {
  margin-block-start: 1rem;
}

.roster-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.roster-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.roster-item {
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.roster-item.is-target {
  background: var(--accent);
  border-color: #60a5fa;
  color: #fff;
  font-weight: 700;
}
