/* Aukuro – player modal v2: village-colour accents, animated stats, profession scene + level rings, phone sheet. */
dialog.profile { --vc: #8a7bd8;
  background: radial-gradient(120% 55% at 12% 0%, color-mix(in srgb, var(--vc) 20%, transparent), transparent 62%), #12101c;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--vc) 60%, #000), inset 0 0 0 4px #160832, 0 20px 60px rgba(0,0,0,.6),
    0 0 46px color-mix(in srgb, var(--vc) 28%, transparent); }
dialog.profile[open] { animation: pf-in .34s cubic-bezier(.2,.9,.3,1.12); }
dialog.profile[open]::backdrop { animation: pf-fade .3s ease-out; }
dialog.profile.closing { animation: pf-out .23s ease-in forwards; }
dialog.profile.closing::backdrop { animation: pf-fade .23s ease-in reverse forwards; }
@keyframes pf-in { from { opacity: 0; transform: translateY(26px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes pf-out { to { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes pf-fade { from { opacity: 0; } to { opacity: 1; } }
.pf-handle { display: none; }

/* 3D stage: click = wave, soft shadow, village glow */
.pf-stage { cursor: pointer; background: radial-gradient(ellipse at 50% 88%, color-mix(in srgb, var(--vc) 26%, transparent), transparent 62%); }
.pf-stage canvas { position: relative; z-index: 1; touch-action: pan-y; }
.pf-shadow { position: absolute; left: 50%; bottom: 10px; width: 130px; height: 16px; margin-left: -65px; z-index: 0;
  background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent); animation: pf-breathe 2.6s ease-in-out infinite; }
@keyframes pf-breathe { 50% { transform: scaleX(.88); opacity: .8; } }
.pf-name { animation: pf-up .4s both .08s; }
.pf-side > .plaque { animation: pf-pop .5s both .18s; }

/* profession badge above the stats: level ring + icon */
.pf-profbadge { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 12px; text-align: left; background: rgba(0,0,0,.3);
  border: 2px solid #000; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--vc) 40%, transparent); animation: pf-up .45s both .1s; }
.pf-prof-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pf-prof-txt strong { font: 600 19px var(--font-head); display: inline-flex; align-items: center; gap: 6px; text-shadow: 2px 2px 0 var(--mc-shadow); }
.pf-prof-txt .stars-line { color: var(--gold); letter-spacing: 2px; text-shadow: 0 0 8px rgba(255,200,61,.7); }
.ring { position: relative; width: 66px; height: 66px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: rgba(0,0,0,.35); stroke: #2a2838; stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--vc); stroke-width: 7; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1) .25s;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--vc) 70%, transparent)); }
.ring-val { position: relative; font: 600 24px/1 var(--font-head); color: #fff; text-shadow: 2px 2px 0 var(--mc-shadow); }
.ring-sub { position: relative; font-size: 11px; line-height: 1; color: var(--muted); }

/* stats: staggered entrance, count-up (JS), hover lift */
.stat-grid .stat { animation: pf-up .45s both; animation-delay: calc(var(--i, 0) * 55ms + 120ms); transition: transform .15s, box-shadow .15s; }
.stat-grid .stat:hover { transform: translateY(-3px); box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), 0 0 0 2px color-mix(in srgb, var(--vc) 55%, transparent); }
.stat .sv { font-variant-numeric: tabular-nums; }
@keyframes pf-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pf-pop { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.06); } 100% { opacity: 1; transform: none; } }

/* bars grow in */
.bar i.grow { width: var(--w); animation: pf-grow 1.1s cubic-bezier(.2,.8,.2,1) both .35s; }
@keyframes pf-grow { from { width: 0; } }

/* titles: pop in + a shine sweeping across */
.title-wall .plaque { animation: pf-pop .45s both; }
.title-wall .plaque:nth-child(2n) { animation-delay: .08s; } .title-wall .plaque:nth-child(3n) { animation-delay: .16s; }
.title-wall .plaque:not(.locked) { position: relative; overflow: hidden; }
.title-wall .plaque:not(.locked)::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%);
  transform: translateX(-130%); animation: pf-shine 4.2s ease-in-out infinite 1s; }
.title-wall .plaque:nth-child(3n+2)::before { animation-delay: 2.4s; }
.title-wall .plaque:nth-child(3n)::before { animation-delay: 3.6s; }
@keyframes pf-shine { 0%, 62% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.pf-feed li { animation: pf-up .4s both .4s; }
.fish:not(.missing) { transition: transform .15s; } .fish:not(.missing):hover { transform: scale(1.04); }

/* phones: full-screen sheet, drag the handle down to close */
@media (max-width: 760px) {
  dialog.profile { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; inset: 0; border: 0;
    transform: translateY(var(--drag, 0px)); }
  dialog.profile:not(.dragging) { transition: transform .2s ease-out; }
  dialog.profile[open] { animation: pf-sheet-in .36s cubic-bezier(.2,.9,.3,1); }
  dialog.profile.closing { animation: pf-sheet-out .23s ease-in forwards; }
  .pf-handle { display: block; position: sticky; top: 0; z-index: 4; height: 30px; padding-top: 10px; touch-action: none; cursor: grab;
    background: linear-gradient(#12101c 60%, rgba(18,16,28,0)); }
  .pf-handle i { display: block; width: 56px; height: 8px; margin: 0 auto; background: color-mix(in srgb, var(--vc) 55%, #3a3550); border: 2px solid #000; }
  .profile .close { top: 4px; margin: -30px 8px 0 0; padding: 4px 10px; }
  .profile-body { padding: 6px 14px 28px; gap: 16px; }
  .pf-name { font-size: 26px; }
}
@keyframes pf-sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes pf-sheet-out { to { transform: translateY(100%); } }
@media (max-width: 360px) {
  .pf-profbadge { gap: 8px; padding: 8px; }
  .ring { width: 58px; height: 58px; }
  .stat .sv { font-size: 20px; }
}

/* ---- layout v3: big skin left (sticky), grouped stat rows right ---- */
.profile-body { grid-template-columns: minmax(300px, 42%) 1fr; gap: 26px; }
.pf-side { position: sticky; top: 12px; align-self: start; justify-content: center;
  min-height: min(calc(100dvh - 90px), 780px); }
.pf-side .pf-profbadge { width: 100%; margin: 4px 0 0; }
.pf-stage, .pf-stage canvas { width: 300px; height: 400px; }
.pf-group { margin-bottom: 18px; animation: pf-up .45s both .12s; }
.pf-group h3 { margin: 0 0 8px; padding-bottom: 4px; border-bottom: 2px solid color-mix(in srgb, var(--vc) 45%, transparent); }
.pf-rows { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); column-gap: 22px; }
.pf-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 2px; border-bottom: 1px dashed rgba(255,255,255,.08); }
.pf-row dt { flex: 1; min-width: 0; color: #d6d8e4; font-size: 16px; }
.pf-row dd { margin: 0; font: 600 18px var(--font-head); color: #fff; text-shadow: 2px 2px 0 var(--mc-shadow); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-row.zero dt, .pf-row.zero dd { color: #7f8296; text-shadow: none; }
.pf-row .rk { font: 600 12px var(--font-head); padding: 1px 5px; color: #1a1200; background: var(--gold); border: 1px solid #000; }
.pf-row .rk.r2 { background: var(--silver); } .pf-row .rk.r3 { background: var(--bronze); }
.pf-row:hover { background: rgba(255,255,255,.04); }
@media (max-width: 760px) {
  .profile-body { grid-template-columns: 1fr; }
  .pf-side { position: static; min-height: 0; }
  .pf-stage, .pf-stage canvas { width: 200px; height: 250px; }
  .pf-rows { grid-template-columns: 1fr; }
}

/* ---- phone sheet v4 (2026-11-30): fixed header bar with close button below the notch, inner scroller,
   no page scroll behind the open sheet, centred content ---- */
html.pf-lock, html.pf-lock body { overflow: hidden; overscroll-behavior: none; }
@media (max-width: 760px) {
  dialog.profile[open] { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
  .pf-handle { position: relative; flex: none; height: auto; min-height: 52px; box-sizing: border-box;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 64px 8px; background: #12101c;
    border-bottom: 2px solid color-mix(in srgb, var(--vc) 35%, #000); }
  .pf-handle i { margin-top: 8px; }
  .profile .close { position: absolute; float: none; top: calc(env(safe-area-inset-top, 0px) + 7px); right: 10px;
    margin: 0; z-index: 5; min-width: 40px; min-height: 38px; padding: 4px 10px; }
  .profile-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 14px max(14px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 28px) max(14px, env(safe-area-inset-left, 0px));
    justify-items: stretch; align-content: start; grid-auto-rows: max-content; }
  .profile-body > * { min-width: 0; }
  .pf-side { width: 100%; align-items: center; justify-content: flex-start; text-align: center; }
  .pf-stage { margin: 0 auto; }
  .pf-side .pf-profbadge { max-width: 420px; margin: 4px auto 0; }
}

/* ---- meistrystė panel ---- */
.pf-mastery { margin-top: 10px; padding: 8px 10px; border: 2px solid var(--rc); background: rgba(0,0,0,.25); }
.pf-mastery-head { display: flex; gap: 10px; align-items: center; }
.pf-mastery-head > div { display: flex; flex-direction: column; }
.pf-mastery-head strong { color: var(--rc); text-shadow: 1px 1px 0 #000; }
.pf-ladder { display: flex; gap: 8px; margin-top: 6px; }
.pf-ladder span { display: flex; flex-direction: column; align-items: center; font-size: 11px; }
.pf-ladder span.off { opacity: .3; filter: grayscale(1); }
img.emblem.big { width: 48px; height: 48px; }

/* kreipinys: pixel ♂ / ♀ after the name (UI chrome: no selection, default cursor) */
.pf-name .pf-gender { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 8px; user-select: none; -webkit-user-select: none; cursor: default; }
.pf-name .pf-gender svg { display: block; image-rendering: pixelated; }

/* /medis/ link on the player card */
.pf-tree-btn { align-self: flex-start; margin-top: 6px; padding: 6px 12px; font-size: 15px; text-decoration: none; }

/* Šunys block in the profile (site.js dogJournal) and on /sunys/ */
.dog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; margin-bottom: 10px; }
.dog-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px;
  background: rgba(0,0,0,.28); border-left: 3px solid rgba(255,255,255,.14); }
.dog-card.champ { border-left-color: var(--gold, #f5c542); }
.dog-head { image-rendering: pixelated; width: 36px; height: 48px; object-fit: contain; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.45)); }
.dog-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dog-name { color: #fff; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.dog-rank, .dog-traits { font-size: 13px; color: var(--muted); }
.dog-traits { color: #d8c7a3; }
.dog-hearts { font-size: 14px; letter-spacing: 1px; line-height: 1; }
.dog-hearts b { color: #ff6fa8; font-weight: 400; } .dog-hearts i { color: #4a3a46; font-style: normal; }
.dog-stats { display: flex; gap: 10px; font-size: 13px; color: #e6e6e6; }
.dog-wins { color: var(--gold, #f5c542); }
.dog-gear { display: flex; gap: 4px; margin-top: 2px; }
.dog-gear-ic { image-rendering: pixelated; width: 20px; height: 20px; background: rgba(0,0,0,.3); }

/* Kaimų sezonų pergalės: a gold pennant per won season, the village colour (as it was then) as the stripe; the card is
   the shared .title-tip (hover, keyboard focus, tap on phones) */
.season-wins { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 6px; }
.season-badge { --vc2: #ffc83d; position: relative; display: inline-block; cursor: pointer; outline: none;
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,.45)); animation: pf-pop .45s both; }
.season-badge:hover .sb-flag, .season-badge:focus-visible .sb-flag { transform: translateY(-3px); }
.season-badge:focus-visible { filter: drop-shadow(0 0 3px #fff) drop-shadow(2px 3px 0 rgba(0,0,0,.45)); }
.season-badge .sb-flag { display: flex; flex-direction: column; align-items: center; width: 58px; height: 74px; padding: 7px 4px 14px;
  text-align: center; color: #2a1800; transition: transform .15s; background: linear-gradient(180deg, #ffe58a 0%, #ffc83d 45%, #d89a12 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  box-shadow: inset 0 6px 0 var(--vc2), inset 2px 0 0 rgba(255,255,255,.45), inset -2px 0 0 rgba(0,0,0,.25); }
.season-badge .sb-crown { font-size: 18px; line-height: 1.1; margin-top: 3px; color: #7a4a00; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.season-badge .sb-month { font: 600 15px/1 var(--font-head); letter-spacing: .3px; }
.season-badge .sb-year { font: 400 13px/1 var(--font-head); opacity: .8; }
.title-tip .tt-village { text-shadow: 1px 1px 0 #000; }
@media (prefers-reduced-motion: reduce) { .season-badge, .season-badge .sb-flag { animation: none; transition: none; } }

/* combat path card under the profession badge (owner 2026-12-01) */
.pf-combatbadge { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cc, var(--vc)) 45%, transparent); animation-delay: .18s; }
.pf-combatbadge .pf-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.pf-combatbadge .pf-warn { color: #ffb86b; }
.pf-side .pf-combatbadge { width: 100%; margin: 0 0 12px; }
@media (max-width: 760px) { .pf-side .pf-combatbadge { max-width: 420px; margin: 0 auto 12px; } }

/* Kelionė serveryje + Vadovavimas (owner 2026-12-02): compact rows, one line each on phones too */
.pj-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; margin: 2px 0 8px; }
.pj-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; background: rgba(0,0,0,.25); font-size: 14px; }
.pj-row dt { color: #b9b4c9; } .pj-row dd { margin: 0; text-align: right; color: #f1f1f1; }
.pj-events { list-style: none; margin: 0 0 6px; padding: 0 0 0 10px; border-left: 2px solid rgba(255,255,255,.15); display: grid; gap: 3px; font-size: 14px; }
.pj-events li { display: flex; gap: 10px; align-items: baseline; }
.pj-date { flex: none; font-variant-numeric: tabular-nums; color: #9d98ad; font-size: 13px; }
.pj-what b { text-shadow: 1px 1px 0 #000; }
.pf-terms { list-style: none; margin: 2px 0 8px; padding: 0; display: grid; gap: 5px; font-size: 15px; }
.pf-terms li { --vc2: #ffc83d; display: flex; gap: 8px; align-items: baseline; padding: 6px 9px; background: rgba(0,0,0,.28);
  border-left: 4px solid var(--vc2); }
.pf-terms li.now { background: linear-gradient(90deg, color-mix(in srgb, var(--vc2) 22%, rgba(0,0,0,.3)), rgba(0,0,0,.28));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vc2) 55%, transparent); }
.pf-terms .pt-title { text-shadow: 1px 1px 0 #000; }
.pf-terms .pt-when { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .pj-rows { grid-template-columns: 1fr; } .pf-terms { font-size: 14px; } }

/* ---- collapsible sections (2026-12-03): the right column is a list of closed <details>, header = name · count ---- */
.pf-sec { margin: 0 0 8px; background: rgba(0,0,0,.22); border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.4); animation: pf-up .4s both .1s; }
.pf-sec > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; cursor: pointer; list-style: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.pf-sec > summary::-webkit-details-marker { display: none; }
.pf-sec > summary::marker { content: ""; }
.pf-sec > summary h3, .pf-main .pf-sec > summary h3 { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; }
.pf-sec > summary:hover { background: rgba(255,255,255,.05); }
.pf-sec > summary:hover h3 { color: #ffff88; }
.pf-sec > summary:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.pf-sec[open] > summary { border-bottom: 2px solid color-mix(in srgb, var(--vc) 45%, transparent); }
.pf-caret { flex: none; width: 10px; height: 8px; color: #ffff55;
  background: linear-gradient(currentColor, currentColor) 0 0 / 10px 2px no-repeat, linear-gradient(currentColor, currentColor) 2px 2px / 6px 2px no-repeat,
  linear-gradient(currentColor, currentColor) 4px 4px / 2px 2px no-repeat; filter: drop-shadow(1px 1px 0 #3f3f15); transition: transform .15s; }
.pf-sec[open] > summary .pf-caret { transform: rotate(180deg); }
.pf-sec-body { padding: 10px 12px 12px; }
.pf-sec[open] > .pf-sec-body { animation: pf-sec-in .2s ease-out; }
@keyframes pf-sec-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pf-sec-body > :first-child { margin-top: 0; }
.pf-sec-body > :last-child { margin-bottom: 0; }
.pf-sec { scroll-margin-top: 8px; }
@media (max-width: 760px) {
  .pf-sec > summary { min-height: 52px; }
  .pf-sec-body { padding: 8px 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-sec[open] > .pf-sec-body { animation: none; }
  .pf-caret { transition: none; }
}
/* the statistics groups (Kova, Darbai, …) sit together inside the one Statistika section */
.pf-sec .pf-group { margin-bottom: 14px; animation: none; }
.pf-sec .pf-group:last-child { margin-bottom: 0; }
.pf-sec .pf-group h3 { font-size: 17px; }
