/* widget_point/style.css : 닉네임 꾸미기 + 포인트 창 (미니멀) */

/* ── 닉네임 꾸미기 (페이지 전체) ── */
.pw-nick-color { color: var(--pw-c1) !important; }
.pw-nick-grad {
    background: linear-gradient(90deg, var(--pw-c1), var(--pw-c2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
}
/* transform 요소는 부모의 background-clip:text 를 못 받아 투명해지므로 직접 칠한다 */
.pw-nick-grad .pw-fx-float,
.pw-nick-grad .pw-fx-heart,
.pw-nick-grad .pw-fx-flip,
.pw-nick-grad .pw-fx-layers {
    background: linear-gradient(90deg, var(--pw-c1), var(--pw-c2));
    -webkit-background-clip: text;
    background-clip: text;
}
/* 글자 단위 효과는 c1 → c2 색을 글자마다 나눠 칠한다 */
.pw-nick-grad .pw-ch {
    -webkit-text-fill-color: color-mix(in srgb, var(--pw-c2) calc(var(--i) / max(var(--n) - 1, 1) * 100%), var(--pw-c1));
}
.pw-nick-icon { display: inline-block; margin: 0 .15em; -webkit-text-fill-color: initial; color: initial; font-style: normal; }
.pw-nick-title {
    display: inline-block;
    margin: 0 .3em;
    padding: 0 .45em;
    border-radius: 4px;
    background: var(--pw-tbg);
    color: var(--pw-tfg);
    font-size: .75em;
    font-weight: 600;
    line-height: 1.6;
    vertical-align: .08em;
    white-space: nowrap;
}

/* ── 포인트 창 ── */
html.pw-open { overflow: hidden; }
.pw-root {
    --pw-accent: var(--primary-color, #e0607e);
    --pw-bg: var(--card-bg-color, #fff);
    --pw-ink: var(--content-font-color, #3a3236);
    --pw-line: color-mix(in srgb, var(--pw-ink) 10%, transparent);
    --pw-faint: color-mix(in srgb, var(--pw-ink) 4%, transparent);
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: grid;
    place-items: center;
    padding: 16px;
    font-family: var(--content-font-family, sans-serif);
    font-size: 12px;
    color: var(--pw-ink);
}
.pw-root[hidden] { display: none; }
.pw-root *, .pw-root *::before, .pw-root *::after { box-sizing: border-box; }
.pw-backdrop { position: absolute; inset: 0; background: #1b141840; }
.pw-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(380px, 100%);
    max-height: min(620px, calc(100dvh - 32px));
    overflow: hidden;
    border: 1px solid var(--pw-line);
    border-radius: 12px;
    background: var(--pw-bg);
    box-shadow: 0 12px 40px #2a1c2224;
    outline: none;
    animation: pw-pop .18s ease;
}
.pw-root button { font: inherit; color: inherit; cursor: pointer; }
.pw-root button:disabled { cursor: default; }
.pw-root button:focus-visible { outline: 1.5px solid var(--pw-accent); outline-offset: 2px; }

.pw-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px 16px;
}
.pw-head-label { margin: 0 0 2px; font-size: 9px; letter-spacing: .18em; opacity: .45; }
.pw-head h2 { display: flex; align-items: center; margin: 0; font-size: 14px; font-weight: 700; color: inherit; overflow-wrap: anywhere; }
.pw-balance { margin: 0; white-space: nowrap; }
.pw-balance strong { font-size: 16px; font-weight: 700; color: var(--pw-accent); letter-spacing: -.01em; }
.pw-balance small { margin-left: 1px; font-size: 10px; font-weight: 600; opacity: .55; }
.pw-x { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 17px !important; line-height: 1; opacity: .45; }
.pw-x:hover { opacity: .9; background: var(--pw-faint); }

.pw-tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 10px; border-bottom: 1px solid var(--pw-line); }
.pw-tabs button { padding: 8px 4px 7px; border: 0; border-bottom: 1.5px solid transparent; background: transparent; font-size: 12px !important; opacity: .5; }
.pw-tabs button[aria-selected=true] { border-bottom-color: var(--pw-ink); font-weight: 600; opacity: 1; }
.pw-tabs i { display: none; }

.pw-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px; scrollbar-width: thin; }
.pw-panel[hidden] { display: none; }
.pw-loading, .pw-empty { margin: 20px 0; text-align: center; font-size: 12px; opacity: .5; }
.pw-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.55; opacity: .5; }
.pw-root.is-busy .pw-btn { opacity: .5; pointer-events: none; }

.pw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 26px;
    padding: 4px 10px;
    border: 1px solid var(--pw-line);
    border-radius: 6px;
    background: transparent;
    font-size: 11.5px !important;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity .12s, background .12s;
}
.pw-btn:not(:disabled):hover { background: var(--pw-faint); }
.pw-btn-main { border-color: var(--pw-ink); background: var(--pw-ink); color: var(--pw-bg) !important; }
.pw-btn-main:not(:disabled):hover { background: var(--pw-ink); opacity: .85; }
.pw-btn:disabled { opacity: .35; }
.pw-btn small { font-size: .9em; font-weight: 500; opacity: .75; }

.pw-stat { display: flex; align-items: baseline; gap: 3px; }
.pw-stat strong { font-size: 15px; font-weight: 700; }
.pw-stat span { font-size: 11px; opacity: .5; }

/* 출석 */
.pw-attend-top { display: flex; align-items: center; gap: 14px; }
.pw-attend-top .pw-btn { margin-left: auto; }
.pw-cal { margin-top: 12px; }
.pw-cal-title { margin: 0 0 6px; font-size: 11px; font-weight: 600; opacity: .6; }
.pw-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.pw-cal-wd { padding-bottom: 2px; text-align: center; font-size: 9.5px; opacity: .4; }
.pw-cal-wd:first-child { color: #d0506a; }
.pw-cal-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 6px; font-size: 10.5px; }
.pw-cal-num { opacity: .45; }
.pw-cal-day.is-today .pw-cal-num { opacity: 1; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.pw-cal-day.is-stamped { background: color-mix(in srgb, var(--pw-accent) 12%, transparent); }
.pw-cal-day.is-stamped .pw-cal-num { opacity: .9; color: var(--pw-accent); font-weight: 600; }
.pw-stamp { position: absolute; right: 3px; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--pw-accent); font-size: 0; animation: pw-fade .3s ease both; }

/* 상점 · 가방: 상자 대신 얇은 구분선 목록 */
.pw-mine { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 10px; border-bottom: 1px solid var(--pw-line); }
.pw-mine-label { font-size: 10.5px; opacity: .5; }
.pw-preview { display: inline-flex; align-items: center; flex-wrap: wrap; min-width: 0; font-size: 13px; font-weight: 600; }
.pw-preview-name { overflow-wrap: anywhere; }
.pw-subtabs { display: flex; gap: 4px; margin-top: 12px; }
.pw-subtabs button { position: relative; padding: 4px 11px; border: 1px solid var(--pw-line); border-radius: 999px; background: transparent; font-size: 11px !important; opacity: .55; }
.pw-subtabs button:hover { opacity: .85; }
.pw-subtabs button[aria-selected=true] { border-color: var(--pw-ink); background: var(--pw-ink); color: var(--pw-bg) !important; font-weight: 600; opacity: 1; }
/* 이 종류에 장착 중인 아이템이 있으면 점으로 표시 */
.pw-subtabs button.has-equipped::after { content: ''; position: absolute; top: 2px; right: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--pw-accent); }
.pw-subtabs + .pw-shop-group { margin-top: 10px; }
.pw-shop-group { margin-top: 14px; }
.pw-group-title { margin: 0 0 2px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: inherit; opacity: .55; }
.pw-group-title small { font-weight: 400; font-size: 10px; }
.pw-shop-list { display: grid; }
.pw-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--pw-line); }
.pw-item:last-child { border-bottom: 0; }
.pw-item.is-equipped .pw-preview { position: relative; padding-left: 9px; }
.pw-item.is-equipped .pw-preview::before { content: ''; position: absolute; left: 0; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--pw-accent); }
.pw-item-info { display: grid; justify-items: end; gap: 1px; text-align: right; }
.pw-item-info strong { font-size: 11px; font-weight: 500; opacity: .6; }
.pw-item-price { font-size: 11px; font-weight: 600; }
.pw-item.is-owned .pw-item-price { opacity: .45; font-weight: 400; }
.pw-item.is-equipped .pw-item-price { color: var(--pw-accent); opacity: 1; }

/* 도감 */
.pw-gacha-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pw-root.is-drawing .pw-gacha-top .pw-btn-main { opacity: .6; }
.pw-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 12px; }
.pw-card-tile { position: relative; display: grid; gap: 3px; padding: 0; border: 0; background: transparent; text-align: center; }
.pw-card-tile-name { overflow: hidden; font-size: 10.5px; white-space: nowrap; text-overflow: ellipsis; }
.pw-card-tile.is-locked .pw-card-tile-name { opacity: .3; }
.pw-card-cnt { position: absolute; top: 4px; right: 4px; font-size: 9px; opacity: .5; }
.pw-cardface {
    --pw-frame: var(--pw-line);
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    padding: 6px 4px 14px;
    border: 1px solid var(--pw-frame);
    border-radius: 8px;
    background: var(--pw-bg);
    transition: border-color .15s;
}
.pw-cardface-nick { max-width: 100%; font-size: 12px; font-weight: 700; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.pw-cardface-blank { font-size: 16px; font-weight: 600; opacity: .2; }
/* 카드 그림: 흑백 사진 + 옅은 하프톤 점. 진하기 opacity, 무늬 세기 --pw-mesh, 점 간격 --pw-dot */
.pw-cardface-art {
    --pw-dot: 3px;
    --pw-mesh: rgba(255, 255, 255, .4);
    position: absolute;
    inset: 0;
    overflow: hidden;
    mix-blend-mode: multiply;
    opacity: .5;
    pointer-events: none;
}
.pw-cardface-img { position: absolute; inset: 0; background: center / cover no-repeat; filter: grayscale(1) contrast(1.1); }
.pw-cardface-art::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, transparent 30%, var(--pw-mesh) 60%) 0 0 / var(--pw-dot) var(--pw-dot);
    transform: rotate(45deg);
}
.pw-cardface.is-big .pw-cardface-art { --pw-dot: 4px; }
.pw-cardface.has-art .pw-cardface-nick { position: relative; z-index: 1; }
.pw-cardface.has-art .pw-rarity { z-index: 1; }
.pw-card-tile.is-locked .pw-cardface { border-style: dashed; background: var(--pw-faint); }
.pw-card-tile:not(.is-locked):hover .pw-cardface { border-color: var(--pw-ink); }
/* 등급은 왼쪽 아래 작은 글자 + 테두리 색으로만 */
.pw-rarity { position: absolute; left: 5px; bottom: 3px; font-size: 8px; font-weight: 700; letter-spacing: .06em; color: var(--pw-rc, currentColor); opacity: .7; }
.pw-r-R { --pw-rc: #6d9cd0; --pw-frame: color-mix(in srgb, #6d9cd0 45%, transparent); }
.pw-r-SR { --pw-rc: #a671cf; --pw-frame: color-mix(in srgb, #a671cf 45%, transparent); }
.pw-r-SSR { --pw-rc: #d69a26; --pw-frame: color-mix(in srgb, #d69a26 60%, transparent); }
.pw-card-fx { overflow: hidden; font-size: 9.5px; white-space: nowrap; text-overflow: ellipsis; opacity: .45; }
.pw-card-tile.is-equipped .pw-cardface { border-color: var(--pw-accent); }
.pw-card-tile.is-equipped .pw-card-fx { color: var(--pw-accent); opacity: 1; }
.pw-card-fx-box { display: grid; justify-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--pw-line); }
.pw-card-fx-label { font-size: 10.5px; opacity: .55; }

/* 칭호 슬롯 */
/* 슬롯 기계만 어두운 틀로 감싸 눈에 띄게 */
.pw-slot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px; border-radius: 10px; background: linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 22%, #2b2226), #2b2226); }
.pw-reel-box { display: grid; gap: 3px; justify-items: center; min-width: 0; padding: 10px 4px; border-radius: 6px; background: var(--pw-bg); box-shadow: inset 0 2px 6px #0002; }
.pw-reel-label { font-size: 9px; letter-spacing: .06em; opacity: .4; }
.pw-reel-word { display: block; max-width: 100%; overflow: hidden; font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.pw-slot.is-spinning .pw-reel-word { opacity: .4; }
.pw-slot.is-spinning .pw-reel-box.is-stopped .pw-reel-word { opacity: 1; animation: pw-fade .25s ease; }
.pw-slot-result { margin-top: 12px; padding-top: 0; }
.pw-slot-actions { display: flex; gap: 6px; margin-top: 10px; }
.pw-slot-actions .pw-btn { flex: 1; }
.pw-slot-now { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--pw-line); }
.pw-slot-now .pw-btn { margin-left: auto; }

/* 가방 버튼 (닉네임 옆) */
.pw-bag-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 11px !important; opacity: .45; }
.pw-bag-btn:hover { opacity: .9; background: var(--pw-faint); }
.pw-bag-btn[aria-pressed=true] { opacity: 1; color: var(--pw-accent) !important; }
.pw-bag-empty { display: grid; justify-items: center; gap: 10px; }
.pw-bag-empty .pw-row { display: flex; gap: 6px; }

/* 카드 크게 보기 / 뽑기 결과 */
.pw-card-view { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; background: #1b141855; }
.pw-card-view[hidden] { display: none; }
.pw-card-view-inner { position: relative; width: min(260px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px 16px 16px; border: 1px solid var(--pw-line); border-radius: 12px; background: var(--pw-bg); text-align: center; animation: pw-pop .2s ease; }
.pw-card-view-inner .pw-x { position: absolute; top: 6px; right: 6px; }
.pw-cardface.is-big { width: 100%; aspect-ratio: 16 / 10; padding: 12px 10px 20px; }
.pw-cardface.is-big .pw-cardface-nick { font-size: 20px; }
.pw-card-name { margin: 10px 0 1px; font-size: 13px; color: inherit; }
.pw-card-rarity { margin: 0; font-size: 10px; opacity: .45; }
.pw-card-memo { margin: 10px 0 0; font-size: 11.5px; line-height: 1.65; white-space: pre-wrap; text-align: left; overflow-wrap: anywhere; }
.pw-draw-label { margin: 0 0 8px; font-size: 10.5px; font-weight: 600; opacity: .5; }
.pw-draw-label.is-new { color: var(--pw-accent); font-size: 12px; letter-spacing: .14em; opacity: 1; animation: pw-fade .3s ease both; }

.pw-toast { position: absolute; left: 50%; bottom: 12px; z-index: 3; max-width: calc(100% - 24px); margin: 0; padding: 6px 11px; border-radius: 6px; background: var(--pw-ink); color: var(--pw-bg); font-size: 11px; text-align: center; transform: translateX(-50%); animation: pw-toast .18s ease; }
.pw-toast.is-error { background: #b03a4e; color: #fff; }
.pw-toast[hidden] { display: none; }

@keyframes pw-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pw-toast { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes pw-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── 숨은 쿠키 (게시글 본문 어딘가) ── */
.pw-cookie {
    position: absolute;
    z-index: 1000001;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 19px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    opacity: .75;
    transform: rotate(var(--pw-rot, 0deg));
    transition: transform .2s, opacity .2s;
    animation: pw-cookie-in .5s ease both;
}
.pw-cookie:hover { opacity: 1; transform: rotate(var(--pw-rot, 0deg)) scale(1.15); }
.pw-cookie:focus-visible { outline: 1.5px dashed var(--primary-color, #e0607e); outline-offset: 2px; }
.pw-cookie.is-got { opacity: 0; transform: rotate(var(--pw-rot, 0deg)) scale(1.5); }
.pw-cookie-pop {
    position: absolute;
    z-index: 1000002;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--content-font-color, #3a3236);
    color: #fff;
    font: 600 11.5px/1.4 var(--content-font-family, sans-serif);
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -100%);
    animation: pw-cookie-pop 1.6s ease forwards;
}
.pw-cookie-pop.is-error { font-weight: 500; animation-duration: 2.6s; }
@keyframes pw-cookie-in { from { opacity: 0; } to { opacity: .75; } }
@keyframes pw-cookie-pop { 0% { opacity: 0; transform: translate(-50%, -60%); } 15% { opacity: 1; transform: translate(-50%, -110%); } 80% { opacity: 1; transform: translate(-50%, -140%); } 100% { opacity: 0; transform: translate(-50%, -160%); } }

@media (max-width: 480px) {
    .pw-root { padding: 0; place-items: end center; }
    .pw-dialog { width: 100%; max-height: 86dvh; border-radius: 12px 12px 0 0; border-bottom: 0; }
    .pw-item { grid-template-columns: minmax(0, 1fr) auto; }
    .pw-item-info { grid-column: 1; grid-row: 2; justify-items: start; text-align: left; }
    .pw-item .pw-btn { grid-column: 2; grid-row: 1 / span 2; }
}
@media (prefers-reduced-motion: reduce) {
    .pw-root *, .pw-root *::before { animation: none !important; transition: none !important; }
}
