/* NMSeawise Shop (0.30.13): purchased profile looks + the Shop pages. Fonts are self-hosted, SIL OFL 1.1 (assets/fonts/*.LICENSE.txt).
   They are used ONLY inside purchased profile elements; the app's own navigation / reading font is never changed. */
@font-face { font-family: 'NM Cinzel'; src: url('assets/fonts/nm-cinzel.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'NM Playfair'; src: url('assets/fonts/nm-playfair-display.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'NM Josefin'; src: url('assets/fonts/nm-josefin-sans.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'NM Pacifico'; src: url('assets/fonts/nm-pacifico.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'NM Dancing'; src: url('assets/fonts/nm-dancing-script.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'NM Lobster'; src: url('assets/fonts/nm-lobster.woff2') format('woff2'); font-display: swap; }
.nm-font-nm-cinzel { font-family: 'NM Cinzel', Georgia, serif; letter-spacing: .02em; }
.nm-font-nm-playfair { font-family: 'NM Playfair', Georgia, serif; }
.nm-font-nm-josefin { font-family: 'NM Josefin', system-ui, sans-serif; }
.nm-font-nm-pacifico { font-family: 'NM Pacifico', cursive; font-weight: 400; }
.nm-font-nm-dancing { font-family: 'NM Dancing', cursive; font-weight: 400; font-size: 1.12em; }
.nm-font-nm-lobster { font-family: 'NM Lobster', cursive; font-weight: 400; }
.profile-bio[class*="nm-font-"] { font-size: max(1em, 15px); line-height: 1.5; }

/* purchased profile theme: only CSS variables with server-checked colours (#RRGGBB); text colour is contrast-checked in shop.js */
.nm-shop-theme { background: var(--shop-bg); color: var(--shop-text); border-radius: 18px; padding: 18px; }
.nm-shop-theme .profile-handle, .nm-shop-theme .profile-role, .nm-shop-theme .profile-bio, .nm-shop-theme .public-profile-counts span { color: var(--shop-text); opacity: .92; }
.nm-shop-theme .public-profile-link { color: var(--shop-text); text-decoration: underline; }
.nm-shop-theme .public-profile-counts b { color: var(--shop-accent); }
.nm-shop-banner { position: relative; padding-top: 88px; }
.nm-shop-banner::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 76px; border-radius: 18px 18px 0 0; background: var(--shop-banner) center / cover no-repeat; }
.nm-shop-banner > * { position: relative; }

/* avatar frames: drawn with CSS only, never an uploaded overlay over the face */
/* Each frame is a real ring made of 1-2 pseudo-elements: a masked, shaded band (rope strands, polished metal, lifebuoy segments, steel bezel, chain links, aurora glow).
   Rings sit OUTSIDE the photo/initial and never cover the face. Pure CSS: no image overlay, no extra download. */
.nm-frame .public-profile-avatar .avatar, .nm-frame .shop-swatch-avatar { position: relative; isolation: isolate; box-shadow: inset 0 1px 2px rgba(255, 255, 255, .25), inset 0 -2px 4px rgba(0, 0, 0, .3), 0 3px 8px rgba(0, 0, 0, .4); }
/* phones: slightly thinner rings so the framed avatar does not crowd lists and the bottom bar */
@media (max-width: 520px) { .nm-frame .avatar::before { transform: scale(.92); } }
.nm-frame .public-profile-avatar .avatar::before, .nm-frame .shop-swatch-avatar::before, .nm-frame .public-profile-avatar .avatar::after, .nm-frame .shop-swatch-avatar::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; }
/* rope: twisted three-strand hemp with a dark lay line, lit from one side */
.nm-frame-rope .avatar::before, .nm-frame-rope .shop-swatch-avatar::before { inset: -10px; background: repeating-linear-gradient(-62deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 4px), repeating-linear-gradient(-62deg, #5E3A1A 0 2px, #C99A5B 2px 4px, #8A5D2E 4px 6px, #E7C088 6px 7px, #6B4420 7px 9px), repeating-linear-gradient(58deg, transparent 0 3px, rgba(255, 240, 210, .18) 3px 4px, transparent 4px 7px), radial-gradient(circle at 35% 30%, rgba(255, 240, 210, .35), transparent 60%); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.nm-frame-rope .avatar::after, .nm-frame-rope .shop-swatch-avatar::after { inset: -4px; background: conic-gradient(from 200deg, rgba(0, 0, 0, .35), transparent 35%, transparent 65%, rgba(0, 0, 0, .35)); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
/* gold: polished metal with a bright specular sweep, a dark edge and a soft warm glow (never flat yellow) */
.nm-frame-gold .avatar::before, .nm-frame-gold .shop-swatch-avatar::before { inset: -9px; background: conic-gradient(from 210deg, #6B4A0E, #F6E7A6 12%, #B98A2C 24%, #FFF6D0 34%, #8C6218 48%, #E9C760 60%, #FFF1BE 72%, #9A6E1C 84%, #6B4A0E); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); filter: drop-shadow(0 0 6px rgba(214, 170, 60, .55)) drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.nm-frame-gold .avatar::after, .nm-frame-gold .shop-swatch-avatar::after { inset: -3px; background: linear-gradient(160deg, rgba(255, 255, 255, .85), transparent 40%, rgba(90, 60, 10, .55)); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); }
/* compass: steel-and-teal bezel with a graduated dial ring, like a navigation instrument */
.nm-frame-compass .avatar::before, .nm-frame-compass .shop-swatch-avatar::before { inset: -10px; background: conic-gradient(#EEF3F7, #6E7C8A, #F7FAFC, #56636F, #DDE5EC, #748291, #EEF3F7); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.nm-frame-compass .avatar::after, .nm-frame-compass .shop-swatch-avatar::after { inset: -5px; background: repeating-conic-gradient(var(--shop-frame, #1AA6A6) 0 1.2deg, transparent 1.2deg 9deg); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
/* lifebuoy: the classic red and white segmented ring with a hard shadow under it */
.nm-frame-lifebuoy .avatar::before, .nm-frame-lifebuoy .shop-swatch-avatar::before { inset: -13px; background: repeating-conic-gradient(#D8432C 0deg 30deg, #F8F5EF 30deg 60deg); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 12px), #000 calc(100% - 11px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 12px), #000 calc(100% - 11px)); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.nm-frame-lifebuoy .avatar::after, .nm-frame-lifebuoy .shop-swatch-avatar::after { inset: -13px; background: radial-gradient(circle, transparent 0 60%, rgba(0, 0, 0, .18) 60% 62%, transparent 62%, rgba(255, 255, 255, .5) 98%, transparent 100%); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 12px), #000 calc(100% - 11px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 12px), #000 calc(100% - 11px)); }
/* chain: brushed steel links with dark bevels */
.nm-frame-chain .avatar::before, .nm-frame-chain .shop-swatch-avatar::before { inset: -10px; background: repeating-conic-gradient(#C9D2DC 0deg 11deg, #4A5561 11deg 22deg); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.nm-frame-chain .avatar::after, .nm-frame-chain .shop-swatch-avatar::after { inset: -3px; background: conic-gradient(rgba(255, 255, 255, .5), transparent 25%, rgba(0, 0, 0, .4) 50%, transparent 75%, rgba(255, 255, 255, .5)); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); }
/* aurora: a luminous ring that moves through green, blue and violet */
.nm-frame-aurora .avatar::before, .nm-frame-aurora .shop-swatch-avatar::before { inset: -9px; background: conic-gradient(from 0deg, #2E9E6B, #4A8EE0, #8A63D2, #2E9E6B); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); filter: drop-shadow(0 0 8px rgba(74, 142, 224, .6)); }
.nm-frame-aurora .avatar::after, .nm-frame-aurora .shop-swatch-avatar::after { inset: -4px; background: linear-gradient(120deg, rgba(255, 255, 255, .55), transparent 45%); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); }
/* supplied frame artwork (assets/shop/frames): the picture sits BEHIND the photo; its centre is transparent, so the face is never covered */
.nm-frame-art .avatar::before, .nm-frame-art .shop-swatch-avatar::before { inset: calc(50% - (100% + 2 * var(--frame-bw, 0px)) * var(--frame-k, 1.8) / 2); background: var(--frame-art) center / 100% 100% no-repeat; -webkit-mask: none; mask: none; filter: none; }
.nm-frame-art .avatar::after, .nm-frame-art .shop-swatch-avatar::after { display: none; }

/* Shop pages */
.shop .shop-intro { margin: 0 0 8px; }
.shop-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; max-width: 100%; }
.shop-tab { flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); color: inherit; text-decoration: none; white-space: nowrap; }
.shop-tab.on { background: var(--tab-active, rgba(14, 78, 178, .22)); font-weight: 600; }
.shop-tab:focus-visible { outline: 2px solid var(--blue, #4A8EE0); outline-offset: 2px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.shop-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card, transparent); display: flex; flex-direction: column; min-width: 0; }
.shop-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shop-card h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.shop-card p { margin: 0; overflow-wrap: anywhere; }
.shop-tier { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #C9A227; color: #1B1400; vertical-align: middle; }
.shop-price b { font-size: 18px; } .shop-price span { font-size: 13px; opacity: .85; }
.shop-owned { font-size: 13px; color: var(--green, #2E9E6B); }
.shop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.shop-actions .btn { width: auto; flex: 1 1 140px; min-height: 44px; }
.shop-swatch { position: relative; height: 104px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: radial-gradient(120% 110% at 0% 0%, rgba(74, 142, 224, .32), transparent 60%), radial-gradient(90% 120% at 100% 100%, rgba(201, 162, 39, .18), transparent 55%), linear-gradient(135deg, #1B2F52, #08121F); color: #EEF2F7; border-radius: 0; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -18px 30px -24px rgba(0, 0, 0, .6); }
/* framed Shop previews (80px): header tall enough for the whole frame, extra left room for the wheel knobs, no clipping */
.shop-swatch.nm-frame-art { height: 176px; padding-left: 58px; overflow: visible; }
.shop-swatch::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .07) 50%, transparent 60%); pointer-events: none; }
.shop-card { box-shadow: 0 6px 18px -12px rgba(8, 18, 31, .55); }
.shop-swatch.nm-shop-theme { border-radius: 0; padding: 14px; }
.shop-swatch-banner { position: absolute; inset: 0 0 auto 0; height: 34px; background: var(--shop-banner); }
.shop-swatch-avatar { position: relative; width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #4A8EE0; color: #fff; font-weight: 700; flex: 0 0 auto; }
.shop-swatch-name { position: relative; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.shop-mine { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 12px; align-items: center; }
.shop-mine .shop-swatch { border-radius: 12px; }
@media (max-width: 520px) { .shop-mine { grid-template-columns: 1fr; } }
.shop-table-wrap { overflow-x: auto; max-width: 100%; }
.shop-table { width: 100%; border-collapse: collapse; font-size: 14px; } .shop-table th, .shop-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.shop-note { padding: 10px 12px; border-radius: 12px; background: rgba(46, 158, 107, .15); }
.shop-preview { margin: 8px 0; }

/* the bottom bar with the Shop tab (7 items): narrower pills so every tab keeps a 44 px touch target down to 320 px */
.tabs.tabs-7 .pill { width: min(56px, calc((100vw - 16px) / 7 - 4px)); }
.tabs.tabs-7 a { font-size: 11px; min-width: 0; } .tabs.tabs-7 a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* chat cosmetics: purchased Messenger theme preview, smiley packs and stickers (pictures from the shop-assets bucket) */
.nm-sticker { display: block; width: 120px; height: 120px; max-width: 100%; object-fit: contain; margin: 2px 0; }
.nm-sml img { width: 20px; height: 20px; vertical-align: middle; object-fit: contain; }
.nm-sml-head { flex: 0 0 100%; margin: 6px 4px 2px; font-size: 12px; opacity: .8; }
.nm-sbl img { display: block; object-fit: contain; }
.nm-sbl-sticker { min-width: 56px; min-height: 56px; }
.shop-swatch-chat { flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; }
.shop-bubble { max-width: 70%; padding: 6px 10px; border-radius: 14px; font-size: 13px; background: rgba(255, 255, 255, .92); color: #0B1626; }
.shop-bubble.mine { align-self: flex-end; background: #4A8EE0; color: #fff; }
.shop-swatch-pack { flex-wrap: wrap; gap: 8px; justify-content: center; }
.shop-swatch-pack img { object-fit: contain; }
/* profile photos have a 4px border (styles.css .pp-v2 .pp-avatar); the artwork starts at the OUTER edge of that border so no gap shows */
.pp-v2 .pp-avatar .avatar { --frame-bw: 0px; }
/* framed profile photo: no border, so the ring sits directly on the photo edge */
.pp-v2.nm-frame-art .pp-avatar .avatar { border: 0; }
/* ROOT CAUSE of the detached look: styles.css gives .avatar overflow:hidden, which clipped the ring to the photo box.
   Framed avatars let the ring draw outside the box; the photo itself stays a circle (rounded image). */
.nm-frame-art .avatar { overflow: visible; }
.nm-frame-art .avatar > img { border-radius: 50%; width: 100%; height: 100%; object-fit: cover; display: block; }
/* 52px Shop previews use the thicker small-size artwork (retired); one SVG per style now */
.nm-frame-art .shop-swatch-avatar::before { background: var(--frame-art-shop, var(--frame-art)) center / 100% 100% no-repeat; }
/* v2 frames: decorations at the bottom edge of the ring need air above the name on phones */
@media (max-width: 640px) { .pp-v2.nm-frame-art .public-profile-info { padding-top: 24px; } }
/* v2 frames: the wheel spokes and bottom decorations reach past the 52px swatch; reserve room so names never sit under them */
/* Shop previews: 80px with a 2.2x frame box, so decorations keep clear of the name and buttons */
.nm-frame-art .shop-swatch-avatar { width: 80px; height: 80px; --frame-k: 2.151; margin-right: 40px; flex: none; }
.pp-v2.nm-frame-art .public-profile-info { margin-top: 0; }

/* 0.30.21 Shop layout: use the available desktop width with more, smaller cards per row. Prices, purchase and ownership logic are unchanged. */
@media (min-width: 900px) {
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .screen > .body:has(.shop-grid) { max-width: 1180px; width: 100%; margin: 0 auto; }
}
.shop-tabs { flex-wrap: nowrap; }

/* 0.30.21 premium cover (2100x700): fill the banner without distortion at any width (only heroes that carry nm-cover-fit) */
.nm-cover-fit .pp-cover.pp-cover-shop { background-size: cover; background-position: center top; }

/* 0.30.23 mobile Shop: a compact two-column marketplace on phones (desktop unchanged) */
@media (max-width: 639px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .shop-card { border-radius: 12px; }
  .shop-card-body { padding: 8px 9px 10px; gap: 4px; }
  .shop-card h3 { font-size: 14px; line-height: 1.25; }
  .shop-card p { font-size: 12px; line-height: 1.35; }
  .shop-card .hint { font-size: 11px; }
  .shop-price b { font-size: 15px; }
  .shop-price span { font-size: 11px; }
  .shop-swatch { height: 96px; padding: 8px 10px; gap: 8px; }
  .shop-swatch.nm-frame-art { height: 112px; padding-left: 0; justify-content: center; overflow: visible; }
  .shop-swatch.nm-frame-art .shop-swatch-avatar { width: 60px; height: 60px; margin-right: 0; }
  .shop-actions { gap: 6px; margin-top: 2px; }
  .shop-actions .btn { flex: 1 1 100%; min-height: 36px; font-size: 13px; padding: 8px 10px; }
  .shop-tabs { gap: 6px; padding-bottom: 6px; }
}
@media (max-width: 359px) {
  .shop-grid { gap: 6px; }
  .shop-card h3 { font-size: 13px; }
  .shop-card p { font-size: 11px; }
  .shop-card-body { padding: 7px 7px 8px; }
  .shop-swatch.nm-frame-art .shop-swatch-avatar { width: 52px; height: 52px; }
}

/* 0.30.23: with the Shop tab there are seven phone tabs: one row of seven (the six-column rule made Menu wrap onto a second row) */
@media (max-width: 899px) { body:not(.auth):not(.sub) .tabs.tabs-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

/* 0.30.27: the Shop swatch shows the uploaded profile photo (round, cropped) when there is one */
.shop-swatch-avatar > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* 0.30.28 Captain's Ship Wheel: its artwork extends about 1.7x the avatar (the spokes and handles stay outside the centre hole, so the photo is not reduced).
   Layout space is reserved: the Shop card swatch is taller, and the preview text keeps clear of the spokes. Other frames are unchanged. */
.shop-swatch.nm-frame-captains_ship_wheel { height: 150px; }
.nm-frame-captains_ship_wheel .public-profile-info { padding-right: 52px; }

/* 0.30.28: the seven phone tabs stay on one row on every page (My Profile and other pages set body.member-nav-visible.sub, which had a six-column rule) */
@media (max-width: 899px) { body:not(.auth) .tabs.tabs-7, body.member-nav-visible.sub:not(.auth) .tabs.tabs-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

/* 0.30.33: the premium frame artwork extends beyond the avatar; keep it inside the preview sheet (phones 320-430 px and desktop) */
.sheet .shop-preview.nm-frame-art { padding-right: 16px; }

/* 0.30.33: the Captain's Ship Wheel is drawn at its design scale (2.151), so its centre opening matches the photo; the preview stacks the avatar above the text so the wheel fits on every width */
.sheet .shop-preview.nm-frame-captains_ship_wheel { grid-template-columns: 1fr; justify-items: center; text-align: center; padding-right: 0; }
.sheet .shop-preview.nm-frame-captains_ship_wheel .public-profile-avatar { order: -1; margin: 60px 0; }
/* 0.30.33: the Wheel on the Shop card: a smaller avatar keeps its artwork inside the card; the photo and the centre opening scale together, so the alignment is unchanged */
.shop-swatch.nm-frame-captains_ship_wheel .shop-swatch-avatar { width: 64px; height: 64px; }
/* 0.30.33: frame cards: the framed photo is centred in its swatch and the sample name is not drawn over the artwork (the product name and price stay in the card body) */
.shop-swatch.nm-frame-art { justify-content: center; padding-left: 0; }
.shop-swatch.nm-frame-art .shop-swatch-name { display: none; }
.shop-swatch.nm-frame-art .shop-swatch-avatar { margin: 0 auto; }
