/* ================= 👤 PROFILE PAGE (profile.html + profile.js) =================
   Uses the portal's own look (portal.css) and follows the portal themes (themes.css): colours come from the theme values. */
.pf { display: grid; gap: 16px; }
.pf .panel { padding: 18px 20px; }
.pf h1 { margin: 0; font-size: 30px; color: var(--t-title, #fff); overflow-wrap: anywhere; }
.pf h3 { margin: 0 0 6px; font-size: 18px; color: var(--t-title, #fff); }
.pf h4 { margin: 16px 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pf .muted { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.pf .empty { padding: 30px 0; }

/* the top card: your Pal, name, username and numbers */
.pf-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pf-pal { flex: none; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--t-soft, rgba(0,240,255,.07)); border: 2px solid var(--t-line, var(--cyan)); box-shadow: var(--t-on-glow, 0 0 18px rgba(0,240,255,.35)); color: var(--t-ink, #cfe9ff); }
.pf-pal img { width: 96%; height: 96%; object-fit: contain; } /* Nate 2026-11-13: 20% bigger (was 80%) */
.pf-pal svg { width: 60%; height: 60%; }
.pf-who { flex: 1 1 240px; min-width: 0; }
.pf-user { margin: 2px 0 10px; color: var(--muted); }
.pf-user b { color: var(--text); }
/* the three big numbers: tokens, Pals owned (links to the Pals page in Blakeit) and packs opened */
.pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); gap: 10px; }
.pf-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 9px; text-decoration: none; text-align: center; color: var(--text);
  border-radius: var(--t-r, 14px); background: var(--t-soft, rgba(0,240,255,.07)); border: var(--t-bw, 1px) solid var(--t-line, rgba(0,240,255,.35)); }
.pf-stat > span, .pf-stat > .tok { font-size: 24px; line-height: 1; }
.pf-stat > .tok { width: 26px; height: 26px; margin: 0; }
.pf-stat b { font: 900 26px/1.15 var(--t-hfont, 'Orbitron'), 'Nunito', sans-serif; color: var(--t-title, #fff); }
.pf-stat:first-child b { color: var(--t-coin, var(--yellow)); }
.pf-stat small { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .03em; }
.pf-stat.link { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.pf-stat.link:hover, .pf-stat.link:focus-visible { transform: translateY(-2px); box-shadow: var(--t-on-glow, 0 0 14px rgba(0,240,255,.45)); border-color: var(--t-on, var(--cyan)); outline: none; }
.pf-stat.link small { color: var(--t-on, var(--cyan)); }
@media (max-width: 420px) { .pf-stats { gap: 6px; } .pf-stat b { font-size: 21px; } .pf-stat > span { font-size: 20px; } }
.pf-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* Nate 2026-11-21 ("more symmetrical… uses the full width"): the page is wider than the other portal pages and the boxes flow into
   balanced columns (3 on wide screens, 2 on smaller ones, 1 on phones): pfBalance() in profile.js measures every box and picks the
   split where the columns end closest together (each column keeps the boxes' usual order), again on resize and when Kid mode changes */
body.pf-page .wrap { max-width: 1440px; }
.pf-grid { display: grid; grid-template-columns: repeat(var(--pf-n, 2), minmax(0, 1fr)); gap: 16px; align-items: start; }
.pf-col { display: grid; gap: 16px; min-width: 0; align-content: start; }
.pf-col:empty { display: none; }
.pf-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .pf-grid { grid-template-columns: 1fr; } .pf-hero { justify-content: center; text-align: center; } .pf-stats { justify-content: center; } }

/* rows of buttons, text boxes */
.pf-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pf-row input { flex: 1 1 160px; min-width: 0; }
/* text boxes + every button follow the chosen portal theme (its --t- colours; Neon Grid = the fallbacks) */
.pf input:not([type=file]):not([hidden]), .pf textarea { font: 700 16px 'Nunito', sans-serif; color: var(--text); background: var(--t-soft, rgba(255,255,255,.06));
  border: var(--t-bw, 1px) solid var(--t-line, rgba(0,240,255,.45)); border-radius: var(--t-r, 10px); padding: 10px 12px; outline: none; }
html[data-theme="vector"] .pf input:not([type=file]), html[data-theme="vector"] .pf textarea { font-family: 'Share Tech Mono', monospace; }
.pf input:focus, .pf textarea:focus { border-color: var(--t-on, var(--yellow)); box-shadow: var(--t-on-glow, 0 0 10px rgba(245,255,59,.3)); }
.pf input:disabled { opacity: .55; }
.pf .btn, .pf-box .btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pf .btn:disabled, .pf-box .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
label.btn { cursor: pointer; }
.btn.red { background: var(--red); color: #fff; }
/* the quieter buttons (Log out, Export, Import, Cancel): the theme's own outlined look */
.pf .btn.ghost, .pf-box .btn.ghost { background: var(--t-soft, rgba(0,240,255,.07)); color: var(--t-ink, #cfe9ff); border: var(--t-bw, 1px) solid var(--t-line, rgba(0,240,255,.4)); box-shadow: none; }
.pf .btn.ghost:hover:not(:disabled), .pf-box .btn.ghost:hover:not(:disabled) { background: var(--t-hover, rgba(0,240,255,.16)); color: var(--t-ink, #fff); }
html[data-theme="pixel"] .pf .btn.ghost, html[data-theme="pixel"] .pf-box .btn.ghost { box-shadow: 4px 4px 0 #000; }
html[data-theme="vector"] .btn.red { background: transparent; color: #ff4d4d; box-shadow: 0 0 0 1px #ff4d4d, 0 0 10px rgba(255,77,77,.35); }
html[data-theme="vector"] .btn.red:hover { background: #ff4d4d; color: #000; }
html[data-theme="vector"] .btn.green:hover { color: #001a07; }
/* the fold-outs and the file picker */
.pf-more summary:hover { color: var(--t-on, var(--yellow)); }

.pf-msg { margin: 10px 0 0; font-size: 14px; line-height: 1.4; color: var(--text); }
.pf-msg small { display: block; margin-top: 4px; color: var(--muted); }
.pf-warn { margin: 12px 0 0; padding: 8px 12px; border-radius: var(--t-r, 10px); font-size: 14px; color: var(--text); background: rgba(255,200,0,.1); border: 1px solid var(--yellow); }
.pf-status { display: inline-block; margin: 0 0 10px; padding: 7px 12px; border-radius: var(--t-r, 10px); font-size: 14px; color: var(--text); background: var(--t-soft, rgba(255,255,255,.06)); border: 1px solid var(--t-line, rgba(0,240,255,.3)); }
.pf-status.ok { border-color: var(--green); }

/* account: username, and the fold-out password form */
.pf-acc { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 4px 0 14px; font-size: 14px; }
.pf-acc span { color: var(--muted); } .pf-acc b { color: var(--text); overflow-wrap: anywhere; }
.pf-more { margin-top: 12px; border-top: 1px solid var(--t-line, rgba(0,240,255,.2)); padding-top: 10px; }
.pf-more summary { cursor: pointer; color: var(--text); font-weight: 800; font-family: var(--t-hfont, 'Nunito'), 'Nunito', sans-serif; }
.pf-form { display: grid; gap: 8px; margin-top: 10px; }
.pf-form .btn { justify-self: start; }

/* the theme picker (the same 4 choices that were in the account menu) */
.pf .th-pick { border-bottom: 0; padding-bottom: 0; }
.pf .th-row { max-width: 420px; }
.pf .th-opt { font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border-radius: var(--t-r, 10px);
  background: var(--t-soft, rgba(0,240,255,.07)); border: 1px solid var(--t-line, rgba(0,240,255,.35)); color: var(--t-ink, #cfe9ff); }
.pf .th-opt:hover { background: var(--t-hover, rgba(0,240,255,.16)); }
.pf .th-label { font-size: 13px; }

/* pop-ups: confirm + the backup list */
.pf-box { width: min(480px, 100%); margin-block: auto; color: var(--text); }
.pf-box h2 { margin: 0 0 6px; text-align: center; color: var(--t-title, #fff); }
.pf-box .muted { color: var(--muted); font-size: 14px; line-height: 1.45; }
.pf-q { margin: 4px 0 14px; line-height: 1.5; font-size: 16px; }
.pf-err { color: var(--yellow); margin: 0 0 10px; }
.pf-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.pf-bks { display: grid; gap: 8px; max-height: min(52vh, 420px); overflow-y: auto; padding-right: 2px; }
.pf-bk { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--t-r, 10px); background: rgba(255,255,255,.05); }
.pf-bk span { min-width: 0; } .pf-bk b { display: block; font-size: 14px; } .pf-bk small { display: block; color: var(--muted); font-size: 12px; }
.pf-bk .btn { padding: 7px 12px; font-size: 13px; flex: none; }

.pf-out { text-align: center; max-width: 460px; margin: 20px auto; }
.pf-big { font-size: 56px; }

/* 💬 suggestion box */
.pf-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pf-kind { font: 800 14px 'Nunito', sans-serif; cursor: pointer; padding: 7px 12px; border-radius: var(--t-r, 999px); color: var(--t-ink, #cfe9ff);
  background: var(--t-soft, rgba(0,240,255,.07)); border: var(--t-bw, 1px) solid var(--t-line, rgba(0,240,255,.35)); }
html[data-theme="jackpot"] .pf-kind { border-radius: 999px; }
.pf-kind:hover { background: var(--t-hover, rgba(0,240,255,.16)); }
.pf-kind[aria-checked="true"] { background: var(--t-on, var(--yellow)); border-color: var(--t-on, var(--yellow)); color: var(--t-on-ink, #05010c); box-shadow: var(--t-on-glow, 0 0 14px rgba(245,255,59,.5)); }
.pf textarea { display: block; width: 100%; resize: vertical; min-height: 90px; line-height: 1.4; }
.pf-sg-foot { margin-top: 10px; justify-content: space-between; }
.pf-sg-foot small { color: var(--muted); font-size: 12px; }

/* ---------- 🧒 Kid mode box (Nate 2026-11-21; profile.js pfKid) ---------- */
.pf-kid h4 { margin: 10px 0 6px; }
.pf-kid-cols { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.pf-kid-col { flex: 1 1 120px; padding: 12px 10px; border-radius: 16px; font: 800 16px 'Nunito', sans-serif; cursor: pointer; border: 3px solid transparent; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pf-kid-col.pink { background: linear-gradient(160deg, #ff9ad0, #ff6fb4); } .pf-kid-col.blue { background: linear-gradient(160deg, #8ac4ff, #4a9cff); }
.pf-kid-col[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--yellow, #ffd23f), 0 4px 12px rgba(0,0,0,.2); }
.pf-pin { font-size: 26px !important; letter-spacing: .4em; text-align: center; max-width: 180px; margin: 0 auto 8px; display: block; }
