body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--page-bg, #07070c);
  color: var(--text, #f6f7fb);
}

:root,
.theme-dark {
  --page-bg: #07070c;
  --panel: #111329;
  --panel-strong: #1d1f3b;
  --panel-soft: #161828;
  --text: #f6f7fb;
  --muted: #8a92b3;
  --accent: #57c7ff;
  --border: 1px solid rgba(255, 255, 255, 0.08);
  --shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  --hero-shadow: 0 35px 80px rgba(0, 0, 0, 0.6);
}

.theme-light {
  --page-bg: #f5f6fa;
  --panel: #ffffff;
  --panel-strong: #f3f4f6;
  --panel-soft: #eceef4;
  --text: #1d1d24;
  --muted: #6b707e;
  --accent: #3b6bff;
  --border: 1px solid rgba(29, 31, 49, 0.08);
  --shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  --hero-shadow: 0 35px 80px rgba(0, 0, 0, 0.15);
}

.theme-saint-patricks {
  --page-bg: #0e2a19;
  --panel: #143623;
  --panel-strong: #1a432c;
  --panel-soft: #204f35;
  --text: #edf9f1;
  --muted: #b8d7c4;
  --accent: #8fd66e;
  --border: 1px solid rgba(222, 246, 227, 0.16);
  --shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  --hero-shadow: 0 35px 80px rgba(0, 0, 0, 0.4);
}

.theme-easter {
  --page-bg: #fff8fb;
  --panel: #ffffff;
  --panel-strong: #f7efff;
  --panel-soft: #f2f8ff;
  --text: #3f3450;
  --muted: #7f7395;
  --accent: #f37ba9;
  --border: 1px solid rgba(125, 107, 157, 0.16);
  --shadow: 0 15px 40px rgba(120, 95, 160, 0.14);
  --hero-shadow: 0 35px 80px rgba(120, 95, 160, 0.2);
}

.theme-fourth-july {
  --page-bg: #0b1b45;
  --panel: #13357d;
  --panel-strong: #19459a;
  --panel-soft: #1f53b2;
  --text: #ffffff;
  --muted: #dce6ff;
  --accent: #d92532;
  --border: 1px solid rgba(255, 255, 255, 0.28);
  --shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  --hero-shadow: 0 35px 80px rgba(0, 0, 0, 0.45);
}

body.theme-fourth-july {
  background:
    radial-gradient(circle at 12px 12px, rgba(255,255,255,.26) 0 2px, transparent 2.4px) 0 0/44px 44px,
    repeating-linear-gradient(180deg, rgba(217,37,50,.10) 0 16px, rgba(255,255,255,.06) 16px 32px),
    linear-gradient(140deg, #0b1b45 0%, #13357d 55%, #1a4ba8 100%);
}

.profile-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  padding: 40px 48px 64px;
  max-width: 1280px;
  margin: 0 auto 60px;
}

.profile-nav {
  position: sticky;
  top: 32px;
  align-self: start;
  background: var(--panel);
  border: var(--border);
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.profile-nav h3,
.profile-nav p {
  margin: 0;
}

.profile-nav .profile-snapshot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}

.profile-avatar-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.profile-avatar-row img {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.15);
}

.profile-avatar-row .profile-avatar-link {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.profile-avatar-row .avatar-overlay {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.profile-avatar-row .military-watermark {
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.profile-avatar-row .military-watermark .mil-stars {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
}

.profile-avatar-row .memory-watermark {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  background: rgba(0,0,0,.58);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.profile-identity .profile-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.profile-identity .profile-handle {
  font-size: 16px;
  color: var(--muted);
}

.profile-avatar-row .mil-star {
  font-size: 12px;
  line-height: 1;
}

.profile-avatar-row .mil-red { color: #e53935; }
.profile-avatar-row .mil-white { color: #ffffff; }
.profile-avatar-row .mil-blue { color: #2b6dff; }

.profile-follow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  font-size: 14px;
  width: 100%;
}

.profile-follow-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  padding: 10px 8px;
  border-radius: 14px;
  border: var(--border);
  background: rgba(255,255,255,0.05);
  text-decoration: none;
  color: var(--text);
  text-align: center;
}

.profile-follow-stat strong {
  font-size: 20px;
  line-height: 1;
}

.profile-follow-stat span {
  font-size: 12px;
  color: var(--muted);
}

.profile-follow-stat:hover {
  background: rgba(255,255,255,0.09);
}

.profile-nav .profile-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: var(--border);
  background: rgba(87, 199, 255, 0.1);
  font-size: 12px;
}

.profile-nav nav {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.links-header {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.profile-nav nav a {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s ease, background .2s ease;
}

.profile-nav nav a.active,
.profile-nav nav a:hover {
  background: rgba(87,199,255,.1);
  color: var(--text);
}

.profile-nav-footer {
  border-top: 1px solid rgba(255,255,255,0.18);
  margin-top: 20px;
  margin-bottom: 0;
  padding: 16px 0 0;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.profile-nav-footer p {
  margin: 0;
}
.profile-nav-footer-brand {
  font-weight: 600;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.9);
}
.profile-nav-footer-links {
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.profile-nav-footer p + p {
  margin-top: 6px;
}
.profile-nav-footer a {
  color: inherit;
  text-decoration: none;
}
.profile-nav-footer a:hover {
  text-decoration: underline;
}

.profile-main {
  background: var(--panel-strong);
  border-radius: 24px;
  padding: 28px;
  border: var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-form {
  background: var(--panel-strong);
  border-radius: 24px;
  padding: 32px;
  border: var(--border);
  box-shadow: var(--hero-shadow);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.profile-hero {
  display: block;
}

.profile-image-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.profile-tagline {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.profile-avatar-link {
  display: inline-block;
}

.profile-image-area img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.2);
}

.profile-metadata h1 {
  margin: 0;
  font-size: 28px;
}

.status-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-link {
  color: var(--accent);
  text-decoration: none;
}

.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.hero-stats article {
  background: var(--panel);
  border-radius: 16px;
  border: var(--border);
  padding: 14px;
  width: 100%;
  text-align: center;
}

.hero-stats article strong {
  display: block;
  font-size: 20px;
}

.profile-data-block {
  background: rgba(255,255,255,0.02);
  border-radius: 16px;
  border: var(--border);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-data-block h4 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-data-block p {
  margin: 0;
  font-size: 14px;
}

.profile-data-block .rating-stars {
  font-size: 20px;
  letter-spacing: 0.08em;
}

.profile-data-block .rating-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.profile-data-block .rating-form button {
  border: var(--border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.profile-data-block .rating-form button:hover {
  filter: brightness(1.12);
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.coin-points {
  display: flex;
  gap: 14px;
}

.coin-card {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  border: var(--border);
  padding: 14px;
  text-align: center;
}

.coin-card .coin-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.coin-card strong {
  display: block;
  font-size: 26px;
  margin: 8px 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-grid .card {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  border: var(--border);
  box-shadow: 0 5px 18px rgba(0,0,0,0.25);
}

.profile-grid header h2 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0.02em;
  border-bottom: var(--border);
  padding-bottom: 6px;
}

.profile-grid .card p {
  margin: 0 0 8px;
  display: block;
  color: var(--text);
  line-height: 1.45;
}

.profile-grid .card p:last-child {
  margin-bottom: 0;
}

.profile-grid .card p strong {
  color: var(--muted);
  font-weight: 700;
}

.avatar-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 30000;
  padding: 24px;
}

.avatar-lightbox img {
  max-width: min(92vw, 1200px);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.profile-grid .card-about-row {
  grid-column: 1 / -1;
}

.profile-media-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.profile-media-card {
  background: var(--panel);
  border-radius: 16px;
  border: var(--border);
  padding: 12px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25);
}

.profile-media-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.profile-media-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--accent);
}

.profile-media-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.media-arrow {
  border: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 8px;
  min-width: 30px;
  height: 30px;
  cursor: pointer;
}

.profile-media-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.profile-media-row.media-draggable {
  cursor: grab;
}

.profile-media-row.media-draggable.dragging {
  cursor: grabbing;
  user-select: none;
}

.media-tile {
  position: relative;
  flex: 0 0 calc((100% - 40px) / 5);
  border-radius: 10px;
  overflow: hidden;
  border: var(--border);
  background: rgba(255, 255, 255, 0.06);
  min-height: 96px;
  cursor: pointer;
}

.media-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-fallback {
  width: 100%;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  color: var(--text);
  font-size: 13px;
}

.media-badge {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.95);
  font-size: 26px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}

.media-del {
  position: absolute;
  right: 6px;
  top: 6px;
  border: 0;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  background: rgba(180, 25, 25, 0.9);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.profile-media-form {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-media-form input,
.profile-media-form select,
.profile-media-form button {
  border: var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
}

.profile-media-form select {
  color: var(--text);
  background: var(--panel-soft);
}

.profile-media-form select option {
  color: var(--text);
  background: var(--panel);
}

.profile-media-form input[type="text"] {
  flex: 1;
  min-width: 220px;
}

.profile-media-form button {
  cursor: pointer;
}

.media-empty {
  border: var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.profile-media-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
}

.profile-media-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.profile-media-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 980px);
  max-height: 86vh;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.profile-media-player-wrap {
  width: 100%;
  height: min(70vh, 560px);
}

.profile-media-player-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.profile-media-image-wrap {
  width: 100%;
  max-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  overflow: auto;
}

.profile-media-image {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.profile-media-image.zoomed {
  transform: scale(1.6);
  cursor: zoom-out;
}

.profile-media-image-wrap {
  cursor: zoom-out;
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-list a {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
}

.profile-section header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.profile-section header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.profile-section header span {
  color: var(--muted);
  font-size: 13px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.field-row input,
.field-row textarea,
.field-row select {
  background: rgba(255,255,255,0.02);
  border: var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.field-row textarea {
  min-height: 110px;
  resize: vertical;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.profile-summary .tile {
  padding: 16px;
  border-radius: 14px;
  border: var(--border);
  background: rgba(255,255,255,0.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.profile-summary .tile strong {
  display: block;
  font-size: 18px;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.social-card {
  padding: 14px;
  background: rgba(255,255,255,0.02);
  min-height: 96px;
  border: var(--border);
  border-radius: 14px;
}

.social-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 10px;
}

.social-card a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.social-card iframe,
.social-card blockquote {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.social-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.social-grid > p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .social-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .social-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.submit-row {
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #b22234, #1f67ff);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform .2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(87,199,255,.35);
  background: rgba(87,199,255,.1);
  color: #fff;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.trust-grid .pill {
  padding: 10px 12px;
  border-radius: 12px;
  border: var(--border);
  text-align: center;
  background: rgba(255,255,255,0.02);
  font-size: 13px;
}

.profile-section .status-badge {
  font-size: 13px;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(87,199,255,.2);
}

.profile-section footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1024px) {
  .profile-shell {
    grid-template-columns: 1fr;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-media-row {
    gap: 8px;
  }
  .media-tile {
    flex-basis: min(220px, 72vw);
  }
  .profile-nav {
    position: relative;
    top: 0;
    display: flex;
    flex-direction: column;
  }
/* overlays should NOT steal clicks */
.media-play,
.media-badge {
  pointer-events: none !important;
}

/* ensure the delete button can always be clicked */
.media-del {
  pointer-events: auto !important;
  position: absolute;
  z-index: 9999;
}

/* ensure tiles/rows accept clicks */
.profile-media-row,
.media-tile {
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}
}
