:root {
  --paper: #f3f1ec;
  --card: #ffffff;
  --ink: #17161a;
  --muted: #81808a;
  --soft: #e9e7e2;
  --line: rgba(23, 22, 26, 0.08);
  --accent: #d9822b;
  --medal: clamp(104px, min(52vw, 31vh), 220px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 0 16px;
  overflow: hidden;
}

.card {
  position: relative;
  width: min(352px, 88vw);
  padding: clamp(12px, 3vh, 22px) clamp(16px, 5vw, 24px) clamp(12px, 3vh, 22px);
  background: var(--card);
  border-radius: 26px;
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 2px rgba(23, 22, 26, 0.05),
    0 8px 18px -8px rgba(23, 22, 26, 0.12),
    0 30px 60px -24px rgba(23, 22, 26, 0.18);
  overflow: clip;
  text-align: center;
}
/* the thread of light on the top edge */
.card::before {
  content: "";
  position: absolute; left: 18%; right: 18%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  box-shadow: 0 0 6px rgba(217, 130, 43, 0.22);
}

.card__top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: clamp(11px, 1.9vh, 13px);
}
.brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; letter-spacing: -0.01em; }
.brand__mark { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.kicker {
  color: var(--accent); font-weight: 600; font-stretch: 105%;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82em;
}

.hang {
  width: var(--medal);
  aspect-ratio: 200 / 210;
  margin: clamp(2px, 1vh, 8px) auto 0;
  cursor: grab;
  touch-action: none;
}
.medal { width: 100%; height: 100%; display: block; overflow: visible; }
.medal__pin { fill: #cfcac0; }
.medal__cord { stroke: #b9b3a7; stroke-width: 2; stroke-linecap: round; fill: none; }
.medal__rim { fill: url(#rim); }
.medal__eye { fill: none; stroke: #c9a26a; stroke-width: 1.8; }
.medal__face { fill: url(#face); }
.medal__etch { fill: none; stroke: rgba(255, 240, 205, 0.55); stroke-width: 1.4; stroke-dasharray: 1.5 3; }
.medal__symbol { fill: none; stroke: #fff6e2; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.medal__shadow { fill: rgba(23, 22, 26, 0.16); filter: blur(3px); }
.medal__sheen { mix-blend-mode: soft-light; }

.name { margin-top: clamp(4px, 1.4vh, 12px); }
.name__mask { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 2px; }
.name__text {
  display: inline-block;
  font-size: clamp(19px, 3.6vh, 26px);
  font-weight: 650; letter-spacing: -0.02em; line-height: 1.15;
}
.name__sub { margin: 4px 0 0; color: var(--muted); font-size: clamp(11px, 1.9vh, 13.5px); }

.xp { margin-top: clamp(10px, 2.4vh, 18px); text-align: left; }
.xp__row { display: flex; justify-content: space-between; align-items: baseline; font-size: clamp(11px, 1.9vh, 13px); margin-bottom: 7px; }
.xp__level { color: var(--muted); }
.xp__slot {
  display: inline-block; height: 1.2em; overflow: hidden; vertical-align: -0.24em;
  color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums;
}
.xp__col { display: flex; flex-direction: column; }
.xp__col > span { height: 1.2em; line-height: 1.2em; }
.xp__gain { color: var(--accent); font-weight: 650; font-variant-numeric: tabular-nums; }
.xp__track { position: relative; height: 6px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.xp__fill {
  position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(90deg, #e9a44c, var(--accent));
  transform-origin: 0 50%; transform: scaleX(0.4);
}

.actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: clamp(10px, 2.4vh, 18px); }
.btn {
  height: clamp(34px, 5.6vh, 42px);
  border: 0; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center;
  font: inherit; font-size: clamp(12px, 2vh, 14px); font-weight: 600;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
}
.btn__label { display: block; line-height: 1; }
.btn--ghost { background: var(--soft); color: var(--ink); }
.btn--main { background: var(--ink); color: #fff; }
.btn:active { transform: scale(0.96); }
@media (hover: hover) {
  .btn--ghost:hover { background: #e1ded7; }
  .btn--main:hover { background: #2b2a30; }
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pointer {
  position: absolute; left: 0; top: 0; width: 20px; height: 20px;
  fill: var(--ink); stroke: #fff; stroke-width: 1.2;
  pointer-events: none; opacity: 0;
}
