:root {
    --background-color: #0a0a1a;
    --container-bg: rgba(22, 23, 46, 0.75);
    --border-color: rgba(0, 255, 255, 0.3);
    --cyan: #00ffff;
    --fuchsia: #ff00ff;
    --yellow: #ffff00;
    --glow-cyan: 0 0 5px var(--cyan), 0 0 10px var(--cyan), 0 0 15px var(--cyan);
    --glow-fuchsia: 0 0 5px var(--fuchsia), 0 0 10px var(--fuchsia), 0 0 15px var(--fuchsia);
    --glow-yellow: 0 0 5px var(--yellow), 0 0 10px var(--yellow), 0 0 15px var(--yellow);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: #fff;
    background-image: radial-gradient(circle at center, rgba(22, 23, 46, 0.5) 0%, var(--background-color) 70%);
    display: flex;
    flex-direction: column;
    /* 수직 배치를 통해 중앙 정렬 유지 */
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
}



.slot-machine-container {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem 1rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.2), inset 0 0 20px rgba(255, 0, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* header는 더 이상 flex 컨테이너일 필요가 없습니다. */
header {
    width: 100%;
}

/* price-display-grid를 3열로 변경합니다. */
.price-display-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 2열에서 3열로 변경 */
    gap: 0.5rem;
}

.price-box,
.points-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 80px;
    min-height: 70px;
    /* 모든 박스의 최소 높이를 지정하여 정렬을 맞춤 */
}

/* 지갑 박스에 대한 추가 스타일 */
.wallet-box {
    padding: 0.5rem;
    /* 내부 컨텐츠를 위해 패딩 조정 */
    align-items: center;
    /* 자식 요소를 중앙 정렬 */
}

#wallet-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.price-box span:first-child {
    text-shadow: var(--glow-cyan);
}

.price-box:last-child span:first-child {
    text-shadow: var(--glow-fuchsia);
}

.price-value,
.points-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--yellow);
    text-shadow: var(--glow-yellow);
    word-break: break-all;
}

#wallet-info {
    display: none;
    flex-direction: column;
    align-items: center;
    /* flex-end에서 center로 변경하여 중앙 정렬 */
    justify-content: center;
    width: 100%;
    height: 100%;
}

.wallet-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    color: white;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background-color: var(--cyan);
    cursor: pointer;
    justify-content: center;
    /* 버튼 내부 아이콘/텍스트 중앙 정렬 */
    width: 100%;
    /* 버튼 너비를 박스에 맞춤 */
    box-sizing: border-box;
}

.wallet-btn span {
    white-space: nowrap;
}

.wallet-btn:hover {
    box-shadow: var(--glow-cyan);
    border-color: var(--cyan);
    background-color: #00dddd;
}

#disconnect-wallet-btn {
    background-color: #ff3366;
    margin-top: 0.5rem;
}

#disconnect-wallet-btn:hover {
    box-shadow: 0 0 5px #ff3366, 0 0 10px #ff3366;
    border-color: #ff3366;
    background-color: #ff1a53;
}

#wallet-address {
    font-size: 0.75rem;
    color: #aaa;
    font-family: monospace;
    margin-bottom: 0.5rem;
    /* Disconnect 버튼과의 간격 */
}




/* 이하 코드는 기존과 동일합니다. */
.reels-container {
    position: relative;
    background: #000;
    border-radius: 10px;
    padding: 1rem;
    border: 2px solid #333;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
    height: 120px;
}

.reel-shadow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    pointer-events: none;
    box-shadow: inset 0 15px 20px rgba(0, 0, 0, 0.6), inset 0 -15px 20px rgba(0, 0, 0, 0.6);
}

.reels {
    display: flex;
    justify-content: space-around;
    height: 100%;
    overflow: hidden;
}

.reel-wrapper {
    width: 33.33%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.reel-symbols {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    font-size: 4rem;
    line-height: 120px;
    text-align: center;
    filter: blur(2px);
    transition: filter 0.5s ease;
    display: flex;
    flex-direction: column;
}

.reel-symbols span {
    height: 120px;
    display: flex;
    align-items: center;
    /* 수직 중앙 정렬 */
    justify-content: center;
    /* 수평 중앙 정렬 */
}



.reels.spinning .reel-symbols {
    animation: spin 40s linear infinite;
}

.reels.stopped .reel-symbols {
    filter: blur(0);
}

@keyframes spin {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(100%);
    }
}

.message-display {
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    font-size: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    min-height: 48px;
    border: 1px solid var(--border-color);
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.points-label {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
}

.payout-table {
    font-size: 0.7rem;
    color: #9c9c9c;
    text-shadow: var(--glow-fuchsia);
    text-align: center;
}

.payout-table span {
    font-size: 0.7rem;
    color: #fff;
}

.bet-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bet-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.bet-button {
    padding: 0.75rem 0;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    color: white;
    cursor: pointer;
}

.bet-button:hover,
.bet-button.active {
    background: var(--fuchsia);
    box-shadow: var(--glow-fuchsia);
    color: black;
    border-color: var(--fuchsia);
}

.manual-bet-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    color: var(--yellow);
    -moz-appearance: textfield;
}

.manual-bet-input::placeholder {
    color: #888;
}

.manual-bet-input:focus {
    outline: none;
    box-shadow: var(--glow-yellow);
    border-color: var(--yellow);
}

.manual-bet-input::-webkit-outer-spin-button,
.manual-bet-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.spin-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    padding: 1rem;
    border-radius: 10px;
    background: linear-gradient(45deg, var(--fuchsia), var(--cyan));
    border: none;
    color: #0a0a1a;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

.spin-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--glow-cyan), var(--glow-fuchsia);
}

.spin-btn:disabled {
    background: #333;
    color: #777;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 릴 안에 표시될 이미지의 크기와 정렬을 설정합니다. */
.reel-symbols img {
    width: 4rem;
    /* 텍스트 심볼의 font-size와 맞춤 */
    height: 4rem;
    /* 텍스트 심볼의 font-size와 맞춤 */
    vertical-align: middle;
    /* 다른 심볼과 높이를 맞추기 위함 */
    object-fit: contain;
    /* 이미지가 잘리지 않도록 함 */
}

/* 결과 메시지 창에 표시될 작은 아이콘 이미지의 스타일입니다. */
.message-display .result-icon {
    width: 1.2em;
    /* 메시지 텍스트의 폰트 크기에 비례하여 설정 */
    height: 1.2em;
    vertical-align: middle;
    margin: 0 0.2em;
}


/* style.css 파일 맨 아래에 추가 */

/* 실시간 당첨 배너 스타일 - 수정된 버전 */
#winner-banner-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.1rem;
    width: 100%;
    overflow: hidden;
    /* 배너 내용이 넘치면 숨김 */
    white-space: nowrap;
    /* 텍스트가 줄바꿈되지 않도록 함 */
    box-sizing: border-box;
    margin-bottom: 0.1rem;
    /* 헤더와의 간격 */
}

#winners-banner {
    display: inline-block;
    padding-left: 100%;
    /* 오른쪽에서 시작하도록 함 */
    animation: scroll-left 45s linear infinite;
    /* 45초 동안 스크롤, 무한 반복 */
    white-space: nowrap;
    /* 중요: 내용이 줄바꿈되지 않도록 */
}

#winners-banner:hover {
    animation-play-state: paused;
    /* 마우스를 올리면 멈춤 */
}

.winner-item {
    display: inline;
    /* span이므로 inline으로 설정 */
    margin-right: 0.5rem;
    /* 각 당첨 내역 사이의 간격 */
    color: var(--yellow);
    text-shadow: var(--glow-yellow);
    font-size: 0.9rem;
    white-space: nowrap;
    /* 각 아이템도 줄바꿈 방지 */
}

.winner-item .player {
    color: var(--cyan);
    font-weight: bold;
}

.winner-item .symbol {
    font-size: 1.2em;
    vertical-align: middle;
    margin: 0 0.1em;
}

.winner-item .symbol img {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
}

.winner-item .amount {
    color: var(--yellow);
    font-weight: bold;
}

/* 스크롤 애니메이션 정의 (우 -> 좌) */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* BET 박스 레이아웃 수정 */
.bet-box {
    justify-content: space-between;
    /* 요소들을 위, 중간, 아래로 분산 */
    padding: 0.5rem;
}

.bet-box .points-label {
    align-self: center;
    /* BET 레이블을 중앙 정렬 */
}

.bet-box .points-value {
    margin: 0;
    /* 불필요한 마진 제거 */
}

.bet-actions {
    display: flex;
    justify-content: center;
    /* 버튼들을 가로 중앙으로 정렬 */
    gap: 4px;
    width: 100%;
}

.hold-btn {
    /* flex-grow 제거하여 버튼이 늘어나지 않도록 함 */
    padding: 2px 10px;
    /* 버튼 좌우 여백 추가 */
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hold-btn:hover {
    border-color: var(--yellow);
    color: var(--yellow);
}

.hold-btn.active {
    background-color: var(--yellow);
    color: #0a0a1a;
    font-weight: bold;
    box-shadow: var(--glow-yellow);
    border-color: var(--yellow);
}

.reset-btn:hover {
    border-color: var(--fuchsia);
    color: var(--fuchsia);
}



/* 새로운 폭죽 효과 스타일 (기존 코드는 지우고 이걸로 교체) */

#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
}

/* 1. 위로 솟아오르는 '로켓'의 스타일 */
.firework-rocket {
    position: absolute;
    /* left: 50%; <- 이 부분은 JS에서 동적으로 설정하므로 제거하거나 주석 처리 */
    bottom: 0;
    /* 화면 맨 아래에서 시작 */
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--yellow);
    /* 솟아오르는 빛 색상 */
    box-shadow: var(--glow-yellow);
    /* 'rise' 애니메이션을 1.5초 동안 실행 */
    animation: rise 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

/* 2. '로켓'이 터진 후 퍼져나가는 '입자'의 스타일 */
.firework-particle {
    position: absolute;
    /* 시작 위치는 JS에서 설정 (화면 중앙) */
    width: 20px;
    height: 12px;
    border-radius: 50%;
    opacity: 0;
    /* 'explode' 애니메이션을 1.5초 동안 실행 */
    animation: explode 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}


/* '로켓'이 위로 솟아오르는 애니메이션 정의 */
@keyframes rise {
    from {
        transform: translateY(0);
        /* 시작은 제자리 */
    }

    to {
        /* JS에서 설정한 --target-y 값으로 이동 */
        transform: translateY(var(--target-y, -50vh));
        /* 기본값 -50vh */
    }
}

/* '입자'가 터져나가는 애니메이션 정의 */
@keyframes explode {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        /* JS에서 설정한 --end-x, --end-y 값으로 멀리 퍼져나감 */
        transform: scale(0) translateX(var(--end-x)) translateY(var(--end-y));
    }
}

/* 역대 최고 기록 스타일 */
#top-winner-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--fuchsia);
    /* 눈에 띄게 fuchsia 색상 사용 */
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    box-shadow: var(--glow-fuchsia);
}

.top-winner-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--yellow);
    text-shadow: var(--glow-yellow);
    margin-bottom: 0.5rem;
}

#top-winner-details {
    display: flex;
    flex-direction: column;
    /* 자식 요소들을 세로로 정렬 */
    align-items: center;
    /* 자식 요소들을 가로 중앙에 정렬 */
    gap: 0.01rem;
    /* 세로 간격 조절 */
    font-size: 0.9rem;
    min-height: 24px;
}

#top-winner-info {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: center;
    /* top-winner-info 내부의 내용물도 중앙 정렬 */
    width: 100%;
    /* 가로 공간을 최대한 차지하도록 설정 */
}


#top-winner-info span {
    white-space: nowrap;
    /* 텍스트 내용이 길더라도 줄 바꿈되지 않도록 강제합니다. */
}

#reset-timer-display {
    white-space: nowrap;
    font-size: 0.85rem;
    color: #bbb;
    width: 100%;
    /* 가로 공간을 모두 차지하게 함 */
    text-align: center;
    /* 내용물을 중앙 정렬 */
    margin-top: -1rem;
    /* 예시: 약간 위로 당김 */
}

#top-winner-info .symbol {
    font-size: 1.5em;
    vertical-align: middle;
}

#top-winner-info .symbol img {
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
}

#top-winner-info .player {
    color: var(--cyan);
    font-family: monospace;
}

#top-winner-info .amount {
    color: var(--yellow);
    font-weight: bold;
}


/* ONE 코인 구매 버튼 스타일 */

/* 가격표와 구매 버튼을 세로로 정렬하기 위한 컨테이너 */
.price-box-with-button {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* 가격표와 버튼 사이의 간격 */
}

/* 새로 추가된 구매 버튼 스타일 */
.buy-button {
    display: block;
    /* a 태그를 블록 요소로 만들어 너비를 가득 채움 */
    padding: 0.5rem;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #0a0a1a;
    /* 어두운 배경색 글자 */
    background: var(--yellow);
    /* 노란색 배경 */
    text-align: center;
    text-decoration: none;
    /* 밑줄 제거 */
    transition: all 0.3s ease;
    cursor: pointer;
}

.buy-button:hover {
    box-shadow: var(--glow-yellow);
    /* 호버 시 노란색 그림자 효과 */
    transform: scale(1.05);
    /* 약간 확대되는 효과 */
}

/* 실시간 랭킹 스타일 */
.rankings-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--cyan);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0rem;
    /* points-grid와의 간격 */
    box-shadow: var(--glow-cyan);
}

.rankings-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    text-align: center;
    margin-bottom: 0.5rem;
}

#rankings-list ol {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

#rankings-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

#rankings-list li:last-child {
    border-bottom: none;
}

.rankings-item .rank {
    font-weight: bold;
    color: var(--cyan);
    margin-right: 1rem;
}

.rankings-item .player {
    font-family: monospace;
    color: #ddd;
}

.rankings-item .amount {
    font-weight: bold;
    color: var(--yellow);
}

/* 나의 랭킹 표시부 스타일 */
.my-rank-container {
    border-top: 2px dotted var(--cyan);
    /* Top 5 리스트와의 구분선 */
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    min-height: 24px;
    /* 내용이 없을 때 최소 높이 */
}

/* 랭킹 아이템 스타일 재사용 */
.my-rank-container .rankings-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    background-color: rgba(0, 255, 255, 0.1);
    /* 내 순위는 배경색으로 강조 */
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
}

/* MY BEST 아래에 표시될 랭크 스타일 */
.my-best-rank {
    font-size: 0.8rem;
    color: var(--cyan);
    /* 랭크 글자색 */
    margin-top: 0.2rem;
    /* 금액과의 간격 */
    text-shadow: var(--glow-cyan);
    text-align: center;
    /* 텍스트 중앙 정렬 */
    width: 100%;
    /* 부모 컨테이너 너비를 채우도록 */
}

/* ONE.gif 심볼만 특별히 크게 만들기 */
.reel-symbols img[src="image/ONE.gif"] {
    width: 8rem;
    /* 원하시는 크기로 조절하세요 (기존 4rem) */
    height: 8rem;
    /* 원하시는 크기로 조절하세요 (기존 4rem) */
}

/* ===== 새로운 헤더 스타일 ===== */
.header-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3칸 레이아웃 */
    gap: 0.5rem;
}

.header-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

.header-label {
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.header-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--yellow);
    text-shadow: var(--glow-yellow);
}

.user-box {
    position: relative;
}

.logout-btn {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    background: rgba(255, 51, 102, 0.8);
    border: none;
    border-radius: 4px;
    padding: 0.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: #ff3366;
    box-shadow: 0 0 10px #ff3366;
}

.logout-btn svg {
    width: 16px;
    height: 16px;
    color: white;
}

.reward-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: linear-gradient(45deg, var(--fuchsia), var(--cyan));
    cursor: pointer;
    width: 100%;
}

.reward-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--glow-cyan), var(--glow-fuchsia);
}

.reward-btn:disabled {
    background: #333;
    color: #777;
    cursor: not-allowed;
    opacity: 0.5;
}

.reward-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== 로그인/회원가입 모달 ===== */
.modal {
    display: none;
    /* none으로 설정하여 초기 로드 시 숨김 */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    /* 뷰포트 너비 강제 */
    height: 100vh;
    /* 뷰포트 높이 강제 */
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    display: flex;
    /* flex 유지 (내용물 정렬용) */
    flex-direction: column;
    position: absolute;
    /* Flexbox 무시하고 강제 중앙 정렬 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.3);
    opacity: 1;
    /* animation: modalFadeIn 0.3s ease forwards; */
    /* forwards 추가 */
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-content h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    text-align: center;
    margin-bottom: 1.5rem;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#auth-form input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: white;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
}

#auth-form input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

#auth-form input::placeholder {
    color: #888;
}

.auth-btn {
    padding: 0.75rem;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, var(--fuchsia), var(--cyan));
    color: white;
}

.auth-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--glow-cyan), var(--glow-fuchsia);
}

.auth-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.auth-message {
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    min-height: 20px;
}

.auth-message.success {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: #0f0;
}

.auth-message.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #f66;
}

/* ===== 광고 표시 영역 ===== */
.ad-container {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-content {
    background: var(--container-bg);
    border: 2px solid var(--fuchsia);
    border-radius: 15px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--glow-fuchsia);
    text-align: center;
}

.ad-content h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--yellow);
    text-shadow: var(--glow-yellow);
    margin-bottom: 1.5rem;
}

#ad-placeholder {
    background: rgba(0, 0, 0, 0.5);
    border: 1px dashed var(--border-color);
}

.ad-content {
    background: #1a1b3a;
    width: 90%;
    max-width: 400px;
    border: 2px solid var(--fuchsia);
    border-radius: 10px;
    padding: 1.5rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.3);
}

#ad-placeholder {
    width: 100% !important;
    min-width: 300px !important;
    /* 구글 배너 최소 너비 대응 */
    min-height: 250px;
    margin: 1rem 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.close-ad-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    background: var(--fuchsia);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-ad-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-fuchsia);
}

/* ===== 광고 버튼 및 배너 광고 스타일 ===== */
.ad-buttons-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.ad-btn-small {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.3rem !important;
    white-space: nowrap;
    min-height: 40px;
}

.ad-btn-small.premium {
    border-color: var(--yellow);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(0, 0, 0, 0.5));
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.ad-btn-small.premium:not(:disabled):hover {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(0, 0, 0, 0.6));
}

.ad-btn-small span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.banner-ad-container {
    width: 100%;
    max-width: 480px;
    min-width: 320px;
    /* 모바일 배너 최소 너비 */
    margin: 10px auto;
    text-align: center;
    border: none;
    background: transparent;
    min-height: 50px;
    /* 배너 기본 높이 확보 */
    box-sizing: border-box;
}

.ad-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    /* JS에서 제어 */
    justify-content: center;
    align-items: center;
}

.ad-loading {
    color: #aaa;
    text-align: center;
    line-height: 1.5;
}

/* 광고 선택 모달 스타일 */
.ad-choice-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-btn.choices {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    height: auto;
    width: 45%;
    min-width: 120px;
    background: rgba(20, 20, 40, 0.8);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.auth-btn.choices:hover {
    background: rgba(0, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.2);
}

.auth-btn.choices.secondary {
    border-color: var(--yellow);
}

.auth-btn.choices.secondary:hover {
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

.close-btn-text {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: color 0.3s;
}

.close-btn-text:hover {
    color: #fff;
    text-decoration: underline;
}

/* 커스텀 모달 스타일 */
.custom-modal-content {
    text-align: center;
    max-width: 320px;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(10, 10, 20, 0.98));
    border: 1px solid var(--cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

#custom-modal-title {
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-shadow: var(--glow-cyan);
}

#custom-modal-message {
    color: #eee;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-size: 1rem;
}

.custom-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.custom-modal-buttons button {
    min-width: 80px;
}

/* 계정 설정 모달 스타일 */
.settings-content {
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.98), rgba(10, 10, 20, 0.99));
    border: 1px solid var(--border-color);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    max-width: 350px;
    padding: 1.5rem;
}

.modal-title {
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: var(--glow-cyan);
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    border-radius: 5px;
    color: white;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
}

.settings-input:focus {
    border-color: var(--cyan);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.settings-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

.danger-zone h3 {
    color: #ff3366;
}

.auth-btn.danger {
    background: linear-gradient(45deg, #cc0000, #ff3333);
    border: none;
}

.auth-btn.danger:hover {
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    transform: scale(1.02);
}

.warning-text {
    color: #ff6666;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* 헤더 아이콘 버튼 스타일 */
.header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: white;
    transform: scale(1.1);
    text-shadow: 0 0 5px white;
}

#logout-btn {
    color: #ff6b6b;
}

#logout-btn:hover {
    color: #ff3333;
    text-shadow: 0 0 5px #ff0000;
}