/* DegenParty public landing page. Same palette family as the admin panel
   (deep navy + amber accent), tuned for a public, mobile-first single column. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Most colour tokens (--bg, --panel, --line, --text, --muted, --accent, --amber,
   --green, --red) now come from the shared /theme.css design system + Branding
   panel. Only the page-specific extras are kept here. */
:root {
  --accent-ink: var(--on-primary);  /* dark text that sits on the accent (buttons) */
  --discord:    #5865f2;            /* fixed brand colour, not themed */
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  /* extra top room so the logo clears the fixed Play/Admin/account controls */
  padding: 64px 16px 64px;
}

/* Scale the whole content down slightly (the page is px-based, so one zoom is
   cleaner than touching every size) - and a bit more on phones. */
.wrap { max-width: 560px; margin: 0 auto; zoom: 0.94; }
@media (max-width: 600px) { .wrap { zoom: 0.84; } }

.site-head { text-align: center; margin-bottom: 22px; }
.site-head h1 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: 1px; }
.site-head h1 span { color: var(--amber); }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.banner {
  border-radius: 10px; padding: 11px 14px; margin-bottom: 16px;
  font-size: 13px; border: 1px solid var(--line);
}
.banner.ok   { background: rgba(29,209,161,0.14); border-color: rgba(29,209,161,0.35); color: var(--green); }
.banner.err  { background: rgba(255,107,107,0.14); border-color: rgba(255,107,107,0.35); color: var(--red); }
.banner.info { background: var(--soft);  border-color: var(--line);  color: var(--text-body); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px;
  margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 7px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.card h3 i { font-size: 16px; color: var(--brand-accent); }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.muted.small { font-size: 11px; margin: 0; }

/* Hero (logged-out) */
.hero { text-align: center; padding: 32px 22px; }
.hero-icon { font-size: 46px; color: var(--amber); }
.hero h2 { margin: 12px 0 8px; font-size: 22px; }
.hero p { margin: 0 auto 20px; max-width: 380px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--soft-strong); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; text-decoration: none; transition: background 0.12s, transform 0.05s;
}
.btn:hover { background: var(--soft-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--button); color: var(--on-button); border-color: transparent; font-weight: 800; }
.btn-primary:hover { background: var(--button-hover); }
.btn-ghost { background: transparent; }
.btn-discord {
  background: var(--discord); border-color: transparent; color: #fff;
  font-size: 15px; padding: 12px 22px;
}
.btn-discord:hover { background: #6c78f5; }

/* "You" card - everything centred: avatar on top, name, the linked-account
   list, then a divider and a centred row of action buttons. One layout serves
   both non-staff (just Log out) and staff (Play / Admin / Log out). */
.you { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; }
.you-head { display: flex; flex-direction: row; align-items: center; gap: 18px; text-align: left; }
.you-av {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  background: var(--raised); border: 1px solid var(--line); flex: 0 0 auto;
}
.you-meta { min-width: 0; flex: 1 1 auto; }
.you-name { font-weight: 800; font-size: 22px; margin-bottom: 10px; }
/* Identity rows: a centred 3-column grid (icon | label | value) so the icons,
   labels and values each line up in their own straight column even though the
   whole block is centred in the card. */
.you-ids { display: grid; grid-template-columns: auto auto auto; gap: 5px 8px;
  justify-content: start; align-items: center; }
.you-id-ic { color: var(--accent); font-size: 14px; text-align: center; }
.you-id-label { font-size: 12px; color: var(--text-faint); text-align: left; }
.you-id-val { font-size: 13px; color: var(--text); font-weight: 600; text-align: left; word-break: break-all; }
/* On narrow phones, stack the avatar above the identity again so nothing cramps. */
@media (max-width: 440px) {
  .you-head { flex-direction: column; align-items: center; text-align: center; }
  .you-ids { justify-content: center; }
}
/* Divider + centred button row below the identity. */
.you-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  width: 100%; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.you-actions .btn { flex: 0 0 auto; }

/* Progression summary - rank, XP-to-next bar, Degen Coins, collection count. */
.progress {
  width: 100%; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px;
}
.prog-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prog-rank { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.prog-rank i { font-size: 17px; }
.prog-rank-img { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; }
.prog-coins { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px; color: var(--accent); }
.prog-bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.prog-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 0.4s ease; }
.prog-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.prog-xp { font-weight: 700; font-size: 13px; color: var(--text); }
.prog-items { display: flex; align-items: center; gap: 6px; justify-content: center; }
.prog-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 2px; }
.prog-stat { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text); }
.prog-stat i { color: var(--accent); font-size: 14px; }
.prog-stat b { font-weight: 800; }

/* Top-right floating bar - staff-only mod pills (Play/Admin) + the account menu.
   Kept off the profile card so the card reads the same for every viewer. */
#topRight {
  position: fixed; top: 12px; right: 16px; z-index: 50;
  display: flex; gap: 8px; align-items: center;
}
#modTools { display: flex; gap: 8px; align-items: center; }
#modTools .modpill {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
  padding: 6px 12px; border-radius: 14px;
  text-decoration: none; cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
#modTools .modpill i { font-size: 13px; }
#modTools .modpill:hover { color: var(--text); border-color: var(--accent); }
#modTools #playLink { color: var(--accent); }   /* primary action gets the accent */

/* Account menu - avatar + name pill that opens a dropdown (Log out today, room
   for more later). Opens on hover (desktop) and on click/tap (touch, via .open). */
.account { position: relative; }
.account-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface, #1b2030); border: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 700;
  padding: 4px 11px 4px 4px; border-radius: 22px; cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.account-trigger:hover { border-color: var(--accent); }
.account-av {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  background: var(--soft, #2a2f3a); flex: 0 0 auto;
}
.account-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-caret { font-size: 12px; color: var(--muted); transition: transform 0.15s; }
.account.open .account-caret { transform: rotate(180deg); }
/* Invisible bridge so moving the cursor from the pill into the dropdown doesn't
   cross a dead gap and close the hover menu. */
.account::after { content: ''; position: absolute; top: 100%; right: 0; width: 100%; height: 8px; }
.account-drop {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 170px;
  background: var(--surface, #1b2030); border: 1px solid var(--line);
  border-radius: 11px; padding: 6px; display: none;
  box-shadow: 0 14px 34px rgba(0,0,0,0.45);
}
.account:hover .account-drop, .account.open .account-drop { display: block; }
.account-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: transparent; border: none; color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; text-align: left;
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
}
.account-item:hover { background: var(--soft, #2a2f3a); }
.account-item i { font-size: 15px; color: var(--muted); }

/* Inline form rows */
.row-form { display: flex; gap: 8px; }
.row-form input {
  flex: 1 1 auto; min-width: 0;
  background: var(--field); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.row-form input:focus { outline: none; border-color: rgba(198,241,53,0.6); }
.field-note { font-size: 12px; margin-top: 8px; min-height: 16px; }
.field-note.ok  { color: var(--green); }
.field-note.err { color: var(--red); }
.field-note.info { color: var(--muted); }

/* Avatar chooser */
.avatar-choices { display: flex; gap: 12px; margin-bottom: 14px; }
.avatar-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; transition: border-color 0.12s, background 0.12s;
  font-size: 12px; color: var(--muted);
}
.avatar-opt:hover { background: var(--soft); }
.avatar-opt.active { border-color: var(--accent); background: var(--soft); color: var(--text); }
.avatar-opt.disabled { opacity: 0.45; cursor: not-allowed; }
.avatar-opt input { display: none; }
.opt-av {
  width: 76px; height: 76px; border-radius: 12px; object-fit: cover;
  background: var(--raised); border: 1px solid var(--line);
}
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Sample (DiceBear) avatar picker - a responsive grid of clickable thumbnails. */
.sample-row { margin-top: 14px; }
.sample-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sample-shuffle {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  padding: 5px 10px; border-radius: 12px; cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.sample-shuffle:hover { color: var(--text); border-color: var(--accent); }
.sample-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.sample-av {
  padding: 0; border: 2px solid var(--line); border-radius: 12px;
  background: var(--soft, #2a2f3a); cursor: pointer; overflow: hidden;
  aspect-ratio: 1; transition: border-color 0.12s, transform 0.08s;
}
.sample-av img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sample-av:hover { border-color: var(--accent); transform: translateY(-1px); }
.sample-av.active { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.sample-head-btns { display: flex; gap: 6px; }
.style-seg { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.style-seg button {
  background: var(--soft, #2a2f3a); border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  padding: 5px 11px; border-radius: 10px; cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.style-seg button:hover { color: var(--text); }
.style-seg button.on { background: var(--accent); color: #15181f; border-color: transparent; }

/* Avatar builder modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 16px;
  background: rgba(0, 0, 0, 0.62); display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--surface, #1b2030); border: 1px solid var(--line); border-radius: 16px;
  width: 100%; max-width: 580px; max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.modal-close { background: transparent; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; display: flex; gap: 20px; flex-wrap: wrap; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.builder-preview { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 0 0 auto; }
.builder-av { width: 140px; height: 140px; border-radius: 50%; background: var(--soft, #2a2f3a); border: 3px solid var(--accent); object-fit: cover; }
.builder-opts { flex: 1 1 250px; min-width: 230px; display: grid; gap: 11px; align-content: start; }
.builder-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.builder-field > span { font-weight: 700; }
.builder-field select {
  background: var(--field); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px;
}
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; transition: transform 0.08s; }
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.swatch-trans { background: repeating-conic-gradient(#888 0% 25%, #ccc 0% 50%) 50% / 12px 12px !important; }

/* always-on offline games hub */
.hub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.hub-head h2 { margin: 0; font-size: 18px; }
.live-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
.live-pill i { font-size: 8px; }
.live-pill.on { background: rgba(29,209,161,0.18); color: var(--success, #1dd1a1); }
.live-pill.on i { animation: livePulse 1.3s infinite; }
.live-pill.off { background: var(--soft-strong, #2a3050); color: var(--text-muted); }
@keyframes livePulse { 50% { opacity: 0.3; } }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.hub-card { display: block; background: var(--raised); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; text-decoration: none; color: var(--text-body); transition: transform 0.15s, border-color 0.15s; }
.hub-card:hover { border-color: var(--brand-accent); transform: translateY(-2px); }
.hub-card > i { font-size: 26px; color: var(--brand-accent); }
.hub-card-t { font-weight: 800; font-size: 15px; margin-top: 8px; }
.hub-card-s { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
@media (max-width: 520px) { .hub-grid { grid-template-columns: 1fr; } }

/* --- avatar crop editor ---------------------------------------------------- */
.cropper {
  position: relative; width: 300px; max-width: 100%; aspect-ratio: 1 / 1;
  margin: 0 auto 14px; touch-action: none;   /* don't scroll the page while dragging */
}
.crop-canvas {
  display: block; width: 100%; height: 100%; border-radius: 14px;
  background: #0a0e1a; cursor: grab; touch-action: none;
}
.crop-canvas:active { cursor: grabbing; }
/* circular guide - dims outside the avatar circle so framing is obvious */
.crop-ring {
  position: absolute; inset: 6%; border-radius: 50%; pointer-events: none;
  border: 2px dashed rgba(255,255,255,0.6);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.42);
}
.crop-zoom { display: flex; align-items: center; gap: 10px; max-width: 300px; margin: 0 auto 8px; }
.crop-zoom i { color: var(--text-muted); font-size: 18px; }
.crop-zoom input[type="range"] { flex: 1; accent-color: var(--brand-accent); }
