/* Profil: brukerkort (svart apparat med XP-skive), nøkkeltall, høydepunkter,
   prestasjoner og skjulte egg, rivaler, når du spiller og siste kamper.
   Dialed: lys og presis, Geist Mono for tall, kun transform/opacity i bevegelse. */

@property --xpv { syntax: '<number>'; inherits: true; initial-value: 0; }

.page.profil {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 30px 22px; align-items: start;
}
.profil > * { grid-column: 1 / -1; min-width: 0; }
.profil > .pf-hero { grid-column: 1 / span 7; align-self: stretch; }
.profil > .pf-tiles { grid-column: 8 / span 5; align-self: stretch; }
.profil > .pf-ach { grid-column: 1 / span 7; }
.profil > .pf-riv-sec { grid-column: 8 / span 5; }
.profil > .pf-ach, .profil > .pf-riv-sec { align-self: stretch; display: flex; flex-direction: column; }
.pf-ach-card, .pf-riv-card { flex: 1; }
.profil .sec-head { margin-bottom: 12px; }

/* seksjonene glir inn forskjøvet når siden vises */
.profil.pf-play > * { animation: riseIn .62s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }

.pf-ico { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--bg-2); color: var(--ink-2); }
.pf-ico .ico { width: 17px; height: 17px; }
.pf-empty { margin: 0; padding: 18px 4px; color: var(--ink-3); font-size: 14px; }

/* ---------- 1. brukerkortet ---------- */
.pf-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 30px;
  padding: 26px 30px 26px 24px;
  background:
    radial-gradient(560px 320px at 6% -4%, color-mix(in oklch, var(--pc) 28%, transparent), transparent 70%),
    var(--app-bg);
}
.pf-avwrap {
  position: relative; width: 188px; height: 188px; display: grid; place-items: center; border-radius: 50%;
  --xpv: 0;
  transition: --xpv 1.3s var(--ease-out), scale var(--dur-press) var(--ease-press);
}
.pf-avwrap:focus-visible { outline-offset: 2px; border-radius: 50%; }
/* XP-skiva: streker som en gradeskive, fylt med XP-regnbuen opp til neste nivå */
.pf-dial { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9.5px)); }
.pf-dial > i { position: absolute; inset: 0; border-radius: 50%; }
.pf-dial-track { background: repeating-conic-gradient(oklch(100% 0 0 / .15) 0 1.6deg, transparent 1.6deg 6deg); }
.pf-dial-fill {
  -webkit-mask: conic-gradient(#000 calc(var(--xpv) * 360deg), transparent 0);
  mask: conic-gradient(#000 calc(var(--xpv) * 360deg), transparent 0);
}
.pf-dial-fill > i { position: absolute; inset: 0; border-radius: 50%; background: var(--xp-ring);
  -webkit-mask: repeating-conic-gradient(#000 0 1.6deg, transparent 1.6deg 6deg);
  mask: repeating-conic-gradient(#000 0 1.6deg, transparent 1.6deg 6deg); }
.pf-needle { position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; rotate: calc(var(--xpv) * 360deg); }
.pf-needle::after {
  content: ''; position: absolute; left: 50%; top: 0; width: 3px; height: 17px; margin-left: -1.5px; border-radius: 3px;
  background: var(--app-ink); box-shadow: 0 0 10px oklch(100% 0 0 / .55);
}
.pf-avwrap .pf-av { --fig-shine: .3; }
.pf-avwrap .avatar-disc { box-shadow: 0 10px 30px -12px oklch(0% 0 0 / .7), 0 0 0 1px oklch(100% 0 0 / .08); }
.pf-hero .avatar-lvl {
  min-width: 34px; height: 34px; padding: 0 9px; right: -4px; bottom: -2px;
  background: var(--accent); color: var(--accent-ink); font-size: 14.5px; box-shadow: 0 0 0 4px var(--app-bg);
}
.pf-av.pf-boing { animation: pfBoing .62s var(--ease-pop); }
@keyframes pfBoing { 22% { scale: 1.12 .88; } 48% { scale: .93 1.07; } 72% { scale: 1.03 .97; } }

.pf-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pf-name-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-width: 0; }
.pf-name-slot { min-width: 0; max-width: 100%; }
.pf-name {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; text-align: left; color: var(--app-ink);
  font: 650 clamp(28px, 2.9vw, 40px)/1.08 var(--font-display); letter-spacing: -.035em;
  transition: scale var(--dur-press) var(--ease-press), opacity .2s;
}
.pf-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pen { width: 18px; height: 18px; opacity: .32; transition: opacity .2s; }
.pf-name:hover .pf-pen, .pf-name:focus-visible .pf-pen { opacity: .85; }
.pf-name-edit { display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 14px; background: oklch(100% 0 0 / .08); animation: popIn .32s var(--ease-pop); max-width: 100%; }
.pf-name-input {
  width: min(300px, 52vw); min-width: 0; height: 44px; padding: 0 12px; border: 0; outline: 0; border-radius: 10px;
  background: var(--app-bg-2); color: var(--app-ink); font: 600 22px/1 var(--font-display); letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.pf-name-input.roll { animation: bump .35s var(--ease-pop); }
.pf-roll { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--app-bg-3); color: var(--app-ink); }
.pf-roll.is-ok { background: var(--good); color: oklch(99% 0 0); }
.pf-roll .ico { width: 20px; height: 20px; }
.pf-title {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; flex: none;
  background: color-mix(in oklch, var(--gold) 20%, transparent); color: var(--gold); font: 600 13px/1 var(--font-ui);
}
.pf-title .ico { width: 14px; height: 14px; }
.pf-title.is-empty { background: oklch(100% 0 0 / .07); color: var(--app-ink-3); }

.pf-lvl { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; color: var(--app-ink-2); }
.pf-lvl b { color: var(--app-ink); font: 600 15px/1 var(--font-ui); white-space: nowrap; }
.pf-lvl .t-num { font-size: 13px; color: var(--app-ink-3); white-space: nowrap; }
.pf-hero .bar { height: 8px; background: oklch(100% 0 0 / .1); }
.pf-hero .bar > i { transition-duration: 1.1s; }

.pf-streak {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 14px;
  padding: 14px; border-radius: var(--r-m); background: oklch(100% 0 0 / .05);
}
.pf-flame { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: oklch(100% 0 0 / .07); color: var(--app-ink-3); }
.pf-flame .ico { width: 26px; height: 26px; }
.pf-streak.is-lit .pf-flame { background: linear-gradient(160deg, var(--flame), var(--flame-2)); color: oklch(99% 0 0); box-shadow: 0 10px 24px -10px var(--flame-2); }
.pf-streak.is-lit .pf-flame .ico { fill: oklch(99% 0 0 / .28); transform-origin: 50% 88%; animation: pfFlicker 2.6s ease-in-out infinite; }
@keyframes pfFlicker { 0%, 100% { transform: scale(1) rotate(0deg); } 30% { transform: scale(1.05, .96) rotate(-2.5deg); } 62% { transform: scale(.97, 1.05) rotate(2deg); } }
.pf-streak-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pf-streak-text b { font: 600 17px/1.15 var(--font-ui); color: var(--app-ink); }
.pf-streak-text small { font-size: 13px; color: var(--app-ink-3); }
.pf-streak.is-lit .pf-streak-text small { color: var(--flame); }
.pf-frys { height: 30px; flex: none; }
.pf-frys .ico { color: oklch(80% .08 230); }
.pf-week { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pf-wd {
  display: grid; place-items: center; height: 28px; border-radius: 9px; font: 600 11.5px/1 var(--font-num);
  color: var(--app-ink-3); background: oklch(100% 0 0 / .06);
}
.pf-wd.is-on { background: var(--flame); color: oklch(20% .03 50); }
.pf-wd.is-today { background: transparent; box-shadow: inset 0 0 0 1.5px var(--flame); color: var(--flame); }
.pf-wd.is-future { background: transparent; box-shadow: inset 0 0 0 1px oklch(100% 0 0 / .08); color: oklch(100% 0 0 / .22); }
.profil.pf-play .pf-wd.is-on { animation: popIn .45s var(--ease-pop) both; animation-delay: calc(420ms + var(--i) * 45ms); }

.pf-form { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pf-form .t-label { color: var(--app-ink-3); flex: none; }
.pf-form-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.pf-form-dots i {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font: 700 10.5px/1 var(--font-num); font-style: normal;
  color: oklch(99% 0 0); background: var(--app-bg-3);
}
.pf-form-dots i.is-seier { background: var(--good); }
.pf-form-dots i.is-tap { background: var(--bad); }
.pf-form-dots i.is-solo { color: var(--app-ink-2); }
.profil.pf-play .pf-form-dots i { animation: popIn .4s var(--ease-pop) both; animation-delay: calc(520ms + var(--i) * 35ms); }

/* ---------- 2. nøkkeltall ---------- */
.pf-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pf-tile { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; min-width: 0; min-height: 148px; }
.pf-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pf-tile-num {
  margin-top: auto; font: 600 clamp(30px, 2.8vw, 40px)/1 var(--font-num); letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform-origin: left center;
}
.pf-tile small { font-size: 13px; color: var(--ink-3); }
.pf-tile-num .pf-u { font: 600 .5em/1 var(--font-ui); letter-spacing: 0; color: var(--ink-3); margin: 0 .3em 0 .14em; }
.pf-tile-num .pf-u:last-child { margin-right: 0; }
.pf-tile.is-done .pf-tile-num { animation: pfNumPop .42s var(--ease-pop); }
@keyframes pfNumPop { 35% { scale: 1.08; } }
.pf-split { display: flex; gap: 2px; height: 6px; border-radius: 6px; overflow: hidden; transform-origin: left; }
.pf-split i { display: block; height: 100%; }
.pf-split .w { background: var(--good); }
.pf-split .l { background: var(--bad); }
.profil.pf-play .pf-split { animation: pfGrowX .9s var(--ease-out) .35s both; }
@keyframes pfGrowX { from { transform: scaleX(0); } }
@keyframes pfGrowY { from { transform: scaleY(0); } }

/* ---------- 3. høydepunkter (bento) ---------- */
.pf-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pf-hl { position: relative; display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px; min-height: 140px; min-width: 0; overflow: hidden; }
.pf-hl.is-wide { grid-column: span 2; }
.pf-hl-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pf-hl-top { display: flex; align-items: center; gap: 10px; }
.pf-hl-val { margin-top: auto; font: 600 26px/1.08 var(--font-display); letter-spacing: -.03em; overflow-wrap: anywhere; }
.pf-hl small { font-size: 13px; line-height: 1.35; color: var(--ink-3); }
.pf-hl.is-none .pf-hl-val { color: var(--ink-3); }
.pf-hl.is-fav { background: var(--app-bg); color: var(--app-ink); box-shadow: var(--shadow-3); }
.pf-hl.is-fav .pf-ico { background: oklch(100% 0 0 / .08); color: var(--app-ink-2); }
.pf-hl.is-fav .t-label, .pf-hl.is-fav small { color: var(--app-ink-3); }
.pf-hl.is-fav .pf-hl-val { font-size: clamp(30px, 3vw, 40px); text-transform: lowercase; letter-spacing: -.04em; }
.pf-hl-art { width: 118px; height: 118px; flex: none; align-self: center; margin: -6px -4px -6px 0; }
.pf-hl-art .art { width: 100%; height: 100%; overflow: visible; display: block; }
.pf-hl-art .art-a { fill: var(--art-a); } .pf-hl-art .art-b { fill: var(--art-b); } .pf-hl-art .art-c { fill: var(--art-c); }
.pf-hl-art .art-ink { fill: var(--app-ink); } .pf-hl-art .art-paper { fill: var(--art-paper); }
.pf-hl-art .art-line { fill: none; stroke: var(--app-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pf-hl-art .art-line.thick { stroke-width: 4.5; } .pf-hl-art .art-line.dash { stroke-dasharray: 2 7; }
.profil.pf-play .pf-hl-art { animation: pfArtIn .8s var(--ease-pop) .35s both; }
@keyframes pfArtIn { from { opacity: 0; scale: .6; rotate: -12deg; } }
.pf-hl.is-foe .pf-foe-av { align-self: center; }
.profil.pf-play .pf-bento .pf-hl { animation: riseIn .55s var(--ease-out) both; }
.profil.pf-play .pf-bento .pf-hl:nth-child(2) { animation-delay: 60ms; }
.profil.pf-play .pf-bento .pf-hl:nth-child(3) { animation-delay: 120ms; }
.profil.pf-play .pf-bento .pf-hl:nth-child(4) { animation-delay: 180ms; }
.profil.pf-play .pf-bento .pf-hl:nth-child(5) { animation-delay: 240ms; }
.profil.pf-play .pf-bento .pf-hl:nth-child(6) { animation-delay: 300ms; }

/* ---------- 4. prestasjoner ---------- */
.pf-ach-card { padding: 22px 22px 20px; }
.pf-badges { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 8px; }
.pf-badge {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 4px 2px 2px; border-radius: 14px;
  color: var(--ink-3);
}
.pf-bd {
  position: relative; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%;
  background: var(--bg-2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line);
  transition: scale var(--dur-pop) var(--ease-pop), box-shadow .25s;
}
.pf-bd .ico { width: 26px; height: 26px; opacity: .5; }
.pf-badge small { max-width: 100%; font: 500 12px/1.22 var(--font-ui); text-align: center; text-wrap: balance; hyphens: manual; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pf-badge.is-down .pf-bd { scale: .9; transition-duration: 80ms; }
.pf-badge.is-ok { color: var(--ink); }
.pf-badge.is-ok .pf-bd {
  overflow: hidden; color: oklch(30% .07 70);
  background: radial-gradient(circle at 34% 28%, oklch(97% .06 92), var(--gold) 54%, oklch(66% .14 72));
  box-shadow: 0 8px 20px -8px color-mix(in oklch, var(--gold) 85%, transparent), inset 0 0 0 1px oklch(100% 0 0 / .55);
}
.pf-badge.is-ok .pf-bd .ico { opacity: 1; stroke-width: 2; }
/* glimt som sveiper over de opplåste merkene når siden vises */
.pf-badge.is-ok .pf-bd::after {
  content: ''; position: absolute; top: -10%; bottom: -10%; left: 0; width: 34%;
  background: linear-gradient(90deg, transparent, oklch(100% 0 0 / .7), transparent); transform: translateX(-160%) skewX(-18deg); pointer-events: none;
}
.profil.pf-play .pf-badge.is-ok .pf-bd::after { animation: pfGlint .9s var(--ease-out) both; animation-delay: calc(800ms + var(--i) * 55ms); }
@keyframes pfGlint { to { transform: translateX(380%) skewX(-18deg); } }
.pf-badge.is-secret .pf-bd { background: var(--bg-2); box-shadow: none; }
.pf-badge.is-secret .pf-bd::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ring-dial);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
}
.pf-q { font: 700 13px/1 var(--font-num); letter-spacing: .06em; color: var(--ink-3); }
.pf-bd-prog {
  position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--ink-2) calc(var(--p) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
}
.pf-badge.is-sel .pf-bd { scale: 1.08; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.pf-badge.is-ok.is-sel .pf-bd { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--gold-ink), 0 8px 20px -8px var(--gold); }
.pf-badge.is-sel { color: var(--ink); }
.profil.pf-play .pf-bd { animation: popIn .45s var(--ease-pop) both; animation-delay: calc(260ms + var(--i) * 22ms); }

.pf-detail { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); min-height: 76px; }
.pf-detail-hint { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; }
.pf-detail-hint .ico { width: 17px; height: 17px; }
.pf-detail-in { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; align-items: start; animation: riseIn .35s var(--ease-out) both; }
.pf-detail-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); }
.pf-detail-ico .ico { width: 24px; height: 24px; }
.pf-detail-in.is-ok .pf-detail-ico { background: radial-gradient(circle at 34% 28%, oklch(97% .06 92), var(--gold) 54%, oklch(66% .14 72)); color: oklch(30% .07 70); }
.pf-detail-in.is-ok .pf-detail-ico .ico { stroke-width: 2; }
.pf-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.pf-detail-head b { font: 600 18px/1.2 var(--font-ui); }
.pf-detail dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 10px 0 0; font-size: 14px; }
.pf-detail dt { font: 500 12px/1.5 var(--font-num); color: var(--ink-3); }
.pf-detail dd { margin: 0; color: var(--ink); line-height: 1.4; }
.pf-detail-p { margin-top: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.pf-detail-prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; }
.pf-detail-prog .t-num { font-size: 13px; color: var(--ink-2); }
.pf-ok { background: var(--good-soft); color: oklch(42% .13 150); }

.pf-eggs { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pf-egg-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.pf-egg-head b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pf-egg-row { display: inline-flex; gap: 6px; }
.pf-egg-row i { width: 14px; height: 18px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.pf-egg-row i.is-found { background: linear-gradient(160deg, oklch(99% 0 0), oklch(85% .1 350) 45%, oklch(70% .15 300)); box-shadow: 0 0 10px oklch(80% .12 330 / .55); }
.profil.pf-play .pf-egg-row i { animation: popIn .4s var(--ease-pop) both; animation-delay: calc(650ms + var(--i) * 50ms); }
.pf-hints { display: flex; flex-direction: column; gap: 6px; }
.pf-hints:empty { display: none; }
.pf-hint { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.pf-hint .ico { width: 16px; height: 16px; margin-top: 1px; color: var(--accent); }
.pf-hint.is-new { animation: riseIn .45s var(--ease-out) both; }
.pf-hint-slot:empty { display: none; }
.pf-hint-btn { align-self: flex-start; }
.pf-hint-btn.is-poor { opacity: .55; }
.pf-price { display: inline-flex; align-items: center; gap: 3px; padding-left: 9px; margin-left: 2px; border-left: 1px solid var(--line-2); font: 600 13px/1 var(--font-num); color: var(--ink-2); }
.pf-price .ico { width: 13px; height: 13px; color: var(--accent); }

/* ---------- 5. rivaler ---------- */
.pf-riv-card { padding: 16px 20px 8px; }
.pf-legend { display: flex; gap: 16px; margin-bottom: 4px; font-size: 12.5px; color: var(--ink-3); }
.pf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pf-legend i { width: 10px; height: 10px; border-radius: 3px; }
.pf-legend .w, .pf-riv-bar .w { background: var(--good); }
.pf-legend .l, .pf-riv-bar .l { background: var(--bad); }
.pf-riv { display: grid; grid-template-columns: 40px minmax(0, 132px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.pf-legend + .pf-riv { border-top: 0; }
.pf-riv-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf-riv-who b { font: 600 14.5px/1.2 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-riv-who small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-riv-track { min-width: 0; }
.pf-riv-bar { display: flex; gap: 2px; height: 14px; width: calc(var(--w) * 100%); border-radius: 5px; overflow: hidden; transform-origin: left; }
.pf-riv-bar i { display: block; height: 100%; }
.profil.pf-play .pf-riv-bar { animation: pfGrowX .9s var(--ease-out) both; animation-delay: calc(380ms + var(--i) * 60ms); }
.pf-riv-sc { min-width: 52px; text-align: right; font: 600 14px/1 var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 6. når du spiller ---------- */
.pf-when-card { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px 48px; padding: 22px 24px 20px; align-items: start; }
.pf-graph { min-width: 0; }
.pf-graph-title { margin-bottom: 12px; font: 500 12px/1 var(--font-num); color: var(--ink-3); }
.pf-heat { width: 100%; }
.pf-heat-months, .pf-heat-grid { display: grid; grid-template-columns: 28px repeat(16, minmax(0, 1fr)); column-gap: 4px; }
.pf-heat-months { margin-bottom: 6px; font: 500 11px/1 var(--font-num); color: var(--ink-3); white-space: nowrap; }
.pf-heat-months span { overflow: visible; }
.pf-heat-grid { grid-template-rows: repeat(7, auto); grid-auto-flow: column; row-gap: 4px; }
.pf-heat-day { display: flex; align-items: center; font: 500 10.5px/1 var(--font-num); color: var(--ink-3); }
.pf-heat-grid i, .pf-scale i { display: block; border-radius: 4px; background: var(--bg-3); }
.pf-heat-grid i { aspect-ratio: 1; }
.pf-heat-grid i.l1, .pf-scale i.l1 { background: color-mix(in oklch, var(--ink) 22%, var(--bg-3)); }
.pf-heat-grid i.l2, .pf-scale i.l2 { background: color-mix(in oklch, var(--ink) 46%, var(--bg-3)); }
.pf-heat-grid i.l3, .pf-scale i.l3 { background: color-mix(in oklch, var(--ink) 70%, var(--bg-3)); }
.pf-heat-grid i.l4, .pf-scale i.l4 { background: var(--ink); }
.pf-heat-grid i.is-future { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.pf-heat-grid i.is-today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }
.pf-heat-grid i[data-tip]:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.profil.pf-play .pf-heat-grid i { animation: popIn .4s var(--ease-out) both; animation-delay: calc(320ms + var(--c) * 24ms); }
.pf-scale { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.pf-scale i { width: 13px; height: 13px; border-radius: 3px; }
.pf-scale i:first-of-type { margin-left: 4px; }
.pf-scale i:last-of-type { margin-right: 4px; }

.pf-hours {
  display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); align-items: end; gap: 4px; height: 172px;
  border-bottom: 1px solid var(--line-2); touch-action: pan-y; cursor: crosshair; -webkit-user-select: none; user-select: none;
}
.pf-hours i {
  display: block; height: 100%; border-radius: 4px 4px 1px 1px; background: var(--ink); opacity: .8;
  transform-origin: bottom; transform: scaleY(max(var(--h), .025)); transition: opacity .15s;
}
.pf-hours i.is-zero { background: var(--line-2); opacity: 1; }
.pf-hours i.is-peak { background: var(--accent); opacity: 1; }
.pf-hours i:hover { opacity: 1; }
.profil.pf-play .pf-hours i { animation: pfGrowY .8s var(--ease-out) both; animation-delay: calc(320ms + var(--i) * 18ms); }
.profil.pf-play .pf-hours i.is-grown { animation: none; }
.profil .pf-hours i.is-hit, .profil.pf-play .pf-hours i.is-hit { animation: pfHit .42s var(--ease-pop) both; animation-delay: 0s; }
@keyframes pfHit { 38% { transform: scaleY(calc(max(var(--h), .025) + .16)); background: var(--accent); opacity: 1; } }
.pf-hours-lab { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; margin-top: 7px; font: 500 11px/1 var(--font-num); color: var(--ink-3); }
.pf-hours-lab span { white-space: nowrap; }
.pf-hours-lab span:last-child { justify-self: end; }
.pf-sum { margin-top: 14px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.pf-sum b { color: var(--ink); font-weight: 600; }

/* ---------- 7. siste kamper ---------- */
.pf-recent-card { padding: 6px 10px 8px; }
.pf-matches { display: flex; flex-direction: column; }
.pf-match {
  display: grid; grid-template-columns: 66px 112px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 12px 8px; border-top: 1px solid var(--line);
}
.pf-match:first-child { border-top: 0; }
.profil.pf-play .pf-match { animation: riseIn .45s var(--ease-out) both; animation-delay: calc(420ms + var(--i) * 40ms); }
.pf-match.is-new { animation: riseIn .45s var(--ease-out) both; animation-delay: calc(var(--i) * 35ms); }
.pf-res { display: grid; place-items: center; height: 28px; padding: 0 10px; border-radius: 999px; font: 600 12.5px/1 var(--font-ui); white-space: nowrap; }
.pf-res.is-seier { background: var(--good-soft); color: oklch(42% .13 150); }
.pf-res.is-tap { background: color-mix(in oklab, var(--bad) 13%, var(--surface)); color: oklch(50% .18 25); }
.pf-res.is-solo { background: var(--bg-2); color: var(--ink-2); }
.pf-avs { display: flex; align-items: center; min-width: 36px; }
.pf-avs .avatar + .avatar { margin-left: -11px; }
.pf-avs .avatar .avatar-disc { box-shadow: 0 0 0 2px var(--surface), var(--shadow-1); }
.pf-avs-more { display: grid; place-items: center; height: 26px; min-width: 26px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font: 600 11.5px/1 var(--font-num); }
.pf-alone { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); color: var(--ink-3); }
.pf-alone .ico { width: 18px; height: 18px; }
.pf-match-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pf-match-text b { font: 600 15px/1.2 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-match-text small { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-match-num { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pf-match-num b { font: 600 16px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.pf-match-num small { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.pf-rep .ico { color: var(--accent); }
.pf-more-btn { display: flex; margin: 8px auto 6px; }

/* ---------- mellomstore skjermer ---------- */
@media (max-width: 1080px) {
  .profil > .pf-hero, .profil > .pf-tiles, .profil > .pf-ach, .profil > .pf-riv-sec { grid-column: 1 / -1; }
  .pf-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pf-tile { min-height: 132px; }
}
@media (max-width: 880px) {
  .pf-when-card { grid-template-columns: minmax(0, 1fr); }
  .pf-heat { max-width: 520px; }
  .pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- mobil: én kolonne, full bredde ---------- */
@media (max-width: 720px) {
  .page.profil { gap: 24px 14px; }
  .pf-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 14px; padding: 22px 16px 18px; }
  .pf-avwrap { width: 156px; height: 156px; }
  .pf-hero .avatar.pf-av { --av: 98px !important; }
  .pf-info { width: 100%; align-items: stretch; gap: 14px; }
  .pf-name-row { justify-content: center; }
  .pf-name { font-size: 28px; }
  .pf-name-edit { margin: 0 auto; }
  .pf-streak { text-align: left; padding: 12px; gap: 10px 12px; }
  .pf-frys span { display: none; }
  .pf-frys { width: 30px; padding: 0; justify-content: center; }
  .pf-form { justify-content: center; flex-wrap: wrap; }
  .pf-tiles { gap: 10px; }
  .pf-tile { padding: 14px 15px; min-height: 120px; gap: 8px; }
  .pf-tile-num { font-size: 28px; }
  .pf-tile small { font-size: 12px; }
  .pf-bento { gap: 10px; }
  .pf-hl { padding: 15px 16px; min-height: 120px; gap: 10px; }
  .pf-hl.is-wide { grid-column: 1 / -1; }
  .pf-hl-val { font-size: 21px; }
  .pf-hl.is-fav .pf-hl-val { font-size: 30px; }
  .pf-hl-art { width: 88px; height: 88px; }
  .pf-ach-card { padding: 18px 12px 16px; }
  .pf-badges { gap: 14px 2px; }
  .pf-bd { width: 50px; height: 50px; }
  .pf-bd .ico { width: 22px; height: 22px; }
  .pf-badge small { font-size: 11px; }
  .pf-riv-card { padding: 14px 14px 6px; }
  .pf-riv { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: 8px; }
  .pf-riv-track { grid-column: 1 / -1; grid-row: 2; }
  .pf-when-card { padding: 18px 14px 16px; gap: 26px; }
  .pf-hours { height: 140px; gap: 2px; }
  .pf-hours-lab { gap: 2px; }
  .pf-recent-card { padding: 4px 8px 6px; }
  .pf-match { grid-template-columns: 50px minmax(0, 1fr) auto auto; gap: 10px; padding: 11px 4px; }
  .pf-res { justify-self: start; }
  .pf-match .pf-avs { display: none; }
  .pf-res { height: 24px; padding: 0 8px; font-size: 11.5px; }
  .pf-rep { width: 36px; padding: 0; }
  .pf-rep span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .profil *, .profil.pf-play * { animation: none !important; }
  .pf-avwrap { transition: none; }
}
