/* ==========================================================
   2026 설날 랜덤박스 이벤트
   사이트 기본 #00a9a7(teal) + 설날 포인트 색상
   모든 클래스/키프레임에 rb- 접두사 (전역 충돌 방지)
   ========================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

/* 스코프 변수 */
.rb-container {
    --rb-primary: #00a9a7;
    --rb-primary-dark: #008b89;
    --rb-primary-light: #00c9c6;
    --rb-accent: #C8102E;
    --rb-accent-dark: #9B0D22;
    --rb-gold: #D4AF37;
    --rb-gold-light: #F0D060;
    --rb-gold-pale: #E8D5A3;
    --rb-cream: #FAFAFA;
    --rb-cream-warm: #F7F4EF;
    --rb-text: #1A1A1A;
    --rb-text-sub: #555555;
    --rb-text-muted: #999999;
    --rb-white: #FFFFFF;
    --rb-border: #E8E8E8;

    position: relative;
    min-height: 100vh;
    background: linear-gradient(170deg, #004D4C 0%, #006B69 25%, #00a9a7 55%, #00c9c6 100%);
    padding: 40px 20px;
    overflow: hidden;
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 전통 문양 오버레이 */
.rb-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 30px,
            rgba(255,255,255,0.03) 30px,
            rgba(255,255,255,0.03) 31px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 30px,
            rgba(255,255,255,0.03) 30px,
            rgba(255,255,255,0.03) 31px
        );
    pointer-events: none;
    z-index: 0;
}

/* ==============================
   떨어지는 말 (말의 해)
   ============================== */
.rb-horses {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.rb-horse {
    position: absolute;
    font-size: 22px;
    line-height: 1;
    animation: rb-gallop linear infinite;
    opacity: 0;
}

.rb-horse::before {
    content: '\1F40E';
    display: inline-block;
    animation: rb-bounce 0.4s ease-in-out infinite alternate;
}

.rb-horse:nth-child(3)::before,
.rb-horse:nth-child(6)::before {
    content: '\1F3C7';
}

/* 달리는 바운스 */
@keyframes rb-bounce {
    0%   { transform: translateY(0) rotate(-3deg); }
    100% { transform: translateY(-5px) rotate(2deg); }
}

/* 좌→우 수평 흐름, 각각 다른 높이·속도·크기 */
.rb-h1 { top: 6%;   font-size: 20px; animation-duration: 18s; animation-delay: 0s; }
.rb-h2 { top: 18%;  font-size: 26px; animation-duration: 24s; animation-delay: 3s; }
.rb-h3 { top: 32%;  font-size: 17px; animation-duration: 16s; animation-delay: 7s; }
.rb-h4 { top: 48%;  font-size: 28px; animation-duration: 22s; animation-delay: 1s; }
.rb-h5 { top: 60%;  font-size: 15px; animation-duration: 19s; animation-delay: 5s; }
.rb-h6 { top: 72%;  font-size: 23px; animation-duration: 26s; animation-delay: 9s; }
.rb-h7 { top: 84%;  font-size: 18px; animation-duration: 15s; animation-delay: 4s; }
.rb-h8 { top: 92%;  font-size: 21px; animation-duration: 20s; animation-delay: 11s; }

@keyframes rb-gallop {
    0%   { right: -40px; opacity: 0; }
    5%   { opacity: 0.4; }
    20%  { opacity: 0.5; transform: translateY(-4px); }
    40%  { opacity: 0.45; transform: translateY(3px); }
    60%  { opacity: 0.5; transform: translateY(-3px); }
    80%  { opacity: 0.4; transform: translateY(2px); }
    95%  { opacity: 0.1; }
    100% { right: calc(100vw + 40px); opacity: 0; transform: translateY(0); }
}

/* ==============================
   메인 카드
   ============================== */
.rb-card {
    position: relative;
    z-index: 10;
    max-width: 520px;
    margin: 0 auto;
    background: var(--rb-white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.1);
    overflow: hidden;
}

/* ==============================
   헤더
   ============================== */
.rb-header {
    background: linear-gradient(160deg, var(--rb-primary-dark) 0%, var(--rb-primary) 60%, var(--rb-primary-light) 100%);
    padding: 32px 28px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.rb-header::before {
    content: '';
    position: absolute;
    top: -60%; left: -60%;
    width: 220%; height: 220%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: rb-shimmer 5s ease-in-out infinite;
}

@keyframes rb-shimmer {
    0%, 100% { transform: translate(-5%, -5%) scale(1); opacity: 0.8; }
    50%      { transform: translate(5%, 5%) scale(1.05); opacity: 1; }
}

.rb-logo-link {
    display: block;
    position: relative;
    z-index: 1;
    transition: opacity 0.2s;
}

.rb-logo-link:hover { opacity: 0.85; }

/* 로고 (logo-top2.png 캐릭터+글자 크롭) */
.rb-logo {
    position: relative;
    z-index: 1;
    height: 80px;
    width: 300px;
    max-width: 70%;
    object-fit: cover;
    object-position: 50% center;
    margin-bottom: 14px;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.25));
}

/* 이벤트 배지 */
.rb-event-badge {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 5px 18px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    color: var(--rb-white);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.rb-subtitle {
    position: relative;
    z-index: 1;
    color: var(--rb-white);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1.2px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.2);
}

/* ==============================
   이벤트 알림 (상태별 화면)
   ============================== */
.rb-notice {
    padding: 48px 28px;
    text-align: center;
}

.rb-notice-icon {
    font-size: 52px;
    margin-bottom: 16px;
}

.rb-notice h2 {
    color: var(--rb-text);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.rb-notice p {
    color: var(--rb-text-sub);
    font-size: 14px;
    margin: 0 0 8px 0;
    line-height: 1.6;
}

.rb-notice .rb-hint {
    font-size: 13px;
    color: var(--rb-text-muted);
}

.rb-countdown {
    margin-top: 24px;
    padding: 14px 24px;
    background: rgba(0,169,167,0.06);
    border: 1px solid rgba(0,169,167,0.15);
    border-radius: 12px;
    color: var(--rb-primary);
    font-size: 14px;
    font-weight: 600;
}

/* 시작 전 배너 */
.rb-before-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(212,175,55,0.12) 0%, rgba(200,16,46,0.08) 100%);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 12px;
}
.rb-before-icon { font-size: 20px; }
.rb-before-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--rb-accent);
}

.rb-btn-login {
    display: inline-block;
    margin-top: 20px;
    padding: 13px 40px;
    background: linear-gradient(135deg, var(--rb-primary) 0%, var(--rb-primary-dark) 100%);
    color: var(--rb-white);
    text-decoration: none;
    border-radius: 48px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,169,167,0.3);
}

.rb-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,169,167,0.4);
    color: var(--rb-white);
}

/* ==============================
   메인 참여 영역
   ============================== */
.rb-main {
    padding: 28px 24px;
}

/* 참여권 현황 */
.rb-coupon {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(0,169,167,0.05) 0%, rgba(0,169,167,0.1) 100%);
    border: 1px solid rgba(0,169,167,0.2);
    border-radius: 14px;
    margin-bottom: 24px;
}

.rb-coupon-icon { font-size: 30px; flex-shrink: 0; }

.rb-coupon-info { display: flex; flex-direction: column; flex: 1; }

/* 플로팅 참여권 발급 버튼 (베타용) */
.rb-fab-issue {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--rb-gold) 0%, #B8962E 100%);
    color: var(--rb-white);
    border: none;
    border-radius: 48px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(212,175,55,0.4), 0 1px 3px rgba(0,0,0,0.1);
    letter-spacing: 0.3px;
}

.rb-fab-issue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212,175,55,0.5), 0 2px 6px rgba(0,0,0,0.12);
}

.rb-fab-issue:active {
    transform: translateY(0);
}

.rb-fab-issue:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

.rb-fab-icon { font-size: 18px; line-height: 1; }
.rb-fab-text { line-height: 1; }

.rb-coupon-label {
    font-size: 12px;
    color: var(--rb-text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.rb-coupon-count {
    font-size: 26px;
    font-weight: 800;
    color: var(--rb-primary);
    line-height: 1.2;
}

/* ==============================
   복주머니 랜덤박스
   ============================== */
.rb-box-area {
    text-align: center;
    padding: 20px 0 28px;
}

.rb-box {
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.rb-box:hover:not(.rb-box-disabled) { transform: scale(1.04); }
.rb-box:active:not(.rb-box-disabled) { transform: scale(0.97); }

.rb-box-body {
    position: relative;
    width: 152px;
    height: 190px;
    margin: 0 auto;
}

/* 복주머니 끈 영역 */
.rb-bok-cord {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 88px;
    height: 44px;
    z-index: 3;
}

/* 끈 좌우 곡선 (모아진 주머니 입구) */
.rb-bok-cord::before,
.rb-bok-cord::after {
    content: '';
    position: absolute;
    top: 18px;
    width: 30px;
    height: 18px;
    border-top: 2.5px solid var(--rb-gold);
    border-radius: 50% 50% 0 0;
}

.rb-bok-cord::before { left: 6px; transform: rotate(-10deg); }
.rb-bok-cord::after  { right: 6px; transform: rotate(10deg); }

/* 매듭 (중앙 장식) */
.rb-bok-knot {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 40% 35%, var(--rb-gold-light) 0%, var(--rb-gold) 60%, #B8962E 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(212,175,55,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
    z-index: 5;
}

.rb-bok-knot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
}

/* 술 (tassel) */
.rb-bok-tassel {
    position: absolute;
    top: 24px;
    width: 2.5px;
    z-index: 2;
}

.rb-bok-tassel-l {
    left: 12px;
    height: 30px;
    background: linear-gradient(to bottom, var(--rb-gold), var(--rb-gold-pale) 80%, transparent);
    transform: rotate(12deg);
    transform-origin: top center;
    border-radius: 0 0 2px 2px;
}

.rb-bok-tassel-l::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, var(--rb-gold-light), var(--rb-gold));
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
}

.rb-bok-tassel-r {
    right: 12px;
    height: 30px;
    background: linear-gradient(to bottom, var(--rb-gold), var(--rb-gold-pale) 80%, transparent);
    transform: rotate(-12deg);
    transform-origin: top center;
    border-radius: 0 0 2px 2px;
}

.rb-bok-tassel-r::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, var(--rb-gold-light), var(--rb-gold));
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
}

/* 복주머니 몸통 */
.rb-bok-pouch {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 148px;
    background: linear-gradient(160deg, #D81B33 0%, #C8102E 30%, #A80E26 65%, #8B0A1E 100%);
    border-radius: 15% 15% 50% 50% / 8% 8% 45% 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--rb-gold);
    box-shadow:
        0 10px 30px rgba(139,0,0,0.35),
        inset 0 3px 0 rgba(255,255,255,0.1),
        inset 0 -8px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* 상단 주름 장식선 */
.rb-bok-pouch::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), var(--rb-gold), rgba(212,175,55,0.4), transparent);
    border-radius: 1px;
}

/* 내부 원형 장식 프레임 */
.rb-bok-pouch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border: 1.5px solid rgba(212,175,55,0.18);
    border-radius: 50%;
}

/* 복주머니 福 글자 */
.rb-bok-char {
    font-size: 48px;
    color: var(--rb-gold);
    font-weight: 900;
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 20px rgba(212,175,55,0.15);
    animation: rb-bokpulse 2.5s ease-in-out infinite;
    font-family: 'Noto Serif KR', 'Batang', serif;
    line-height: 1;
}

@keyframes rb-bokpulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* 복주머니 모양에 맞춘 글로우 */
.rb-box-glow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 156px;
    height: 164px;
    border-radius: 15% 15% 50% 50% / 8% 8% 45% 45%;
    animation: rb-glow 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes rb-glow {
    0%, 100% { box-shadow: 0 0 14px rgba(212,175,55,0.15); }
    50%      { box-shadow: 0 0 28px rgba(212,175,55,0.35), 0 0 48px rgba(200,16,46,0.12); }
}

.rb-box-hint {
    margin-top: 14px;
    font-size: 13px;
    color: var(--rb-text-sub);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* 비활성 박스 */
.rb-box-disabled {
    cursor: default;
    opacity: 0.5;
    filter: saturate(0.3);
}

.rb-box-disabled .rb-bok-char {
    animation: none;
}

.rb-box-disabled .rb-box-glow {
    animation: none;
    box-shadow: none;
}

.rb-box-hint-disabled {
    color: var(--rb-text-muted) !important;
    font-weight: 500 !important;
}

/* 복주머니 열기 애니메이션 */
.rb-box.opening .rb-bok-pouch {
    animation: rb-shake 0.6s ease-in-out;
}

.rb-box.opening .rb-bok-cord {
    animation: rb-shake 0.6s ease-in-out;
}

@keyframes rb-shake {
    0%, 100% { transform: translateX(-50%) rotate(0deg) scale(1); }
    10%  { transform: translateX(-50%) rotate(-8deg) scale(1.02); }
    20%  { transform: translateX(-50%) rotate(8deg) scale(1.02); }
    30%  { transform: translateX(-50%) rotate(-6deg) scale(1.04); }
    40%  { transform: translateX(-50%) rotate(6deg) scale(1.04); }
    50%  { transform: translateX(-50%) rotate(-4deg) scale(1.06); }
    60%  { transform: translateX(-50%) rotate(4deg) scale(1.06); }
    70%  { transform: translateX(-50%) rotate(-2deg) scale(1.03); }
    80%  { transform: translateX(-50%) rotate(2deg) scale(1.01); }
}

/* 참여권 없음 안내 */
.rb-no-coupon {
    text-align: center;
    padding: 0 20px 12px;
}

.rb-no-coupon p {
    color: var(--rb-text-muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

/* ==============================
   경품 목록 보기 버튼 (헤더 내)
   ============================== */
.rb-btn-prizes {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 9px 24px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.95);
    border-radius: 20px;
    color: var(--rb-primary-dark);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.rb-btn-prizes:hover {
    background: var(--rb-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.rb-btn-prizes:active {
    transform: translateY(0);
}

/* ==============================
   경품 목록 모달
   ============================== */
.rb-prize-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rb-prize-modal.active {
    opacity: 1;
    visibility: visible;
}

.rb-prize-modal-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.rb-prize-modal-content {
    position: relative;
    background: var(--rb-white, #fff);
    border-radius: 20px;
    max-width: 480px;
    width: 92%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    border: 1px solid rgba(0,169,167,0.15);
    scrollbar-width: thin;
    scrollbar-color: rgba(0,169,167,0.3) transparent;
}

.rb-prize-modal.active .rb-prize-modal-content {
    transform: scale(1) translateY(0);
}

.rb-prize-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #E8E8E8;
    position: sticky;
    top: 0;
    background: var(--rb-white, #fff);
    border-radius: 20px 20px 0 0;
    z-index: 1;
}

.rb-prize-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1A1A1A;
}

.rb-prize-modal-x {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.04);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}

.rb-prize-modal-x:hover {
    background: rgba(0,0,0,0.08);
    color: #333;
}

.rb-prize-modal-content > .rb-prize-grid {
    padding: 20px 24px 24px;
}

.rb-prize-empty {
    text-align: center;
    padding: 40px 24px;
    color: #999;
    font-size: 14px;
}

/* ==============================
   경품 목록 그리드
   ============================== */
.rb-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rb-text);
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rb-border);
    letter-spacing: 0.3px;
}

.rb-section-title .rb-draw-total {
    font-size: 13px;
    color: var(--rb-text-muted);
    font-weight: 500;
}

/* .rb-prize-section은 더 이상 인라인으로 사용하지 않음 (모달로 이동) */

.rb-prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.rb-prize-item {
    position: relative;
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: 12px;
    padding: 14px 8px 12px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.rb-prize-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.rb-prize-item.rb-prize-gold {
    border-color: var(--rb-gold);
    background: linear-gradient(175deg, #FFFDF7 0%, #FFF8E7 100%);
}

.rb-prize-item.rb-prize-silver { border-color: #C0C0C0; }
.rb-prize-item.rb-prize-bronze { border-color: #CD7F32; }

/* SVG 아이콘 (포인트/트론) */
.rb-svg-icon {
    font-size: 0;
    line-height: 0;
}

.rb-svg-icon svg {
    width: 32px;
    height: 32px;
}

/* 하위호환 */
.rb-tron-icon {
    font-size: 0;
    line-height: 0;
}

.rb-tron-icon svg {
    width: 32px;
    height: 32px;
}

.rb-prize-thumb-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 6px;
}

.rb-prize-thumb {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.rb-prize-amount-badge {
    position: absolute;
    bottom: 0;
    right: -4px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.3;
    white-space: nowrap;
}

.rb-prize-icon {
    font-size: 34px;
    margin-bottom: 6px;
}

.rb-prize-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--rb-text);
    line-height: 1.35;
}

.rb-prize-desc {
    font-size: 10px;
    color: var(--rb-text-muted);
    margin-top: 3px;
}

/* ==============================
   참여 기록
   ============================== */
.rb-history-section { margin-bottom: 24px; }

.rb-history-list {
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,169,167,0.3) transparent;
}

.rb-history-loading, .rb-history-empty {
    text-align: center;
    padding: 20px;
    color: var(--rb-text-muted);
    font-size: 13px;
}

.rb-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--rb-border);
    font-size: 13px;
    transition: background 0.15s;
}

.rb-history-item:hover { background: rgba(0,169,167,0.03); }

.rb-history-item.rb-type-gifticon  { border-left: 3px solid var(--rb-accent); }
.rb-history-item.rb-type-point     { border-left: 3px solid var(--rb-primary); }
.rb-history-item.rb-type-consolation { border-left: 3px solid #6f42c1; }
.rb-history-item.rb-type-trx       { border-left: 3px solid #6f42c1; }

.rb-hi-prize {
    font-weight: 600;
    color: var(--rb-text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rb-hi-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    flex-shrink: 0;
}

.rb-hi-point { color: var(--rb-primary); font-weight: 700; }
.rb-hi-date  { color: var(--rb-text-muted); }

.rb-gs-pending   { color: #856404; background: #FFF3CD; padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 600; }
.rb-gs-delivered { color: #155724; background: #D4EDDA; padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 600; }
.rb-gs-failed    { color: #721C24; background: #F8D7DA; padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 600; }
.rb-gs-deferred  { color: #6f42c1; background: #E0CFFC; padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 600; }
.rb-gs-accumulated { color: #4a5568; background: #EDF2F7; padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 600; }

/* ==============================
   누적 TRX 수령 섹션
   ============================== */
.rb-trx-claim-section {
    text-align: center;
    padding: 20px 16px;
}

.rb-trx-accumulated {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #fef3f3, #fff);
    border: 1px solid rgba(239, 0, 39, 0.15);
    border-radius: 12px;
}

.rb-trx-icon { width: 40px; height: 40px; flex-shrink: 0; }
.rb-trx-icon svg { width: 100%; height: 100%; }

.rb-trx-info { display: flex; flex-direction: column; align-items: flex-start; }
.rb-trx-label { font-size: 12px; color: var(--rb-text-muted); font-weight: 500; }
.rb-trx-amount { font-size: 24px; font-weight: 800; color: #EF0027; letter-spacing: -0.5px; }

.rb-trx-desc {
    font-size: 13px;
    color: var(--rb-text-sub);
    line-height: 1.6;
    margin-bottom: 16px;
}

.rb-btn-claim-trx {
    display: inline-block;
    padding: 12px 32px;
    background: #EF0027;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.1s;
}
.rb-btn-claim-trx:hover { background: #d0001f; }
.rb-btn-claim-trx:active { transform: scale(0.97); }
.rb-btn-claim-trx:disabled { background: #ccc; cursor: not-allowed; transform: none; }

.rb-trx-claimed { margin-top: 8px; }
.rb-trx-claimed .rb-claim-code { margin-bottom: 10px; }
.rb-trx-status { margin-bottom: 10px; font-size: 13px; font-weight: 600; }

/* 결과 모달 TRX 누적 안내 */
.rb-trx-acc-info {
    margin-top: 8px;
    padding: 8px 14px;
    background: #fef3f3;
    border: 1px solid rgba(239, 0, 39, 0.12);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
}
.rb-trx-acc-info strong { color: #EF0027; }

.rb-btn-more {
    padding: 8px 28px;
    background: rgba(0,169,167,0.06);
    color: var(--rb-primary);
    border: 1px solid rgba(0,169,167,0.2);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s;
}

.rb-btn-more:hover { background: rgba(0,169,167,0.12); }

/* ==============================
   이벤트 기간 표시
   ============================== */
.rb-event-period {
    text-align: center;
    padding: 14px;
    background: rgba(0,169,167,0.04);
    border: 1px solid rgba(0,169,167,0.1);
    border-radius: 10px;
    font-size: 13px;
    color: var(--rb-text-sub);
}

.rb-event-period strong { color: var(--rb-text); }

/* ==============================
   결과 모달
   ============================== */
.rb-result-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rb-result-modal.active {
    opacity: 1;
    visibility: visible;
}

.rb-result-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.rb-result-content {
    position: relative;
    background: var(--rb-white);
    border-radius: 20px;
    padding: 36px 28px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 2px solid var(--rb-primary);
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.rb-result-modal.active .rb-result-content {
    transform: scale(1);
    animation: rb-pop 0.45s ease;
}

@keyframes rb-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    65%  { transform: scale(1.04); }
    100% { transform: scale(1); opacity: 1; }
}

/* 결과 스타일 효과 */
.rb-result-content.rb-result-gold {
    border-color: var(--rb-gold);
    box-shadow:
        0 24px 64px rgba(0,0,0,0.35),
        0 0 20px rgba(212,175,55,0.4),
        0 0 40px rgba(212,175,55,0.2);
    animation: rb-pop 0.45s ease, rb-goldglow 1.8s ease-in-out infinite;
}

@keyframes rb-goldglow {
    0%, 100% { box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 0 20px rgba(212,175,55,0.4); }
    50%      { box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 0 36px rgba(212,175,55,0.6), 0 0 60px rgba(212,175,55,0.25); }
}

.rb-result-content.rb-result-silver { border-color: #C0C0C0; }
.rb-result-content.rb-result-bronze { border-color: #CD7F32; }

.rb-result-icon {
    margin-bottom: 12px;
    animation: rb-resultbounce 0.6s ease;
}

/* 결과 미니 복주머니 */
.rb-result-bok {
    display: inline-block;
    position: relative;
}

.rb-result-bok-pouch {
    width: 64px;
    height: 68px;
    margin: 0 auto;
    background: linear-gradient(160deg, #D81B33 0%, #C8102E 35%, #A80E26 65%, #8B0A1E 100%);
    border-radius: 15% 15% 50% 50% / 8% 8% 45% 45%;
    border: 2px solid var(--rb-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rb-gold);
    font-size: 30px;
    font-weight: 900;
    font-family: 'Noto Serif KR', 'Batang', serif;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
    box-shadow: 0 4px 14px rgba(139,0,0,0.25);
    overflow: hidden;
}

.rb-result-bok-pouch::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 18%;
    right: 18%;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), var(--rb-gold), rgba(212,175,55,0.4), transparent);
}

@keyframes rb-resultbounce {
    0%   { transform: scale(0); }
    50%  { transform: scale(1.2); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.rb-result-content h3 {
    color: var(--rb-primary);
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 14px 0;
}

.rb-result-content.rb-result-gold h3 { color: var(--rb-gold); }

.rb-result-prize {
    background: var(--rb-cream);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 14px;
    border: 1px solid var(--rb-border);
}

.rb-result-prize-img {
    width: 68px; height: 68px;
    object-fit: contain;
    margin-bottom: 10px;
}

.rb-result-prize-name {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--rb-text);
    margin-bottom: 4px;
}

.rb-result-prize-detail {
    display: block;
    font-size: 13px;
    color: var(--rb-primary);
    font-weight: 600;
}

.rb-result-message {
    color: var(--rb-text-muted);
    font-size: 13px;
    margin: 0 0 18px 0;
}

.rb-btn-close {
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, var(--rb-primary) 0%, var(--rb-primary-dark) 100%);
    color: var(--rb-white);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,169,167,0.3);
}

.rb-btn-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,169,167,0.4);
}

/* ==============================
   처리 중 오버레이
   ============================== */
.rb-processing {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rb-processing.active {
    opacity: 1;
    visibility: visible;
}

.rb-processing-inner {
    text-align: center;
    color: var(--rb-white);
}

.rb-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--rb-primary-light);
    border-radius: 50%;
    animation: rb-spin 0.9s linear infinite;
    margin: 0 auto 16px;
}

@keyframes rb-spin {
    to { transform: rotate(360deg); }
}

.rb-processing-inner p {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

/* ==============================
   반응형
   ============================== */
@media (max-width: 540px) {
    .rb-container { padding: 20px 12px; }
    .rb-header { padding: 24px 20px 22px; }
    .rb-subtitle { font-size: 14px; letter-spacing: 0.8px; }
    .rb-logo { height: 64px; width: 240px; }
    .rb-main { padding: 20px 16px; }
    .rb-prize-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); }
    .rb-box-body { width: 130px; height: 165px; }
    .rb-bok-pouch { width: 120px; height: 128px; }
    .rb-bok-char { font-size: 40px; }
    .rb-bok-cord { width: 76px; height: 38px; }
    .rb-coupon-count { font-size: 22px; }
    .rb-notice { padding: 32px 20px; }
    .rb-notice h2 { font-size: 18px; }
    .rb-result-content { padding: 28px 20px; }
    .rb-result-icon { font-size: 48px; }
    .rb-result-content h3 { font-size: 18px; }
    .rb-result-prize-name { font-size: 16px; }

    .rb-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .rb-hi-prize {
        white-space: normal;
        flex-wrap: wrap;
    }

    .rb-hi-meta { width: 100%; flex-wrap: wrap; }

    .rb-claim-value { font-size: 16px; letter-spacing: 1.5px; }
    .rb-claim-label { width: 100%; text-align: center; }
}

@media (max-width: 380px) {
    .rb-container { padding: 16px 8px; }
    .rb-prize-grid { grid-template-columns: repeat(2, 1fr); }
    .rb-subtitle { font-size: 13px; letter-spacing: 0.5px; }
    .rb-logo { height: 56px; width: 210px; }
    .rb-box-body { width: 118px; height: 150px; }
    .rb-bok-pouch { width: 108px; height: 116px; }
    .rb-bok-char { font-size: 36px; }
    .rb-bok-cord { width: 68px; height: 34px; }
    .rb-coupon { padding: 12px 14px; gap: 10px; }
    .rb-coupon-count { font-size: 20px; }
    .rb-claim-value { font-size: 15px; letter-spacing: 1px; }
}

/* ==============================
   수령코드 (결과 모달 내)
   ============================== */
.rb-claim-code {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(0,169,167,0.06);
    border: 1px dashed rgba(0,169,167,0.3);
    border-radius: 10px;
}

.rb-claim-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--rb-text-muted);
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.rb-claim-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--rb-primary);
    letter-spacing: 2px;
    font-family: 'Courier New', Courier, monospace;
}

.rb-claim-copy {
    padding: 4px 12px;
    background: var(--rb-primary);
    color: var(--rb-white);
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.rb-claim-copy:hover {
    background: var(--rb-primary-dark);
}

/* 히스토리 내 수령코드 */
.rb-hi-code {
    display: inline-block;
    margin-left: 0;
    padding: 4px 8px;
    background: rgba(0,169,167,0.08);
    border: 1px solid rgba(0,169,167,0.2);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--rb-primary);
    letter-spacing: 0.5px;
    font-family: 'Courier New', Courier, monospace;
    vertical-align: middle;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    min-height: 28px;
    line-height: 20px;
}
.rb-hi-code:active, .rb-hi-code-copied {
    background: var(--rb-primary);
    color: #fff;
}

.rb-hi-bot-link {
    display: inline-block;
    padding: 2px 8px;
    background: #0088cc;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s;
}
.rb-hi-bot-link:hover { background: #006da3; color: #fff; }
.rb-hi-bot-retry { background: #dc3545; }
.rb-hi-bot-retry:hover { background: #b02a37; color: #fff; }

/* 지갑 안내 (TRX 당첨 시 지갑 미생성) */
.rb-wallet-notice {
    background: #fff3cd; color: #856404; border: 1px solid #ffc107;
    border-radius: 8px; padding: 10px 14px; margin: 10px 0;
    font-size: 13px; line-height: 1.6; text-align: center;
}
.rb-wallet-notice a {
    color: #C8102E; font-weight: 700; text-decoration: underline;
}

/* ==============================
   텔레그램 봇 CTA
   ============================== */
.rb-bot-cta {
    margin-top: 10px;
    text-align: center;
}

.rb-tg-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.rb-bot-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    background: #0088cc;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.rb-bot-link:hover {
    background: #006da3;
    color: #fff;
}

/* ==============================
   룰렛 애니메이션
   ============================== */
.rb-roulette {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rb-roulette.active {
    opacity: 1;
    visibility: visible;
}

.rb-roulette-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.rb-roulette-box {
    position: relative;
    width: 320px;
    max-width: 90%;
    text-align: center;
}

.rb-roulette-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 1px;
    transition: all 0.4s ease;
}

.rb-roulette-title-done {
    color: var(--rb-gold, #D4AF37);
    font-size: 24px;
    text-shadow: 0 0 24px rgba(212,175,55,0.6);
}

.rb-roulette-window {
    position: relative;
    height: 360px;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255,255,255,0.97);
    border: 2px solid rgba(0,169,167,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1);
}

.rb-roulette-strip {
    will-change: transform;
}

.rb-rl-item {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-sizing: border-box;
}

.rb-rl-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rb-rl-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
}

.rb-rl-svg {
    width: 40px;
    height: 40px;
}

.rb-rl-svg svg {
    width: 100%;
    height: 100%;
}

.rb-rl-name {
    font-size: 14px;
    font-weight: 600;
    color: #1A1A1A;
    text-align: left;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 센터 포인터 (선택 영역) */
.rb-roulette-pointer {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 72px;
    transform: translateY(-50%);
    border-top: 2.5px solid var(--rb-primary, #00a9a7);
    border-bottom: 2.5px solid var(--rb-primary, #00a9a7);
    background: rgba(0,169,167,0.06);
    pointer-events: none;
    z-index: 10;
}

/* 좌측 삼각형 인디케이터 */
.rb-roulette-pointer::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 10px solid var(--rb-primary, #00a9a7);
}

/* 상하 그라데이션 페이드 */
.rb-roulette-fade {
    position: absolute;
    left: 0;
    right: 0;
    height: 90px;
    pointer-events: none;
    z-index: 5;
}

.rb-roulette-fade-top {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.98) 0%, transparent 100%);
}

.rb-roulette-fade-bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.98) 0%, transparent 100%);
}

/* 당첨 하이라이트 */
.rb-rl-winner.rb-rl-landed {
    background: rgba(0,169,167,0.12);
    transition: background 0.3s ease;
}

.rb-rl-winner.rb-rl-landed .rb-rl-name {
    color: var(--rb-primary, #00a9a7);
    font-weight: 800;
}

/* 반응형 */
@media (max-width: 540px) {
    .rb-roulette-window { height: 288px; }
    .rb-rl-item { height: 58px; padding: 0 14px; gap: 10px; }
    .rb-rl-icon { width: 36px; height: 36px; }
    .rb-rl-img { width: 32px; height: 32px; }
    .rb-rl-svg { width: 32px; height: 32px; }
    .rb-rl-name { font-size: 13px; }
    .rb-roulette-pointer { height: 58px; }
    .rb-roulette-fade { height: 70px; }
}

@media (max-width: 380px) {
    .rb-roulette-window { height: 232px; }
    .rb-rl-item { height: 58px; }
}
