:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --accent-color: #64ffda;
    --secondary-bg: #2d2d2d;
    --font-main: 'Outfit', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
}

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

body {
    font-family: var(--font-main), var(--font-jp);
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    height: 100%;
}

/* Click Area */
.click-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, #333 0%, #1a1a1a 100%);
    overflow: hidden;
}

.header-stats {
    position: absolute;
    top: 40px;
    text-align: center;
    z-index: 10;
}

.score-container {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.score-container .label {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.7;
    display: block;
    margin-top: 5px;
    letter-spacing: 2px;
}

.power-container {
    font-size: 1.2rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
}

/* 3D Block */
.block-wrapper {
    perspective: 1000px;
    width: 200px;
    height: 200px;
    position: relative;
    margin-top: 20px;
}

.block {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(30deg);
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    user-select: none;
}

.block:active {
    transform: rotateX(-20deg) rotateY(30deg) scale(0.9);
}

.block-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.front {
    transform: rotateY(0deg) translateZ(100px);
}

.back {
    transform: rotateY(180deg) translateZ(100px);
}

.right {
    transform: rotateY(90deg) translateZ(100px);
}

.left {
    transform: rotateY(-90deg) translateZ(100px);
}

.top {
    transform: rotateX(90deg) translateZ(100px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

/* Ranks Colors */
.rank-0 .block-face {
    background-color: #8B4513;
}

/* Brown */
.rank-1 .block-face {
    background-color: #808080;
}

/* Gray */
.rank-2 .block-face {
    background-color: #228B22;
}

/* Green */
.rank-3 .block-face {
    background-color: #9ACD32;
}

/* YellowGreen */
.rank-4 .block-face {
    background-color: #800080;
}

/* Purple */
.rank-5 .block-face {
    background-color: #FF69B4;
}

/* Pink */
.rank-6 .block-face {
    background-color: #87CEEB;
}

/* LightBlue */
.rank-7 .block-face {
    background-color: #FF0000;
}

/* Red */
.rank-8 .block-face {
    background-color: #C0C0C0;
}

/* Silver */
.rank-9 .block-face {
    background-color: #FFD700;
}

/* Gold */
.rank-10 .block-face {
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    animation: rainbow 3s ease infinite;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Shop Area */
.shop-area {
    width: 400px;
    background-color: var(--secondary-bg);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
}

.shop-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.shop-section {
    margin-bottom: 40px;
}

.shop-section h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shop-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.shop-item:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.shop-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.item-cost {
    font-size: 0.9rem;
    color: #ffd700;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-desc {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 5px;
}

.item-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    font-size: 1.2rem;
}

/* Click Effects */
.click-effect {
    position: absolute;
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    font-weight: 700;
    color: white;
    font-size: 1.8rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.8);
        opacity: 0;
    }

    20% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(-80px) scale(1);
        opacity: 0;
    }
}

/* Tool Animation */
.tool-animation {
    position: absolute;
    pointer-events: none;
    z-index: 101;
    font-size: 2rem;
    color: #e0e0e0;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    animation: toolSwing 0.5s ease-out forwards;
    transform-origin: bottom right;
    /* Rotate from handle */
}

@keyframes toolSwing {
    0% {
        transform: rotate(45deg) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: rotate(-45deg) scale(1.2);
        opacity: 1;
    }

    60% {
        transform: rotate(-45deg) scale(1);
        opacity: 1;
    }

    100% {
        transform: rotate(-45deg) translateY(-20px) scale(0.8);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
    }

    .shop-area {
        width: 100%;
        height: 50%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .click-area {
        height: 50%;
    }

    .block-wrapper {
        width: 160px;
        height: 160px;
    }

    .block-face {
        width: 160px;
        height: 160px;
    }

    .front {
        transform: rotateY(0deg) translateZ(80px);
    }

    .back {
        transform: rotateY(180deg) translateZ(80px);
    }

    .right {
        transform: rotateY(90deg) translateZ(80px);
    }

    .left {
        transform: rotateY(-90deg) translateZ(80px);
    }

    .top {
        transform: rotateX(90deg) translateZ(80px);
    }

    .bottom {
        transform: rotateX(-90deg) translateZ(80px);
    }
}