#player-profile-overlay{position:fixed;inset:0;z-index:70000;background:#112b47a6;backdrop-filter:blur(5px);display:grid;place-items:center;padding:16px;color:#513521;font:15px/1.4 system-ui,sans-serif}
#player-profile-overlay[hidden]{display:none}
.pp-card{position:relative;box-sizing:border-box;width:min(620px,96vw);max-height:94dvh;overflow:auto;background:linear-gradient(145deg,#fff8e8,#f5dfbb);border:5px ridge #ce995b;border-radius:25px;box-shadow:0 18px 70px #07132480,inset 0 0 0 2px #fff7de;padding:25px}
.pp-card h2{font:700 27px Georgia,serif;margin:0 45px 18px 0;color:#704526}
.pp-button{border:2px solid #bd8d50;border-radius:13px;background:linear-gradient(#fff6df,#e7bf89);color:#513521;font:700 15px system-ui;padding:11px 18px;cursor:pointer;box-shadow:inset 0 1px #fff}
.pp-button:hover{filter:brightness(1.04)}.pp-button:disabled{opacity:.6;cursor:wait}.pp-secondary{background:#fff8ed;margin-left:8px}
.pp-close{position:absolute;right:16px;top:14px;width:37px;height:37px;border:2px solid #bd8d50;border-radius:12px;background:#fff5dd;font:700 25px/1 system-ui;color:#604023;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;text-align:center}
.pp-tabs{display:flex;gap:8px;align-items:center;border-bottom:1px solid #d9b47d;margin-bottom:20px;padding-bottom:12px}.pp-tabs .pp-button{font-size:13px;padding:8px 12px}.pp-tabs [aria-current]{background:#dbeaf1}.pp-tabs>span{margin-left:auto;font-size:12px;color:#77664e}
.pp-summary{display:flex;align-items:center;gap:22px;background:#fffdf7;border:2px solid #e5c699;border-radius:20px;padding:16px}.pp-name-block{flex:1;min-width:0}.pp-name{font-size:24px;overflow-wrap:anywhere}.pp-name-block p{margin:8px 0;color:#826c55}.pp-pencil{margin-left:9px;border:1px solid #ca9b60;border-radius:8px;background:#fff1d6;color:#634323;font-size:22px;cursor:pointer}
.pp-avatar-button{border:0;background:transparent;padding:0;cursor:pointer;border-radius:20px}
.pp-portrait,.pp-hud-portrait{display:block;position:relative;overflow:hidden;width:110px;height:110px;border-radius:22px;background:radial-gradient(ellipse at top,#e8f9fc,#9fbbd3);border:3px solid #d7b57a;box-sizing:border-box;box-shadow:inset 0 0 12px #fff8}
.pp-portrait img,.pp-hud-portrait img{position:absolute;left:0;top:0;margin:0;width:100%;height:100%;object-fit:cover;transform:scale(var(--portrait-scale));transform-origin:50% 20%;max-width:none!important}
.pp-code{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:20px;padding:15px;border:1px solid #d7b57a;border-radius:15px;background:#fff9eb}.pp-code>strong{flex:1;overflow-wrap:anywhere;font-size:14px;user-select:all}.pp-code>span{width:100%;font-weight:700}.pp-code button{font-size:13px;padding:8px 12px}
.pp-help{color:#7b624b;line-height:1.5}.pp-feedback{min-height:1.4em;color:#674321;margin-bottom:0}.pp-form{display:grid;gap:10px}.pp-form label{font-weight:700}.pp-form input{box-sizing:border-box;max-width:100%;min-width:0;border:2px solid #c99c65;border-radius:12px;background:#fffdf7;color:#4b3221;font:22px system-ui;padding:12px}.pp-form small{color:#806850}
.pp-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:16px 0}.pp-avatar-choice{display:flex;flex-direction:column;align-items:center;gap:6px;border:2px solid transparent;border-radius:15px;padding:8px;background:#fff9ed;font:700 12px system-ui;color:#62482c;cursor:pointer}.pp-avatar-choice .pp-portrait{width:85px;height:85px}.pp-avatar-choice[aria-pressed=true]{border-color:#dc9a28;background:#fff0c0;box-shadow:0 0 0 2px #fff8}.pp-avatar-preview{display:flex;justify-content:center}
.pp-card button:focus-visible,.pp-form input:focus-visible{outline:3px solid #3e7b9b;outline-offset:3px}
#game .brand-mark{background-image:none!important;overflow:hidden;flex-shrink:0}#game .pp-hud-portrait{width:100%;height:100%;border:0;border-radius:inherit}#game #open-profile{height:auto;min-height:76px}#game #player-name{max-width:180px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block}#game #player-progress{font-size:11px}
@media(max-height:500px){#player-profile-overlay{padding:7px}.pp-card{max-height:96dvh;padding:16px;width:min(620px,94vw);border-radius:18px}.pp-card h2{font-size:22px;margin-bottom:10px}.pp-tabs{margin-bottom:10px;padding-bottom:8px}.pp-summary{padding:10px;gap:15px}.pp-portrait{width:76px;height:76px}.pp-name{font-size:20px}.pp-code{padding:10px;margin-top:10px}.pp-gallery{grid-template-columns:repeat(6,1fr);gap:5px}.pp-avatar-choice{padding:5px;font-size:10px}.pp-avatar-choice .pp-portrait{width:62px;height:62px}.pp-avatar-preview .pp-portrait{width:65px;height:65px}.pp-button{font-size:13px;padding:8px 12px}.pp-form input{padding:8px;font-size:18px}#game #open-profile{min-height:0}#game #player-name{max-width:90px}#game #player-progress{font-size:8px}}
/* Complete player profile: keep the meadow's cream, carved-wood and gold palette. */
#player-profile-overlay .pp-card{width:min(1120px,96vw);max-height:min(92dvh,980px);padding:28px 32px;background:linear-gradient(155deg,#fffaf0 0%,#f8e6c5 68%,#f2d5a7 100%);border:5px solid #b88648;box-shadow:0 20px 70px #16253599,inset 0 0 0 3px #fff2d6,inset 0 -20px 30px #bc8a4623;scrollbar-color:#c79852 #fff5dc}
#player-profile-overlay .pp-card h2{font:700 34px Georgia,serif;color:#71411f;margin-bottom:16px}
#player-profile-overlay .pp-card h3{font:700 21px Georgia,serif;color:#71411f;margin:0 0 10px}
#player-profile-overlay .pp-tabs{display:flex;gap:12px;margin-bottom:15px;padding:5px 4px 14px;border-bottom:2px solid #dfbb80}
#player-profile-overlay .pp-tab{border:2px solid #c99b57;border-radius:12px;background:linear-gradient(#fff9ea,#e8ca98);color:#643f26;font-weight:800;padding:11px 18px;cursor:pointer;box-shadow:0 3px 0 #bd8d53}
#player-profile-overlay .pp-tab[aria-current=page]{background:linear-gradient(#84b348,#457c30);color:#fffdf3;border-color:#9da850;box-shadow:0 3px 0 #3c6624}
#player-profile-overlay .pp-dashboard{display:grid;grid-template-columns:minmax(320px,1.1fr) minmax(260px,.9fr) minmax(250px,.85fr);gap:16px;align-items:start}
#player-profile-overlay .pp-player-card{display:flex;align-items:center;gap:18px;border:2px solid #e5bf83;border-radius:18px;background:#fff9ea;padding:18px;min-width:0;min-height:154px}
#player-profile-overlay .pp-player-card .pp-portrait{width:110px;height:110px}
#player-profile-overlay .pp-player-info{min-width:0;flex:1}
#player-profile-overlay .pp-player-name-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
#player-profile-overlay .pp-name{font:700 28px Georgia,serif;color:#56341e;overflow-wrap:anywhere}
#player-profile-overlay .pp-subtitle{font-size:13px;color:#84664c;margin:7px 0}
#player-profile-overlay .pp-stats{display:grid;grid-auto-rows:minmax(0,1fr);gap:10px}
#player-profile-overlay .pp-stat{display:grid;grid-template-columns:33px 1fr;grid-template-rows:auto auto auto;column-gap:10px;align-content:center;background:#fff8e7;border:2px solid #e2c28b;border-radius:16px;padding:11px 13px;min-height:95px}
#player-profile-overlay .pp-stat-symbol{grid-row:span 2;font-size:28px;color:#b87b22;align-self:center}
#player-profile-overlay .pp-stat-name{font:600 12px system-ui;color:#886649}
#player-profile-overlay .pp-stat strong{font-size:21px;color:#654020}
#player-profile-overlay .pp-stat-help{grid-column:2;font-size:11px;line-height:1.35;color:#8a6a49}
#player-profile-overlay .pp-player-meta{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
#player-profile-overlay .pp-meta-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid #dfbf8a;border-radius:999px;background:#fff6e3;color:#78532f;font-size:12px;font-weight:700}
#player-profile-overlay .pp-side-tools{display:grid;gap:12px;align-content:start}
#player-profile-overlay .pp-inline-actions{display:flex;flex-wrap:wrap;gap:10px}
#player-profile-overlay .pp-inline-actions .pp-button{margin-left:0}
#player-profile-overlay .pp-progress-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}
#player-profile-overlay .pp-meadow-promo{background:linear-gradient(135deg,#fffaf0,#f5e7c5)}
#player-profile-overlay .pp-mini-head{margin-top:18px;margin-bottom:8px}
#player-profile-overlay .pp-code{padding:12px 15px;margin-top:0;border:2px solid #e4c793;border-radius:14px;background:#fff9ec}
#player-profile-overlay .pp-kicker{font-size:12px;color:#7c5c3b;font-weight:700}
#player-profile-overlay .pp-code-row{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%}
#player-profile-overlay .pp-code-row strong{font:800 16px system-ui;letter-spacing:1px;color:#71411f;user-select:all}
#player-profile-overlay .pp-code-row button{padding:7px 13px}
#player-profile-overlay .pp-story-promo{margin-top:13px;background:linear-gradient(135deg,#fff9e8,#ffe6b9);border:2px solid #e4bd7c;border-radius:16px;padding:15px 17px}
#player-profile-overlay .pp-section-head{display:flex;gap:14px;justify-content:space-between;align-items:center}
#player-profile-overlay .pp-section-head h3{margin:0}
#player-profile-overlay .pp-story-percent{font-size:22px;color:#6d8d26}
#player-profile-overlay .pp-story-promo p{margin:7px 0;font-size:13px;color:#7a5939}
#player-profile-overlay .pp-next-goal{font-weight:600}
#player-profile-overlay .pp-meter{height:13px;width:100%;overflow:hidden;border:2px solid #c9a46b;background:#c9ad7e;border-radius:10px;box-sizing:border-box;box-shadow:inset 0 2px 4px #7b572b77}
#player-profile-overlay .pp-meter i{display:block;height:100%;background:linear-gradient(#a8d45d,#4b942f);border-radius:inherit}
#player-profile-overlay .pp-story-button{margin-top:12px;background:linear-gradient(#8cb04b,#527c30);color:#fff}
#player-profile-overlay .pp-chapter-mini,#player-profile-overlay .pp-chapter-picker{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;margin-top:15px}
#player-profile-overlay .pp-chapter-tile{display:flex;flex-direction:column;gap:3px;text-align:center;align-items:center;padding:6px 5px 8px;min-width:0;background:#fff7e5;border:2px solid #e5c390;border-radius:13px;color:#673e21;cursor:pointer;font-size:11px;font-weight:800;box-shadow:0 3px 7px #8c63212a}
#player-profile-overlay .pp-chapter-tile[aria-pressed=true]{border-color:#9eb049;background:#fff0bf}
#player-profile-overlay .pp-chapter-tile img{width:100%;height:72px;border-radius:9px;object-fit:cover;background:#d4e4df}
#player-profile-overlay .pp-chapter-tile span{min-height:29px;line-height:1.16;display:flex;align-items:center;justify-content:center}
#player-profile-overlay .pp-chapter-tile small{color:#8a6335}
#player-profile-overlay .pp-story-detail{margin:15px 0;padding:12px 16px;border:2px solid #d9b37c;border-radius:16px;background:#fffaf0}
#player-profile-overlay .pp-chapter-header{display:flex;gap:20px;align-items:center;margin-bottom:8px}
#player-profile-overlay .pp-chapter-art{width:104px;height:82px;object-fit:cover;border-radius:14px;border:2px solid #ceaa6e;background:#dde9e8}
#player-profile-overlay .pp-chapter-header p{font-size:13px;color:#88664d;margin:2px 0 8px}
#player-profile-overlay .pp-goal{display:flex;gap:12px;padding:10px 6px;border-bottom:1px solid #e7d4b9;font-size:14px;color:#6b503b}
#player-profile-overlay .pp-goal:last-child{border:0}
#player-profile-overlay .pp-goal-check{font-size:19px;line-height:19px;color:#b69769}
#player-profile-overlay .pp-goal-done .pp-goal-check{color:#5a9a35;font-weight:bold}
#player-profile-overlay .pp-goal-done{background:#f2f8e7}
#player-profile-overlay .pp-ranking-title{margin-top:5px}
#player-profile-overlay .pp-ranking-table{border:2px solid #ddbe8e;border-radius:13px;overflow:hidden;background:#fff9e9}
#player-profile-overlay .pp-ranking-row{display:grid;grid-template-columns:56px minmax(185px,1fr) 104px minmax(90px,auto);align-items:center;gap:9px;padding:8px 13px;border-bottom:1px solid #ead6b4}
#player-profile-overlay .pp-ranking-head{font-size:12px;font-weight:800;color:#76522a;background:#edc995}
#player-profile-overlay .pp-ranking-row:last-child{border:0}
#player-profile-overlay .pp-ranking-row.pp-is-me{background:#edf5d6;border-block:2px solid #98b45e}
#player-profile-overlay .pp-ranking-player{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center;min-width:0;overflow-wrap:anywhere}
#player-profile-overlay .pp-rank-meta{display:flex;flex-direction:column;gap:3px;min-width:0}
#player-profile-overlay .pp-rank-name{font-size:14px;line-height:1.15;overflow-wrap:anywhere}
#player-profile-overlay .pp-rank-level{font-size:12px;line-height:1.1;color:#7b6143}
#player-profile-overlay .pp-rank-avatar{display:block;width:39px;height:39px;flex-shrink:0;overflow:hidden;border-radius:50%;border:2px solid #d9b277;background:#c7dae8}
#player-profile-overlay .pp-rank-avatar img{width:100%;height:100%;object-fit:cover;transform:scale(var(--portrait-scale))}
#player-profile-overlay .pp-my-place{font-weight:800;background:#eff7dc;padding:9px 14px;border-radius:12px}
#player-profile-overlay .pp-pager{display:flex;gap:15px;align-items:center;justify-content:center;margin:14px auto}
#player-profile-overlay .pp-pager .pp-button{font-size:13px}
#player-profile-overlay .pp-friend-list{display:grid;gap:8px}
#player-profile-overlay .pp-friend-row{display:flex;justify-content:space-between;gap:12px;background:#fff9eb;border-radius:10px;border:1px solid #d9b984;padding:10px}
#player-profile-overlay .pp-friend-row small{user-select:all;word-break:break-word}
#player-profile-overlay .pp-friend-form{display:flex;align-items:end;gap:12px;margin:20px 0 10px}
#player-profile-overlay .pp-friend-form label{display:grid;gap:5px;flex:1;font-weight:700}
#player-profile-overlay .pp-friend-form input{min-width:0;width:100%;box-sizing:border-box;padding:10px;font:15px system-ui;background:#fff;border:2px solid #cfa66b;border-radius:9px}
#player-profile-overlay .pp-gallery{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;align-items:stretch}
#player-profile-overlay .pp-avatar-choice{font-size:12px;justify-content:flex-start;min-height:176px;padding:10px 8px 12px}
#player-profile-overlay .pp-avatar-choice .pp-portrait{width:min(105px,100%);height:105px;margin-inline:auto;flex:0 0 auto}
#player-profile-overlay .pp-avatar-choice span{min-height:2.6em;display:flex;align-items:center;justify-content:center;line-height:1.15;text-align:center}
#game #player-progress{display:flex;flex-direction:column;align-items:flex-start;gap:0;line-height:1.2;white-space:nowrap;height:auto!important;min-height:0!important}
#game #player-progress .pp-hud-story{font-size:10px;color:#79512b;font-weight:700;max-width:100%;text-overflow:ellipsis;overflow:hidden}
#game #open-profile{min-height:87px!important}
@media(max-width:1040px){#player-profile-overlay .pp-card{max-width:calc(100vw - 10px)}#player-profile-overlay .pp-dashboard{grid-template-columns:minmax(0,1fr) minmax(250px,.9fr)}#player-profile-overlay .pp-side-tools{grid-column:1/-1}#player-profile-overlay .pp-progress-grid{grid-template-columns:1fr}#player-profile-overlay .pp-chapter-tile img{height:58px}}
@media(max-height:500px){
 #player-profile-overlay{padding:4px}
 #player-profile-overlay .pp-card{max-height:97dvh;padding:12px 15px;width:96vw;border-width:3px}
 #player-profile-overlay .pp-card h2{font-size:21px;margin-bottom:7px}
 #player-profile-overlay .pp-tabs{padding-bottom:7px;margin-bottom:8px;gap:5px}
 #player-profile-overlay .pp-tab{padding:6px 10px;font-size:11px}
 #player-profile-overlay .pp-dashboard{grid-template-columns:1fr;gap:7px}
 #player-profile-overlay .pp-player-card{padding:7px;gap:8px}
 #player-profile-overlay .pp-player-card .pp-portrait{width:65px;height:65px}
 #player-profile-overlay .pp-name{font-size:18px}
 #player-profile-overlay .pp-subtitle{font-size:11px;margin:3px 0}
 #player-profile-overlay .pp-stats{gap:3px}
 #player-profile-overlay .pp-stat{padding:4px 7px;grid-template-columns:24px 1fr;column-gap:4px}
 #player-profile-overlay .pp-stat-symbol{font-size:20px}
 #player-profile-overlay .pp-stat-name{font-size:10px}
 #player-profile-overlay .pp-stat strong{font-size:13px}
#player-profile-overlay .pp-stat-help{font-size:9px}
 #player-profile-overlay .pp-player-meta{gap:4px;margin-top:4px}
 #player-profile-overlay .pp-meta-chip{padding:3px 7px;font-size:10px}
 #player-profile-overlay .pp-inline-actions{gap:6px}
 #player-profile-overlay .pp-progress-grid{grid-template-columns:1fr;gap:8px;margin-top:8px}
 #player-profile-overlay .pp-code{margin-top:6px;padding:5px 8px}
 #player-profile-overlay .pp-story-promo{margin-top:8px;padding:7px 10px}
 #player-profile-overlay .pp-story-promo h3,#player-profile-overlay .pp-section-head h3{font-size:17px}
 #player-profile-overlay .pp-story-promo p{font-size:11px;margin:3px 0}
 #player-profile-overlay .pp-story-percent{font-size:18px}
 #player-profile-overlay .pp-story-button{margin-top:4px;font-size:11px;padding:4px 12px}
 #player-profile-overlay .pp-chapter-mini,#player-profile-overlay .pp-chapter-picker{margin-top:7px;gap:5px}
 #player-profile-overlay .pp-chapter-tile{font-size:10px;padding:3px 4px}
 #player-profile-overlay .pp-chapter-tile img{height:42px}
 #player-profile-overlay .pp-chapter-tile span{min-height:23px}
 #player-profile-overlay .pp-chapter-header{margin:0 0 4px}
 #player-profile-overlay .pp-chapter-art{height:48px;width:65px}
 #player-profile-overlay .pp-goal{padding:5px 6px}
 #player-profile-overlay .pp-avatar-choice{min-height:124px;padding:4px 4px 6px}
 #player-profile-overlay .pp-gallery .pp-portrait{height:65px;width:65px}
 #player-profile-overlay .pp-avatar-choice span{min-height:2.3em;font-size:9px}
 #player-profile-overlay .pp-ranking-row{padding:3px 8px}
 #player-profile-overlay .pp-rank-avatar{width:26px;height:26px}
 #game #open-profile{min-height:0!important}
 #game #player-progress{font-size:9px!important}
 #game #player-progress .pp-hud-story{font-size:8px}
}

/* The close icon has symmetric SVG strokes; no font glyph centering or platform dependence. */
#player-profile-overlay .pp-close{position:absolute;top:14px;right:16px;display:grid;place-items:center;box-sizing:border-box;width:38px;height:38px;padding:0;line-height:1;flex:none;z-index:2}
#player-profile-overlay .pp-close svg{display:block;width:20px;height:20px;overflow:visible;stroke:currentColor;stroke-width:3;stroke-linecap:round;fill:none}
/* All portraits share a fixed square viewport and centered source artwork. */
#player-profile-overlay .pp-gallery{grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;gap:10px}
#player-profile-overlay .pp-avatar-choice{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-height:177px;box-sizing:border-box;padding:10px 6px 12px;gap:9px}
#player-profile-overlay .pp-avatar-choice .pp-portrait{display:block;flex:0 0 auto;width:105px;height:105px;margin:0 auto;border-radius:21px}
#player-profile-overlay .pp-avatar-choice .pp-portrait img,#player-profile-overlay .pp-avatar-preview .pp-portrait img{object-position:50% 50%!important;transform:none!important}
#player-profile-overlay .pp-avatar-choice>span:not(.pp-portrait){font-size:12px;line-height:1.18;min-height:2.4em;display:flex;align-items:center;justify-content:center;text-align:center;overflow-wrap:break-word}
@media(max-height:500px){
 #player-profile-overlay .pp-close{top:8px;right:9px;width:32px;height:32px}
 #player-profile-overlay .pp-close svg{width:16px;height:16px}
 #player-profile-overlay .pp-avatar-choice{min-height:119px;padding:5px 2px;gap:4px}
 #player-profile-overlay .pp-avatar-choice .pp-portrait{width:65px;height:65px;border-radius:15px}
 #player-profile-overlay .pp-avatar-choice>span:not(.pp-portrait){font-size:9px;min-height:2.4em}
}

/* R52: profile only — a broad, aligned layout. Other account dialogs retain their sizes. */
#player-profile-overlay .pp-card.pp-view-profile {
  width:min(1440px,calc(100vw - 32px));
  max-height:calc(100dvh - 24px);
  padding:28px clamp(22px,2.5vw,40px) 30px;
}
#player-profile-overlay .pp-view-profile h2 {
  font:700 clamp(27px,2.2vw,36px)/1.13 Georgia,serif !important;
}
#player-profile-overlay .pp-view-profile h3 {
  font:700 clamp(17px,1.3vw,21px)/1.22 Georgia,serif !important;
}
#player-profile-overlay .pp-view-profile .pp-name {
  font:700 clamp(21px,1.8vw,30px)/1.18 Georgia,serif !important;
}
#player-profile-overlay .pp-view-profile .pp-tabs {margin-bottom:16px}
#player-profile-overlay .pp-overview {
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(300px,.85fr);
  gap:14px;
  align-items:stretch;
}
#player-profile-overlay .pp-overview .pp-player-card {
  min-height:96px;
  padding:10px 14px;
  gap:12px;
}
#player-profile-overlay .pp-overview .pp-player-card .pp-portrait {width:76px;height:76px}
#player-profile-overlay .pp-overview .pp-player-info {display:grid;align-content:center;gap:6px}
#player-profile-overlay .pp-overview .pp-subtitle {margin:0;color:#856043}
#player-profile-overlay .pp-player-note {margin:2px 0 0;color:#8b704f;font-size:13px}
#player-profile-overlay .pp-side-tools {
  display:flex;flex-direction:column;justify-content:space-between;
  gap:6px;min-height:96px;padding:10px 14px;
  border:2px solid #e5bf83;border-radius:18px;
  background:#fff9ea;box-sizing:border-box;
}
#player-profile-overlay .pp-side-tools .pp-code {
  border:0;background:transparent;padding:0;margin:0;box-shadow:none;
}
#player-profile-overlay .pp-side-tools .pp-code-row {gap:10px}
#player-profile-overlay .pp-side-tools .pp-code-row strong {font:800 15px/1.3 system-ui !important}
#player-profile-overlay .pp-inline-actions {display:flex;flex-wrap:wrap;gap:9px;padding-top:4px}
#player-profile-overlay .pp-inline-actions .pp-button {margin:0;white-space:normal}
#player-profile-overlay .pp-metrics {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;margin-top:9px;
}
#player-profile-overlay .pp-metrics .pp-stat {
  min-height:72px;box-sizing:border-box;
  display:grid;grid-template-columns:38px minmax(0,1fr);
  grid-template-rows:auto auto auto;align-content:center;
  column-gap:8px;row-gap:2px;padding:9px 12px;
}
#player-profile-overlay .pp-metrics .pp-stat-symbol {grid-row:1/span 3;font-size:30px}
#player-profile-overlay .pp-metrics .pp-stat strong {font:800 clamp(19px,1.65vw,25px)/1.1 system-ui;color:#654020}
#player-profile-overlay .pp-metrics .pp-stat-help {grid-column:2;font-size:11px;color:#8a6a49}
#player-profile-overlay .pp-view-profile .pp-progress-grid {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;margin-top:9px;align-items:stretch;
}
#player-profile-overlay .pp-view-profile .pp-progress-grid .pp-story-promo {
  display:flex;flex-direction:column;gap:8px;
  margin-top:0;min-height:116px;box-sizing:border-box;padding:12px 14px;
}
#player-profile-overlay .pp-view-profile .pp-story-promo p {margin:0;line-height:1.4}
#player-profile-overlay .pp-view-profile .pp-story-promo .pp-meter {margin:3px 0}
#player-profile-overlay .pp-view-profile .pp-story-button {margin-top:auto;align-self:start}
#player-profile-overlay .pp-view-profile .pp-mini-head {margin:20px 0 9px}
#player-profile-overlay .pp-view-profile .pp-chapter-mini {margin-top:0;gap:12px}
#player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile {min-height:143px;padding:7px 7px 9px}
#player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile img {height:86px}

#player-profile-overlay .pp-contact{margin-top:10px;padding:12px 16px;border:2px solid #e5bf83;border-radius:16px;background:#fff9ea}
#player-profile-overlay .pp-contact h3{margin:0 0 5px;font-size:17px}
#player-profile-overlay .pp-contact-intro{margin:0 0 6px}
#player-profile-overlay .pp-contact-row{display:flex;align-items:center;flex-wrap:wrap;gap:7px 10px;margin-top:5px;overflow-wrap:anywhere}
#player-profile-overlay .pp-contact-row a{color:#285b82;overflow-wrap:anywhere}
#player-profile-overlay .pp-contact-row .pp-button{margin:0;min-height:36px;padding:5px 10px}
#player-profile-overlay .pp-copy-status{font-size:12px;color:#4b7132}
@media(max-width:1000px) {
  #player-profile-overlay .pp-overview {grid-template-columns:minmax(0,1.2fr) minmax(275px,.8fr)}
  #player-profile-overlay .pp-overview .pp-player-card {gap:14px;padding:14px}
  #player-profile-overlay .pp-metrics .pp-stat {padding:11px 12px;column-gap:7px}
}
@media(max-width:710px) {
  #player-profile-overlay .pp-card.pp-view-profile {width:calc(100vw - 10px);max-height:calc(100dvh - 10px);padding:9px 10px}
  #player-profile-overlay .pp-overview {grid-template-columns:1fr;gap:6px}
  #player-profile-overlay .pp-overview .pp-player-card {min-height:0}
  #player-profile-overlay .pp-overview .pp-player-card .pp-portrait {width:62px;height:62px}
  #player-profile-overlay .pp-side-tools {min-height:0;gap:5px;padding:7px 9px}
  #player-profile-overlay .pp-metrics {grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:6px}
  #player-profile-overlay .pp-metrics .pp-stat {min-height:68px;padding:6px;grid-template-columns:1fr;gap:2px} #player-profile-overlay .pp-metrics .pp-stat-symbol{display:none} #player-profile-overlay .pp-metrics .pp-stat strong{font-size:17px} #player-profile-overlay .pp-metrics .pp-stat-help{grid-column:1;font-size:10px}
  #player-profile-overlay .pp-view-profile .pp-progress-grid {grid-template-columns:1fr;gap:6px;margin-top:6px}
  #player-profile-overlay .pp-view-profile .pp-progress-grid .pp-story-promo {min-height:0;padding:8px 10px;gap:4px}
  #player-profile-overlay .pp-view-profile .pp-chapter-mini {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-height:500px) and (min-width:711px) {
  #player-profile-overlay .pp-card.pp-view-profile {width:calc(100vw - 12px);max-height:calc(100dvh - 8px);padding:12px 16px}
  #player-profile-overlay .pp-view-profile .pp-tabs {margin-bottom:8px;padding-bottom:7px}
  #player-profile-overlay .pp-overview {grid-template-columns:minmax(0,1.4fr) minmax(230px,.8fr);gap:8px}
  #player-profile-overlay .pp-overview .pp-player-card {min-height:82px;padding:7px 11px}
  #player-profile-overlay .pp-overview .pp-player-card .pp-portrait {width:72px;height:72px}
  #player-profile-overlay .pp-side-tools {min-height:82px;padding:8px 11px}
  #player-profile-overlay .pp-metrics {gap:8px;margin-top:8px}
  #player-profile-overlay .pp-metrics .pp-stat {min-height:70px;padding:6px 10px}
  #player-profile-overlay .pp-view-profile .pp-progress-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
  #player-profile-overlay .pp-view-profile .pp-progress-grid .pp-story-promo {min-height:140px;padding:10px 13px;gap:4px}
  #player-profile-overlay .pp-view-profile .pp-chapter-mini {grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
  #player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile {min-height:100px}
  #player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile img {height:48px}
}
/* Do not let the old two-column dashboard breakpoint span the profile tools. */
#player-profile-overlay .pp-overview .pp-side-tools {grid-column:auto}
#player-profile-overlay .pp-view-profile .pp-inline-actions {justify-content:flex-end}
@media(max-width:710px){
 #player-profile-overlay .pp-view-profile .pp-inline-actions {justify-content:flex-start}
}
@media(min-width:900px) and (max-height:900px) {
 #player-profile-overlay .pp-card.pp-view-profile {padding-top:19px;padding-bottom:19px}
 #player-profile-overlay .pp-view-profile .pp-tabs {margin-bottom:12px;padding-bottom:11px}
 #player-profile-overlay .pp-overview .pp-player-card {min-height:122px;padding:12px 16px}
 #player-profile-overlay .pp-overview .pp-player-card .pp-portrait {width:93px;height:93px}
 #player-profile-overlay .pp-side-tools {min-height:122px;padding:11px 15px}
 #player-profile-overlay .pp-metrics {margin-top:10px;gap:12px}
 #player-profile-overlay .pp-metrics .pp-stat {min-height:87px;padding:9px 13px}
 #player-profile-overlay .pp-view-profile .pp-progress-grid {margin-top:10px;gap:12px}
 #player-profile-overlay .pp-view-profile .pp-progress-grid .pp-story-promo {min-height:163px;padding:14px 17px;gap:6px}
 #player-profile-overlay .pp-view-profile .pp-mini-head {margin:13px 0 7px}
 #player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile {min-height:119px;padding:5px}
 #player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile img {height:65px}
}

/* R53 — full chapter illustrations. No cover crop on any screen. */
#player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile img,
#player-profile-overlay .pp-chapter-picker .pp-chapter-tile img {
  display:block;
  width:100%;
  height:122px;
  box-sizing:border-box;
  padding:4px 9px;
  object-fit:contain;
  object-position:center center;
  background:radial-gradient(ellipse at 50% 25%,#f0f8fb,#d5e7f0);
  border:1px solid #d5e6ef;
  border-radius:10px;
}
#player-profile-overlay .pp-chapter-art {
  width:175px;
  height:155px;
  flex:0 0 175px;
  box-sizing:border-box;
  padding:7px;
  object-fit:contain;
  object-position:center;
  background:radial-gradient(ellipse at 50% 20%,#eff8fc,#d9e8ef);
}
@media (max-height:900px) and (min-width:711px) {
 #player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile img {height:94px}
}
@media(max-width:710px) {
 #player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile img,
 #player-profile-overlay .pp-chapter-picker .pp-chapter-tile img {height:104px}
 #player-profile-overlay .pp-chapter-art {width:110px;height:115px;flex-basis:110px}
}
@media(max-height:500px) and (min-width:711px) {
 #player-profile-overlay .pp-view-profile .pp-chapter-mini .pp-chapter-tile img,
 #player-profile-overlay .pp-chapter-picker .pp-chapter-tile img {height:70px;padding:2px 5px}
 #player-profile-overlay .pp-chapter-art {width:93px;height:92px;flex-basis:93px}
}

/* R54: rewrite and structure the account & saves screen. */
#player-profile-overlay .pp-card.pp-view-account{
  width:min(980px,96vw);
  max-height:calc(100dvh - 24px);
  padding:26px 28px 30px;
}
#player-profile-overlay .pp-view-account h2{font:700 clamp(28px,2.1vw,36px)/1.14 Georgia,serif!important}
#player-profile-overlay .pp-view-account h3{font:700 24px/1.2 Georgia,serif;color:#71411f;margin:0 0 10px}
#player-profile-overlay .pp-account-panel{
  border:2px solid #e1bd84;border-radius:20px;background:linear-gradient(180deg,#fffaf0 0%,#f9ebcf 100%);
  padding:18px 20px;margin-top:16px;box-shadow:inset 0 0 0 1px #fff6e8;
}
#player-profile-overlay .pp-account-panel:first-of-type{margin-top:0}
#player-profile-overlay .pp-account-panel>.pp-help{margin:7px 0 0}
#player-profile-overlay .pp-account-note{
  margin-top:14px;padding:14px 16px;border-radius:16px;border:1px solid #dfc08f;
  background:linear-gradient(180deg,#fff7e5 0%,#f8ecd0 100%);color:#6c4a27;
}
#player-profile-overlay .pp-account-note-title{display:block;font:800 12px/1 system-ui;letter-spacing:.08em;text-transform:uppercase;color:#94632a;margin-bottom:7px}
#player-profile-overlay .pp-account-note p{margin:0}
#player-profile-overlay .pp-account-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}
#player-profile-overlay .pp-account-step{
  display:flex;gap:10px;align-items:flex-start;padding:12px 13px;border-radius:16px;
  background:#fffdf6;border:1px solid #e5ca9b;min-height:88px;box-sizing:border-box;
}
#player-profile-overlay .pp-account-step-dot{
  flex:0 0 12px;width:12px;height:12px;border-radius:50%;margin-top:5px;
  background:radial-gradient(circle at 30% 30%,#ffeeb3 0%,#d1a14c 60%,#a46b27 100%);
  box-shadow:0 0 0 2px #fff7df,0 0 0 3px #d0ac72;
}
#player-profile-overlay .pp-account-step p{margin:0;font-size:14px;line-height:1.42}
#player-profile-overlay .pp-account-code-box{
  margin-top:16px;padding:14px 16px;border-radius:16px;border:2px solid #e3c58d;background:#fffdf7;
}
#player-profile-overlay .pp-account-code-box .pp-help{margin:8px 0 0}
#player-profile-overlay .pp-view-account .pp-code-row input{
  flex:1 1 220px;min-width:180px;border:2px solid #c99c65;border-radius:12px;background:#fffdf7;color:#4b3221;
  font:700 22px/1.1 system-ui;padding:11px 14px;box-sizing:border-box;
}
#player-profile-overlay .pp-account-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
#player-profile-overlay .pp-account-actions .pp-button{margin:0}
#player-profile-overlay .pp-account-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
#player-profile-overlay .pp-account-summary{
  padding:14px 15px;border-radius:17px;border:1px solid #e2c48d;background:#fffdf7;
  box-shadow:inset 0 0 0 1px #fff5dd;
}
#player-profile-overlay .pp-account-summary-title{display:block;font:800 12px/1 system-ui;letter-spacing:.08em;text-transform:uppercase;color:#926129;margin-bottom:8px}
#player-profile-overlay .pp-account-summary-name{font:700 22px/1.15 Georgia,serif;color:#634022;margin-bottom:10px;overflow-wrap:anywhere}
#player-profile-overlay .pp-account-summary-stats{display:flex;flex-wrap:wrap;gap:7px}
#player-profile-overlay .pp-account-chip{
  display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;border:1px solid #ddbf8a;
  background:#fff5df;color:#7a5430;font-size:12px;font-weight:700;
}
#player-profile-overlay .pp-account-form{margin-top:14px;max-width:520px}
#player-profile-overlay .pp-account-form label{display:grid;gap:8px}

@media(max-width:820px){
  #player-profile-overlay .pp-card.pp-view-account{width:calc(100vw - 12px);padding:16px 15px 18px;max-height:calc(100dvh - 10px)}
  #player-profile-overlay .pp-view-account h3{font-size:21px}
  #player-profile-overlay .pp-account-panel{padding:14px 14px 15px;margin-top:12px}
  #player-profile-overlay .pp-account-steps{grid-template-columns:1fr;gap:9px}
  #player-profile-overlay .pp-account-compare{grid-template-columns:1fr;gap:9px}
}

#player-profile-overlay .pp-card.pp-view-onboard { width:min(480px,calc(100vw - 20px)); padding:clamp(16px,4vw,28px); }
#player-profile-overlay .pp-view-onboard h2 { margin-right:0; }
.pp-onboard-recovery { margin-top:16px; color:#704526; }
.pp-onboard-recovery summary { cursor:pointer; padding:8px 0; font-weight:700; }

#meadow-guide:not([hidden]) {
 position:fixed; z-index:55; right:max(12px,env(safe-area-inset-right)); bottom:calc(82px + env(safe-area-inset-bottom));
 box-sizing:border-box; width:min(340px,calc(100vw - 24px)); padding:13px 38px 13px 15px;
 border:2px solid #d29b51; border-radius:16px; background:linear-gradient(145deg,#fff8e6,#f1d5a5);
 color:#553219; box-shadow:0 6px 24px #14274285;
}
#meadow-guide-title { font:700 18px/1.2 Georgia,serif; }
#meadow-guide-copy { margin:5px 0 9px; font-size:13px; line-height:1.35; }
#meadow-guide-action { min-height:34px; border:1px solid #955925; border-radius:8px; padding:5px 11px; background:#75401f; color:#fff6df; font:inherit; font-weight:700; }
#meadow-guide-dismiss { position:absolute; top:6px; right:6px; width:30px; height:30px; border:0; border-radius:50%; background:transparent; color:#553219; font-size:22px; }
#game[inert] #meadow-guide, body:has(#game-loading:not([hidden])) #meadow-guide,
body:has(#object-panel:not([hidden]), #modal:not([hidden]), #system-screen:not([hidden]), #gift-workshop:not([hidden]), #expeditions-overlay:not([hidden])) #meadow-guide { display:none; }
#game:not([inert]) .meadow-guide-target { outline:2px solid #ffe59e; outline-offset:3px; border-radius:12px; }
#game:has(.meadow-guide-target[data-object="house"]) #object-panel[data-view="house"]:not([hidden]) #panel-action:not(:disabled),
#game:has(.meadow-guide-target[data-object="tree"]) #object-panel[data-view="tree"]:not([hidden]) #panel-action:not(:disabled),
#game:has(.meadow-guide-target[data-object="chest"]) #object-panel[data-view="chest"]:not([hidden]) #panel-action:not(:disabled) { box-shadow:0 0 0 3px #ffe39a; }
@media(max-height:500px) {
 #meadow-guide:not([hidden]) { bottom:calc(54px + env(safe-area-inset-bottom)); padding-top:8px; padding-bottom:8px; }
 #meadow-guide-title { font-size:16px; }
}

/* The accepted desktop leaderboard keeps its existing layout. */
@media (max-width:700px), (max-width:950px) and (max-height:540px) {
 #player-profile-overlay .pp-view-ranking {
  width:min(100%,740px);max-height:calc(100dvh - 16px);box-sizing:border-box;
  padding:8px 10px 10px;overflow-x:hidden;overscroll-behavior:contain;
 }
 #player-profile-overlay .pp-view-ranking > h2 {margin:0 46px 5px 0;font-size:clamp(19px,4.2vw,24px);line-height:1.15;}
 #player-profile-overlay .pp-view-ranking .pp-close {top:4px;right:7px;min-width:38px;min-height:38px;}
 #player-profile-overlay .pp-view-ranking .pp-ranking-title,
 #player-profile-overlay .pp-view-ranking .pp-ranking-head {display:none;}
 #player-profile-overlay .pp-view-ranking .pp-tabs,
 #player-profile-overlay .pp-view-ranking .pp-ranking-filters {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin:4px 0;
 }
 #player-profile-overlay .pp-view-ranking .pp-tabs .pp-tab,
 #player-profile-overlay .pp-view-ranking .pp-pager .pp-button {
  min-height:34px;margin:0;padding:3px 5px;font-size:12px;
 }
 #player-profile-overlay .pp-view-ranking .pp-ranking-table {display:grid;gap:4px;background:transparent;border:0;}
 #player-profile-overlay .pp-view-ranking .pp-ranking-row:not(.pp-ranking-head) {
  min-height:0;grid-template-columns:1.9em minmax(0,1fr) auto;grid-template-areas:"place player points" "place player add";
  gap:3px 7px;padding:6px 8px;border:1px solid #ddbe8e;border-radius:9px;background:#fff9e9;font-size:14px;line-height:1.15;
 }
 #player-profile-overlay .pp-view-ranking .pp-ranking-row.pp-is-me {background:#edf5d6;border-color:#7e9e4d;}
 #player-profile-overlay .pp-view-ranking .pp-rank-place {grid-area:place;text-align:center;font-size:14px;font-weight:700;align-self:center;}
 #player-profile-overlay .pp-view-ranking .pp-ranking-player {grid-area:player;display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;column-gap:9px;line-height:1.15;overflow-wrap:anywhere;}
 #player-profile-overlay .pp-view-ranking .pp-rank-avatar {width:40px;height:40px;box-sizing:border-box;}
 #player-profile-overlay .pp-view-ranking .pp-rank-meta {display:flex;flex-direction:column;gap:4px;min-width:0;}
 #player-profile-overlay .pp-view-ranking .pp-rank-name {font-size:16px;line-height:1.05;font-weight:700;}
 #player-profile-overlay .pp-view-ranking .pp-rank-level {font-size:13px;line-height:1.1;padding-left:0;color:#7b6143;}
  #player-profile-overlay .pp-view-ranking .pp-rank-points {grid-area:points;align-self:center;text-align:right;overflow-wrap:anywhere;font-size:15px;font-weight:700;}
 #player-profile-overlay .pp-view-ranking .pp-rank-points::after {content:" очков";font-weight:500;}
 #player-profile-overlay .pp-view-ranking .pp-rank-add {grid-area:add;align-self:center;min-height:32px;padding:3px 10px;margin:0;font-size:12px;line-height:1.1;}
 #player-profile-overlay .pp-view-ranking .pp-my-place {margin:5px 0 4px;font-size:13px;}
 #player-profile-overlay .pp-view-ranking .pp-ranking-pages {
  position:static;display:flex;flex-wrap:nowrap;justify-content:center;gap:5px;
  margin:4px 0 0;padding:2px 3px;background:#fff0d4;
 }
}



