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

body {
    font-family: Arial, sans-serif;
    background-color: #1a237e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.game-container {
    text-align: center;
    color: white;
    padding: 30px 30px 150px 30px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    /* 关键：开启3D透视 */
    perspective: 600px;
}

h1 {
    font-size: 2em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* 骰子动画区域 */
.dice-animation-area {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dice-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 20px 0;
    gap: 40px;
}

/* Spine骰子样式 */
.spine-dice {
    width: 80px;
    height: 80px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.spine-dice:hover {
    transform: translate(var(--current-x, 0px), var(--current-y, 0px)) scale(1.05);
}

.spine-dice.locked {
    border: 3px solid #ff9800;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.8);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .spine-dice {
        width: 60px;
        height: 60px;
    }
}

/* 按钮操作区域 */
.button-area {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 20px 15px;
    gap: 15px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.roll-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 40px 80px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.roll-btn:hover {
    background-color: #f57c00;
}

.roll-btn:active {
    transform: scale(0.98);
}

.reset-btn {
    background-color: #607d8b;
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.reset-btn:hover {
    background-color: #455a64;
}

.reset-btn:active {
    transform: scale(0.98);
}

/* 骰子点数样式 */
.dice::before {
    content: attr(data-value);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .dice {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .roll-btn {
        padding: 18px 35px;
        font-size: 1.3em;
    }
    
    .reset-btn {
        padding: 12px 20px;
        font-size: 1em;
    }
}
