@font-face {
    font-family: 'KotraBold';
    src: url('fonts/KOTRA_BOLD.ttf') format('truetype');
    font-weight: bold;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1f1f 50%, #1a1a1a 100%);
    font-family: 'KotraBold', sans-serif;
    color: #d4af37;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 233, 4, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 75% 75%, rgba(144, 12, 63, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(54, 164, 57, 0.02) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.title {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.2);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: #b8860b;
    margin-bottom: 10px;
}

.game-board {
    background: linear-gradient(145deg, #2a1810, #1a100a);
    border: 2px solid #8b4513;
    border-radius: 20px;
    padding: 30px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(139, 69, 19, 0.3);
    position: relative;
}

.selection-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gacha-button {
    background: linear-gradient(135deg, #3d2f1f 0%, #2a1f15 100%);
    border: 3px solid #8b4513;
    border-radius: 15px;
    padding: 25px;
    color: #d4af37;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.gacha-button:hover {
    border-color: #d4af37;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    transform: translateY(-3px);
}

.gacha-button.special {
    border-color: #36a439;
    background: linear-gradient(135deg, #1f3d1f 0%, #152a15 100%);
}

.draw-options {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.draw-btn {
    background: linear-gradient(135deg, #8b4513 0%, #5d2f0a 100%);
    border: 2px solid #a0522d;
    border-radius: 12px;
    padding: 18px 25px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.draw-btn:hover {
    background: linear-gradient(135deg, #a0522d 0%, #6b3610 100%);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(160, 82, 45, 0.4);
}

.specific-select {
    display: none;
    background: linear-gradient(145deg, rgba(42, 36, 32, 0.95), rgba(26, 26, 26, 0.95));
    border: 2px solid #8b4513;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
}

.specific-select select {
    background: #2a2420;
    border: 2px solid #8b4513;
    border-radius: 8px;
    padding: 12px;
    color: #d4af37;
    font-size: 1rem;
    width: 100%;
    margin: 10px 0;
}

.result-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(145deg, rgba(13, 9, 7, 0.8), rgba(26, 15, 10, 0.6));
    border-radius: 20px;
    border: 2px solid rgba(139, 69, 19, 0.5);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.identity-wrapper {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.identity-wrapper:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}

.identity-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.5s ease;
    border-radius: 12px;
    cursor: pointer;
}

.cover::before {
    content: '?';
    font-size: 4rem;
    opacity: 0.8;
}

.duplicate-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4444;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
}

.reveal-all-btn {
    display: none;
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    border: 3px solid #d4af37;
    border-radius: 15px;
    padding: 18px 40px;
    color: #1a1a1a;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    margin: 30px auto;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
}

.reveal-all-btn:hover {
    background: linear-gradient(135deg, #ffff00 0%, #d4af37 100%);
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.back-btn {
    background: linear-gradient(135deg, #5d2f0a 0%, #3d1f08 100%);
    border: 2px solid #8b4513;
    border-radius: 12px;
    padding: 15px 30px;
    color: #d4af37;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-btn:hover {
    border-color: #d4af37;
    background: linear-gradient(135deg, #6b3610 0%, #4d2309 100%);
    transform: translateY(-2px);
}

.n-draw-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.n-draw-input {
    background: #2a2420;
    border: 2px solid #8b4513;
    border-radius: 8px;
    padding: 12px;
    color: #d4af37;
    font-size: 1rem;
    width: 80px;
    text-align: center;
    font-weight: 600;
}

.n-draw-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* 3성 연출 관련 스타일 */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.3s ease;
}

.symbol-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.symbol-animation {
    max-width: 400px;
    max-height: 400px;
    opacity: 0;
    transform: scale(0.5) rotate(-180deg);
    transition: all 1.5s ease-out;
}

.symbol-text {
    font-size: 4rem;
    color: #ffd700;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    opacity: 0;
    transform: scale(0.5) rotate(-180deg);
    transition: all 1.5s ease-out;
}

.three-star-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    cursor: pointer;
}

.three-star-display {
    max-width: 60vw;
    max-height: 70vh;
    opacity: 0;
    transform: scale(0.8) translateY(50px);
    transition: all 1s ease-out;
    border-radius: 20px;
    box-shadow:
        0 0 50px rgba(255, 233, 4, 0.8),
        0 0 100px rgba(255, 233, 4, 0.4);
}

.identity-name-box {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(26, 15, 10, 0.95), rgba(42, 36, 32, 0.95));
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out 0.5s;
}

.identity-rank-img {
    width: 60px;
    height: 60px;
}

.identity-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.identity-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
}

.inmate-name {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-align: center;
}

.spawn-dialog {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(42, 36, 32, 0.95), rgba(26, 26, 26, 0.95));
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 20px 30px;
    color: #d4af37;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    max-width: 600px;
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.8s ease-out;
}

.floating-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 900;
    z-index: 1002;
    opacity: 0;
    transition: all 1s ease-out;
    pointer-events: none;
}

.variation-text {
    color: #ff6b35;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
}

.shake-animation {
    animation: shake 0.8s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

.sparkle-effect {
    animation: sparkle 2s infinite;
}

@keyframes sparkle {

    0%,
    100% {
        filter: brightness(1) saturate(1);
    }

    50% {
        filter: brightness(1.3) saturate(1.5);
        box-shadow:
            0 0 50px rgba(255, 233, 4, 0.8),
            0 0 100px rgba(255, 233, 4, 0.4),
            0 0 150px rgba(255, 233, 4, 0.2);
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .selection-panel {
        grid-template-columns: 1fr;
    }

    .result-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .three-star-display {
        max-width: 90vw;
        max-height: 60vh;
    }

    .identity-name-box {
        flex-direction: column;
        text-align: center;
    }
}
