/* numbergenerator.css - 랜덤 숫자 생성기 전용 스타일 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

h1 {
    color: #e0e0e0;
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

/* 뒤로가기 버튼 */
.back-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(127, 90, 240, 0.8);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-decoration: none;
    z-index: 20;
}

.back-btn:hover {
    background: #7f5af0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(127, 90, 240, 0.4);
}

/* 범위 입력 */
#range-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 36px;
    color: #999;
    font-size: 0.95rem;
}

#range-row label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.range-input {
    width: 60px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid #555;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.range-input:focus {
    border-color: #7f5af0;
}

#range-sep {
    color: #666;
    font-size: 1.1rem;
}

/* 메인 박스 */
#box {
    width: 260px;
    height: 260px;
    overflow: hidden;
    border: 3px solid #444;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: border-color 0.3s;
    background: rgba(255, 255, 255, 0.03);
}

#box.charging {
    border-color: #7f5af0;
}

#box.reveal {
    border-color: #60a5fa;
}

/* 캔버스 & 플래시 */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.15s;
}

/* 숫자 표시 */
#number {
    position: relative;
    z-index: 2;
    font-family: 'Segoe UI', 'Arial Black', sans-serif;
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    transform: scale(0.3);
    transition: opacity 0.35s ease-out, transform 0.35s cubic-bezier(0.17, 0.67, 0.35, 1.5);
    background: linear-gradient(
        135deg,
        #3b82f6 0%, #93c5fd 12%, #60a5fa 25%,
        #e0eeff 38%, #3b82f6 50%, #93c5fd 62%,
        #2563eb 75%, #bfdbfe 88%, #3b82f6 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.8))
            drop-shadow(0 0 30px rgba(37, 99, 235, 0.4))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    animation: none;
}

#number.show {
    opacity: 1;
    transform: scale(1);
    animation: metalShimmer 2.5s ease-in-out infinite, metalPulse 1.5s ease-in-out infinite;
}

@keyframes metalShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes metalPulse {
    0%, 100% {
        filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.8))
                drop-shadow(0 0 30px rgba(37, 99, 235, 0.4))
                drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 22px rgba(96, 165, 250, 1))
                drop-shadow(0 0 55px rgba(59, 130, 246, 0.6))
                drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    }
}

#hint {
    position: absolute;
    bottom: -40px;
    color: #666;
    font-size: 0.85rem;
    transition: opacity 0.3s;
}