/* ═══════════════════════════════════════════════════════
   Dr. G's Retirement — Styles
   UF Gators: Blue #003087 · Orange #FA4616
   Theme: Pediatric Dentistry
════════════════════════════════════════════════════════ */

:root {
  --blue:        #003087;
  --blue-mid:    #00408a;
  --blue-light:  #0040a8;
  --orange:      #FA4616;
  --orange-light: #FF6B3D;
  --orange-dim:  #d63b10;
  --bg:          #F2F5FA;
  --bg-dark:     #E4EAF4;
  --white:       #ffffff;
  --text:        #0d1a2e;
  --text-mid:    #3d4f6b;
  --text-light:  #7a8fb0;
  --border:      #cdd6e8;
  --success:     #2d7a4f;
  --error:       #c0392b;
  --shadow-sm:   0 2px 8px rgba(0,48,135,.10);
  --shadow:      0 4px 20px rgba(0,48,135,.14);
  --shadow-lg:   0 8px 40px rgba(0,48,135,.22);
  --radius:      14px;
  --radius-lg:   20px;
  --transition:  0.22s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; }

.hidden { display: none !important; }

/* ── Utility Buttons ────────────────────────────────── */
button { cursor: pointer; border: none; font-family: inherit; }

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  background: linear-gradient(135deg, var(--orange), var(--orange-dim));
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .02em;
  border-radius: 50px;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(250,70,22,.35);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(250,70,22,.45);
}
.btn-gold:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.btn-gold svg { width: 18px; height: 18px; }

.btn-lg { padding: 1rem 2.25rem; font-size: 1.05rem; border-radius: 50px; width: 100%; justify-content: center; }

.btn-sm { padding: .55rem 1.2rem; font-size: .87rem; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .75rem 1.75rem;
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  font-weight: 500;
  font-size: .95rem;
  border-radius: 50px;
  transition: var(--transition);
}
.btn-outline:hover {
  background: var(--blue);
  color: #fff;
}
.btn-outline svg { width: 16px; height: 16px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  background: transparent;
  color: var(--text-light);
  font-size: .88rem;
  border-radius: 50px;
  transition: var(--transition);
}
.btn-ghost:hover { background: rgba(0,0,0,.06); color: var(--text); }

/* ── Password Screen ────────────────────────────────── */
#password-screen {
  min-height: 100vh;
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-light) 55%, #001f6e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
}

/* Animated background orbs — orange glow */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  animation: float 10s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(250,70,22,.22) 0%, transparent 70%);
  top: -130px; right: -130px;
  animation-delay: 0s;
}
.orb-2 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(250,70,22,.13) 0%, transparent 70%);
  bottom: -90px; left: -90px;
  animation-delay: -4s;
}
.orb-3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
  top: 40%; left: 40%;
  animation-delay: -7s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -30px) scale(1.05); }
  66%       { transform: translate(-15px, 15px) scale(.97); }
}

.password-card {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(250,70,22,.30);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.32);
  animation: slideUp .6s cubic-bezier(.4,0,.2,1) both;
}

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

.pw-ornament {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  opacity: .9;
  line-height: 1;
}

.pw-title {
  font-size: 3.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin-bottom: .3rem;
}

.pw-subtitle {
  font-size: .9rem;
  color: var(--orange-light);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}

/* Minimal password screen layout */
.pw-minimal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUp .6s cubic-bezier(.4,0,.2,1) both;
}

.pw-tooth-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.pw-tooth-emoji {
  font-size: 6.5rem;
  line-height: 1;
  animation: toothFloat 3.5s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(250,70,22,.55))
          drop-shadow(0 0 40px rgba(250,70,22,.25));
}

.pw-form-minimal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  width: 280px;
}
.pw-form-minimal .input-wrap { width: 100%; }
.pw-form-minimal .input-wrap input {
  width: 100%;
  padding: .95rem 2.8rem .95rem 1.4rem;
  background: rgba(255,255,255,.09);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 50px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  text-align: center;
  letter-spacing: .05em;
}
.pw-form-minimal .input-wrap input::placeholder { color: rgba(255,255,255,.35); }
.pw-form-minimal .input-wrap input:focus {
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.13);
}

.btn-pw {
  width: 100%;
  padding: .8rem !important;
  border-radius: 50px !important;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .85;
  transition: opacity .2s, transform .2s;
}
.btn-pw:hover:not(:disabled) { opacity: 1; }

.pw-form-minimal .pw-error {
  width: 100%;
  text-align: center;
}

.pw-divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.4rem;
}
.pw-divider span { flex: 1; height: 1px; background: rgba(250,70,22,.3); display: block; }
.pw-divider .diamond { color: var(--orange-light); font-size: 1.1rem; flex: 0; opacity: .85; }

.pw-desc {
  color: rgba(255,255,255,.72);
  font-size: .93rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.pw-form { display: flex; flex-direction: column; gap: .8rem; }

.input-wrap { position: relative; }

.input-wrap input {
  width: 100%;
  padding: .9rem 3rem .9rem 1.2rem;
  background: rgba(255,255,255,.09);
  border: 1.5px solid rgba(250,70,22,.35);
  border-radius: 50px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.input-wrap input::placeholder { color: rgba(255,255,255,.4); }
.input-wrap input:focus {
  border-color: var(--orange-light);
  background: rgba(255,255,255,.13);
}
.input-wrap.shake { animation: shake .4s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.pw-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  padding: .25rem;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.pw-toggle:hover { color: rgba(255,255,255,.9); }
.pw-toggle svg { width: 18px; height: 18px; }

.pw-error {
  color: #ffaaaa;
  font-size: .87rem;
  min-height: 1.2em;
  text-align: center;
}

/* Spinner */
.btn-spinner { width: 18px; height: 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App Header ─────────────────────────────────────── */
.app-header {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.header-tagline {
  font-size: .68rem;
  color: var(--orange-light);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── Tab Bar ────────────────────────────────────────── */
.tab-bar {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: center;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.8rem;
  background: none;
  color: var(--text-light);
  font-size: .93rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn svg { width: 17px; height: 17px; }
.tab-btn:hover { color: var(--blue); background: rgba(0,48,135,.04); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--orange); }

/* ── Tab Content ────────────────────────────────────── */
.tab-content {
  padding: 2rem 1.5rem 4rem;
  animation: fadeIn .3s ease both;
}

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

.content-wrap {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Welcome Card ───────────────────────────────────── */
.welcome-card {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Subtle orange stripe accent on top of welcome card */
.welcome-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light), var(--orange));
}

.welcome-icon { font-size: 2.6rem; margin-bottom: .8rem; line-height: 1; }

.welcome-card h2 { font-size: 1.55rem; color: #fff; margin-bottom: .6rem; }

.welcome-card p { color: rgba(255,255,255,.82); font-size: .95rem; line-height: 1.65; }

/* ── Success Card ───────────────────────────────────── */
.success-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  border: 2px solid #d4edda;
  animation: popIn .4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

.success-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dim));
  color: #fff;
  font-size: 1.9rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
}

.success-card h2 { font-size: 1.7rem; color: var(--blue); margin-bottom: .5rem; }
.success-card p { color: var(--text-mid); line-height: 1.6; margin-bottom: 1.5rem; }

/* ── Upload Card ────────────────────────────────────── */
.upload-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.form-group { display: flex; flex-direction: column; gap: .45rem; position: relative; }

label { font-size: .88rem; font-weight: 600; color: var(--blue); letter-spacing: .01em; }

.required { color: var(--orange-dim); }

input[type="text"],
textarea {
  width: 100%;
  padding: .8rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .97rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: var(--transition);
  resize: vertical;
}
input[type="text"]:focus,
textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,48,135,.09);
}
textarea { min-height: 80px; }

.char-count { font-size: .8rem; color: var(--text-light); text-align: right; margin-top: -.2rem; }

/* ── Video Drop Zone ────────────────────────────────── */
.video-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
  background: var(--bg);
}
.video-drop-zone.drag-over { border-color: var(--orange); background: #fff5f2; }

.drop-idle {
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
}

.drop-icon svg { width: 52px; height: 52px; color: var(--blue); opacity: .3; }

.drop-title { font-size: 1rem; font-weight: 600; color: var(--blue); }

.drop-sub { font-size: .83rem; color: var(--text-light); }

.drop-btns {
  display: flex;
  gap: .75rem;
  margin-top: .5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.drop-record {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  position: relative;
}

.drop-record video { width: 100%; max-height: 300px; border-radius: 10px; background: #000; transform: scaleX(-1); }

.record-timer {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  background: rgba(200,0,0,.9);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  padding: .25rem .55rem;
  border-radius: 4px;
  animation: recPulse 1s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.record-timer::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}

@keyframes recPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

.record-controls {
  display: flex;
  gap: .6rem;
  align-items: center;
}

.drop-preview {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
}

.drop-preview video { width: 100%; max-height: 300px; border-radius: 10px; background: #000; }

.preview-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.preview-meta { display: flex; gap: .8rem; align-items: center; font-size: .83rem; }

.preview-name {
  color: var(--blue);
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-size { color: var(--text-light); }

/* ── Upload Progress ────────────────────────────────── */
.upload-progress { display: flex; flex-direction: column; gap: .5rem; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .87rem;
  color: var(--text-mid);
  font-weight: 500;
}

.progress-bar-track { height: 8px; background: var(--bg-dark); border-radius: 50px; overflow: hidden; }

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  border-radius: 50px;
  width: 0%;
  transition: width .3s ease;
}

.error-msg {
  color: var(--error);
  font-size: .88rem;
  padding: .6rem .9rem;
  background: #fef2f2;
  border-radius: 8px;
  border-left: 3px solid var(--error);
}

/* ── Gallery Header ─────────────────────────────────── */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.gallery-header-left { display: flex; align-items: center; gap: .8rem; }

.gallery-header h2 { font-size: 1.55rem; color: var(--blue); }

.badge {
  background: var(--blue);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .2rem .65rem;
  border-radius: 50px;
}

/* ── Stitch Progress ────────────────────────────────── */
.stitch-progress {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.stitch-progress-inner { display: flex; align-items: flex-start; gap: 1rem; }

.stitch-icon svg { width: 28px; height: 28px; color: var(--orange); }

.stitch-text p { font-size: .95rem; font-weight: 600; color: var(--blue); }
.stitch-sub { font-size: .82rem !important; color: var(--text-light) !important; font-weight: 400 !important; }

.stitch-pct { font-size: .85rem; color: var(--orange-dim); font-weight: 600; text-align: right; }

.spin { animation: spin 1.2s linear infinite; }

/* ── Gallery Empty ──────────────────────────────────── */
.gallery-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-mid);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.gallery-empty h3 { font-size: 1.3rem; color: var(--blue); margin-bottom: .5rem; }
.gallery-empty p { margin-bottom: 1.5rem; font-size: .95rem; }

/* ── Video Grid ─────────────────────────────────────── */
.video-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }

@media (min-width: 640px) {
  .video-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Video Card ─────────────────────────────────────── */
.video-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeIn .35s ease both;
}
.video-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Orange top accent on video cards */
.video-card::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
}

.video-card video { width: 100%; display: block; background: #111; max-height: 220px; object-fit: cover; }

.video-card-body { padding: 1rem; }

.video-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: .25rem;
}

.video-card-msg { font-size: .85rem; color: var(--text-mid); line-height: 1.5; margin-bottom: .75rem; }

.video-card-meta { font-size: .78rem; color: var(--text-light); margin-bottom: .75rem; }

.video-card-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem 1rem;
  background: var(--bg);
  color: var(--blue);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-download:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-download svg { width: 14px; height: 14px; }

.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem 1rem;
  background: var(--bg);
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-delete:hover { background: var(--error); color: #fff; }
.btn-delete svg { width: 14px; height: 14px; }

/* ── Loading Screen ─────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(150deg, var(--blue) 0%, #001f6e 55%, #000d40 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.7s cubic-bezier(.4,0,.2,1);
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }

/* Orange spotlight glow */
.loader-spotlight {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250,70,22,.20) 0%, rgba(250,70,22,.05) 50%, transparent 70%);
  animation: spotlightPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes spotlightPulse {
  0%, 100% { transform: scale(1);    opacity: .8; }
  50%       { transform: scale(1.25); opacity: 1;  }
}

/* Tooth + sparkle container */
.loader-tooth-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.8rem;
  animation: slideUp .6s cubic-bezier(.4,0,.2,1) both;
}
.loader-tooth-emoji {
  font-size: 6.5rem;
  line-height: 1;
  animation: toothFloat 3.5s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(250,70,22,.55))
          drop-shadow(0 0 40px rgba(250,70,22,.25));
}
@keyframes toothFloat {
  0%, 100% { transform: translateY(0)    rotate(-4deg); }
  50%       { transform: translateY(-14px) rotate(4deg); }
}

/* Sparkles */
.loader-sparkle {
  position: absolute;
  color: var(--orange-light);
  animation: sparklePop 2.4s ease-in-out infinite;
  line-height: 1;
  pointer-events: none;
}
.sp1 { top: 4px;    right: 8px;  font-size: 1.3rem; animation-delay: 0s;   }
.sp2 { top: 30px;   right: -8px; font-size: .8rem;  animation-delay: 0.4s; }
.sp3 { bottom: 18px; right: 4px; font-size: 1rem;   animation-delay: 0.8s; }
.sp4 { bottom: 12px; left: 4px;  font-size: .75rem; animation-delay: 1.2s; }
.sp5 { top: 24px;   left: -6px;  font-size: 1.1rem; animation-delay: 1.6s; }
.sp6 { top: 2px;    left: 22px;  font-size: .9rem;  animation-delay: 2s;   }
@keyframes sparklePop {
  0%, 100% { opacity: .15; transform: scale(.7);               }
  50%       { opacity: 1;   transform: scale(1.5) rotate(30deg); }
}

/* Text block */
.loader-text {
  text-align: center;
  margin-bottom: 2.2rem;
  animation: fadeInUp .7s .35s cubic-bezier(.4,0,.2,1) both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.loader-subtitle {
  font-size: .78rem;
  color: var(--orange-light);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-weight: 500;
  margin-bottom: .5rem;
}
.loader-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -.01em;
  margin-bottom: .4rem;
}
.loader-tagline {
  font-size: .9rem;
  color: rgba(255,255,255,.55);
  font-weight: 300;
  letter-spacing: .04em;
}

/* Progress bar */
.loader-bar-wrap {
  width: 180px;
  height: 3px;
  background: rgba(255,255,255,.12);
  border-radius: 50px;
  overflow: hidden;
  animation: fadeInUp .5s .6s ease both;
}
.loader-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  border-radius: 50px;
  width: 0%;
  animation: loadProgress 2s .4s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes loadProgress {
  0%   { width: 0%;  }
  60%  { width: 75%; }
  100% { width: 100%; }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
  .password-card { padding: 2.2rem 1.5rem; }
  .pw-title { font-size: 2.6rem; }
  .tab-btn { padding: .9rem 1rem; font-size: .85rem; }
  .tab-btn svg { display: none; }
  .header-inner { padding: .85rem 1rem; }
  .gallery-header { flex-direction: column; align-items: flex-start; }
  .content-wrap { gap: 1.1rem; }
  .upload-card { padding: 1.5rem; }
  .drop-btns { flex-direction: column; width: 100%; }
  .drop-btns button { width: 100%; justify-content: center; }
}

/* ── Admin Tooth (hidden login) ─────────────────────── */
.admin-tooth {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.12;
  transition: opacity .3s;
  padding: .3rem;
  line-height: 1;
}
.admin-tooth:hover { opacity: 0.5; }

.admin-prompt {
  position: fixed;
  bottom: 3.5rem;
  right: 1rem;
  z-index: 51;
}
.admin-prompt.hidden { display: none !important; }

.admin-prompt-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: .8rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.admin-prompt-card input {
  width: 140px;
  padding: .5rem .7rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
  outline: none;
}
.admin-prompt-card input:focus { border-color: var(--blue); }

.admin-error {
  width: 100%;
  font-size: .78rem;
  color: var(--error);
  margin-top: .2rem;
  min-height: 0;
}

/* ═══════════════════════════════════════════════════════
   RETRO GAME — Escape the Residency
════════════════════════════════════════════════════════ */

/* ── Header Game Button ────────────────────────────── */
.btn-game-header {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  background: rgba(250,70,22,.2);
  color: var(--orange-light);
  border: 1.5px solid rgba(250,70,22,.5);
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-right: .6rem;
}
.btn-game-header:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

/* ── Game CTA Card (near upload section) ───────────── */
.game-cta-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1.5px solid rgba(250,70,22,.35);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  color: #fff;
}
.game-cta-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.game-cta-text { font-size: .88rem; line-height: 1.5; flex: 1; }
.game-cta-text strong { color: var(--orange-light); }
.game-cta-card .btn-outline {
  border-color: var(--orange-light);
  color: var(--orange-light);
  flex-shrink: 0;
}
.game-cta-card .btn-outline:hover { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ── Game Modal ────────────────────────────────────── */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.game-modal.hidden { display: none !important; }

.game-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(6px);
}

.game-modal-content {
  position: relative;
  background: #0f0f23;
  border: 2px solid var(--orange);
  border-radius: 12px;
  padding: 1rem;
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  box-shadow: 0 0 60px rgba(250,70,22,.25);
}

/* ── Close Button ──────────────────────────────────── */
.game-close-btn {
  position: absolute;
  top: .5rem;
  right: .75rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: color .2s;
}
.game-close-btn:hover { color: var(--orange-light); }

/* ── Canvas ────────────────────────────────────────── */
#game-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: 6px;
  background: #0a0a1a;
  image-rendering: pixelated;
}

/* ── CRT Overlay ───────────────────────────────────── */
.crt-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  /* Height matches canvas — set via JS or let it cover */
  height: 0;
  pointer-events: none;
  border-radius: 6px;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, .12) 0px,
    rgba(0, 0, 0, .12) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}
.crt-overlay.crt-off { display: none; }

/* ── Game HUD ──────────────────────────────────────── */
.game-hud {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: .85rem;
  font-weight: 700;
  color: var(--orange-light);
  padding: .2rem 0;
  width: 100%;
}
.game-hud.hidden { display: none; }

.hud-coffee {
  color: #55CDFC;
  background: rgba(85, 205, 252, .15);
  padding: 0 .5rem;
  border-radius: 4px;
}
.hud-coffee.hidden { display: none; }

/* ── Game Controls Row ─────────────────────────────── */
.game-controls-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.game-ctrl-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  color: #aaa;
  font-size: .78rem;
  font-family: inherit;
  padding: .35rem .8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.game-ctrl-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ── Help Panel ────────────────────────────────────── */
.game-help-panel {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: .8rem 1.2rem;
  font-size: .8rem;
  color: #bbb;
  line-height: 1.6;
  width: 100%;
  max-width: 500px;
}
.game-help-panel.hidden { display: none; }
.game-help-panel p { margin-bottom: .4rem; }
.game-help-panel ul { margin: .2rem 0 .6rem 1.2rem; }
.game-help-panel kbd {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .75rem;
  font-family: 'Courier New', monospace;
}

/* ── Mobile Jump Button ────────────────────────────── */
.mobile-jump-btn {
  display: none;
  width: 100%;
  max-width: 300px;
  padding: 1rem;
  background: linear-gradient(135deg, var(--orange), var(--orange-dim));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: .15em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

/* Show mobile jump on touch devices */
@media (hover: none) and (pointer: coarse) {
  .mobile-jump-btn { display: block; }
}

/* ── Responsive Game Modal ─────────────────────────── */
@media (max-width: 480px) {
  .game-modal-content { padding: .6rem; gap: .4rem; }
  .game-hud { font-size: .75rem; gap: .8rem; }
  .btn-game-header { padding: .35rem .7rem; font-size: .75rem; }
  .game-cta-card { flex-direction: column; text-align: center; }
}
