/* ====== 全局样式设置 ====== */
body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f0f8ff;
    padding: 0;
    margin: 0;
    transition: background-color 0.3s;
}

/* 特殊模式：核熔毁背景闪烁 */
body.final-mode {
    background-color: #ffecec !important;
}

h1 {
    color: #2c3e50;
    margin-top: 30px;
}

.screen {
    display: none;
    padding: 20px;
}

/* ====== 警告页面样式 ====== */
#warningScreen {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
}
#warningScreen h2 {
    color: #e74c3c;
    font-size: 24px;
    margin-bottom: 20px;
}
#warningText {
    text-align: left;
    max-width: 800px;
    margin: 0 auto 30px;
    line-height: 1.6;
    font-size: 16px;
    color: #333;
}
#acknowledgeBtn {
    padding: 14px 40px;
    font-size: 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}
#acknowledgeBtn:hover {
    background-color: #2980b9;
}

/* ====== 通用按钮与说明 ====== */
.instructions {
    max-width: 600px;
    margin: 20px auto;
    line-height: 1.6;
    color: #555;
    font-size: 18px;
}

.btn-large {
    padding: 14px 40px;
    font-size: 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 20px;
}
.btn-large:hover {
    background-color: #2980b9;
}

/* ====== 游戏状态栏 ====== */
.status-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}
.score, .timer {
    padding: 6px 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ====== 游戏卡片区域 ====== */
.game-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 15px auto;
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 180px;
}
.card {
    width: 80px;
    height: 80px;
    background: white;
    border: 2px solid #3498db;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.card:hover {
    background-color: #eaf7ff;
    transform: translateY(-2px);
}
.card.selected {
    border-color: #e74c3c;
    background-color: #ffecec;
}
.global-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.global-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #95a5a6;
    color: white;
    transition: background 0.2s;
}
.global-btn:hover {
    background-color: #7f8c8d;
}

/* ====== 运算符按钮 ====== */
.operators {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}
.op-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    border: none;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    transform: scale(1);
}
.op-btn:hover {
    background-color: #2980b9;
}
.op-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}
/* 选中的运算符高亮 */
.op-btn.active {
    background-color: #2c3e50;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(44, 62, 80, 0.5);
}

/* ====== 天赋（Power-Up）展示 ====== */
.power-up {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}
.power-btn {
    display: flex;
    align-items: center;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: opacity 0.2s;
    max-width: 220px;
    min-width: 180px;
}
.icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
    line-height: 1;
}
.power-text {
    text-align: left;
}
.power-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 4px 0;
}
.power-desc {
    font-size: 12px;
}
.power-btn.ab { background-color: #e74c3c; color: white; }
.power-btn.ab:hover { background-color: #c0392b; }
.power-btn.nuclear { background-color: #e67e22; color: white; }
.power-btn.nuclear:hover { background-color: #d35400; }
.power-btn.hidden-hand { background-color: #f1c40f; color: #2c3e50; }
.power-btn.hidden-hand:hover { background-color: #d4ac0d; }

.power-btn.used {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ====== 天赋选择界面 ====== */
.powerup-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}
.powerup-option {
    width: 180px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.powerup-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.powerup-option h3 {
    margin: 8px 0 5px;
    font-size: 18px;
}
.powerup-option p {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
}

/* ====== 消息提示与结束界面 ====== */
#message {
    margin-top: 20px;
    font-size: 20px;
    font-weight: bold;
    min-height: 28px;
}
.win { color: #27ae60; }
.lose { color: #e74c3c; }
.final-mode { color: #e67e22; }

#endScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 248, 255, 0.95);
    z-index: 1000;
    padding-top: 20vh;
}
#endScreen h2 {
    font-size: 36px;
    color: #e74c3c;
    margin-bottom: 20px;
}
#finalScore {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin: 20px 0;
}
.end-buttons {
    margin-top: 30px;
}
.end-btn {
    padding: 12px 24px;
    font-size: 18px;
    margin: 0 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
#uploadBtn {
    background-color: #3498db;
    color: white;
}
#uploadBtn:hover {
    background-color: #2980b9;
}
#backHomeBtn {
    background-color: #9b59b6;
    color: white;
}
#backHomeBtn:hover {
    background-color: #8e44ad;
}

/* ====== 字体图标设置 ====== */
@font-face {
    font-family: 'Material Design Icons';
    src: url('fonts/materialdesignicons-webfont.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.mdi {
    font-family: 'Material Design Icons', sans-serif !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: inline-block;
    vertical-align: middle;
}

.mdi.mdi-18 { font-size: 18px; }
.mdi.mdi-24 { font-size: 24px; }
.mdi.mdi-36 { font-size: 36px; }