* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
    transition: background 0.5s ease;
}

#screen-width-display {
    display: none;
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    color: #ffd700;
    padding: 4px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    pointer-events: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

body.theme-galaxy {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
}

body.theme-emerald {
    background: linear-gradient(135deg, #0a2e1a 0%, #1a4d2e 50%, #0a2e1a 100%);
}

body.theme-royal {
    background: linear-gradient(135deg, #1a0a2e 0%, #2e1a4d 50%, #1a0a2e 100%);
}

body.theme-sunset {
    background: linear-gradient(135deg, #2e1a0a 0%, #4d2e1a 50%, #2e1a0a 100%);
}

#container {
    position: relative;
    width: 100%;
    height: 100vh;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0) 100%
    );
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.top-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-selector {
    /*display: flex;*/
    display: none; /* 스타일 개발전 비활성화 */
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
}

.theme-btn {
    width: 35px;
    height: 35px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    pointer-events: all;
}

.theme-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition:
        width 0.3s,
        height 0.3s;
}

.theme-btn:hover::after {
    width: 50px;
    height: 50px;
}

.theme-btn:hover {
    transform: scale(1.15);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.theme-btn.active {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    transform: scale(1.1);
}

.theme-btn.galaxy {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #4a4a8e 100%);
}

.theme-btn.emerald {
    background: linear-gradient(135deg, #0a2e1a 0%, #1a4d2e 50%, #2e8e4a 100%);
}

.theme-btn.royal {
    background: linear-gradient(135deg, #1a0a2e 0%, #2e1a4d 50%, #6a4a8e 100%);
}

.theme-btn.sunset {
    background: linear-gradient(135deg, #2e1a0a 0%, #4d2e1a 50%, #8e6a4a 100%);
}

.sound-toggle {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: all;
    position: relative;
}

.sound-toggle:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.sound-toggle.muted {
    border-color: rgba(255, 0, 0, 0.5);
    background: rgba(255, 0, 0, 0.1);
}

.sound-toggle svg {
    width: 24px;
    height: 24px;
    fill: #ffd700;
    transition: fill 0.3s ease;
}

.sound-toggle.muted svg {
    fill: #ff4444;
}

.dice-design-selector {
    /*display: flex;*/
    display: none; /* 스타일 개발전 비활성화 */
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
}

.design-btn {
    width: 35px;
    height: 35px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.design-btn:hover {
    transform: scale(1.15);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.design-btn.active {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    transform: scale(1.1);
}

.design-btn.classic {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    color: #000;
}

.design-btn.neon {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.design-btn.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
}

.design-btn.ruby {
    background: linear-gradient(135deg, #8b0000 0%, #ff0000 100%);
    color: #fff;
}

.stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
}

.stat-label {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.control-panel {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    width: 90%;
    max-width: 600px;
}

.dice-count-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.4);
    backdrop-filter: blur(20px);
    width: 100%;
    justify-content: center;
}

.dice-count-label {
    font-size: 14px;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.dice-buttons {
    display: flex;
    gap: 8px;
}

.dice-btn {
    width: 45px;
    height: 45px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    touch-action: manipulation;
}

.dice-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.dice-btn.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

.roll-button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #000;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
    pointer-events: all;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    white-space: nowrap;
    margin-left: 15px;
    flex-shrink: 0;
}

.roll-button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition:
        width 0.6s,
        height 0.6s;
}

.roll-button:hover::before {
    width: 300px;
    height: 300px;
}

.roll-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 60px rgba(255, 215, 0, 0.8);
}

.roll-button:active {
    transform: scale(0.95);
}

.roll-button span {
    position: relative;
    z-index: 1;
}

.result-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700 0%, #fff 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 60px rgba(255, 215, 0, 0.8);
    pointer-events: none;
}

.result-display.show {
    opacity: 1;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

@media (max-width: 1300px) {
    .dice-count-selector {
        margin-bottom: 92px;
    }
}
@media (max-width: 768px) {
    .logo {
        font-size: 18px;
        letter-spacing: 1px;
    }

    .theme-selector {
        gap: 5px;
        padding: 6px;
    }

    .theme-btn {
        width: 28px;
        height: 28px;
    }

    .dice-design-selector {
        gap: 5px;
        padding: 6px;
    }

    .design-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .sound-toggle {
        width: 35px;
        height: 35px;
    }

    .sound-toggle svg {
        width: 20px;
        height: 20px;
    }

    .stats {
        gap: 8px;
        font-size: 12px;
    }

    .stat-item {
        padding: 8px 12px;
    }

    .stat-label {
        font-size: 8px;
    }

    .stat-value {
        font-size: 16px;
    }

    .dice-count-label {
        font-size: 12px;
    }

    .dice-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .roll-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .result-display {
        font-size: 60px;
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}
