/* ═══════════════════════════════════════════════════════════════
   MISCAST — The Daily Podcast Puzzle
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-deep: #08081a;
  --bg-surface: #111128;
  --bg-elevated: #1a1a3a;
  --bg-hover: #222250;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --accent: #ff4757;
  --accent-glow: rgba(255, 71, 87, 0.3);
  --success: #2ed573;
  --success-glow: rgba(46, 213, 115, 0.25);
  --warning: #ffa502;
  --easy: #2ed573;
  --medium: #ffa502;
  --hard: #ff4757;
  --border: #2a2a4a;
  --border-light: #3a3a5a;
  --radius: 8px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */

#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

.header-left, .header-right { width: 80px; display: flex; align-items: center; gap: 4px; }
.header-right { justify-content: flex-end; }
.header-center { text-align: center; flex: 1; }

header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent) 0%, #ff6b81 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  cursor: pointer;
}

.subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

header button {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

header button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

/* ─── Screens ─── */

.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; }

/* ─── Menu Screen ─── */

#screen-menu { padding: 24px 20px; gap: 20px; }

.menu-heading {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.difficulty-cards { display: flex; flex-direction: column; gap: 12px; }

.diff-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.diff-card:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.diff-card:active { transform: scale(0.98); }

.diff-card.completed {
  opacity: 0.7;
}

.diff-card.completed::after {
  content: '✅';
  position: absolute;
  right: 16px;
  font-size: 1.3rem;
}

.diff-card .diff-emoji {
  font-size: 2rem;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}

.diff-card .diff-info { flex: 1; }

.diff-card .diff-label {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.diff-card .diff-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.diff-card[data-difficulty="easy"] .diff-label { color: var(--easy); }
.diff-card[data-difficulty="medium"] .diff-label { color: var(--medium); }
.diff-card[data-difficulty="hard"] .diff-label { color: var(--hard); }

.diff-card[data-difficulty="easy"]:hover { border-color: var(--easy); }
.diff-card[data-difficulty="medium"]:hover { border-color: var(--medium); }
.diff-card[data-difficulty="hard"]:hover { border-color: var(--hard); }

/* ─── Streak Banner ─── */

.streak-banner {
  text-align: center;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.streak-banner .fire { color: var(--warning); font-weight: 700; }

/* ─── Today Progress ─── */

.today-progress {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 10px;
}

.today-progress .prog-item {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.today-progress .prog-item .prog-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 auto 4px;
  background: var(--border);
}

.today-progress .prog-item.done .prog-dot { background: var(--success); }

/* ─── Game Screen ─── */

#screen-game { padding: 16px 20px; gap: 12px; }

#puzzle-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.puzzle-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  background: rgba(255, 71, 87, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 71, 87, 0.2);
}

.puzzle-diff-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
}

.puzzle-diff-badge.easy { color: var(--easy); border-color: rgba(46, 213, 115, 0.3); background: rgba(46, 213, 115, 0.1); }
.puzzle-diff-badge.medium { color: var(--medium); border-color: rgba(255, 165, 2, 0.3); background: rgba(255, 165, 2, 0.1); }
.puzzle-diff-badge.hard { color: var(--hard); border-color: rgba(255, 71, 87, 0.3); background: rgba(255, 71, 87, 0.1); }

.puzzle-theme {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ─── Status Bar ─── */

#status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  gap: 8px;
}

#takes { font-size: 1.15rem; letter-spacing: 2px; }
.take-used { opacity: 0.2; filter: grayscale(1); }

#timer {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: center;
}

#found-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── Passage ─── */

#passage {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  line-height: 2;
  font-size: 1.1rem;
  flex: 1;
}

#passage .word {
  cursor: pointer;
  padding: 2px 1px;
  border-radius: 4px;
  transition: all 0.15s;
  display: inline;
  -webkit-user-select: none;
  user-select: none;
}

#passage .word:hover:not(.found):not(.game-over):not(.revealed) {
  background: var(--bg-hover);
  color: white;
}

#passage .word:active:not(.found):not(.game-over) { transform: scale(0.97); }
#passage .word.selected { background: rgba(255, 71, 87, 0.15); color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }

#passage .word.found { cursor: default; }
#passage .word.found .wrong-text { text-decoration: line-through; color: var(--text-muted); opacity: 0.6; }
#passage .word.found .correct-text { color: var(--success); font-weight: 700; margin-left: 2px; }

#passage .word.revealed { cursor: default; }
#passage .word.revealed .wrong-text { text-decoration: line-through; color: var(--text-muted); opacity: 0.5; }
#passage .word.revealed .correct-text { color: var(--warning); font-weight: 600; margin-left: 2px; }

#passage .word.game-over { cursor: default; }

#passage .word.miss-flash { animation: missShake 0.5s ease; }
#passage .word.found-flash { animation: foundPop 0.4s ease; }

@keyframes missShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-4px); background: rgba(255, 71, 87, 0.3); }
  30% { transform: translateX(4px); }
  45% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
}

@keyframes foundPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ─── Back Button (in-game) ─── */

#back-btn {
  font-size: 0.8rem !important;
  width: auto !important;
  padding: 0 10px !important;
  border-radius: var(--radius) !important;
  height: 32px !important;
}

/* ─── Input Panel ─── */

#input-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#input-panel.visible { transform: translateY(0); }

.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

#input-panel.visible .panel-backdrop { opacity: 1; }

.input-panel-content {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border-top: 2px solid var(--accent);
  padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#selected-word-display { text-align: center; margin-bottom: 12px; }
#selected-word-display .label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
#selected-word-display .word-highlight { font-size: 1.5rem; font-weight: 800; color: var(--accent); letter-spacing: 0.05em; }

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

#correction-input {
  flex: 1;
  background: var(--bg-deep);
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 1.1rem;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

#correction-input:focus { border-color: var(--accent); }
#correction-input::placeholder { color: var(--text-muted); }

#submit-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 52px;
}

#submit-btn:hover { filter: brightness(1.15); transform: scale(1.03); }
#submit-btn:active { transform: scale(0.97); }

#input-feedback {
  text-align: center;
  margin-top: 8px;
  font-size: 0.85rem;
  min-height: 1.2em;
}

#input-feedback.success { color: var(--success); }
#input-feedback.error { color: var(--accent); }
#input-feedback.hint { color: var(--warning); }

.cancel-link {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  text-decoration: underline;
}

.cancel-link:hover { color: var(--text-secondary); }

/* ─── Modals ─── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal.visible { opacity: 1; pointer-events: auto; }

.modal::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 440px;
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  animation: modalSlideUp 0.3s ease;
}

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

.modal-content h2 {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.modal-close-btn, .modal-action-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
  font-family: var(--font);
}

.modal-close-btn:hover, .modal-action-btn:hover { filter: brightness(1.15); }

.modal-action-btn.secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ─── Help Modal ─── */

.help-content p { color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; font-size: 0.95rem; }
.help-steps { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.help-step { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-surface); border-radius: var(--radius); border: 1px solid var(--border); }
.help-step .step-icon { font-size: 1.3rem; flex-shrink: 0; width: 32px; text-align: center; }
.help-step span { font-size: 0.9rem; color: var(--text-primary); line-height: 1.4; }
.help-note { font-size: 0.8rem !important; color: var(--text-muted) !important; font-style: italic; border-left: 3px solid var(--border); padding-left: 12px; }

/* ─── Results Modal ─── */

#result-title { font-size: 1.5rem !important; }
#result-emoji { text-align: center; font-size: 1.8rem; letter-spacing: 4px; margin: 10px 0; }
#result-time { text-align: center; font-family: var(--font-mono); font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 12px; }
#result-details { text-align: center; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; line-height: 1.5; }

#corrections-reveal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

#corrections-reveal h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 8px; }

.correction-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.85rem; }
.correction-item .status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.correction-item .status-dot.found { background: var(--success); }
.correction-item .status-dot.missed { background: var(--accent); }
.correction-item .wrong { text-decoration: line-through; color: var(--text-muted); }
.correction-item .arrow { color: var(--text-muted); }
.correction-item .right { font-weight: 700; }
.correction-item .right.found-text { color: var(--success); }
.correction-item .right.missed-text { color: var(--accent); }

#share-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--success);
  color: #111;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

#share-btn:hover { filter: brightness(1.1); }

#next-puzzle-timer { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: 12px; font-family: var(--font-mono); }

.donecast-cta { text-align: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.donecast-cta p { font-size: 0.8rem; color: var(--text-secondary); }
.donecast-cta a { color: var(--accent); text-decoration: none; font-weight: 700; }
.donecast-cta a:hover { text-decoration: underline; }
.donecast-cta .cta-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Stats Modal ─── */

#stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-item {
  text-align: center;
  padding: 10px 4px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stat-value { font-size: 1.4rem; font-weight: 800; line-height: 1; margin-bottom: 3px; }
.stat-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

.stats-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.stats-diff-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.stats-diff-row .diff-name { font-weight: 600; }
.stats-diff-row .diff-stats { color: var(--text-secondary); }

/* ─── Toast ─── */

#toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-primary);
  color: var(--bg-deep);
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

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

/* ─── Footer ─── */

footer {
  padding: 12px 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}

footer a { color: var(--text-muted); text-decoration: none; font-size: 0.75rem; letter-spacing: 0.03em; transition: color 0.2s; }
footer a:hover { color: var(--accent); }

/* ─── Responsive ─── */

@media (max-width: 480px) {
  header h1 { font-size: 1.6rem; }
  .subtitle { font-size: 0.65rem; }
  #passage { padding: 18px; font-size: 1rem; line-height: 1.9; }
  .input-panel-content { padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .modal-content { padding: 24px 20px; }
  #stats-grid { grid-template-columns: repeat(2, 1fr); }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::selection { background: rgba(255, 71, 87, 0.3); color: white; }

/* ─── Leaderboard ─── */

.lb-tab { transition: all 0.15s; }
.lb-tab.active { border-color: currentColor !important; background: var(--bg-elevated) !important; }
.lb-tab:hover { background: var(--bg-elevated) !important; }

#lb-entries { max-height: 300px; overflow-y: auto; }

.rank-badge {
  display: inline-block;
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 6px;
}

/* ─── Username Input ─── */

#username-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#username-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Stats Auth Section ─── */

#stats-auth-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── Correct color var ─── */
:root { --correct: #2ed573; }

/* ─── Auth Gate ─── */

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-deep);
  overflow-y: auto;
}

.auth-gate-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  padding: 8px 0 24px;
}

.auth-gate-logo {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--accent), #ff6b81, #ff8e53);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  line-height: 1;
}

.auth-gate-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.auth-gate-hook {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 0 8px;
}

.auth-gate-how {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-gate-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: left;
}

.auth-gate-step span:first-child {
  font-size: 1.2rem;
  min-width: 28px;
  text-align: center;
}

.auth-gate-step strong {
  color: var(--text-primary);
}

.auth-gate-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.auth-gate-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.auth-gate-google-btn:hover {
  background: #f7f8f8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.auth-gate-benefits {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -2px;
}

.auth-gate-anon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: color 0.15s;
  margin-top: 4px;
}

.auth-gate-anon-btn:hover {
  color: var(--text-primary);
}

.auth-gate-footer {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-gate-footer a {
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 480px) {
  .auth-gate-logo { font-size: 2.6rem; }
  .auth-gate-hook { font-size: 0.95rem; }
}

/* ─── Auth Gate Form ─── */

.auth-gate-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

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

.auth-gate-divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.auth-gate-donecast-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  background: rgba(255,71,87,0.08);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: var(--radius);
  padding: 8px 12px;
  line-height: 1.4;
}

.auth-gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-gate-form input {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.auth-gate-form input:focus {
  border-color: var(--accent);
}

.auth-gate-form input::placeholder {
  color: var(--text-muted);
}

.auth-gate-error {
  font-size: 0.82rem;
  color: var(--accent);
  padding: 4px 2px;
}

.auth-gate-submit-btn {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s;
}

.auth-gate-submit-btn:hover { opacity: 0.9; }
.auth-gate-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
