/* Player account pages. Colours, fonts and controls copied from the homepage
   (index.html) so the pages look like part of the same site. */

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

:root {
  --bg:       #0f0e0c;
  --bg-deep:  #060606;
  --card:     #1a1814;
  --line:     #2a2620;
  --line2:    #2f2a22;
  --text:     #ede6d6;
  --head:     #f6efe0;
  --muted:    #b9b0a0;
  --dim:      #8f8778;
  --gold:     #e0b85c;
  --gold-hi:  #f3d48a;
  --ink:      #15130f;
  --error:    #e8735f;
  --ok:       #7fd1a0;
  --radius:   10px;
}

body {
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }

/* ── Nav (same bar, links and gold button as the homepage) ── */
.nav { position: sticky; top: 0; z-index: 40; background: var(--bg-deep); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; flex-shrink: 0; }
.brand img { height: 56px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.nav-links a:hover { color: var(--gold); }
/* The gold button. Capped at the width of "Register / Login" (160px), so a
   long username is cut with an ellipsis instead of widening the nav. */
.nav-links a.nav-cta {
  background: var(--gold); color: var(--ink); font-weight: 700; padding: 11px 22px; border-radius: 6px;
  min-height: 44px; display: inline-flex; align-items: center; max-width: 160px;
}
.nav-links a.nav-cta:hover { color: var(--ink); filter: brightness(1.08); }
.nav-links a.nav-play { gap: 8px; max-width: none; margin-right: -14px; }
@media (max-width: 1080px) { .nav-links a.nav-play { margin-right: 0; } }
.nav-cta-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger {
  display: none; margin-left: auto; background: none; border: 1px solid #3a342a; border-radius: 7px;
  width: 44px; height: 44px; color: var(--gold); cursor: pointer; align-items: center; justify-content: center;
}

/* Burger menu below 1080px. The full row needs 1059px (measured with a
   30-character username in the gold button). */
@media (max-width: 1080px) {
  .burger { display: inline-flex; }
  .nav-inner { position: relative; padding: 8px 20px; }
  .brand img { height: 46px; max-width: 160px; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 0; background: #0c0c0c; border-bottom: 1px solid var(--line); padding: 8px 20px 20px; margin-left: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 2px; border-bottom: 1px solid #1c1a15; }
  .nav-links a.nav-cta { justify-content: center; margin-top: 14px; border-bottom: none; max-width: none; }
}

/* ── Page ── */
.acct { max-width: 480px; margin: 0 auto; padding: 48px 16px 64px; }
.card {
  background: var(--card); border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 32px; display: flex; flex-direction: column; gap: 16px;
}
.eyebrow {
  font-family: 'Oswald', sans-serif; font-size: 15px;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold);
}
h1 {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 32px; line-height: 1.1;
  text-transform: uppercase; color: var(--head);
}
.lead { color: var(--muted); font-size: 16px; }
.small { font-size: 15px; color: var(--muted); text-align: center; }

/* ── Form fields ── */
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field .opt { font-weight: 400; color: var(--dim); }
.field input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--bg); border: 1px solid #3a342a; border-radius: 8px;
  color: var(--text); font-family: inherit; font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,184,92,0.18); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field input[type="file"] { padding: 8px; font-size: 15px; color: var(--muted); cursor: pointer; }
.field input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 14px; border-radius: 6px; cursor: pointer;
  background: none; border: 1px solid #5a5143; color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600;
}
.field input[type="file"]::file-selector-button:hover { color: var(--gold); border-color: var(--gold); }
.field .hint { font-size: 13px; color: var(--dim); margin-top: 4px; }
.field .err { font-size: 14px; font-weight: 600; color: var(--error); margin-top: 4px; }
.section-label {
  font-family: 'Oswald', sans-serif; font-size: 14px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim); border-top: 1px solid var(--line); padding-top: 14px;
}

/* ── Messages ── */
.msg { padding: 12px 14px; border-radius: 8px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.msg-error { color: var(--error); background: rgba(232,115,95,0.08); border: 1px solid rgba(232,115,95,0.35); }
.msg-ok { color: var(--ok); background: rgba(127,209,160,0.08); border: 1px solid rgba(127,209,160,0.35); }

/* ── Buttons (same as the homepage) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 14px 32px; border-radius: 6px;
  font-family: inherit; font-size: 18px; font-weight: 700;
  text-decoration: none; cursor: pointer; border: none;
  transition: filter 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { color: var(--ink); filter: brightness(1.08); }
.btn-ghost { background: none; border: 1px solid #5a5143; color: var(--text); font-weight: 600; }
.btn-ghost:hover { color: var(--gold); border-color: var(--gold); }
.card .btn, .card form .btn { width: 100%; }
.card form { display: flex; flex-direction: column; gap: 16px; }

/* ── Profile: avatar and stats ── */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head > div { min-width: 0; }
.profile-head h1 { overflow-wrap: anywhere; }
.avatar {
  width: 96px; height: 96px; flex-shrink: 0; border-radius: 50%;
  object-fit: cover; background: var(--line); border: 2px solid var(--line2); display: block;
}
.member-since { font-size: 15px; color: var(--muted); margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats > div {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 10px; text-align: center;
}
.stats dt { font-size: 13px; line-height: 1.3; color: var(--dim); }
.stats dd {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 26px; line-height: 1.2;
  color: var(--head); margin-top: 4px;
}
/* Finishing places: always one row of four, phones included. */
.stats-h {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 14px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: -6px;
}
.stats.stats-places { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats-places > div { padding: 10px 4px; }
.stats + .stats { margin-top: 10px; }

/* ── Players directory (players.php) ── */
.acct.acct-wide { max-width: 1180px; padding-left: 24px; padding-right: 24px; }
.pl-head { margin-bottom: 20px; }
.pl-empty { max-width: 480px; }
.pl-tools { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.pl-tools .field:first-child { flex: 1 1 260px; max-width: 420px; }
.pl-tools .field:last-child { flex: 0 1 220px; }
.field select {
  width: 100%; min-height: 48px; padding: 12px 40px 12px 14px;
  background: var(--bg); border: 1px solid #3a342a; border-radius: 8px;
  color: var(--text); font-family: inherit; font-size: 16px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,184,92,0.18); }
.pl-count { font-size: 15px; color: var(--dim); margin: 14px 0 12px; }
.pl-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pl-grid > li[hidden] { display: none; }
.pl-card {
  height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 20px 14px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: border-color 0.15s;
}
.pl-card:hover { color: var(--text); border-color: var(--gold); }
.pl-card:hover .pl-name { color: var(--gold); }
.pl-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: var(--line); border: 2px solid var(--line2); display: block;
}
.pl-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 20px; line-height: 1.2; color: var(--head);
}
.pl-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; font-size: 14px; color: var(--muted); }
.pl-stats b { color: var(--head); font-weight: 700; }
.pl-none { font-size: 14px; color: var(--dim); }
.pl-stats.pl-online { margin-top: 2px; }
.pl-online-tag { font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold); border-radius: 4px; padding: 0 6px; }
.pl-section-h { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin: 8px 0 12px; }
.pl-boards + .pl-section-h { margin-top: 32px; }
.pl-section-note { font-size: 14px; color: var(--dim); margin: -6px 0 12px; }
.pl-nomatch { color: var(--muted); padding: 24px 0; }

/* Players / Stat Leaders tabs (links, one page each). */
.pl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line2); margin-bottom: 24px; overflow-x: auto; }
.pl-tab {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; margin-bottom: -1px;
  border-bottom: 3px solid transparent; color: var(--muted); text-decoration: none; white-space: nowrap;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase;
}
.pl-tab:hover { color: var(--gold); }
.pl-tab[aria-current="page"] { color: var(--head); border-bottom-color: var(--gold); }
.pl-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 4px; }

/* Stat Leaders: four boards, two across, one on phones. Rows ranked 6-10
   carry .is-extra and hide while the Top 5 view is chosen. */
.pl-top-form { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.pl-top-form .field { flex: 0 1 200px; }
.pl-boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pl-boards[data-top="5"] .is-extra { display: none; }
.pl-board { background: var(--card); border: 1px solid var(--line2); border-radius: var(--radius); padding: 20px 20px 12px; min-width: 0; }
.pl-board-title {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 22px; line-height: 1.2;
  text-transform: uppercase; color: var(--head);
}
.pl-board-note { font-size: 14px; color: var(--dim); margin: 2px 0 10px; }
.pl-board-list { list-style: none; margin: 0; padding: 0; }
.pl-board-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.pl-board-row:first-child { border-top: none; }
.pl-rank {
  width: 28px; flex-shrink: 0; text-align: center;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 18px; color: var(--gold);
}
.pl-board-player { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.pl-board-player:hover { color: var(--gold); }
.pl-board-avatar {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; object-fit: cover;
  background: var(--line); border: 2px solid var(--line2); display: block;
}
.pl-board-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pl-board-value { flex-shrink: 0; font-size: 14px; color: var(--muted); white-space: nowrap; }
.pl-board-value b { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 18px; color: var(--head); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

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

/* Honeypot field: off-screen for people, still an ordinary field to bots. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 520px) {
  .acct { padding: 28px 16px 48px; }
  .card { padding: 24px 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .avatar { width: 72px; height: 72px; }
  .acct.acct-wide { padding-left: 16px; padding-right: 16px; }
  .pl-tools .field:first-child, .pl-tools .field:last-child { flex: 1 1 100%; max-width: none; }
  .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pl-card { padding: 16px 10px; }
  .pl-avatar { width: 60px; height: 60px; }
  .pl-name { font-size: 18px; }
}
@media (max-width: 340px) {
  .pl-grid { grid-template-columns: minmax(0, 1fr); }
}
