/* The menu bar on every launcher page, and the dashboard and profile pages. Theme roles only, from tokens.css or the
   player's theme, so the bar, the hero and the cards change with everything else. */

/* The bar: the games and your dashboard as links, then you. On a phone the links stay, short. */
.menu-bar ul { display: flex; align-items: center; gap: .2rem clamp(.5rem, 2.2vw, 1.4rem); }
.menu-bar a { display: inline-block; padding: .45rem .2rem; font: 800 .95rem/1.2 var(--sw-display); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; color: var(--sw-muted); border-bottom: 3px solid transparent; }
.menu-bar a:hover { color: var(--sw-on-surface); }
.menu-bar a[aria-current="page"] { color: var(--sw-on-surface); border-bottom-color: var(--sw-action); }
.menu-bar [hidden], .me-menu [hidden] { display: none; }
#menu-session { display: flex; align-items: center; gap: .48rem; }
.me-status { color: var(--sw-muted); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.me-status[data-session="guest"] { color: var(--sw-caution); }
.me-status[data-session="signed"] { color: var(--sw-positive); }
#menu-login, #menu-register { color: var(--sw-on-surface); }
#menu-register { color: var(--sw-action); }
.me-button { display: inline-flex; align-items: center; gap: .55rem; max-width: min(16rem, 44vw); min-height: 2.75rem; padding: .2rem .8rem .2rem .25rem;
  border: 1.5px solid var(--sw-border); border-radius: 999px; background: var(--sw-raised); color: var(--sw-on-raised); cursor: pointer;
  transition: border-color var(--sw-quick), box-shadow var(--sw-quick); }
.me-button:hover, .me-button:focus-visible { border-color: var(--sw-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw-accent) 25%, transparent); }
.me-picture .avatar { --avatar-size: 2rem; box-shadow: 0 0 0 2px var(--sw-accent); }
.me-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.me-menu { inset: 4.6rem max(clamp(1rem, 4vw, 3.5rem), calc((100vw - 88rem) / 2 + 3.5rem)) auto auto; }
.me-links { display: grid; margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--sw-border); }
.me-links a { display: block; padding: .5rem .1rem; font-weight: 600; text-decoration: none; }
.me-links a:hover { color: var(--sw-action); }
.me-links a[aria-current="page"] { color: var(--sw-action); }

@media (max-width: 34rem) {
  .top { position: relative; flex-wrap: wrap; row-gap: .65rem; }
  .menu-bar { flex-basis: 100%; max-width: 100%; }
  .menu-bar ul { flex-wrap: wrap; gap: .2rem .65rem; }
  .menu-bar a { letter-spacing: .025em; font-size: .8rem; }
  #menu-session { position: absolute; top: .6rem; inset-inline-end: max(1rem, env(safe-area-inset-right)); gap: .32rem; }
  .me-name { display: none; }
  .me-button { padding-inline-end: .25rem; }
}

/* The dashboard and a profile: the hero, then cards. */
.profile { max-width: 60rem; display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); padding-block: .4rem 2.5rem; }
.profile-hero { position: relative; overflow: hidden; display: grid; gap: 1.3rem; padding: clamp(1.2rem, 3.5vw, 2.2rem);
  border: 1px solid var(--sw-border); border-radius: calc(var(--sw-radius) * 1.4); color: var(--sw-on-raised);
  background:
    radial-gradient(28rem 16rem at 100% 0%, color-mix(in srgb, var(--sw-accent) 30%, transparent), transparent 70%),
    radial-gradient(24rem 14rem at 0% 100%, color-mix(in srgb, var(--sw-action) 20%, transparent), transparent 70%),
    var(--sw-raised);
  box-shadow: var(--shadow); }
.profile-who { display: flex; align-items: center; gap: clamp(1rem, 3.2vw, 1.8rem); }
.profile-words { display: grid; gap: .35rem; min-width: 0; }
.eyebrow { font: 800 .82rem/1 var(--sw-display); letter-spacing: .16em; text-transform: uppercase; color: var(--sw-accent); }
.profile-hero h1 { font: 900 clamp(2.1rem, 6vw, 3.6rem)/1 var(--sw-display); letter-spacing: -.01em; text-transform: uppercase; overflow-wrap: anywhere; }
/* The avatar in a ring of the theme's two bright colors. On the dashboard the ring is a button with a pencil. */
.profile-ring { position: relative; flex: none; display: grid; place-items: center; padding: 5px; border: 0; border-radius: 50%; line-height: 0;
  background: conic-gradient(from 210deg, var(--sw-action), var(--sw-accent), var(--sw-action)); box-shadow: 0 0 26px var(--glow); }
button.profile-ring { cursor: pointer; }
button.profile-ring:hover { box-shadow: 0 0 34px var(--glow), 0 0 0 3px var(--sw-focus); }
.profile-avatar { --avatar-size: clamp(4.8rem, 15vw, 7rem); box-shadow: 0 0 0 4px var(--sw-raised); }
.ring-edit { position: absolute; right: 2px; bottom: 2px; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--sw-action); color: var(--sw-on-action); font-size: 1rem; line-height: 1; box-shadow: 0 0 0 3px var(--sw-raised); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin-top: .2rem; }
.chip-tag { padding: .15rem .65rem; border-radius: 999px; background: color-mix(in srgb, var(--sw-accent) 22%, transparent); color: var(--sw-on-raised);
  font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.chip-link { font-weight: 700; color: var(--sw-action); text-underline-offset: 4px; }
.profile .hint { color: var(--sw-muted); }
.profile .hint .quiet { min-height: 2rem; color: var(--sw-action); }

/* Big numbers with small labels: the hero's totals and each game's. */
.hero-stats, .record-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: .6rem; }
.hero-stats[aria-busy="true"] { min-height: 4.6rem; }
.stat { display: grid; gap: .15rem; padding: .7rem .85rem; border-radius: var(--sw-radius);
  background: color-mix(in srgb, var(--sw-surface) 55%, transparent); border: 1px solid color-mix(in srgb, var(--sw-border) 70%, transparent); }
.stat-value { font: 900 clamp(1.6rem, 4vw, 2.2rem)/1 var(--sw-display); font-variant-numeric: tabular-nums; color: var(--sw-on-raised); }
.stat-label { font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--sw-muted); }
.record-stats .stat { padding: .55rem .7rem; }
.record-stats .stat-value { font-size: 1.55rem; }

/* Section cards: a heading behind the accent bar. */
.profile .card h2 { display: flex; align-items: center; gap: .6rem; font: 800 1.05rem/1.2 var(--sw-display); letter-spacing: .14em; text-transform: uppercase; }
.profile .card h2::before { content: ""; width: .35rem; height: 1.2em; border-radius: 2px; background: var(--sw-accent); box-shadow: 0 0 12px var(--glow); }

.progress-rows { display: grid; gap: .5rem; }
.progress-row a { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .8rem 1rem; text-decoration: none;
  border: 1px solid var(--sw-border); border-radius: var(--sw-radius); background: color-mix(in srgb, var(--sw-surface) 45%, transparent);
  transition: border-color var(--sw-quick), translate var(--sw-quick); }
.progress-row a:hover { border-color: var(--sw-action); translate: 3px 0; }
.progress-words { display: grid; gap: .1rem; min-width: 0; }
.progress-words span { color: var(--sw-muted); font-size: .95rem; }
.pill { flex: none; padding: .2rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: var(--sw-action); color: var(--sw-on-action); }
.progress-row[data-state="waiting"] .pill { background: transparent; color: var(--sw-muted); box-shadow: inset 0 0 0 1.5px var(--sw-border); }

.record-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .9rem; }
.record-card { display: grid; gap: .7rem; align-content: start; padding: 1rem; border: 1px solid var(--sw-border); border-radius: var(--sw-radius);
  background: color-mix(in srgb, var(--sw-surface) 45%, transparent); }
.record-card h3 { font: 900 1.35rem/1.1 var(--sw-display); text-transform: uppercase; letter-spacing: .02em; }
.record-card h3 a { text-decoration: none; }
.record-card h3 a:hover { color: var(--sw-action); }
.record-rating { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; font-weight: 700; }

/* The avatar picker over a launcher page. */
.avatar-picker { border: 1px solid var(--sw-border); border-radius: var(--sw-radius); background: var(--sw-raised); color: var(--sw-on-raised); box-shadow: var(--shadow); }
.avatar-picker::backdrop { background: color-mix(in srgb, var(--sw-surface) 70%, transparent); }
.avatar-picker-close { min-height: 2.75rem; padding: .3rem 1.2rem; border: 2px solid var(--sw-action); border-radius: calc(var(--sw-radius) * .75);
  background: transparent; color: var(--sw-action); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .progress-row a, .me-button { transition: none; } .progress-row a:hover { translate: none; } }

.me-menu:not([popover]) { position: static; flex: 1 0 100%; margin: 0; }
