/* 全局重置：清除默认内外边距，统一盒模型 */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, sans-serif; /* 使用系统无衬线字体，移动端友好 */
    -webkit-tap-highlight-color: transparent; /* 取消移动端点击灰色高亮 */
}

/* 页面主体样式 */
body{
    background-color: #0f111a; /* 深色背景 */
    min-height: 100vh;         /* 最小高度占满屏幕视口高度 */
    padding: 40px 16px;        /* 上下内边距40，左右16，防止贴边 */
}

/* 页面主标题 */
.page-title{
    text-align: center;        /* 居中 */
    color: #32cd32;            /* 亮绿色文字 */
    font-size: 32px;
    margin-bottom: 10px;
}

/* 页面描述文字 */
.page-desc{
    text-align: center;
    color: #aaa;               /* 浅灰色 */
    font-size: 15px;
    margin-bottom: 40px;
}

/* 游戏卡片容器 - 网格布局，自动换行 */
.game-wrap{
    max-width: 600px;          /* 最大宽度，大屏不会拉太宽 */
    margin: 0 auto;            /* 容器水平居中 */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;                 /* 卡片之间间距 */
}

/* 单张游戏卡片容器 */
.game-card{
    background: #1a1d2b;
    border-radius: 14px;       /* 圆角 */
    overflow: hidden;          /* 内部元素超出卡片部分隐藏 */
    border: 1px solid #2d3248;
    transition: 0.25s ease;    /* 过渡动画，用于点击缩放效果 */
}
/* 卡片按下激活态（移动端触摸/鼠标点击） */
.game-card:active{
    transform: scale(0.96);    /* 轻微缩小 */
    border-color: #32cd32;     /* 边框变绿色高亮 */
}

/* 卡片顶部图标区域 */
.card-top{
    height: 140px;
    display: flex;
    align-items: center;       /* 垂直居中 */
    justify-content: center;   /* 水平居中 */
    color: #000;
    font-size: 48px;
    font-weight: bold;
}

/* ========== 各个游戏卡片顶部渐变背景 ========== */
.card-top.block{
    background: linear-gradient(135deg, #227722, #32cd32);
}
.card-top.love{
    background: linear-gradient(135deg, #b8326b, #ff6b9c);
}
.card-top.sokoban{
    background: linear-gradient(135deg, #194699, #4298ff);
}
.card-top.num2048{
    background: linear-gradient(135deg, #d48806, #ffc107);
}
.card-top.snake{
    background: linear-gradient(135deg, #059669, #34d399);
}
.card-top.memory{
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.card-top.mole{
    background: linear-gradient(135deg, #c2410c, #fb923c);
}
.card-top.minesweeper{
    background: linear-gradient(135deg, #374151, #9ca3af);
}
.card-top.starpop{
    background: linear-gradient(135deg, #7b2cbf, #4cc9f0);
}
.card-top.dice{
    background: linear-gradient(135deg, #92400e, #fbbf24);
}

/* 卡片下方文字内容区域 */
.card-content{
    padding: 20px;
}
/* 游戏名称标题 */
.game-name{
    color: #fff;
    font-size: 20px;
    margin-bottom: 8px;
}
/* 游戏简介 */
.game-info{
    color: #999;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* 开始游戏按钮 */
.go-btn{
    display: block;            /* 独占一行 */
    width: 100%;
    text-align: center;
    padding: 12px 0;
    color: #000;
    text-decoration: none;     /* 去掉a标签默认下划线 */
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
}

/* ========== 各个游戏按钮背景色 ========== */
.go-btn.block{
    background: #32cd32;
}
.go-btn.love{
    background: #ff6b9c;
}
.go-btn.sokoban{
    background: #4298ff;
}
.go-btn.num2048{
    background: #ffc107;
}
.go-btn.snake{
    background: #34d399;
}
.go-btn.memory{
    background: #a78bfa;
}
.go-btn.mole{
    background: #fb923c;
}
.go-btn.minesweeper{
    background: #9ca3af;
}
.go-btn.starpop{
    background: #4cc9f0;
}
.go-btn.dice{
    background: #fbbf24;
}

/* ========== 更新弹窗遮罩层 ========== */
.update-mask{
    position: fixed;           /* 固定定位，覆盖全屏 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75); /* 黑色半透明遮罩 */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;              /* 最高层级，浮在所有内容上方 */
}
/* 弹窗白色盒子 */
.update-box{
    width: 90%;
    max-width: 360px;
    background: #1a1d2b;
    border-radius: 16px;
    border: 1px solid #32cd32;
    padding: 28px 24px;
    color: #fff;
}
/* 弹窗标题 */
.update-title{
    font-size: 24px;
    color: #32cd32;
    text-align: center;
    margin-bottom: 16px;
}
/* 更新日志列表 */
.update-list{
    line-height: 1.8;
    color: #ddd;
    margin-bottom: 24px;
    font-size: 15px;
}
/* 弹窗关闭按钮 */
.update-close{
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #32cd32;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}
