/* My Account: the Game Guide's layout (guide.css) and the home page's ornate panel and form
   controls (site.css), plus the account's own pieces. Three views on <main data-view>:
   loading (the sign-in panel, inert, while the session check runs), signed-out, signed-in. */

/* ---------- views ---------- */
/* The hidden attribute must win over the flex rows and the portrait image below. */
.account [hidden] { display: none !important; }
.account [data-panel="account"], .account .hero-in { display: none; }
.account[data-view="signed-in"] [data-panel="account"] { display: grid; }
.account[data-view="signed-in"] .hero-in { display: grid; }
.account[data-view="signed-in"] .hero-out, .account[data-view="signed-in"] [data-panel="signin"] { display: none; }
.account[data-view="loading"] [data-form="login"] { opacity: .55; pointer-events: none; }

/* ---------- hero ---------- */
/* One height for both views, so signing in or out never moves the page below it. */
.account-hero { min-height: 330px; }
.account-hero .hero-inner { min-height: 250px; display: flex; align-items: center; }
.hero-out { max-width: 640px; }
.hero-out h1 { margin-bottom: 12px; }
.hero-in { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 30px; width: 100%; }

/* The launcher's portrait ring: a dark band inside a gilded rim, a fine inner line. */
.portrait-ring {
  position: relative; width: 132px; height: 132px; border-radius: 50%; flex: none; padding: 5px;
  background: linear-gradient(135deg, #f1dca6 0%, #9a7a48 45%, #e3c68c 70%, #8a6326 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .7), 0 0 34px -6px rgba(231, 199, 124, .55), 0 14px 30px -12px rgba(0, 0, 0, .9);
}
.portrait-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #16203a, #05070c 70%); box-shadow: inset 0 0 0 3px #3a2e1c; }
.portrait-ring::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; border: 1px solid rgba(212, 188, 134, .55); pointer-events: none; }
.portrait-img { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.portrait-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 26px;
  font: 600 11px/1.35 var(--serif); letter-spacing: .12em; text-transform: uppercase; color: #ebdfb8; }
.portrait-ring.has-portrait .portrait-empty { display: none; }

.hero-id .eyebrow { margin-bottom: 6px; }
.hero-name { margin: 0 0 14px; font: 600 clamp(28px, 3.2vw, 44px)/1.1 var(--serif); letter-spacing: .06em; color: var(--gold-100);
  overflow-wrap: anywhere; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.hero-level { display: flex; align-items: center; gap: 16px; max-width: 520px; }
.level-badge { position: relative; flex: none; width: 58px; height: 58px; display: grid; place-items: center; align-content: center;
  border-radius: 50%; border: 1px solid rgba(231, 199, 124, .65); background: radial-gradient(circle at 50% 35%, #1b2b4f, #091228 75%);
  box-shadow: inset 0 0 0 3px rgba(8, 15, 36, .9), inset 0 0 0 4px rgba(231, 199, 124, .25), 0 0 18px -4px rgba(231, 199, 124, .5); }
.level-badge small { font: 600 8px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-300); }
.level-badge b { font: 600 22px/1.1 var(--serif); color: var(--gold-100); }
.level-track { flex: 1; min-width: 0; }
.bar-text { margin: 7px 0 0; font-size: 13px; color: var(--text); }
.dim { color: var(--text-dim); }
.hero-actions-in { align-self: start; padding-top: 6px; }
.hero-actions-in .btn { min-height: 42px; padding: 0 18px; font-size: 11px; }

/* ---------- progress bars ---------- */
.bar { position: relative; height: 8px; border-radius: 6px; background: rgba(3, 7, 18, .85); box-shadow: inset 0 0 0 1px rgba(142, 171, 222, .18); overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); border-radius: inherit;
  background: linear-gradient(90deg, #8a6326, #e7c77c 70%, #fff3cf); box-shadow: 0 0 12px rgba(231, 199, 124, .6); transition: width .8s var(--ease); }

/* ---------- notices ---------- */
.notice { margin: 26px 0 0; padding: 12px 16px; border-left: 2px solid var(--gold-500); background: rgba(20, 31, 52, .6); font-size: 14px; color: var(--text); }
.notice:empty { display: none; }
.notice.is-error { border-color: var(--bad); }
.notice-static { display: block; }

/* ---------- sign in ---------- */
.signin-band { padding: 56px 0 80px; }
.signin-panel { max-width: 560px; background: #0b1832; }
.signin-panel .lede { margin: -8px 0 22px; color: var(--text-dim); font-size: 15px; }
.signin-foot { margin: 16px 0 0; }
.signin-foot + .signin-foot { margin-top: 8px; font-size: 12px; }

/* ---------- forms (site.css .field controls) ---------- */
.acc-form { display: grid; gap: 14px; }
/* Error and status lines keep their space, so a message never pushes the page down. */
.acc-form .err, .acc-form .err:empty { display: block; min-height: 20px; margin: 4px 0 0; font-size: 13px; line-height: 20px; }
.acc-form .hint { min-height: 20px; line-height: 20px; margin: 4px 0 0; }
.acc-form .form-msg, .acc-form .form-msg:empty, .sessions-card .form-msg, .sessions-card .form-msg:empty { display: block; min-height: 24px; margin: 0; font-size: 14px; line-height: 1.5; }
.form-msg.is-ok { color: var(--ok); }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.form-row .btn { min-height: 46px; padding: 0 22px; font-size: 12px; }
.form-row .form-msg { flex: 1; min-width: 220px; }
.acc-card { position: relative; padding: 26px 28px; background: linear-gradient(145deg, #11223d, #0b1529); border: 1px solid var(--guide-border); border-radius: 4px; }
.acc-card::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; border-radius: 4px 0 0 4px; background: linear-gradient(180deg, var(--gold-300), var(--gold-700)); }
.acc-card .small { margin: 2px 0 0; font-size: 13px; line-height: 1.7; }
.acc-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.acc-form[aria-disabled="true"] .field { opacity: .55; }
.rename-status { margin: 0; padding: 10px 14px; font-size: 14px; color: var(--text); background: rgba(3, 7, 18, .5); border: 1px solid rgba(142, 171, 222, .14); border-radius: 3px; }
.rename-status.is-locked { border-color: rgba(231, 199, 124, .35); color: var(--gold-100); }
.sessions-card p { margin: 0 0 16px; font-size: 14px; line-height: 1.75; color: var(--text-dim); }
.sessions-card .form-row { margin: 0; }
.confirm-text { margin: 0 !important; color: var(--gold-100) !important; font: 600 14px/1.4 var(--serif) !important; letter-spacing: .06em; }

/* ---------- profile ---------- */
.acc-facts { margin: 6px 0 0; }
.acc-facts > div { grid-template-columns: 200px minmax(0, 1fr); }
.acc-facts > div::before { background: #050a18; }
.acc-facts dd { font-size: 15px; overflow-wrap: anywhere; }

/* ---------- class ranks ---------- */
.rank-grid { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rank-card { --rank: #b4c2d8; display: flex; gap: 14px; align-items: center; padding: 16px 16px 14px; min-height: 118px;
  background: linear-gradient(125deg, #101f3b, #0a1428); border: 1px solid rgba(142, 171, 222, .14); border-radius: 3px; }
.rank-card img { width: 56px; height: 56px; flex: none; mix-blend-mode: screen; }
.rank-card > div { flex: 1; min-width: 0; }
.rank-card h3 { font-size: 15px; margin: 0 0 3px; }
.rank-label { margin: 0 0 9px; font: 600 12px/1.3 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--rank); }
.rank-card .bar { height: 6px; }
.rank-card .bar > span { background: linear-gradient(90deg, color-mix(in srgb, var(--rank) 45%, #0a1428), var(--rank)); box-shadow: 0 0 10px color-mix(in srgb, var(--rank) 60%, transparent); }
.rank-detail { margin: 7px 0 0; font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; gap: 8px; }
.rank-detail b { color: var(--text); font-weight: 600; white-space: nowrap; }
/* The class's own Class Badge balance (guide wording), under its rank progress. */
.rank-badges { margin: 8px 0 0; padding-top: 7px; border-top: 1px solid rgba(142, 171, 222, .12); display: flex; justify-content: space-between;
  align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-dim); }
.rank-badges b { font: 600 15px/1 var(--serif); color: var(--gold-100); font-variant-numeric: tabular-nums; }
.rank-card[data-rank="veteran"] { --rank: #8fd0ff; }
.rank-card[data-rank="champion"] { --rank: #e8bf62; border-color: rgba(231, 199, 124, .4); box-shadow: 0 0 0 1px rgba(231, 199, 124, .08), 0 16px 40px -26px rgba(231, 199, 124, .6); }
.rank-card[data-rank="unavailable"] img { filter: grayscale(.8) brightness(.7); }
.rank-card[data-rank="unavailable"] .rank-label { color: #8d97b0; }

/* ---------- currencies ---------- */
.acc-currencies .currency-card { display: flex; align-items: center; gap: 20px; }
.acc-currencies img { width: 72px; height: 72px; flex: none; filter: drop-shadow(0 0 14px rgba(127, 196, 255, .35)); }
.acc-currencies .universal-card img { filter: drop-shadow(0 0 14px rgba(231, 199, 124, .45)); }
.acc-currencies h3 { margin: 0 0 4px; font-size: 18px; }
.acc-currencies .eyebrow { margin-bottom: 6px; }
.acc-currencies .balance { margin: 0 !important; font: 600 34px/1.1 var(--serif) !important; color: var(--gold-100) !important; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.acc-currencies .essence .balance { color: #bfe3ff !important; }

/* ---------- layout ---------- */
.account-layout { margin-top: 48px; }
.guide-section > p a, .note a { color: var(--gold-300); }

@media (max-width: 1130px) {
  .rank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .account[data-view="signed-in"] [data-panel="account"] { display: block; }
  .account-hero { min-height: 0; }
  .account-hero .hero-inner { min-height: 0; }
  .hero-in { grid-template-columns: auto minmax(0, 1fr); gap: 18px; }
  .portrait-ring { width: 92px; height: 92px; padding: 4px; }
  .portrait-ring::before { inset: 4px; }
  .portrait-ring::after { inset: 8px; }
  .portrait-empty { padding: 14px; font-size: 9px; }
  .hero-name { font-size: 26px; margin-bottom: 10px; }
  .hero-level { grid-column: 1 / -1; }
  .hero-id { display: contents; }
  .hero-in { row-gap: 0; }
  .portrait-ring { grid-row: span 2; }
  .hero-id > .eyebrow, .hero-id > .hero-name { grid-column: 2; }
  .hero-id > .eyebrow { align-self: end; margin-bottom: 4px; }
  .hero-id > .hero-name { align-self: start; margin: 0; }
  .hero-level { margin-top: 18px; }
  .hero-actions-in { margin-top: 18px; }
  .hero-in { grid-template-areas: none; }
  .hero-actions-in { grid-column: 1 / -1; padding: 0; }
  .hero-actions-in .btn { width: 100%; }
  .level-badge { width: 50px; height: 50px; }
  .level-badge b { font-size: 19px; }
  .account-layout { margin-top: 26px; }
  .signin-band { padding: 40px 0 56px; }
  .two-fields { grid-template-columns: 1fr; gap: 14px; }
  .two-fields .hint:not([id]) { display: none; }
  .rank-grid { grid-template-columns: 1fr; gap: 10px; }
  .rank-card { min-height: 0; }
  .acc-card { padding: 20px 18px; }
  .acc-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .acc-currencies .balance { font-size: 28px !important; }
  .form-row .btn { width: 100%; }
  .form-row .form-msg { min-width: 0; flex-basis: 100%; }
}
