/* Four equal navigation targets; the icon and label share one center line. */
#app>.bottom-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:6px 8px;align-items:stretch;background:linear-gradient(#fbf9ee,#f1f3e5);border-top:1px solid #d1d7be;}
#app>.bottom-nav>.nav-item{position:relative;min-width:0;min-height:50px;padding:6px 2px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:1px solid transparent;border-radius:10px;color:#718789;background:transparent;line-height:1;transition:background .18s,border-color .18s,color .18s;}
#app>.bottom-nav>.nav-item>.icon{display:grid;place-items:center;width:21px;height:21px;line-height:1;font-size:20px;margin:0;}
#app>.bottom-nav>.nav-item[data-screen="hero"]>.icon{font-size:24px;transform:translateY(-.5px);}
#app>.bottom-nav>.nav-item{min-height:48px;padding:4px 2px 3px;gap:3px;}
#app>.bottom-nav>.nav-item:focus:not(:focus-visible){outline:none!important;}
#app>.bottom-nav>.nav-item:focus-visible{outline:1px solid #68978b!important;outline-offset:1px;}
#app>.bottom-nav>.nav-item>span:not(.icon):not(.nav-badge){font:700 10px/1.15 Interface,sans-serif;white-space:nowrap;letter-spacing:0;}
#app>.bottom-nav>.nav-item.active{background:#e8efdc;border-color:#b9cba6;color:#326c64;box-shadow:inset 0 1px 0 #fffdf3;}
#app>.bottom-nav .nav-badge{top:2px;right:calc(50% - 31px);min-width:16px;min-height:14px;padding:2px 3px;font:700 8px/1 Interface,sans-serif;border:1px solid #fff8e9;}
.header-party-art{display:block;width:24px;height:25px;object-fit:contain;}
#app .header-actions>#party-open{display:grid;place-items:center;padding:2px;line-height:0;}
#app .header-actions>#party-open>.header-party-art{width:28px;height:26px;max-width:none;max-height:none;margin:0;object-fit:contain;object-position:center;}
#friends-open{position:relative;}
.friends-request-badge{position:absolute;top:-4px;right:-4px;display:grid;place-items:center;min-width:14px;height:14px;padding:0 3px;border:1px solid #fff8e9;border-radius:8px;background:#c97861;color:#fffdf3;font:700 8px/1 Interface,sans-serif;}
#settings.settings-page{padding:15px 12px 20px;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;}
#settings>.page-head{margin:0 0 14px;}
#settings>.page-head h1{font:700 23px/1.2 Interface,sans-serif;color:#305d59;}
#settings .v13-preferences,#settings .v13-settings-character{background:linear-gradient(#fffdf3,#f6f5e8);}
.friends-panel{width:min(420px,calc(100vw - 22px));max-height:min(720px,calc(100dvh - 36px));padding:16px;display:flex;flex-direction:column;overflow:hidden;border:1px solid #beb58b;background:linear-gradient(#fffcef,#f1f2e2);}
.friends-panel>.modal-header{flex:none;margin-bottom:12px;}
#app.friends-sheet-open #modal-root .modal-shade{padding:0;align-items:flex-start;justify-content:flex-end;pointer-events:none;background:transparent;backdrop-filter:none;}
#app.friends-sheet-open #modal-root .friends-panel{position:absolute;margin:0;max-width:none;pointer-events:auto;border-radius:0 0 12px 12px;transform-origin:top center;animation:friends-drop-in .32s cubic-bezier(.2,.75,.25,1) both;box-shadow:0 7px 20px #304a3b24;}
#app.friends-sheet-open #modal-root .modal-shade.closing .friends-panel{animation:friends-drop-out .2s ease-in both;}
@keyframes friends-drop-in{from{opacity:0;transform:translateY(calc(-100% - 14px))}to{opacity:1;transform:translateY(0)}}
@keyframes friends-drop-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(calc(-100% - 14px))}}
.friends-panel>.modal-header{touch-action:pan-x;user-select:none;}
.friends-list:not(.can-scroll){touch-action:pan-x;}
.friends-list.can-scroll{touch-action:pan-y;}
.friends-drag-handle{display:block;flex:none;width:36px;height:3px;margin:10px auto 0;border-radius:3px;background:#b9c3aa;touch-action:none;cursor:grab;}
.reduced-motion.friends-sheet-open #modal-root .friends-panel{animation:none!important;}
@media(prefers-reduced-motion:reduce){#app.friends-sheet-open #modal-root .friends-panel{animation:none!important;}}
.friends-tabs{display:grid;grid-template-columns:1fr 1fr;gap:3px;flex:none;padding:3px;margin-bottom:10px;border:1px solid #d5cfac;border-radius:9px;background:#ede8d4;}
.friends-tabs>button{display:flex;justify-content:center;align-items:center;gap:6px;min-height:32px;min-width:0;padding:5px;border:1px solid transparent;border-radius:6px;font:700 11px/1.2 Interface,sans-serif;color:#897d62;background:none;}
.friends-tabs>button[aria-selected=true]{background:#fffdf3;border-color:#d2c8a3;color:#386b60;box-shadow:0 1px 2px #6e60451a;}
.friends-tabs small{font-size:9px;opacity:.8;}
.friends-search{flex:none;min-width:0;width:100%;box-sizing:border-box;height:34px;margin-bottom:10px;padding:7px 10px;border:1px solid #ccd3b6;border-radius:8px;background:#fffdf4;color:#3e665c;font:11px/1.2 Interface,sans-serif;}
.friends-list{min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;}
.friends-section-title{margin:12px 1px 7px;color:#8c856d;font:700 9px/1.2 Interface,sans-serif;text-transform:uppercase;letter-spacing:.5px;}
.friend-row{display:flex;align-items:center;gap:8px;min-width:0;padding:9px 8px;margin-bottom:6px;border:1px solid #d0d7bd;border-radius:9px;background:#fffdf2;}
.friend-portrait{position:relative;display:block;flex:0 0 38px;width:38px;height:42px;border:1px solid #ddd2ad;border-radius:7px;background:#f5f0de;overflow:hidden;}
.friend-portrait>img{width:100%;height:100%;object-fit:contain;object-position:center bottom;}
.friend-row.is-online .friend-portrait:after{content:"";position:absolute;right:2px;bottom:2px;width:6px;height:6px;border:1px solid #fffdf3;border-radius:50%;background:#70a35e;}
.friend-copy{flex:1;min-width:0;}
.friend-copy strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#3a675b;font:700 11px/1.3 Interface,sans-serif;}
.friend-copy small{display:block;margin-top:3px;color:#8a886f;font:9px/1.3 Interface,sans-serif;}
.friend-copy .friend-status{color:#8c8b7b;}
.friend-row.is-online .friend-status{color:#6d8a56;}
.friend-actions{display:flex;gap:4px;flex:none;align-items:center;}
.friend-actions>button{display:grid;place-items:center;min-width:28px;min-height:29px;padding:4px 7px;border:1px solid #c5d0b2;border-radius:7px;background:#edf2df;color:#447263;font:700 11px/1 Interface,sans-serif;}
.friend-actions>button.secondary{background:#f5efdd;border-color:#d9ccaa;color:#9b8269;}
.friend-actions>button:disabled{opacity:.5;}
.friend-actions>button>img{width:18px;height:18px;object-fit:contain}
.friend-actions>.friend-icon{padding:4px;width:30px;min-width:30px}
.friends-empty{padding:27px 14px;text-align:center;color:#8d8b76;font:11px/1.6 Interface,sans-serif;}
.friends-empty strong{display:block;margin-bottom:5px;color:#57786a;font-size:12px;}
.party-sheet-code{width:min(310px,calc(100vw - 44px))!important;max-height:min(58dvh,430px);overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;}
.party-invite-code-line{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:6px 0 13px;padding:9px;border:1px solid #d6cba6;border-radius:8px;background:#fffaf0;}
.party-invite-code-line>strong{font:700 18px/1.2 Interface,sans-serif;letter-spacing:2px;color:#416e5f;}
.party-invite-code-line>button{padding:5px 8px;min-height:28px;font-size:9px;}
.party-sheet-code>.friends-section-title{margin:10px 0 8px;}
.party-sheet-code .friend-row{padding:7px 5px;gap:6px;}
.party-sheet-code .friend-portrait{width:30px;height:34px;flex-basis:30px;}
.party-sheet-code .friend-copy strong{font-size:10px;}
.party-sheet-code .friend-actions>button{font-size:9px;padding:4px 6px;}
@media(max-width:350px){#app>.bottom-nav{padding-left:5px;padding-right:5px;gap:3px;}#app>.bottom-nav>.nav-item>span:not(.icon):not(.nav-badge){font-size:9px;}.friends-panel{padding:12px;}}
@media(prefers-reduced-motion:reduce){#app>.bottom-nav>.nav-item{transition:none;}}
/* Motion stays inside the painted glass; the frame and chains stay planted. */
.opponent-card .opponent-blood-bubbles{animation:none!important;transform:none!important;opacity:1;fill:#c64a3c;stroke:#ffc6aa;stroke-width:.6;}
.opponent-blood-bubbles>circle{transform-box:fill-box;transform-origin:center;animation:respawn-bubble var(--bubble-time,2.8s) linear infinite;animation-delay:var(--bubble-delay,0s);}
@keyframes respawn-bubble{0%{transform:translate(0,0) scale(.45);opacity:0}12%{opacity:.72}80%{opacity:.75}100%{transform:translate(var(--bubble-x,1px),calc(-1 * var(--blood-rise,40px))) scale(1.15);opacity:0}}
.opponent-card .opponent-sand-stream{stroke:#e5b75e;stroke-width:.65;stroke-dasharray:none;animation:none;opacity:.58;}
.opponent-sand-fall{fill:#fff0b7;}
.opponent-sand-fall>circle{animation:respawn-grain .48s linear infinite;animation-delay:var(--grain-delay,0s);}
@keyframes respawn-grain{0%{transform:translateY(0);opacity:0}12%,88%{opacity:1}100%{transform:translateY(var(--sand-fall,55px));opacity:0}}
.opponent-card .opponent-sand-glint{animation:respawn-sand-settle .7s ease-in-out infinite;transform-origin:center;}
@keyframes respawn-sand-settle{0%,100%{opacity:.25}50%{opacity:.95}}
.opponent-card:not([data-phase=RESPAWNING]) .opponent-blood-bubbles>circle,.opponent-card:not([data-phase=RESPAWNING]) .opponent-sand-fall>circle,.opponent-card:not([data-phase=RESPAWNING]) .opponent-sand-glint{animation:none!important;}
.ritual-offscreen .opponent-blood-bubbles>circle,.ritual-offscreen .opponent-sand-fall>circle,.ritual-offscreen .opponent-sand-glint{animation-play-state:paused!important;}
.reduced-motion .opponent-blood-bubbles,.reduced-motion .opponent-sand-fall,.reduced-motion .opponent-sand-glint{display:none!important;}
@media(prefers-reduced-motion:reduce){.opponent-blood-bubbles,.opponent-sand-fall,.opponent-sand-glint{display:none!important;}}

/* Keep the notification sheet steady when switching between friends and trade. */
#app.friends-sheet-open #modal-root .friends-panel{box-sizing:border-box;padding:12px}
.friends-panel>.modal-header{margin-bottom:8px}
.friends-panel>.friends-tabs{margin-bottom:8px}
.friends-panel>.friends-list{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.friends-panel .friends-empty{box-sizing:border-box;min-height:100%;padding:12px 8px;display:flex;flex-direction:column;justify-content:center}
.friends-panel .friends-section-title{margin:3px 1px 5px;font-size:8px;line-height:11px}
.friends-panel .xc-row.is-ask{gap:3px;padding:4px 7px;margin-bottom:6px;min-width:0}
.friends-panel .xc-ask-head{display:flex;align-items:baseline;gap:5px;min-width:0}
.friends-panel .xc-ask-head b{flex:0 1 auto;max-width:48%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:15px}
.friends-panel .xc-ask-head small{flex:1;min-width:0;font-size:9px;line-height:13px}
.friends-panel .xc-pair-box{gap:4px}
.friends-panel .xc-box{grid-template-columns:minmax(0,1fr);align-items:center;gap:2px}
.friends-panel .xc-anim{height:54px;border-radius:7px}
.friends-panel .xc-anim .lot-fan-card{width:34px;height:47px;top:50%;transform:translate(-50%,-50%) translateX(calc((var(--i) - (var(--n) - 1) / 2) * 18px)) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 4deg))}
.friends-panel .xc-coins{gap:2px;min-height:14px;font-size:10px}
.friends-panel .xc-coins .icon{font-size:12px}
.friends-panel .xc-coins small{max-width:28px;font-size:8px;line-height:10px;text-align:center}
.friends-panel .xc-arrow svg{width:16px;height:16px}
.friends-panel .xc-msg{padding:0 2px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:13px}
.friends-panel .xc-actions{gap:6px}
.friends-panel .xc-actions button{min-height:28px;height:28px;padding:4px 7px;font-size:11px}

/* Compact, aligned trade notifications; scroll stays usable without a gutter. */
.friends-panel>.friends-list{scrollbar-width:none;scrollbar-gutter:auto;padding-right:0}
.friends-panel>.friends-list::-webkit-scrollbar{display:none;width:0;height:0}
.friends-panel .xc-ask-head{display:grid;grid-template-columns:minmax(0,1fr);gap:1px;align-items:start}
.friends-panel .xc-ask-head b{max-width:100%;font-family:inherit;line-height:16px}
.friends-panel .xc-ask-head small{display:block;min-width:0;line-height:13px;overflow-wrap:anywhere}
.friends-panel .xc-msg{white-space:normal;line-height:14px;padding:1px 0}
.friends-panel .xc-row.is-ask{gap:5px;padding:7px 8px}
.friends-panel .xc-coins{justify-content:center;line-height:14px;font-variant-numeric:tabular-nums}

/* 05.11.2026: панель по содержимому, заметные новые заявки, понятные действия */
.friends-panel>.friends-list{flex:1 1 auto}
.friends-panel .friends-empty{min-height:0;padding:14px 8px 6px;align-items:center}
.friends-tabs>button.has-new small{display:inline-grid;place-items:center;min-width:15px;height:15px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:#c97861;color:#fffdf3;font-weight:700;opacity:1}
.friends-nearby{margin-top:10px;min-height:32px;padding:6px 14px;border:1px solid #608975;border-radius:7px;background:#447d6b;color:#fffaf0;font:600 11px/1.2 Interface,sans-serif}
.friend-actions>button:not(.secondary){padding:6px 10px;border-color:#608975;background:#447d6b;color:#fffaf0;font-size:11px}
.friend-actions>button{height:32px;min-height:32px;box-sizing:border-box}
.friend-actions>button.secondary{width:32px;min-width:32px;padding:0;background:none;border-color:#e0d6b8;color:#a8977c}
button.friend-portrait{padding:0;cursor:pointer}
.friend-copy strong{font-size:12px}
/* 05.11.2026: крестик в строке вкладок, новые заявки и торговля мигают на вкладке */
.friends-panel>.friends-tabs{grid-template-columns:repeat(3,minmax(0,1fr)) 32px!important;align-items:stretch}
.friends-tabs>.friends-close{min-width:0;padding:0;border:1px solid #d2c8a3;border-radius:6px;background:#fffdf3;color:#6d8a76;font:400 18px/1 Interface,sans-serif}
.friends-request-badge,#app>.bottom-nav .nav-badge{display:grid;place-items:center;min-width:16px;height:16px;min-height:16px;padding:0 4px;box-sizing:border-box;border:1px solid #fff8e9;border-radius:5px;background:linear-gradient(180deg,#d1705d,#b0483b);color:#fffdf5;font:700 9.5px/1 Interface,sans-serif;font-variant-numeric:tabular-nums;box-shadow:0 1px 2px #5a2a2040}
.friends-request-badge{top:-5px;right:-5px}
#app>.bottom-nav .nav-badge{top:1px;right:calc(50% - 30px)}
/* 06.11.2026: no blinking; a small block with the number stands right after the word. Tabs and the cross are one even row with equal side margins. */
#app #modal-root .friends-panel{padding-left:12px!important;padding-right:12px!important;scrollbar-gutter:auto!important}
.friends-panel>.friends-tabs{display:grid!important;box-sizing:border-box;width:100%!important;margin-left:0!important;margin-right:0!important;grid-template-columns:repeat(3,minmax(0,1fr)) 32px!important;align-items:stretch!important;gap:4px!important;padding:4px!important;border-radius:12px!important}
.friends-panel>.friends-tabs>button{position:relative;display:flex!important;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;height:32px!important;min-height:32px!important;margin:0!important;padding:0 4px!important;border:1px solid transparent!important;border-radius:9px!important;font:600 12px/1 Interface,sans-serif!important;animation:none!important}
.friends-panel>.friends-tabs>button[aria-selected=true]{border-color:#e0d7b4!important;box-shadow:0 1px 2px #49584a22!important}
.friends-panel>.friends-tabs>button.has-new::after{content:attr(data-count);flex:none;box-sizing:border-box;min-width:14px;height:14px;padding:0 3px;border-radius:4px;background:#b85f4f;color:#fffdf3;font:600 9px/14px Interface,sans-serif;text-align:center}
.friends-panel>.friends-tabs>.friends-close{width:32px;border-color:#d8cfae!important;background:#fffdf4!important;color:transparent!important;font-size:0!important}
.friends-panel>.friends-tabs>.friends-close::before,.friends-panel>.friends-tabs>.friends-close::after{content:"";position:absolute;left:50%;top:50%;width:12px;height:1.5px;margin:-.75px 0 0 -6px;border-radius:1px;background:#6b7560;transform:rotate(45deg)}
.friends-panel>.friends-tabs>.friends-close::after{transform:rotate(-45deg)}
#presence-panel .presence-action{display:grid;place-items:center;padding:0}
#presence-panel .presence-action img{width:16px;height:16px}
/* 06.11.2026: section names are centred on a thin line */
#modal-root .friends-panel .friends-section-title{display:flex;align-items:center;gap:8px;margin:9px 2px 6px;padding:0;border:0;background:none;font:500 10px/1.2 Interface,sans-serif;letter-spacing:.03em;text-transform:none;text-align:center;color:#938e74}
#modal-root .friends-panel .friends-section-title:first-child{margin-top:2px}
#modal-root .friends-panel .friends-section-title::before,#modal-root .friends-panel .friends-section-title::after{content:"";flex:1;height:1px;background:#ded6ba}
/* someone asked to be your friend: their plus softly pulses, pressing it accepts */
#presence-panel [data-presence-accept].is-incoming{animation:presence-incoming 1.5s ease-in-out infinite}
@keyframes presence-incoming{0%,100%{background:#fffdf3;box-shadow:0 0 0 0 #447d6b00;border-color:#cfd2b8;color:#447d6b}50%{background:#e3eedc;box-shadow:0 0 0 2px #447d6b33;border-color:#447d6b;color:#2f6a55}}
@media(prefers-reduced-motion:reduce){#presence-panel [data-presence-accept].is-incoming{animation:none;background:#e3eedc;border-color:#447d6b}}
/* 06.11.2026: friend row buttons with drawn marks; a direct trade offer is one even line, like a friend request */
.friend-actions>button.friend-icon{width:29px;min-width:29px;height:29px;padding:0;background:#fffdf4;border-color:#d8cfae}
.friend-actions>button.friend-icon img,.friend-actions>[data-friend-action="remove"] img{display:block;width:16px;height:16px}
.friends-panel .xc-row.is-direct{display:flex;align-items:center;gap:8px;min-width:0;padding:8px;margin-bottom:6px;border:1px solid #d0d7bd;border-radius:9px;background:#fffdf2;box-shadow:none}
.friends-panel .xc-row.is-direct .xc-who{flex:1;min-width:0;display:grid;gap:2px}
.friends-panel .xc-row.is-direct .xc-who b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 13px/1.2 Interface,sans-serif;color:#2f4a3a}
.friends-panel .xc-row.is-direct .xc-who small{font:400 11px/1.2 Interface,sans-serif;color:#827c63}
.friends-panel .xc-direct-actions{flex:none;display:flex;align-items:center;gap:5px}
.friends-panel .xc-direct-actions button{height:29px;border-radius:7px;font:600 11px/1 Interface,sans-serif}
.friends-panel .xc-accept{padding:0 11px;border:1px solid #608975;background:#447d6b;color:#fffaf0}
.friends-panel .xc-accept:disabled{opacity:.55}
.friends-panel .xc-decline{width:29px;padding:0;border:1px solid #d9ccaa;background:#f5efdd;color:#9b8269;font-size:14px!important;font-weight:400!important}
