/* 本地字体定义 */
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/Nunito-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/Nunito-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/Nunito-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('./fonts/Nunito-ExtraBold.ttf') format('truetype');
}

:root {
    --bg-color: #fff9c4;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --panel-border: rgba(0, 0, 0, 0.06);
    --text-color: #333;
    --accent-color: #ff6b6b;
    --block-size: 32px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #fff9c4 0%, #f8bbd0 50%, #b3e5fc 100%);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.6);
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    z-index: 10;
}

/* 顶部记分板 */
.scoreboard {
    display: flex;
    justify-content: space-around;
    padding: 16px 24px;
    border-bottom: 2px dashed rgba(0, 0, 0, 0.08);
    border-radius: 24px 24px 0 0;
    background: rgba(255, 255, 255, 0.92);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.score-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}

.score-item.highlight .score-value {
    color: var(--accent-color);
}

/* 游戏主区域 */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 3000px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
}

.world-camera {
    width: 0;
    height: 0;
    position: absolute;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.blocks-world {
    position: absolute;
    transform-style: preserve-3d;
    transform: rotateX(60deg) rotateZ(45deg);
}

/* 内部偏移容器：通过JS动态设置translate3d使结构围绕原点居中 */
.blocks-offset {
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.click-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-weight: 700;
}

/* 3D方块容器 */
.block {
    position: absolute;
    width: var(--block-size);
    height: var(--block-size);
    transform-style: preserve-3d;
}

/* 方块内容（无动画，直接显示） */
.block-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

/* 方块面基础样式 */
.block-face {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* 顶面 (+Z方向) - 最亮 */
.block-top {
    background: #b3e5fc;
    transform: translateZ(var(--block-size));
    border: 1.5px solid #333;
}

/* 底面 (-Z方向) */
.block-bottom {
    background: #81d4fa;
    transform: translateZ(0) rotateX(180deg);
    border: 1.5px solid #333;
}

/* 左面 (-X方向) */
.block-left {
    background: #81d4fa;
    transform: rotateY(-90deg);
    transform-origin: left;
    border: 1.5px solid #333;
}

/* 右面 (+X方向) */
.block-right {
    background: #4fc3f7;
    transform: rotateY(90deg);
    transform-origin: right;
    border: 1.5px solid #333;
}

/* 背面 (-Y方向) */
.block-back {
    background: #4fc3f7;
    transform: rotateX(90deg);
    transform-origin: top;
    border: 1.5px solid #333;
}

/* 正面 (+Y方向) */
.block-front {
    background: #29b6f6;
    transform: rotateX(-90deg);
    transform-origin: bottom;
    border: 1.5px solid #333;
}

/* 底部控制区 */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 2px dashed rgba(0, 0, 0, 0.08);
    border-radius: 0 0 24px 24px;
    flex-wrap: wrap;
}

.btn {
    border: 2px solid rgba(0, 0, 0, 0.15);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-add {
    background: linear-gradient(135deg, #66bb6a, #43a047);
    border-color: #388e3c;
}

.btn-add-ten {
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    border-color: #1565c0;
}

.btn-add-hundred {
    background: linear-gradient(135deg, #ab47bc, #8e24aa);
    border-color: #6a1b9a;
}

.btn-undo {
    background: linear-gradient(135deg, #ffa726, #fb8c00);
    border-color: #e65100;
}

.btn-clear {
    background: linear-gradient(135deg, #ef5350, #e53935);
    border-color: #c62828;
}

.btn-icon {
    font-weight: bold;
    font-size: 1.1rem;
}

/* 分隔线 */
.controls-divider {
    width: 2px;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 1px;
}