﻿@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');



* {
    font-family: 'Press Start 2P', monospace !important;
    font-weight: normal !important; /* 很多浏览器在遇到加粗标签如 h1、h2 时，会因为像素字体没有加粗版而拒绝加载，需要强制取消加粗 */
}

body {
    font-family: 'Ark Pixel', 'Press Start 2P', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #000;
    color: white;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 按钮和标题分开 */
    align-items: center;
    padding: 80px 0 100px 0; /* 上下留点边距 */
    box-sizing: border-box;
    overflow: hidden; /* 防止视频溢出 */
    z-index: 1000;
}

#bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证视频填满且不变形 */
    z-index: -1; /* 置于底层 */
}

#start-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* 稍微降低一点暗度，让背景更清晰 */
    z-index: 0;
}

.menu-selectors {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 1001; /* 必须比 start-screen 的伪元素高 */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

.menu-selector select {
    padding: 6px 12px;
    font-family: inherit;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #4ade80;
    border: 2px solid #4ade80;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    transition: all 0.2s ease;
}

.menu-selector select:hover, .menu-selector select:focus {
    background: rgba(0, 0, 0, 0.8);
    border-color: #ffc107;
    color: #ffc107;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
}

.difficulty-desc {
    font-size: 14px;
    color: #ffd700;
    max-width: 300px;
    margin-top: 5px;
    line-height: 1.4;
    text-shadow: 1px 1px 2px #000;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.start-header {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.game-title {
    font-size: 52px;
    color: #fff;
    text-shadow: 4px 4px 0 #4ade80, 0 0 20px rgba(74, 222, 128, 0.8); /* 配合图片的绿色调 */
    margin-bottom: 5px;
    text-align: center;
    letter-spacing: 2px;
}

.game-subtitle {
    font-size: 16px;
    color: #f0f0f0;
    margin-bottom: 0;
    text-shadow: 2px 2px 2px #000;
    background: rgba(0, 0, 0, 0.5); /* 加个半透明底色更容易看清 */
    padding: 10px 20px;
    border-radius: 8px;
    max-width: 80%;
    text-align: center;
    line-height: 1.5;
}

.start-buttons {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

#start-btn {
    font-family: inherit;
    font-size: 24px;
    padding: 20px 50px;
    background-color: #ff4747;
    color: white;
    border: 4px solid #fff;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 0 #cc0000;
    transition: all 0.1s ease;
    z-index: 1;
}

#start-btn:hover {
    background-color: #ff6666;
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #cc0000;
}

#start-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #cc0000;
}

#char-select-btn {
    font-family: inherit;
    font-size: 16px;
    padding: 15px 30px;
    margin-top: 20px;
    background-color: #8fc31f;
    color: white;
    border: 4px solid #fff;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 0 #5b8a0e;
    transition: all 0.1s ease;
    z-index: 1;
}

#char-select-btn:hover {
    background-color: #a4db29;
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #5b8a0e;
}

#char-select-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #5b8a0e;
}

#game-wrapper {
    display: flex;
    flex-direction: row;
    width: 1200px;
    height: 650px;
    background-color: #5ea861; /* Green theme background */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    background-image: radial-gradient(#4d8b50 15%, transparent 16%);
    background-size: 20px 20px;
}

#left-panel {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    box-sizing: border-box;
}

#score-board {
    background-color: #111;
    border: 4px solid #8fc31f;  /* Lime green border */
    padding: 15px;
    text-align: right;
}

.score-title {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

#score-display {
    font-size: 32px;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #444;
}

.score-tiers div {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    text-align: left;
}

#toast-container {
    height: 140px;
    width: 200px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    gap: 8px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.toast {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(80, 200, 120, 0.4), rgba(80, 200, 120, 0));
    border-left: 4px solid #4ade80;
    padding: 8px 10px;
    border-radius: 4px;
    animation: toast-slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: opacity 0.5s, transform 0.5s;
    flex-shrink: 0;
}

.toast img {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    filter: drop-shadow(1px 1px 0 #000);
}

.toast span {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 0 #000;
}

.toast.fade-out {
    opacity: 0;
    transform: translateX(-50px) scale(0.9);
}

@keyframes toast-slide-in {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.dpad {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: auto;
    position: relative;
}

.dpad::before { 
    display: none; 
}

.dpad-dir {
    width: 65px;
    height: 65px;
    background-color: #3a3727;
    border-radius: 50%;
    border: 6px solid #4d4a36;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 5px 10px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #9e9c3c;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s, background-color 0.1s, box-shadow 0.1s;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    line-height: 1;
    z-index: 2;
    position: relative;
}

.dpad-dir:active {
    transform: scale(0.95) translateY(4px);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.6);
    background-color: #2b291d;
}

/* 装饰性A/D提示 */
.dpad-left::after {
    content: 'A';
    font-size: 14px;
    color: #6e6b52;
    margin-top: 5px;
    text-shadow: none;
}

.dpad-right::after {
    content: 'D';
    font-size: 14px;
    color: #6e6b52;
    margin-top: 5px;
    text-shadow: none;
}

#center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px 0 30px 0;
}

#game-header {
    width: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

#timer-display {
    font-size: 24px;
    color: #fff;
    background-color: #222;
    padding: 8px 20px;
    border-radius: 20px;
    border: 3px solid #ff4747;
    box-shadow: 0 0 10px rgba(255, 71, 71, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

#timer-text {
    color: #ffc107;
    text-shadow: 2px 2px 0px #aa0000;
}

#game-container {
    width: 600px;
    height: 100%;
    border: 4px solid #333;
    position: relative;
    overflow: hidden;
    background-image: url('素材/background.png');
    background-size: cover; 
    background-position: center; 
    background-color: #222;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transition: box-shadow 0.3s, border-color 0.3s;
}

#game-container.skill-active {
    animation: skill-border-glow 0.8s alternate infinite;
    border-color: #fffa3f;
}

@keyframes skill-border-glow {
    0% { box-shadow: 0 0 10px #fffa3f, inset 0 0 10px #fffa3f; }
    100% { box-shadow: 0 0 40px #fffa3f, inset 0 0 20px #fffa3f; }
}

#player {
    width: 64px;
    height: 64px; 
    background-image: url('素材/像素人物面左.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    background-color: transparent;
    border: none;
    position: absolute;
    bottom: 25px; /* 现在刚刚好*/
    left: 210px; 
    transition: transform 0.1s, box-shadow 0.3s, filter 0.3s;
    border-radius: 20%; 
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

/* 角色头顶的餐盘 */
#player::before {
    content: '';
    position: absolute;
    top: -5px; 
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% + 20px); /* 盘子比头稍微宽一点 */
    height: 10px;
    background: linear-gradient(180deg, #f8f6f0, #c4c1b5);
    border: 3px solid #3b4238;
    border-radius: 6px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1) inset, 0 -2px 0 rgba(255,255,255,0.5) inset;
    pointer-events: none;
    z-index: 10;
}

/* 激活技能时的发光类 */
.player-active-skill {
    /* 移除掉会导致边框变方的 box-shadow */
    filter: drop-shadow(0 0 20px #ffea00) drop-shadow(0 0 35px #ff5500) brightness(1.8) hue-rotate(-20deg);
    animation: skill-pulse 0.3s ease-in-out infinite alternate !important;
}

@keyframes skill-pulse {
    from {
        transform: scale(1);
        filter: drop-shadow(0 0 15px #ffcc00) drop-shadow(0 0 25px rgba(255,80,0,0.8)) brightness(1.5);
    }
    to {
        transform: scale(1.1) translateY(-10px);
        filter: drop-shadow(0 0 35px #ffff00) drop-shadow(0 0 60px rgba(255,50,0,1)) brightness(2.2);
    }
}

#energy-area {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
}

#energy-bar-bg {
    flex: 1;
    height: 12px;
    background-color: #222;
    border: 2px solid #000;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 10px;
    margin-left: 20px;
}

#energy-bar {
    width: 0%;
    height: 100%;
    background: #ffc107;
    transition: width 0.3s;
}

.energy-icon {
    font-size: 20px;
    color: #ffc107;
}

#right-panel {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding: 30px;
    box-sizing: border-box;
}

.top-buttons {
    display: flex;
    gap: 15px;
}

.small-btn {
    width: 40px;
    height: 40px;
    background-color: #333;
    border: 2px solid #111;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    color: #ccc;
    cursor: pointer;
    box-shadow: 2px 2px 0px #111;
}

#action-btn {
    width: 120px;
    height: 120px;
    background-color: #2b2825;
    border-radius: 50%;
    border: 12px solid #b8b335;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 0 0 8px #3b3829, 0 8px 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-image: radial-gradient(#151515 25%, transparent 30%);
    background-size: 6px 6px;
    opacity: 0.6;
    pointer-events: none;
}



.action-icon {
    font-size: 70px;
    color: #928b6d;
    opacity: 0.4;
    z-index: 2;
    transition: 0.2s;
    /* 强行取消 emoji 的默认颜色渲染以适配我们设定的黄色系 */
    text-shadow: 0 0 0 #928b6d; 
    color: transparent; 
}

.action-icon.ready {
    opacity: 1;
    text-shadow: 0 0 0 #fff44f, 0 0 20px #ffea00;
}

.action-icon.ready {
    color: #ffc107;
    opacity: 1;
    text-shadow: 0 0 10px #ffc107;
}

.item {
    width: 40px;
    height: 40px;
    position: absolute;
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    user-select: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    color: transparent;
}

.item:not([data-type="jelly_green"])::after {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 50px;
    background: linear-gradient(to top, rgba(255,255,255,0.7), transparent);
    border-radius: 2px;
    z-index: -1;
    pointer-events: none;
}

.good {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

.bad {
    filter: drop-shadow(0 0 8px #ff4747);
}

#player.glow-active {
    filter: drop-shadow(0 0 15px #ffff00) brightness(1.5);
    transition: filter 0.2s;
}

#player.shield-active::after {
    content: '';
    position: absolute;
    top: -15px; left: -15px; right: -15px; bottom: -15px;
    border: 3px solid #00e5ff;
    border-radius: 50%;
    box-shadow: 0 0 15px #00e5ff, inset 0 0 15px #00e5ff;
    animation: shield-pulse 1s infinite alternate;
    pointer-events: none;
}
@keyframes shield-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 0.4; }
}

@keyframes fall-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================= */
/* ======= 结算页面 (End Screen) 样式 ======= */
/* ========================================= */
#game-over-screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.result-modal {
    width: 600px;
    height: 400px;
    background: linear-gradient(135deg, #1b3017, #2f4f22);
    border: 3px solid #73a942;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 10px #73a942;
    position: relative;
    animation: popIn 0.5s ease-out forwards;
    transform: scale(0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    color: white;
    font-family: inherit;
    /* Adding subtle grid pattern */
    background-image: linear-gradient(rgba(115, 169, 66, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 169, 66, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.result-title {
    font-size: 40px;
    color: #ffff66;
    margin: 0;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 4px 4px 6px rgba(0,0,0,0.8);
    position: absolute;
    top: -25px; /* pop out of the top border */
    background: #2f4f22;
    padding: 0 20px;
    border-radius: 10px;
    border: 3px solid #73a942;
}

.sparkle {
    font-size: 24px;
    color: #fff;
    position: absolute;
    top: 5px;
    right: 5px;
}

.result-content-wrap {
    display: flex;
    width: 100%;
    margin-top: 60px;
    padding: 0 30px;
    box-sizing: border-box;
}

/* ================= 左侧区域 ================= */
.result-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 2px solid rgba(115, 169, 66, 0.5);
    padding-right: 20px;
}

.player-name-plate {
    background: #172613;
    padding: 5px 30px;
    font-size: 16px;
    color: #e5f5c9;
    border-left: 5px solid #73a942;
    margin-bottom: 10px;
}

.stars-container {
    margin-bottom: 20px;
    font-size: 32px;
}
.star { color: #ffd700; text-shadow: 2px 2px 0 #000; margin: 0 3px; }
.star.empty { color: #223a1a; }

.player-avatar-box {
    margin-top: auto;
    margin-bottom: auto;
}
.result-player-img {
    width: 150px;
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.8));
    animation: idle-bounce 2s infinite alternate ease-in-out;
}
@keyframes idle-bounce {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-10px); }
}


/* ================= 右侧区域 ================= */
.result-right {
    flex: 2;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
}

.score-banner {
    background: #c9e265;
    color: #1b3017;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    font-size: 20px;
    font-weight: bold;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
    margin-bottom: 15px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}
.score-number {
    font-size: 36px;
    letter-spacing: 2px;
}

.items-list-box {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4b663b;
    padding: 10px;
    border-radius: 5px;
}

.items-list-title {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 10px;
    border-bottom: 1px solid #4b663b;
    padding-bottom: 5px;
}

.items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.items-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e5f5c9;
    padding: 5px 10px;
    background: rgba(115, 169, 66, 0.15);
    border-radius: 3px;
}

/* ================= 按钮区域 ================= */
.result-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.result-btn {
    padding: 10px 40px;
    font-size: 18px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    border: none;
    clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
    transition: transform 0.1s, filter 0.2s;
}

.result-btn:active {
    transform: translateY(2px);
}

.btn-back {
    background: #73a942;
    color: #fff;
    border-bottom: 3px solid #4b663b;
}

.btn-restart {
    background: #ffb703;
    color: #5c3a21;
    border-bottom: 3px solid #cc9202;
}

.result-btn:hover {
    filter: brightness(1.2);
}
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    80% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
/* 物品说明弹窗 */
#info-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
.info-content {
    background: linear-gradient(135deg, #1b3017, #2f4f22);
    padding: 40px 30px 10px;
    border-radius: 12px;
    border: 3px solid #73a942;
    color: #fff;
    max-width: 450px;
    width: 90%;
    font-family: inherit;
    text-align: left;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 10px #73a942;
    animation: popIn 0.3s ease-out;
    background-image: linear-gradient(rgba(115, 169, 66, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 169, 66, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.info-title {
    font-size: 30px;
    color: #ffff66;
    margin: 0;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 4px 4px 6px rgba(0,0,0,0.8);
    position: absolute;
    top: -25px;
    background: #2f4f22;
    padding: 0 20px;
    border-radius: 10px;
    border: 3px solid #73a942;
    white-space: nowrap;
}
.info-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 10px;
    width: 100%;
}
.info-list li {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #e5f5c9;
    background: rgba(115, 169, 66, 0.15);
    padding: 8px 10px;
    border: 1px solid #4b663b;
    border-radius: 3px;
}
.info-list .icon {
    font-size: 26px;
    margin-right: 15px;
    width: 35px;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
}

/* ========================================= */
/* ======= 角色选择页面 (Character Select) === */
/* ========================================= */

#character-select-screen {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.char-select-main {
    position: relative;
    width: 1000px;
    height: 600px;
    display: flex;
    flex-direction: column;
    animation: popIn 0.3s ease-out;
}

.char-select-tab {
    position: absolute;
    top: -45px;
    left: 20px;
    background: #8fc31f; /* A light green to match screenshot tab */
    color: white;
    font-size: 24px;
    padding: 15px 30px;
    border-radius: 20px 20px 0 0;
    text-shadow: 2px 2px 0px #38590c;
    border: 4px solid #fff;
    border-bottom: none;
    z-index: 2;
}

.char-select-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    background: #1b3017;
    background-image: linear-gradient(rgba(115, 169, 66, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 169, 66, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    border: 4px solid #8fc31f;
    border-radius: 12px;
    padding: 20px;
    gap: 20px;
    box-sizing: border-box;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 1;
}

.char-grid-wrapper {
    flex: 1.5;
    background: rgba(0,0,0,0.3);
    border: 2px solid #4b663b;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
}

.char-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
    align-content: flex-start;
}

.char-card {
    width: 150px;
    height: 180px;
    background: #e9e6d3; /* Cream color */
    border: 4px solid #3b4238; /* Thick dark border */
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.char-card.active, .char-card:hover {
    border-color: #ff4747;
    box-shadow: 0 0 10px #ff4747, inset 0 0 10px rgba(255, 71, 71, 0.3);
    transform: translateY(-5px);
}

.char-card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 10px;
    box-sizing: border-box;
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.03),
        rgba(0, 0, 0, 0.03) 10px,
        transparent 10px,
        transparent 20px
    );
}

.char-rank {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 20px;
    color: #4a4a4a;
    font-weight: bold;
    text-shadow: 1px 1px 0px #fff;
    z-index: 2;
}

.char-sprite-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
}

.char-sprite-wrap img {
    height: 90px;
    image-rendering: pixelated;
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.4));
}

.char-name-label {
    text-align: center;
    background: #aabc78;
    color: #1b3017;
    font-size: 14px;
    padding: 6px 0;
    border-radius: 4px;
    margin-top: auto;
    border: 2px solid #7a8c58;
}

.char-details-wrapper {
    flex: 1;
    background: #aabc78; /* Lighter olive green */
    border: 4px solid #ffd1dc; /* A pinkish light border? The screenshot has a pinkish-red border on the details box */
    border-color: #ff6b81;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    color: #1b3017;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.char-details-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(255,255,255,0.2) 20%, transparent 20%);
    background-size: 20px 20px;
    pointer-events: none;
}

.char-details-panel {
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.char-details-top {
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.3);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px dashed rgba(0,0,0,0.1);
}

.cd-large-sprite {
    height: 140px;
    image-rendering: pixelated;
    filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.5));
    animation: idle-bounce 2s infinite alternate ease-in-out;
}

.char-details-header {
    display: flex;
    align-items: center;
    background: #8aa35a;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    border: 2px solid #5b7337;
}

.cd-header-left {
    font-size: 26px;
    font-weight: bold;
    color: #3e5022;
    margin-right: 15px;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
}

.cd-header-right {
    flex: 1;
    font-size: 22px;
    color: #1b3017;
    text-align: right;
}

.char-details-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================= */
/* ======= 暂停页面 (Pause Screen) ========= */
/* ========================================= */

#pause-screen {
    position: fixed;
    inset: 0;
    background: rgba(14, 30, 20, 0.85); /* 深绿色半透明背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: #fff;
    font-family: 'Ark Pixel', 'Press Start 2P', monospace;
    overflow: hidden;
}

.pause-overlay-scanline {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.3) 3px,
        rgba(0, 0, 0, 0.3) 4px
    );
    pointer-events: none;
    z-index: 10001;
}

.pause-content {
    position: relative;
    width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pause-title {
    font-size: 28px;
    color: #e5f5c9;
    margin-bottom: 30px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
}

.pause-deco {
    color: #73a942;
    margin: 0 15px;
    letter-spacing: -2px;
}

.pause-score-section {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.pause-score-label {
    font-size: 16px;
    color: #e5f5c9;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px #000;
}

.pause-score-value {
    font-size: 36px;
    color: #fff;
    letter-spacing: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 2px 2px 4px #000;
}

.pause-bracket {
    color: #5b7337;
}

.pause-milestones {
    width: 100%;
    max-width: 450px;
    margin-bottom: 60px;
}

.milestone-item {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    color: #fff;
    font-size: 16px;
    text-shadow: 1px 1px 2px #000;
}

.milestone-circle {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid #aabc78;
    border-radius: 50%;
    margin-right: 15px;
    box-sizing: border-box;
}

.milestone-text {
    white-space: nowrap;
}

.milestone-line {
    flex: 1;
    border-bottom: 2px dashed #73a942;
    margin: 0 15px;
    opacity: 0.6;
}

.milestone-star {
    font-size: 20px;
    color: #1b3017; /* 暗绿色星星由于还未达到目标，或者加text-shadow */
    text-shadow: 1px 1px 0 #73a942, -1px -1px 0 #73a942, 1px -1px 0 #73a942, -1px 1px 0 #73a942;
}

.pause-buttons {
    display: flex;
    justify-content: center;
    gap: 80px;
    width: 100%;
}

.pause-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.pause-btn-box {
    width: 80px;
    height: 80px;
    background: rgba(20, 35, 10, 0.8);
    border: 3px solid #8fc31f;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    margin-bottom: 12px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5), inset 0 0 5px rgba(115, 169, 66, 0.3);
}

.pause-btn-wrap:hover .pause-btn-box {
    background: #2f4f22;
    transform: scale(1.1);
    box-shadow: 0 0 15px #8fc31f;
    color: #dff05d;
}

.pause-btn-wrap:active .pause-btn-box {
    transform: scale(0.95);
}

.pause-btn-label {
    font-size: 14px;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
}

/* ========================================= */
/* ======= 倒计时页面 (Countdown Screen) === */
/* ========================================= */

#countdown-screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    pointer-events: none; /* 让鼠标无法点击 */
}

#countdown-number {
    font-size: 150px;
    color: #ffc107;
    text-shadow: 8px 8px 0px rgba(0, 0, 0, 0.7), 0 0 30px #ffea00;
}

@keyframes count-pulse {
    0% { transform: scale(0.3); opacity: 0; }
    40% { transform: scale(1.2); opacity: 1; filter: brightness(1.5); }
    70% { transform: scale(1); opacity: 1; filter: brightness(1); }
    100% { transform: scale(0.8); opacity: 0; }
}

.cd-quote {
    font-size: 14px;
    font-style: italic;
    color: #fff;
    background: rgba(0,0,0,0.4);
    padding: 10px;
    border-radius: 6px;
    margin: 0 0 10px 0;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.8);
}

.cd-desc {
    font-size: 12px;
    color: #1b3017;
    line-height: 1.6;
    margin: 0 0 20px 0;
    font-family: 'Ark Pixel', sans-serif !important;
}

.cd-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1b3017;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.4);
}

.stat-icon {
    font-size: 18px;
}

.stat-bar-container {
    height: 14px;
    background: #1b3017; /* 更深的背景色，模拟槽位空缺 */
    border: 2px solid #1b3017;
    width: 100%;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    display: flex;
    gap: 3px; /* 给格子之间留出间隙 */
}

.stat-bar-fill {
    flex: 1; /* 自动等分 */
    background: #dff05d; /* bright yellowish-green */
    transition: background-color 0.3s ease;
}
.stat-bar-fill.empty {
    background: #3e5022; /* 变暗代表没有点亮 */
}

#close-char-select {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4747;
    color: white;
    border: 4px solid #fff;
    padding: 10px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 0 #cc0000;
    transition: all 0.1s;
}

#close-char-select:hover {
    background-color: #ff6666;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 0 #cc0000;
}

#close-char-select:active {
    transform: translateX(-50%) translateY(2px);
    box-shadow: 0 2px 0 #cc0000;
}


