/* gw-commentator-ranking: shortcode display */

.gwcr-ranking {
    max-width: 720px;
    margin: 24px auto;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e6ecea;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(7, 105, 81, 0.06);
    font-family: inherit;
}
.gwcr-ranking .gwcr-title {
    font-size: 1.1rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6ecea;
    color: #076951;
}
.gwcr-ranking .gwcr-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: gwcr;
}
.gwcr-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 6px;
    border-bottom: 1px dashed #eef2f1;
}
.gwcr-item:last-child { border-bottom: 0; }
.gwcr-position {
    width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1rem;
    background: #f0f4f3;
    color: #555;
    flex-shrink: 0;
    /* 既定（normal上書き前）にもうっすら影 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
/* 順位バッジ：コメント欄バッジと同じグラデーションでビジュアル統一 */
.gwcr-rank-gold .gwcr-position {
    background: linear-gradient(135deg, #fff1b0 0%, #f8d568 45%, #d49520 100%);
    color: #5b4500;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    box-shadow: 0 1px 3px rgba(212, 149, 32, 0.3);
}
.gwcr-rank-silver .gwcr-position {
    background: linear-gradient(135deg, #f0f3f5 0%, #c8ced2 45%, #8e979b 100%);
    color: #2e3a40;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    box-shadow: 0 1px 3px rgba(142, 151, 155, 0.3);
}
.gwcr-rank-bronze .gwcr-position {
    background: linear-gradient(135deg, #f0c8a4 0%, #d8a47a 45%, #a06b3a 100%);
    color: #4a2810;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
    box-shadow: 0 1px 3px rgba(160, 107, 58, 0.3);
}
.gwcr-rank-normal .gwcr-position {
    background: linear-gradient(135deg, #0d8e6e 0%, #076951 60%, #054a3a 100%);
    color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,0.15);
    box-shadow: 0 1px 3px rgba(7, 105, 81, 0.25);
}
.gwcr-avatar-wrap { flex-shrink: 0; }
.gwcr-avatar {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    object-fit: cover;
}
.gwcr-meta { flex: 1; min-width: 0; }
.gwcr-name {
    font-weight: 600;
    color: #1a3a4a;
    text-decoration: none;
    word-break: break-all;
}
.gwcr-name:hover { text-decoration: underline; }
.gwcr-sub {
    margin-top: 2px;
    font-size: 0.8rem;
    color: #6e7c82;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}
.gwcr-sub b { color: #076951; }
.gwcr-relief {
    background: #e7f4ef;
    color: #076951;
    border: 1px solid #b8dccc;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.gwcr-empty {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    padding: 18px;
}
@media (max-width: 480px) {
    .gwcr-ranking { padding: 14px; }
    .gwcr-item { gap: 10px; }
    .gwcr-avatar { width: 36px !important; height: 36px !important; }
    .gwcr-position { width: 30px; height: 30px; line-height: 30px; }
}

/* ===== コメント欄: アバター枠＋ラベル位置バッジ (v0.1.4 wpDiscuz風) ===== */

/* アバターのフチ（box-shadow で被せる）
   UM (Ultimate Member) の .um-avatar が !important で box-shadow を上書きしてくるので、
   こちらも !important で確実に効かせる。transition はチラつきの原因になるので削除。 */
.gwcr-frame .avatar,
.gwcr-frame img.avatar,
.gwcr-frame > a > img,
.gwcr-frame > img {
    box-shadow:
        0 0 0 3px var(--gwcr-frame-color, transparent),
        0 0 0 5px #fff !important;
    border-radius: 50% !important;
}
.gwcr-frame-gold   { --gwcr-frame-color: #f8d568; }
.gwcr-frame-silver { --gwcr-frame-color: #c0c8cc; }
.gwcr-frame-bronze { --gwcr-frame-color: #d49968; }
.gwcr-frame-rank   { --gwcr-frame-color: #076951; }

/* ランクバッジ本体（wpDiscuz の Member バッジに揃えたコンパクトな矩形）
   wpDiscuz が周辺要素に強い font-size を継承させてくるので !important で確実に効かせる */
.gwcr-cm-badge {
    display: inline-block !important;
    margin-top: 3px !important;
    margin-left: 3px !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
    user-select: none;
    font-feature-settings: "palt";
    text-decoration: none !important;
}
/* グラデーションでメダル感・立体感を演出 */
.gwcr-cm-gold   {
    background: linear-gradient(135deg, #fff1b0 0%, #f8d568 45%, #d49520 100%) !important;
    color: #5b3f00 !important;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.gwcr-cm-silver {
    background: linear-gradient(135deg, #f0f3f5 0%, #c8ced2 45%, #8e979b 100%) !important;
    color: #2e3a40 !important;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.gwcr-cm-bronze {
    background: linear-gradient(135deg, #f0c8a4 0%, #d8a47a 45%, #a06b3a 100%) !important;
    color: #4a2810 !important;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.gwcr-cm-rank   {
    background: linear-gradient(135deg, #0d8e6e 0%, #076951 60%, #054a3a 100%) !important;
    color: #fff !important;
    text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

/* wpDiscuz アバター内に同居する場合のレイアウト微調整 */
.wpd-avatar.gwcr-frame { position: relative; }
.wpd-avatar .gwcr-cm-badge { display: inline-block; }
.wpd-comment-label .gwcr-cm-badge { margin-left: 4px; }

/* 標準WP fallback */
.comment-author.gwcr-frame .avatar { box-shadow: 0 0 0 3px var(--gwcr-frame-color), 0 0 0 4px #fff; }
