/* ==============================
   VARIABLES & RESET
   ============================== */
:root {
  --color-bg: #0d1117;
  --color-surface: #161b22;
  --color-border: #30363d;
  --color-text: #e6edf3;
  --color-text-muted: #8b949e;
  --color-accent: #58a6ff;
  --color-accent-emphasis: #1f6feb;
  --color-btn-primary: #238636;
  --color-btn-primary-hover: #2ea043;
  --color-white: #ffffff;
  --font-family: 'Mona Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --card-width: 360px;
  --card-height: 530px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Hide form screen instantly when restoring card from hash */
html.restoring-card #form-screen {
  display: none !important;
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ==============================
   SCREEN TRANSITIONS
   ============================== */
.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardReveal {
  from { opacity: 0; transform: scale(0.9) translateY(24px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==============================
   FORM SCREEN
   ============================== */
.form-container {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 40px 24px;
  gap: 80px;
}

.form-left {
  flex: 1;
  max-width: 480px;
}

.form-right {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-header {
  margin-bottom: 32px;
}

.github-mark {
  width: 48px;
  height: 48px;
  color: var(--color-white);
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #e6edf3 0%, #8b949e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.deadline {
  font-size: 0.875rem;
  color: #f0883e;
  font-weight: 600;
  margin-bottom: 32px;
}

/* ---- Social proof ---- */
.social-proof {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-proof strong {
  color: var(--color-text);
}

.social-proof-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-btn-primary);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(35, 134, 54, 0.5); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(35, 134, 54, 0); }
}

/* ---- Already claimed notice ---- */
.already-claimed {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: #3fb950;
  animation: fadeIn 0.3s ease;
  width: 100%;
  max-width: var(--card-width);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Form ---- */

/* ---- OAuth sign-in ---- */
.oauth-section {
  margin-bottom: 24px;
  text-align: center;
}

.btn-github-signin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: var(--font-family);
  color: var(--color-white);
  background: #24292f;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  width: 100%;
  justify-content: center;
}

.btn-github-signin:hover {
  background: #30363d;
  border-color: #484f58;
}

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

.oauth-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.oauth-authed {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(46, 160, 67, 0.1);
  border: 1px solid rgba(46, 160, 67, 0.3);
  border-radius: 8px;
  margin-bottom: 20px;
}

.oauth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.oauth-user-info {
  font-size: 0.8125rem;
  color: var(--color-text);
  flex: 1;
}

.oauth-signout {
  font-size: 0.75rem;
  font-family: var(--font-family);
  color: var(--color-text-muted);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.oauth-signout:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.required {
  color: #f85149;
}

input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: var(--font-family);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

input[type="text"]:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

input[type="text"].error {
  border-color: #f85149;
  box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.15);
}

.input-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 5px;
}

.input-hint code {
  background: var(--color-surface);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.input-error-msg {
  display: none;
  font-size: 0.75rem;
  color: #f85149;
  margin-top: 5px;
}

.input-error-msg:not(:empty) {
  display: block;
}

input[type="text"].error ~ .input-error-msg:not(:empty) {
  display: block;
}

.input-with-prefix:has(input.error) ~ .input-error-msg:not(:empty) {
  display: block;
}

input[type="text"].error ~ .input-hint {
  display: none;
}

.input-with-prefix {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.input-with-prefix input {
  padding-left: 30px;
}

/* ---- Primary button ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-family);
  color: var(--color-white);
  background: var(--color-btn-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--color-btn-primary-hover);
}

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

/* ---- Preview placeholder (ghost card) ---- */
.preview-placeholder {
  perspective: 1000px;
}

.card-mockup {
  width: var(--card-width);
  height: var(--card-height);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: float 6s ease-in-out infinite;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.card-mockup-shape {
  width: 100%;
  height: 55%;
  background: linear-gradient(135deg, #30363d 0%, #21262d 100%);
  border-radius: 12px;
  opacity: 0.6;
}

.card-mockup-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.line {
  height: 14px;
  border-radius: 7px;
  background: var(--color-border);
  opacity: 0.5;
}

.line-name { width: 70%; }
.line-title { width: 50%; }
.line-handle { width: 40%; }

@keyframes float {
  0%, 100% { transform: rotateY(-3deg) rotateX(2deg) translateY(0); }
  50% { transform: rotateY(3deg) rotateX(-2deg) translateY(-12px); }
}

/* ==============================
   CARD SCREEN
   ============================== */
.card-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-header {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 8px;
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  padding: 6px 0;
  transition: opacity 0.2s;
}

.btn-back:hover {
  opacity: 0.8;
}

/* ==============================
   THE BADGE CARD — FLIP
   ============================== */
.card-preview-area {
  animation: cardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  perspective: 1200px;
}

.card-flip-container {
  width: var(--card-width);
  height: var(--card-height);
  cursor: pointer;
  perspective: 1200px;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.card-flip-inner.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.card-back {
  transform: rotateY(180deg);
}

.badge-card {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

/* ---- Card art with animated gradient ---- */
.card-art {
  position: relative;
  height: 40%;
  overflow: hidden;
}

.card-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 100%);
  z-index: 1;
}

.card-art-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
}

.card-art-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.card-logo svg {
  width: 24px;
  height: 24px;
  opacity: 0.9;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.card-label {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 1;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.card-shape {
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  border-radius: 0 0 50% 0;
  animation: gradientShift 8s ease-in-out infinite alternate;
  background-size: 200% 200%;
}

.card-shape-accent {
  position: absolute;
  width: 60%;
  height: 60%;
  bottom: -5%;
  right: -5%;
  border-radius: 50% 0 0 0;
  opacity: 0.5;
  animation: gradientShift 10s ease-in-out infinite alternate-reverse;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Card role title ---- */
.card-role {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 4px;
  display: none;
}

.card-role:not(:empty) {
  display: block;
}

/* ---- Card body ---- */
.card-body {
  flex: 1;
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.card-name {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2px;
  word-spacing: 0.15em;
}

.card-handle {
  font-size: 0.875rem;
  opacity: 0.6;
  margin-bottom: 6px;
}

.card-tagline {
  font-size: 0.9375rem;
  opacity: 0.85;
  font-style: italic;
  margin-bottom: 0;
  line-height: 1.4;
  font-weight: 500;
}

.card-project-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.card-project {
  font-size: 0.875rem;
  opacity: 0.75;
  font-weight: 600;
  margin-bottom: 0;
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
  align-items: center;
}

.card-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.6;
}

.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  font-weight: 500;
  opacity: 0.55;
}

.star-tier-badge {
  font-size: 0.875rem;
  margin-right: 1px;
}

.card-date {
  font-size: 0.6875rem;
  opacity: 0.5;
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  position: relative;
  z-index: 1;
}

.card-badge-tag {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.6;
  text-transform: uppercase;
}

.card-footer-logo {
  width: 54px;
  opacity: 0.6;
}

/* ---- Card back ---- */
.card-back-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 32px;
  text-align: center;
}

.card-back-icon svg {
  width: 40px;
  height: 40px;
  opacity: 0.6;
  margin-bottom: 20px;
}

.card-back-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
}

.card-back-message {
  font-size: 0.8125rem;
  opacity: 0.6;
  line-height: 1.6;
  margin-bottom: 28px;
}

.card-back-project {
  margin-bottom: 28px;
}

.card-back-label {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  opacity: 0.4;
  display: block;
  margin-bottom: 4px;
}

.card-back-project-name {
  font-size: 1rem;
  font-weight: 700;
}

.card-back-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.card-back-logo {
  width: 20px;
  height: 20px;
}

/* ==============================
   CARD THEMES
   ============================== */

/* Theme: GitHub Dark */
.theme-github-dark {
  background: #0d1117;
  color: #e6edf3;
}

.theme-github-dark .card-shape {
  background: linear-gradient(135deg, #6e40c9 0%, #1f6feb 30%, #238636 60%, #6e40c9 100%);
  background-size: 200% 200%;
}

.theme-github-dark .card-shape-accent {
  background: linear-gradient(135deg, #1f6feb 0%, #58a6ff 50%, #1f6feb 100%);
  background-size: 200% 200%;
}

/* Theme: Octoverse */
.theme-octoverse {
  background: #0a0e1a;
  color: #c9d1d9;
}

.theme-octoverse .card-shape {
  background: linear-gradient(135deg, #da3633 0%, #f0883e 30%, #d29922 60%, #da3633 100%);
  background-size: 200% 200%;
}

.theme-octoverse .card-shape-accent {
  background: linear-gradient(135deg, #f0883e 0%, #ffd33d 50%, #f0883e 100%);
  background-size: 200% 200%;
}

/* Theme: Mona */
.theme-mona {
  background: #fafbfc;
  color: #24292f;
}

.theme-mona .card-shape {
  background: linear-gradient(135deg, #8957e5 0%, #d2a8ff 30%, #f778ba 60%, #8957e5 100%);
  background-size: 200% 200%;
}

.theme-mona .card-shape-accent {
  background: linear-gradient(135deg, #bf8700 0%, #d2a8ff 50%, #bf8700 100%);
  background-size: 200% 200%;
}

.theme-mona .card-label,
.theme-mona .card-handle,
.theme-mona .card-project,
.theme-mona .card-badge-tag,
.theme-mona .card-footer-logo {
  opacity: 0.6;
}

/* Theme: Copilot */
.theme-copilot {
  background: #1a1b26;
  color: #a9b1d6;
}

.theme-copilot .card-shape {
  background: linear-gradient(135deg, #79c0ff 0%, #56d364 30%, #3fb950 60%, #79c0ff 100%);
  background-size: 200% 200%;
}

.theme-copilot .card-shape-accent {
  background: linear-gradient(135deg, #56d364 0%, #a5d6ff 50%, #56d364 100%);
  background-size: 200% 200%;
}

.theme-copilot .card-name {
  color: #e6edf3;
}

/* Theme: Sunrise */
.theme-sunrise {
  background: #1c1118;
  color: #f0d6e8;
}

.theme-sunrise .card-shape {
  background: linear-gradient(135deg, #db61a2 0%, #f0883e 30%, #ffd33d 60%, #db61a2 100%);
  background-size: 200% 200%;
}

.theme-sunrise .card-shape-accent {
  background: linear-gradient(135deg, #f0883e 0%, #f85149 50%, #f0883e 100%);
  background-size: 200% 200%;
}

/* Theme: Arctic */
.theme-arctic {
  background: #ecf2f8;
  color: #24292f;
}

.theme-arctic .card-shape {
  background: linear-gradient(135deg, #0969da 0%, #54aeff 30%, #79c0ff 60%, #0969da 100%);
  background-size: 200% 200%;
}

.theme-arctic .card-shape-accent {
  background: linear-gradient(135deg, #218bff 0%, #54aeff 50%, #218bff 100%);
  background-size: 200% 200%;
}

.theme-arctic .card-label,
.theme-arctic .card-handle,
.theme-arctic .card-project,
.theme-arctic .card-badge-tag,
.theme-arctic .card-footer-logo {
  opacity: 0.6;
}

/* Theme: Neon */
.theme-neon {
  background: #0a0a0f;
  color: #e0e0ff;
}

.theme-neon .card-shape {
  background: linear-gradient(135deg, #ff006e 0%, #8338ec 30%, #3a86ff 60%, #ff006e 100%);
  background-size: 200% 200%;
}

.theme-neon .card-shape-accent {
  background: linear-gradient(135deg, #ff006e 0%, #fb5607 50%, #ff006e 100%);
  background-size: 200% 200%;
}

/* Theme: Deep Sea */
.theme-deep-sea {
  background: #0b1628;
  color: #b8d4e8;
}

.theme-deep-sea .card-shape {
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 30%, #90e0ef 60%, #0077b6 100%);
  background-size: 200% 200%;
}

.theme-deep-sea .card-shape-accent {
  background: linear-gradient(135deg, #023e8a 0%, #0096c7 50%, #023e8a 100%);
  background-size: 200% 200%;
}

/* Theme: Forest */
.theme-forest {
  background: #0d1a0b;
  color: #c5e1c0;
}

.theme-forest .card-shape {
  background: linear-gradient(135deg, #2d6a4f 0%, #40916c 30%, #95d5b2 60%, #2d6a4f 100%);
  background-size: 200% 200%;
}

.theme-forest .card-shape-accent {
  background: linear-gradient(135deg, #1b4332 0%, #52b788 50%, #1b4332 100%);
  background-size: 200% 200%;
}

/* Theme: Midnight */
.theme-midnight {
  background: #13111c;
  color: #d4d0e8;
}

.theme-midnight .card-shape {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 30%, #a78bfa 60%, #5b21b6 100%);
  background-size: 200% 200%;
}

.theme-midnight .card-shape-accent {
  background: linear-gradient(135deg, #4c1d95 0%, #8b5cf6 50%, #4c1d95 100%);
  background-size: 200% 200%;
}

/* Theme: Ember */
.theme-ember {
  background: #1a0e0a;
  color: #f0d2c4;
}

.theme-ember .card-shape {
  background: linear-gradient(135deg, #dc2626 0%, #ea580c 30%, #f59e0b 60%, #dc2626 100%);
  background-size: 200% 200%;
}

.theme-ember .card-shape-accent {
  background: linear-gradient(135deg, #b91c1c 0%, #f97316 50%, #b91c1c 100%);
  background-size: 200% 200%;
}

/* Theme: Rose Gold */
.theme-rose-gold {
  background: #fdf2f4;
  color: #3b1a2a;
}

.theme-rose-gold .card-shape {
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 30%, #fda4af 60%, #f43f5e 100%);
  background-size: 200% 200%;
}

.theme-rose-gold .card-shape-accent {
  background: linear-gradient(135deg, #e11d48 0%, #fecdd3 50%, #e11d48 100%);
  background-size: 200% 200%;
}

.theme-rose-gold .card-label,
.theme-rose-gold .card-handle,
.theme-rose-gold .card-project,
.theme-rose-gold .card-badge-tag,
.theme-rose-gold .card-footer-logo {
  opacity: 0.6;
}

/* ==============================
   THEME PICKER
   ============================== */
.theme-picker {
  margin-top: 16px;
  text-align: center;
}

.theme-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 8px;
}

.theme-options {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 3px;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.2s, transform 0.2s;
}

.theme-btn:hover {
  transform: scale(1.1);
}

.theme-btn.active {
  border-color: var(--color-accent);
}

.theme-swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.swatch-dark {
  background: linear-gradient(135deg, #6e40c9 0%, #1f6feb 60%, #238636 100%);
}

.swatch-octoverse {
  background: linear-gradient(135deg, #da3633 0%, #f0883e 60%, #d29922 100%);
}

.swatch-mona {
  background: linear-gradient(135deg, #8957e5 0%, #d2a8ff 60%, #f778ba 100%);
}

.swatch-copilot {
  background: linear-gradient(135deg, #79c0ff 0%, #56d364 60%, #3fb950 100%);
}

.swatch-sunrise {
  background: linear-gradient(135deg, #db61a2 0%, #f0883e 60%, #ffd33d 100%);
}

.swatch-arctic {
  background: linear-gradient(135deg, #0969da 0%, #54aeff 60%, #79c0ff 100%);
}

.swatch-neon {
  background: linear-gradient(135deg, #ff006e 0%, #8338ec 60%, #3a86ff 100%);
}

.swatch-deep-sea {
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 60%, #90e0ef 100%);
}

.swatch-forest {
  background: linear-gradient(135deg, #2d6a4f 0%, #40916c 60%, #95d5b2 100%);
}

.swatch-midnight {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 60%, #a78bfa 100%);
}

.swatch-ember {
  background: linear-gradient(135deg, #dc2626 0%, #ea580c 60%, #f59e0b 100%);
}

.swatch-rose-gold {
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 60%, #fda4af 100%);
}

/* ==============================
   SHARE ACTIONS
   ============================== */
.share-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-family);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, border-color 0.2s;
  background: var(--color-surface);
  color: var(--color-text);
}

.btn-share:hover {
  background: #21262d;
  border-color: var(--color-text-muted);
}

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

.btn-download {
  background: var(--color-btn-primary);
  border-color: var(--color-btn-primary);
  color: var(--color-white);
}

.btn-download:hover {
  background: var(--color-btn-primary-hover);
  border-color: var(--color-btn-primary-hover);
}

/* ==============================
   BADGE NUMBER
   ============================== */
.card-badge-number {
  color: var(--color-accent, #58a6ff);
  opacity: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.badge-number-header {
  font-size: 0.9375rem;
  color: var(--color-accent);
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ==============================
   EMBEDDABLE BADGE
   ============================== */
/* ==============================
   TAG A MAINTAINER
   ============================== */
.tag-maintainer {
  margin-top: 36px;
  text-align: center;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.08), rgba(110, 64, 201, 0.08));
  border: 1px solid rgba(88, 166, 255, 0.15);
  border-radius: 16px;
  padding: 20px 20px;
}

.tag-divider {
  width: 48px;
  height: 2px;
  background: var(--color-accent-emphasis);
  margin: 0 auto 12px;
  border-radius: 1px;
  opacity: 0.5;
}

.tag-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tag-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

.tag-form-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.tag-input-wrapper {
  flex: 1;
}

.tag-input {
  height: 100%;
}

.btn-tag {
  margin-top: 0;
  white-space: nowrap;
  padding: 10px 20px;
  font-size: 0.875rem;
}

/* ---- Gallery link ---- */
/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
  .form-container {
    flex-direction: column;
    gap: 40px;
    padding: 32px 20px;
  }

  .form-left {
    max-width: 100%;
  }

  .form-right {
    display: none;
  }

  h1 {
    font-size: 1.75rem;
  }

  :root {
    --card-width: 300px;
    --card-height: 410px;
  }

  .card-container {
    padding: 20px 16px;
  }

  .share-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-share {
    justify-content: center;
  }

  .tag-form-row {
    flex-direction: column;
  }
}

/* ---- Share toast notification ---- */
.share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1c2128;
  color: #e6edf3;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid #30363d;
  font-size: 0.875rem;
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
