/* client/profile/styles.css
 *
 * Styles for the player profile page. Matches the hub's playful, polished look:
 * gradient header, rounded cards, soft shadows, Poppins/Nunito fonts.
 */

:root {
  --green: #10b981;
  --green-deep: #059669;
  --bg: #f3f5fb;
  --card: #ffffff;
  --text: #16233a;
  --muted: #6b7a90;
  --line: #e9edf5;
  --hero-gradient: linear-gradient(120deg, #10b981 0%, #06b6d4 50%, #6366f1 100%);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(22, 35, 58, 0.08);
  --font-head: "Poppins", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* --- Top bar --- */
.p-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--hero-gradient);
  color: #fff;
  box-shadow: var(--shadow);
}
.p-hub {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
}
.p-hub:hover { background: rgba(255, 255, 255, 0.28); }
.p-brand { font-family: var(--font-head); font-weight: 800; }
.p-spacer { flex: 1; }

/* --- Layout --- */
.p-main {
  max-width: 640px;
  margin: 24px auto;
  padding: 0 16px;
}
.p-loading { color: var(--muted); text-align: center; }

.p-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* --- Header (avatar + name) --- */
.p-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}
.p-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2.2rem;
  background: var(--green);
  background-size: cover;
  background-position: center;
  box-shadow: 0 6px 18px rgba(22, 35, 58, 0.18);
}
.p-avatar-lock { background: #9aa7bd; font-size: 2rem; }
.p-name { font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; margin: 0; }
.p-username { color: var(--muted); margin: 2px 0 0; font-weight: 700; }

/* --- Stats row --- */
.p-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.p-stat {
  background: var(--bg);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}
.p-stat-num {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--green-deep);
}
.p-stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
}

.p-subhead {
  font-family: var(--font-head);
  font-size: 1rem;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Emoji icon shown before a section heading. */
.p-subhead-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* --- Dividers --- */
/* Bold, on-theme bar separating the two major sections (played vs created). */
.p-divider {
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: var(--hero-gradient);
  opacity: 0.7;
  margin: 24px 0 18px;
}
/* Softer-but-clear line separating the name/avatar header from the stats row. */
.p-divider-soft {
  height: 2px;
  background: #cdd6e6;
  opacity: 1;
  margin: 0 0 20px;
}

/* --- Per-game list --- */
.p-pergame { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.p-game-row {
  --accent: var(--green);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
}
.p-game-name { font-family: var(--font-head); font-weight: 700; }
/* When the name links to the game, keep the same look but hint it's clickable. */
a.p-game-name { color: inherit; text-decoration: none; }
a.p-game-name:hover { color: var(--accent); text-decoration: underline; }
.p-game-meta { color: var(--muted); font-size: 0.85rem; text-align: right; }
.p-game-meta b { color: var(--text); }
.p-empty { color: var(--muted); }

/* --- Pager (prev/next under a paged list) --- */
.p-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 8px;
}
.p-page-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font: 700 0.85rem var(--font-body);
  cursor: pointer;
}
.p-page-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green-deep); }
.p-page-btn:disabled { opacity: 0.4; cursor: default; }
.p-pageinfo { color: var(--muted); font-weight: 700; font-size: 0.85rem; }

/* --- Edit panel --- */
.p-edit {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.p-field {
  display: grid;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 14px;
}
.p-field input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 1rem var(--font-body);
  background: #fbfcfe;
}
.p-field input[type="text"]:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
/* Read-only value (e.g. the username) shown in the edit panel. */
.p-readonly {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
/* Small helper text under a field (e.g. allowed file types / max size). */
.p-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.p-toggle { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 16px; cursor: pointer; }
.p-toggle input { width: 18px; height: 18px; }
.p-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font: 800 0.95rem var(--font-body);
  color: #fff;
  background: var(--hero-gradient);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  cursor: pointer;
}
.p-btn:active { transform: scale(0.98); }
.p-msg { min-height: 1.2em; margin: 10px 0 0; font-weight: 700; font-size: 0.9rem; color: var(--green-deep); }

.p-error {
  text-align: center;
  color: #d6336c;
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

/* Default hover/press feedback for every link and button that doesn't already
   define its own. :where() = zero specificity, so existing component styles win. */
:where(a, button) { transition: filter 0.15s ease, opacity 0.15s ease, transform 0.1s ease; }
:where(button:not(:disabled)) { cursor: pointer; }
:where(a:hover) { opacity: 0.82; }
:where(button:not(:disabled):hover) { filter: brightness(1.08); }
:where(button:not(:disabled):active) { transform: translateY(1px); }
