* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'VT323', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#app {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    max-height: 932px;
    position: relative;
    background-color: #000;
    overflow: hidden;
    user-select: none;
    padding: 20px;
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.hidden {
    display: none !important;
}

/* 시작 화면 */
#start-screen {
    justify-content: center;
    align-items: center;
}

#start-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 80px;
    font-family: 'VT323', monospace;
    cursor: pointer;
    transition: transform 0.1s ease;
}

/* 헤더 & 내 숫자 */
#header {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 80px;
    overflow: hidden;
}

#my-number {
    font-size: 70px;
    line-height: 1;
    transition: font-size 0.3s ease;
    white-space: nowrap;
}

#inventory {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 36px;
}

.inv-item {
    cursor: grab;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.inv-item:active {
    cursor: grabbing;
}

.dragging {
    opacity: 0.5;
    transform: scale(1.1);
}

/* 상점 */
#shop-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

#shop-label {
    font-size: 30px;
    opacity: 0.7;
}

#shop-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.shop-item {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    transition: opacity 0.1s ease;
    white-space: nowrap;
}

/* 하이라이트 애니메이션 */
.flash-green {
    animation: flashGreen 1s ease-out;
}

@keyframes flashGreen {
    0% {
        color: #fff;
    }

    20% {
        color: #0f0;
        text-shadow: 0 0 10px #0f0;
    }

    80% {
        color: #0f0;
        text-shadow: 0 0 10px #0f0;
    }

    100% {
        color: #fff;
    }
}

.flash-red {
    animation: flashRed 0.5s ease-in-out 3;
}

@keyframes flashRed {
    0% {
        color: #fff;
    }

    50% {
        color: #f00;
        text-shadow: 0 0 10px #f00;
    }

    100% {
        color: #fff;
    }
}

#footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    width: 100%;
}

#restart-btn {
    font-size: 36px;
    cursor: pointer;
    transition: opacity 0.1s ease;
    padding-left: 5px;
}

#restart-btn:hover {
    opacity: 0.7;
}

#calc-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 60px;
    font-family: 'VT323', monospace;
    cursor: pointer;
}

#calc-btn:active {
    transform: scale(0.9);
}

.rolling {
    animation: roll 0.1s linear infinite;
}

@keyframes roll {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}