/* ============ PROFILE ============ */
.profile-head{padding:28px var(--gutter) 8px;max-width:var(--frame-max);margin:0 auto;animation:fadeIn .3s ease-out;background:var(--bg);}
.profile-head-top{display:flex;align-items:center;gap:18px;flex-wrap:wrap;}
.profile-head-actions{display:flex;gap:10px;flex-shrink:0;margin-left:auto;}
#profileEditBtn{
  appearance:none;border:1px solid var(--green-200);cursor:pointer;
  font-family:'Pretendard',sans-serif;font-size:13px;font-weight:600;
  padding:9px 18px;border-radius:var(--r-full);background:transparent;color:var(--primary);
  transition:background .12s linear;flex-shrink:0;
}
#profileEditBtn:hover{background:var(--primary-soft);}
#profileUploadBtn{
  appearance:none;border:none;cursor:pointer;
  font-family:'Pretendard',sans-serif;font-size:13px;font-weight:600;
  padding:9px 18px;border-radius:var(--r-full);background:var(--primary);color:var(--bg);
  transition:background .12s linear;flex-shrink:0;
}
#profileUploadBtn:hover{background:var(--primary-dark);}
#profileFollowBtn{
  appearance:none;cursor:pointer;border:none;
  font-family:'Pretendard',sans-serif;font-size:13px;font-weight:600;
  padding:9px 20px;border-radius:var(--r-full);background:var(--primary);color:var(--bg);
  transition:background .12s linear;flex-shrink:0;
}
#profileFollowBtn:hover{background:var(--primary-dark);}
#profileFollowBtn.following{background:transparent;color:var(--primary);border:1px solid var(--green-200);}
#profileFollowBtn.following:hover{background:var(--primary-soft);}
#profileReportBtn{
  appearance:none;border:1px solid var(--border-strong);cursor:pointer;
  font-family:'Pretendard',sans-serif;font-size:13px;font-weight:600;
  padding:9px 16px;border-radius:var(--r-full);background:transparent;color:var(--muted);
  transition:background .12s linear,color .12s linear;flex-shrink:0;
}
#profileReportBtn:hover{background:var(--primary-soft);color:var(--accent-warm);}
#profileBlockBtn{
  appearance:none;border:1px solid var(--border-strong);cursor:pointer;
  font-family:'Pretendard',sans-serif;font-size:13px;font-weight:600;
  padding:9px 16px;border-radius:var(--r-full);background:transparent;color:var(--muted);
  transition:background .12s linear,color .12s linear;flex-shrink:0;
}
#profileBlockBtn:hover{background:var(--primary-soft);color:var(--accent-warm);}
.profile-follow-counts{display:flex;gap:16px;margin-top:6px;}
.profile-follow-count-btn{
  appearance:none;background:none;border:none;padding:0;cursor:pointer;
  font-family:'Pretendard',sans-serif;font-size:13px;color:var(--muted);
}
.profile-follow-count-btn strong{color:var(--text);font-weight:700;}
.profile-follow-count-btn:hover strong{color:var(--primary);}
#follow-list-dialog{width:380px;max-width:calc(100vw - 40px);padding:26px;max-height:70vh;display:flex;flex-direction:column;}
#follow-list-content{overflow-y:auto;margin:4px -6px 0;}
#new-collection-dialog,#edit-collection-dialog{width:380px;max-width:calc(100vw - 40px);padding:26px;}
#add-to-collection-dialog,#add-artwork-dialog{width:380px;max-width:calc(100vw - 40px);padding:26px;max-height:70vh;display:flex;flex-direction:column;}
#atc-list,#aa-list{overflow-y:auto;margin:4px -6px 0;display:flex;flex-direction:column;gap:2px;}
.list-row{
  display:flex;align-items:center;gap:10px;padding:8px 6px;border-radius:8px;
  text-decoration:none;color:inherit;transition:background .12s linear;
}
.list-row:hover{background:var(--primary-soft);}
.list-avatar,.list-avatar-fallback{width:36px;height:36px;border-radius:50%;flex-shrink:0;object-fit:cover;}
.list-thumb{width:36px;height:36px;border-radius:6px;flex-shrink:0;object-fit:cover;background:var(--border);color:transparent;overflow:hidden;}
.list-avatar-fallback{
  background:var(--primary);color:var(--bg);display:flex;align-items:center;justify-content:center;
  font-family:'Pretendard',sans-serif;font-size:14px;font-weight:700;
}
.list-name{font-family:'Pretendard',sans-serif;font-size:14px;font-weight:600;color:var(--text);}
#upload-art-dialog{width:380px;max-width:calc(100vw - 40px);padding:26px;}
#upload-art-dialog h3{font-family:'Pretendard',sans-serif;font-size:18px;font-weight:700;margin:0 0 10px;color:var(--primary);}
.profile-avatar-lg{width:72px;height:72px;border-radius:50%;object-fit:cover;background:var(--border);flex-shrink:0;display:block;border:1px solid var(--border-strong);}
.profile-avatar-fallback-lg{
  width:72px;height:72px;border-radius:50%;background:var(--primary);color:var(--bg);flex-shrink:0;
  display:flex;align-items:center;justify-content:center;font-family:'Pretendard',sans-serif;font-size:26px;font-weight:700;
}
.profile-head-info{min-width:0;}
.profile-head-info h1{margin:0 0 6px;font-family:'Pretendard',sans-serif;font-size:24px;font-weight:700;letter-spacing:-.01em;color:var(--primary);}
.profile-meta{color:var(--muted);font-family:'Pretendard',sans-serif;font-size:13px;}
.collection-status{
  display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:3px 10px;border-radius:999px;
  font-family:'Pretendard',sans-serif;font-size:11px;font-weight:600;
  background:var(--border);color:var(--muted);
}
.collection-status.live{background:var(--primary-soft);color:var(--primary);}
.profile-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;}
.profile-link-chip{
  display:inline-flex;align-items:center;gap:5px;padding:5px 12px;border-radius:999px;border:1px solid var(--green-200);
  background:transparent;color:var(--primary);font-family:'Pretendard',sans-serif;font-size:12px;font-weight:600;text-decoration:none;
  transition:background .12s linear;
}
.profile-link-chip:hover{background:var(--primary-soft);}
#profileBio{color:var(--muted);font-size:13.5px;line-height:1.6;margin:16px 0 0;max-width:640px;}
.profile-disability-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;}
.profile-disability-tags:empty{margin-top:0;}
.profile-disability-tag{
  display:inline-flex;align-items:center;padding:4px 11px;border-radius:999px;
  background:var(--primary-soft);color:var(--primary);font-family:'Pretendard',sans-serif;font-size:11.5px;font-weight:600;
}
.profile-section{
  margin:16px max(var(--gutter), calc((100% - var(--frame)) / 2)) 0;padding:22px var(--gutter) 26px;
  background:var(--surface);border-top:none;border-radius:var(--r-lg);
}
.profile-section:last-child{margin-bottom:48px;}
.profile-section .section-label{margin-left:0;margin-right:0;}
.profile-projects-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,180px));gap:12px;justify-content:start;}
.profile-art-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,110px));gap:12px;justify-content:start;}
.profile-section-head{display:flex;align-items:center;justify-content:space-between;margin:4px 0 14px;}
.profile-section-head .section-label{margin:0;}
.section-new-btn{
  appearance:none;border:1px solid var(--green-200);cursor:pointer;
  font-family:'Pretendard',sans-serif;font-size:12px;font-weight:600;
  padding:6px 14px;border-radius:var(--r-full);background:transparent;color:var(--primary);
  transition:background .12s linear;flex-shrink:0;
}
.section-new-btn:hover{background:var(--primary-soft);}
.profile-collections-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,180px));gap:12px;justify-content:start;}
.board-add-btn{
  position:absolute;top:5px;right:5px;z-index:2;width:22px;height:22px;border-radius:50%;
  appearance:none;border:none;cursor:pointer;background:rgba(15,36,23,.72);color:var(--bg);
  display:flex;align-items:center;justify-content:center;font-size:14px;line-height:1;
  transition:background .12s linear;
}
.board-add-btn:hover{background:var(--primary);}
.profile-art-thumb{
  position:relative;aspect-ratio:1;border-radius:var(--r-sm);overflow:hidden;cursor:pointer;
  background:var(--bg);border:none;box-shadow:var(--shadow-sm);
  transition:box-shadow .12s linear;
  display:block;color:inherit;text-decoration:none;
}
.profile-art-thumb:hover{box-shadow:var(--shadow-md);}
.profile-art-thumb img{width:100%;height:100%;object-fit:cover;display:block;color:transparent;}
.pool-badge{
  position:absolute;left:0;right:0;bottom:0;padding:4px 6px;text-align:center;
  background:rgba(15,36,23,.78);color:var(--bg);
  font-family:'Pretendard',sans-serif;font-size:10px;font-weight:600;
  pointer-events:none;
}
.profile-graph-desc{color:var(--muted);font-size:12px;line-height:1.6;margin:-6px 0 14px;max-width:640px;}
.profile-graph-panel{position:relative;border:1px solid var(--border-strong);border-radius:var(--r-lg);background:#fff;height:360px;overflow:hidden;}
.profile-graph-panel svg{width:100%;height:100%;display:block;cursor:grab;}
.profile-graph-panel svg:active{cursor:grabbing;}
.profile-graph-crumb{
  position:absolute;top:10px;left:10px;z-index:2;display:none;align-items:center;gap:8px;
  background:rgba(247,247,245,.94);border:1px solid var(--border-strong);border-radius:16px;
  padding:4px 12px 4px 8px;font-family:'Pretendard',sans-serif;font-size:12px;max-width:calc(100% - 20px);
}
#profileGraphBack{appearance:none;border:none;background:none;cursor:pointer;font:inherit;font-weight:600;color:var(--primary);padding:2px 4px;flex-shrink:0;}
#profileGraphCrumbLabel{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#profileGraphCrumbVisit{color:var(--primary);font-weight:600;text-decoration:none;flex-shrink:0;}
#profileGraphCrumbVisit:hover{text-decoration:underline;}
.profile-graph-empty{
  position:absolute;inset:0;display:none;align-items:center;justify-content:center;
  color:var(--muted);font-family:'Pretendard',sans-serif;font-size:13px;
  text-align:center;padding:0 24px;
}

/* ---------- shared follow-relationship graph marks (profile + network pages) ---------- */
.pg-node{cursor:pointer;}
.pg-node .pg-ring{fill:none;stroke:var(--border-strong);stroke-width:1.5px;transition:stroke .12s linear,stroke-width .12s linear;}
.pg-node:hover .pg-ring{stroke:var(--primary);stroke-width:2.5px;}
.pg-node.pg-center .pg-ring{stroke:var(--primary);stroke-width:2px;}
.pg-node .pg-fallback{fill:var(--primary);}
.pg-node .pg-fallback-label{fill:var(--bg);font-family:'Pretendard',sans-serif;font-weight:700;text-anchor:middle;dominant-baseline:central;pointer-events:none;}
.pg-label{font-family:'Pretendard',sans-serif;font-size:9.5px;fill:var(--text);text-anchor:middle;pointer-events:none;}
.pg-link{stroke:var(--border-strong);stroke-width:1.4px;fill:none;}
.pg-link.pg-mutual{stroke:var(--primary);stroke-width:1.6px;}

/* ---------- standalone collection page item grid ---------- */
#collectionItemsGrid{max-width:var(--frame-max);margin:0 auto;padding:0 var(--gutter);}

@media (max-width:640px){
  /* Side gutters come from the shared frame (--gutter is 16px here). */
  .profile-head-actions{margin-left:0;}
  #collectionItemsGrid{padding-left:16px;padding-right:16px;}
}

/* ---------- game medals ----------
   Podium finishes in the piece-finding game (supabase_game.sql).
   A standing, not a trophy: lose the top time and the medal goes with it,
   which is why the count is read live rather than stored. Hidden entirely
   when the player has none — an empty medal row reads as a rebuke. */
.profile-medals{display:flex;flex-wrap:wrap;gap:12px;margin-top:8px;}
.pm-item{display:inline-flex;align-items:center;gap:4px;font-family:'Pretendard',sans-serif;font-size:13px;color:var(--muted);}
.pm-ico{font-size:15px;line-height:1;}
.pm-item strong{font-size:14px;font-weight:700;color:var(--text);font-variant-numeric:tabular-nums;}

/* ---------- medal-winning artworks (2026-09-13) ---------- */
/* A horizontal strip rather than a grid: this is a side note on a profile,
   and someone with 40 medals should not push the artist's own work off the
   screen. Only the strip scrolls sideways — the page never does. */
.pmw-track{
  display:flex;gap:14px;overflow-x:auto;overflow-y:hidden;padding-bottom:10px;
  scroll-snap-type:x proximity;overscroll-behavior-x:contain;
}
.pmw-track::-webkit-scrollbar{height:8px;}
.pmw-track::-webkit-scrollbar-thumb{background:var(--gray-300);border-radius:var(--r-full);}
.pmw-track::-webkit-scrollbar-track{background:transparent;}
.pmw-card{flex:0 0 auto;width:150px;scroll-snap-align:start;display:flex;flex-direction:column;}
.pmw-thumb-link{display:block;position:relative;line-height:0;border-radius:var(--r-sm);}
.pmw-thumb-link:focus-visible{outline:2px solid var(--primary);outline-offset:2px;}
.pmw-thumb{
  display:block;width:150px;height:150px;object-fit:cover;border-radius:var(--r-sm);
  background:var(--gray-100);box-shadow:var(--shadow-sm);cursor:zoom-in;
  transition:transform .12s ease-out,box-shadow .12s ease-out;
}
.pmw-thumb-link:hover .pmw-thumb{transform:translateY(-2px);box-shadow:var(--shadow-md);}
/* The medal sits on the picture, so it needs its own dark disc — a bare
   emoji vanishes on a bright artwork (same reason the lightbox zoom bar
   got a pill). */
.pmw-medal{
  position:absolute;top:6px;left:6px;width:26px;height:26px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:15px;line-height:1;
  background:rgba(15,20,17,.72);
}
.pmw-title{
  font-family:'Pretendard',sans-serif;font-size:12.5px;line-height:1.35;color:var(--text);
  font-weight:600;margin-top:8px;
  /* Two lines reserved whether or not the title needs them: without it a
     one-line title and a two-line title put their start buttons at
     different heights, and the row of buttons goes ragged. */
  min-height:34px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:keep-all;
}
.pmw-by{
  margin-bottom:8px;
  font-family:'Pretendard',sans-serif;font-size:11.5px;color:var(--muted);margin-top:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
/* Sized here because this page loads neither admin.css nor the modal
   action styles that give .btn-primary its padding elsewhere. */
.pmw-play{
  display:block;margin-top:auto;padding:8px 10px;border-radius:var(--r-full);
  font-family:'Pretendard',sans-serif;font-size:12.5px;font-weight:700;text-align:center;
  background:var(--gradient-primary);color:#fff;text-decoration:none;
}
.pmw-play:hover{opacity:.92;}
@media (max-width:640px){
  .pmw-card{width:132px;}
  .pmw-thumb{width:132px;height:132px;}
}

/* Which medal this artwork is. Colour-coded so the three read apart at a
   glance even when the strip is scrolled fast. */
.pmw-rank{font-family:'Pretendard',sans-serif;font-size:11.5px;font-weight:700;margin-top:4px;}
.pmw-rank-1{color:#b8860b;}
.pmw-rank-2{color:#8a8f98;}
.pmw-rank-3{color:#a1663b;}

/* ---------- upload: visibility choice + private badge (supabase_portfolios.sql) ---------- */
.ua-visibility{display:flex;flex-direction:column;gap:8px;}
.ua-vis-opt{display:flex;gap:10px;align-items:flex-start;font-family:'Pretendard',sans-serif;font-size:13px;line-height:1.45;font-weight:400;cursor:pointer;}
.ua-vis-opt input{width:auto;margin:3px 0 0;flex-shrink:0;accent-color:var(--primary);}
.ua-vis-opt strong{font-weight:600;}
.ua-vis-opt small{display:block;color:var(--muted);font-size:12px;}
.private-badge{
  position:absolute;left:0;right:0;bottom:0;padding:4px 6px;text-align:center;
  background:rgba(40,40,40,.8);color:#fff;
  font-family:'Pretendard',sans-serif;font-size:10px;font-weight:600;
  pointer-events:none;
}

/* Coloured-artworks strip: the highest level finished, on the thumbnail. */
.pmw-level{
  position:absolute;left:6px;bottom:6px;line-height:1;pointer-events:none;
  font-family:'Pretendard',sans-serif;font-size:10.5px;font-weight:700;padding:3px 7px;border-radius:var(--r-full);
  background:rgba(15,20,17,.75);color:#fff;
}

/* Constellations strip (2026-09-21): the newest completed constellations,
   drawn small. A sky with none yet hides the whole section. */
.pstar-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.pstar-track{display:flex;gap:10px;flex-wrap:wrap;}
.pstar-item{width:92px;text-align:center;text-decoration:none;color:inherit;}
.pstar-item svg{display:block;width:92px;height:92px;border:1px solid var(--border);border-radius:var(--r-md);background:#0b1020;}
.pstar-name{display:block;font-family:'Pretendard',sans-serif;font-size:11.5px;font-weight:600;color:var(--muted);margin-top:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pstar-all{font-family:'Pretendard',sans-serif;font-size:13px;font-weight:600;color:var(--primary);text-decoration:none;}
.pstar-all:hover{text-decoration:underline;}
.pstar-meta{font-family:'Pretendard',sans-serif;font-size:12.5px;color:var(--muted);margin-top:8px;}
