/* =============================================
   GameResult 공통 결과화면 스타일
   프리픽스: .gr- (game-result)
   ============================================= */

/* ===== 공통 애니메이션 ===== */
@keyframes grFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes grBoom {
    0%   { transform: scale(0.3); opacity: 0; }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes grSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes grPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== 솔로 게임 결과 ===== */

.gr-badge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    animation: grFadeIn 0.4s ease;
}

.gr-emoji {
    font-size: 40px;
    line-height: 1;
}

.gr-grade {
    font-size: 28px;
    font-weight: 900;
    margin-top: 2px;
    line-height: 1.1;
}

.gr-label {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
    animation: grFadeIn 0.4s ease 0.1s both;
}

.gr-pct {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
    text-align: center;
    animation: grFadeIn 0.4s ease 0.15s both;
}

.gr-stats {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-bottom: 16px;
    animation: grFadeIn 0.4s ease 0.2s both;
}

.gr-stat {
    text-align: center;
}

.gr-stat-val {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

.gr-stat-val small {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.6;
}

.gr-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.gr-new-record {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
    animation: grFadeIn 0.4s ease 0.25s both;
}

.gr-challenge-result {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    line-height: 1.6;
    animation: grFadeIn 0.4s ease 0.25s both;
}

.gr-challenge-win { color: #ffd700; }
.gr-challenge-lose { color: #9CA3AF; }

/* ===== 공통 버튼 ===== */

.gr-result-btns {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
    animation: grFadeIn 0.4s ease 0.3s both;
}

.gr-btn-share,
.gr-btn-retry,
.gr-btn-alt {
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}

.gr-btn-share:active,
.gr-btn-retry:active,
.gr-btn-alt:active { transform: scale(0.95); }

.gr-btn-share {
    padding: 16px 32px;
    background: #FEE500;
    color: #191919;
    font-size: 17px;
    box-shadow: 0 4px 16px rgba(254, 229, 0, 0.3);
    flex: 1;
    min-width: 140px;
}

.gr-btn-retry {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gr-btn-alt {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
}

/* ===== 랭킹 섹션 ===== */

.gr-ranking-section {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding-bottom: 40px;
    animation: grFadeIn 0.4s ease 0.35s both;
}

.gr-ranking-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    text-align: center;
}

.gr-ranking-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.gr-nickname-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.gr-nickname-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.gr-nickname-input:focus { border-color: rgba(108, 92, 231, 0.5); }

.gr-btn-submit {
    padding: 10px 20px;
    background: #6C5CE7;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s;
}

.gr-btn-submit:active { transform: scale(0.95); }

.gr-rankings-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gr-rank-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    font-size: 13px;
}

.gr-rank-pos {
    width: 28px;
    text-align: center;
    font-weight: 700;
}

.gr-rank-name {
    flex: 1;
    color: #fff;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gr-rank-grade {
    font-size: 12px;
    font-weight: 600;
}

.gr-rank-score {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    min-width: 48px;
    text-align: right;
}
.gr-rank-date {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    min-width: 60px;
    text-align: right;
}

.gr-no-ranking {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    padding: 16px;
}

/* ===== 파티 게임 공통 ===== */

.gr-party-wrap {
    width: 100%;
    max-width: 360px;
    text-align: center;
    margin: 0 auto;
    animation: grFadeIn 0.4s ease;
}

.gr-party-emoji {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 16px;
}

.gr-emoji-boom {
    animation: grBoom 0.5s ease-out;
}

.gr-party-title {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.gr-party-name {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 8px;
}

.gr-party-sub {
    font-size: 18px;
    color: #ffd700;
    font-weight: 700;
    margin-bottom: 24px;
}

.gr-party-extra {
    margin-bottom: 24px;
}

/* 파티 버튼 */
.gr-party-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.gr-party-btns .gr-btn-share,
.gr-party-btns .gr-btn-retry,
.gr-party-btns .gr-btn-alt {
    /* 기본 스타일 상속 */
}

/* ===== 파티 - mapping 타입 (사다리) ===== */

.gr-map-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.gr-map-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    animation: grSlideUp 0.3s ease both;
}

.gr-map-from {
    font-weight: 700;
    font-size: 15px;
}

.gr-map-arrow {
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    margin: 0 8px;
}

.gr-map-to {
    font-weight: 700;
    font-size: 15px;
}

/* ===== 파티 - ranking 타입 (주사위, 순서정하기) ===== */

.gr-rank-announce {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
    line-height: 1.6;
}

.gr-rank-announce strong {
    color: #fff;
}

.gr-rank-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
}

.gr-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    font-size: 15px;
    animation: grSlideUp 0.3s ease both;
}

.gr-rank-item:nth-child(1) {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.25);
}

.gr-rank-item:nth-child(2) {
    background: rgba(192, 192, 192, 0.08);
    border: 1px solid rgba(192, 192, 192, 0.2);
}

.gr-rank-item:nth-child(3) {
    background: rgba(205, 127, 50, 0.08);
    border: 1px solid rgba(205, 127, 50, 0.2);
}

.gr-rank-item-highlight {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.gr-rank-medal {
    width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
}

.gr-rank-item-name {
    flex: 1;
    color: #fff;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gr-rank-item-score {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    min-width: 32px;
    text-align: right;
}

/* ===== 파티 - classify 타입 (제비뽑기, 복불복) ===== */

.gr-party-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

.gr-group-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.gr-group {
    border-radius: 12px;
    padding: 14px;
}

.gr-group-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gr-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gr-group-item {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    animation: grSlideUp 0.3s ease both;
}

/* ===== 팝업 오버레이 (룰렛 등) ===== */

.gr-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: grFadeIn 0.3s ease;
}

.gr-popup-card {
    background: #1a1a2e;
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gr-popup-card .gr-party-emoji {
    font-size: 64px;
    margin-bottom: 12px;
}

.gr-popup-card .gr-party-name {
    font-size: 24px;
}

.gr-popup-card .gr-party-btns {
    margin-top: 16px;
}

.gr-popup-card .gr-btn-share {
    padding: 14px 24px;
    font-size: 15px;
}

.gr-popup-card .gr-btn-retry,
.gr-popup-card .gr-btn-alt {
    padding: 10px 20px;
    font-size: 14px;
}
