:root {
  --bg: #0f1115;
  --panel: #171a21CC;
  --border: #2a2e38;
  --text: #e6e8ee;
  --text-dim: #9aa1ae;
  --accent: #4f8cff;
  --accent-dim: #33507f;
  --success: #3ecf8e;
  --error: #ff6b6b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background-image: url("bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body {
  background-color: var(--bg); /* shows while bg.jpg loads, and behind any transparent areas */
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app {
  width: 100%;
  max-width: 480px;
}

header h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
  text-align: center;
}

.subtitle-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 24px;
}

.subtitle {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.9rem;
  flex: 1;
}

.state-banner {
  background: var(--panel);
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.hidden { display: none !important; }

.btn-primary, .btn-secondary {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
}

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

.btn-primary:hover { background: #3f78e0; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover { border-color: var(--accent); }

.share-row {
  display: flex;
  gap: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

#share-link {
  flex: 1;
  background: #0d0f14;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin: 8px 0 0;
}

.file-meta {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.progress-bar {
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s ease;
}

.error-text { color: var(--error); }

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--accent-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

.info-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px; /* nudge to roughly align with the subtitle's first line */
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.info-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal {
  background: #171a21;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 16px 20px 20px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.modal-body p {
  margin: 0 0 12px;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body code {
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}
