/* 룬 뽑기 전용 스타일 - 다른 페이지에 영향 안줌 */
.rune-lottery-container {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Malgun Gothic', sans-serif;
}

.rune-lottery-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.rune-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: #fff;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.rune-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.rune-header .draw-time {
    font-size: 1.2em;
    opacity: 0.9;
}

.rune-header .countdown {
    font-size: 1.5em;
    margin-top: 10px;
    font-weight: bold;
    color: #ffd700;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    background: #fff;
    color: #666;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    font-size: 1.3em;
}

.rules-box {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.rules-box h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.rules-box ul {
    list-style: none;
    padding: 0;
}

.rules-box li {
    padding: 8px 0;
    color: #664d03;
    font-size: 14px;
    border-bottom: 1px dashed #e0c96e;
}

.rules-box li:last-child {
    border-bottom: none;
}

.rules-box li::before {
    content: '✓ ';
    color: #28a745;
    font-weight: bold;
}

.prize-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #fff;
}

.prize-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.prize-row:first-child {
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.prize-label {
    font-weight: bold;
    font-size: 13px;
    min-width: 80px;
}

.prize-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.prize-values em {
    font-style: normal;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.prize-values .p1 { background: linear-gradient(135deg, #ffd700, #ffb700); color: #664d00; }
.prize-values .p2 { background: linear-gradient(135deg, #e0e0e0, #c0c0c0); color: #333; }
.prize-values .p3 { background: linear-gradient(135deg, #deb887, #cd853f); color: #fff; }
.prize-values .p4 { background: rgba(255,255,255,0.3); color: #fff; }

.prize-values .m0 { background: rgba(220,53,69,0.8); color: #fff; }
.prize-values .m1 { background: rgba(255,193,7,0.8); color: #333; }
.prize-values .m2 { background: rgba(23,162,184,0.8); color: #fff; }
.prize-values .m3 { background: rgba(40,167,69,0.8); color: #fff; }
.prize-values .m4 { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #333; }

@media (max-width: 500px) {
    .prize-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .prize-values {
        width: 100%;
    }
}

.rune-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.rune-item {
    aspect-ratio: 1;
    border: 3px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.rune-item:hover {
    transform: scale(1.05);
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.rune-item.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.rune-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rune-item img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.rune-item .rune-number {
    font-size: 12px;
    font-weight: bold;
    color: #666;
    margin-top: 5px;
}

.rune-item.selected .rune-number {
    color: #28a745;
}

.selected-runes {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.selected-rune-slot {
    width: 70px;
    height: 90px;
    border: 3px dashed #ccc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.selected-rune-slot.filled {
    border-style: solid;
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.selected-rune-slot img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.selected-rune-slot .slot-number {
    font-size: 12px;
    font-weight: bold;
    color: #28a745;
    margin-top: 5px;
}

.betting-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.betting-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.betting-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.betting-input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.betting-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.betting-input-group .point-label {
    font-weight: bold;
    color: #666;
}

.quick-bet-btns {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quick-bet-btn {
    padding: 8px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: #fff;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-bet-btn:hover {
    background: #667eea;
    color: #fff;
}

.current-point {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.btn-participate {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.btn-participate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-participate:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.my-entry {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.my-entry h3 {
    color: #155724;
    margin-bottom: 15px;
}

.my-entry-runes {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 15px 0;
}

.my-entry-rune {
    width: 60px;
    height: 80px;
    background: #fff;
    border: 2px solid #28a745;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.my-entry-rune img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.my-entry-rune span {
    font-size: 12px;
    font-weight: bold;
    color: #28a745;
    margin-top: 5px;
}

.my-entry .bet-info {
    color: #155724;
    font-size: 14px;
}

.participants-list {
    /* 스크롤 없이 전체 표시 */
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}

.participant-item:last-child {
    border-bottom: none;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.participant-name {
    font-weight: bold;
    color: #333;
    min-width: 80px;
}

.participant-runes {
    display: flex;
    gap: 8px;
}

.participant-rune {
    width: 40px;
    height: 50px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.participant-rune img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.participant-rune span {
    font-size: 10px;
    color: #666;
    font-weight: bold;
}

.participant-bet {
    color: #667eea;
    font-weight: bold;
}

.winning-numbers {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.winning-number {
    width: 70px;
    height: 90px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    border: 3px solid #cc9900;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.winning-number img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.winning-number span {
    font-size: 14px;
    font-weight: bold;
    color: #664d00;
    margin-top: 5px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.history-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.history-numbers {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.history-num {
    width: 30px;
    height: 30px;
    background: #667eea;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.winners-list {
    /* 스크롤 없이 전체 표시 */
}

.winner-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}

.winner-item:last-child {
    border-bottom: none;
}

.winner-rank {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.rank-4 { background: linear-gradient(135deg, #ffd700, #ffb700); color: #664d00; }
.rank-3 { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); }
.rank-2 { background: linear-gradient(135deg, #cd7f32, #b87333); }
.rank-1 { background: linear-gradient(135deg, #667eea, #764ba2); }

.winner-reward {
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.admin-settings-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px;
    transition: all 0.3s;
}

.admin-settings-btn:hover {
    background: rgba(255,255,255,0.3);
    color: #fff !important;
}

.rune-header {
    position: relative;
}

.btn-cancel {
    display: block;
    width: 100%;
    max-width: 250px;
    margin: 15px auto 0;
    padding: 10px 20px;
    border: 2px solid #dc3545;
    border-radius: 8px;
    background: transparent;
    color: #dc3545;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: #dc3545;
    color: #fff;
}

.participant-profile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
    vertical-align: middle;
}

.participant-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* 당첨자 목록 스타일 */
.winner-game-group {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.winner-game-group:last-of-type {
    margin-bottom: 15px;
}

.winner-game-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.winner-game-date {
    font-weight: bold;
    font-size: 14px;
}

.winner-game-nums {
    font-size: 13px;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 15px;
}

.winners-list {
    background: #fff;
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.winner-item:last-child {
    border-bottom: none;
}

.btn-show-more {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 5px;
}

.btn-show-more:hover {
    background: #e9ecef;
    color: #333;
}

.winner-profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
    vertical-align: middle;
    margin-right: 6px;
}

/* 이미지닉네임 원본 (동그라미 없이) */
.winner-profile-img-raw {
    max-height: 28px;
    vertical-align: middle;
}

.participant-profile-raw {
    max-height: 28px;
    vertical-align: middle;
}

.winner-user {
    display: flex;
    align-items: center;
    font-weight: 500;
    min-width: 100px;
}

.winner-runes {
    display: flex;
    gap: 4px;
    font-weight: bold;
    font-size: 14px;
}

.winner-runes .rune-match {
    color: #fff;
    background: #3498db;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
}

.winner-runes .rune-miss {
    color: #fff;
    background: #e74c3c;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
}

.winner-reward {
    margin-left: auto;
    font-weight: bold;
    font-size: 13px;
    min-width: 100px;
    text-align: right;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* 기본보상 (초록) */
.reward-base {
    color: #27ae60;
}

/* 배팅보상 (주황) */
.reward-bet {
    color: #e67e22;
}

.reward-zero {
    color: #999;
}

/* 추첨기록 당첨현황 */
.winner-summary {
    font-size: 12px;
    color: #666;
}

.winner-rank {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    min-width: 40px;
    text-align: center;
}

.winner-rank.rank-4 {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
}

.winner-rank.rank-3 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
}

.winner-rank.rank-2 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
}

.winner-rank.rank-1 {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.winner-rank.rank-0 {
    background: #999;
}

@media (max-width: 600px) {
    .rune-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
    
    .rune-item img {
        width: 35px;
        height: 35px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .selected-runes {
        gap: 10px;
    }
    
    .selected-rune-slot {
        width: 60px;
        height: 80px;
    }
    
    .winner-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .winner-date {
        margin-left: 0;
    }
}
