/* ==================== 赛博朋克风格 ==================== */
* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #050510;
    background-image:
        linear-gradient(0deg, transparent 24%, rgba(0, 240, 255, 0.03) 25%, rgba(0, 240, 255, 0.03) 26%, transparent 27%, transparent 74%, rgba(255, 0, 255, 0.03) 75%, rgba(255, 0, 255, 0.03) 76%, transparent 77%),
        linear-gradient(90deg, transparent 24%, rgba(0, 240, 255, 0.02) 25%, rgba(0, 240, 255, 0.02) 26%, transparent 27%, transparent 74%, rgba(255, 0, 255, 0.02) 75%, rgba(255, 0, 255, 0.02) 76%, transparent 77%);
    background-size: 60px 60px;
    font-family: 'Segoe UI', 'Helvetica Neue', system-ui, -apple-system, 'PingFang SC', 'Noto Sans', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

/* 主游戏面板 */
.game-container {
    max-width: 500px;
    width: 100%;
    background: rgba(10, 10, 30, 0.95);
    border: 2px solid #0ff;
    border-radius: 4px;
    box-shadow:
        0 0 10px rgba(0, 255, 255, 0.4),
        0 0 40px rgba(0, 255, 255, 0.1),
        inset 0 0 20px rgba(0, 240, 255, 0.03);
    overflow: hidden;
    padding: 20px 20px 30px;
    position: relative;
}
.game-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0ff, #f0f, transparent);
    z-index: 10;
}

/* 角色展示区 */
.characters {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.char-card {
    text-align: center;
    background: rgba(10, 10, 40, 0.8);
    border: 1px solid #f0f;
    border-radius: 4px;
    padding: 12px 12px 8px;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.2), 0 4px 0 #508;
    width: 130px;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.char-card:hover {
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.5), 0 4px 0 #508;
}

.char-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6));
}

.char-name {
    font-weight: bold;
    margin-top: 8px;
    background: #f0f;
    display: inline-block;
    padding: 2px 16px;
    border-radius: 2px;
    font-size: 0.8rem;
    color: #000;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.4);
}

/* 汤圆怪兽区域 */
.monster-area {
    background: rgba(10, 10, 40, 0.6);
    border: 1px solid #0ff;
    border-radius: 4px;
    padding: 12px;
    margin: 8px 0 12px;
    text-align: center;
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.05), 0 0 15px rgba(0, 240, 255, 0.1);
}
.monster-img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    transition: filter 0.05s linear;
    cursor: pointer;
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.4));
}
.flash-red {
    filter: brightness(1.5) drop-shadow(0 0 15px #f0f) drop-shadow(0 0 30px #f0f) !important;
    transition: 0.05s;
}

/* 血条区域 */
.health-bar-container {
    background-color: #0a0a20;
    border: 1px solid #333;
    border-radius: 2px;
    height: 22px;
    margin: 15px 8px 8px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}
.health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f, #0ff);
    border-radius: 2px;
    transition: width 0.08s linear;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.6), 0 0 30px rgba(0, 255, 255, 0.3);
}
.health-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0 12px;
    color: #0ff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

/* 统计数据 & 状态 */
.stats {
    background: rgba(10, 10, 40, 0.6);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-weight: bold;
}
.defeat-count {
    background: #0ff;
    color: #000;
    padding: 6px 16px;
    border-radius: 2px;
    font-size: 1rem;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}
.rage-badge {
    background: #f0f;
    padding: 5px 12px;
    border-radius: 2px;
    font-size: 0.75rem;
    color: #000;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

/* 肘击按钮 */
.elbow-btn {
    background: linear-gradient(135deg, #0ff, #f0f);
    border: none;
    width: 100%;
    padding: 22px 10px;
    font-size: 2.4rem;
    font-weight: 900;
    color: #000;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    border-radius: 4px;
    letter-spacing: 8px;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(255, 0, 255, 0.3),
        0 6px 0 #088;
    cursor: pointer;
    transition: 0.05s linear;
    margin: 16px 0 12px;
    touch-action: manipulation;
}
.elbow-btn:active {
    transform: translateY(3px);
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.8),
        0 0 60px rgba(255, 0, 255, 0.5),
        0 2px 0 #088;
}

/* 底部按钮 */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}
.shop-btn, .rank-btn, .close-rank {
    background: transparent;
    border: 1px solid #0ff;
    padding: 10px 20px;
    border-radius: 4px;
    color: #0ff;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    cursor: pointer;
    transition: 0.15s ease;
    flex: 1;
    text-align: center;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}
.shop-btn:hover, .rank-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}
.shop-btn:active, .rank-btn:active, .close-rank:active {
    transform: translateY(1px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
}

/* 模态框通用 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-content {
    background: rgba(10, 10, 30, 0.98);
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    border-radius: 4px;
    padding: 20px 12px 20px 12px;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(255, 0, 255, 0.15);
    border: 1px solid #0ff;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 12px 12px;
    border-bottom: 1px solid #333;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.6rem;
    color: #0ff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}
.close-modal-btn {
    background: transparent;
    border: 1px solid #f0f;
    font-size: 1.3rem;
    font-weight: bold;
    color: #f0f;
    width: 36px;
    height: 36px;
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
    transition: 0.15s;
}
.close-modal-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}

/* 排行榜列表 */
.rank-list {
    overflow-y: auto;
    margin: 12px 0;
    flex: 1;
    max-height: 55vh;
}
.rank-list::-webkit-scrollbar {
    width: 4px;
}
.rank-list::-webkit-scrollbar-thumb {
    background: #0ff;
    border-radius: 2px;
}
.rank-item {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.15);
    margin: 4px 8px;
    padding: 8px 16px;
    border-radius: 2px;
    font-weight: 500;
    font-size: 0.85rem;
    color: #cce;
}
.rank-item:nth-child(odd) {
    background: rgba(255, 0, 255, 0.03);
}
.rank-num {
    width: 45px;
    font-weight: bold;
    color: #0ff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}
.rank-name {
    flex: 2;
    text-align: left;
    margin-left: 8px;
}
.rank-count {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #f0f;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.4);
}
.player-rank-item {
    background: rgba(0, 255, 255, 0.15) !important;
    border: 1px solid #0ff !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4) !important;
}
.my-rank-area {
    background: rgba(10, 10, 40, 0.8);
    border: 1px solid #0ff;
    margin: 12px 8px 0;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    color: #0ff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

/* 全屏金光 -> 霓虹闪烁 */
.gold-flash-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.6) 0%, rgba(255, 0, 255, 0.5) 100%);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.1s;
    mix-blend-mode: screen;
}
.gold-flash-active {
    animation: neonGlow 0.4s infinite alternate;
}
@keyframes neonGlow {
    0%   { opacity: 0.3; background: radial-gradient(circle, rgba(0, 255, 255, 0.6), rgba(255, 0, 255, 0.4)); }
    100% { opacity: 0.9; background: radial-gradient(circle, rgba(0, 255, 255, 0.9), rgba(255, 0, 255, 0.8)); }
}

/* 暴击浮动字 */
.crit-text {
    position: fixed;
    font-size: 2rem;
    font-weight: 900;
    color: #0ff;
    text-shadow:
        0 0 10px #0ff,
        0 0 30px #0ff,
        0 0 50px rgba(0, 255, 255, 0.6);
    z-index: 1001;
    pointer-events: none;
    animation: floatUp 0.6s ease-out forwards;
}
@keyframes floatUp {
    0%   { transform: scale(0.6) translateY(0); opacity: 1; }
    100% { transform: scale(1.4) translateY(-80px); opacity: 0; }
}

/* 提示文字 */
.tip {
    font-size: 0.7rem;
    text-align: center;
    color: #558;
    margin-top: 10px;
}
.disclaimer {
    font-size: 0.65rem;
    text-align: center;
    color: #444;
    margin-top: 6px;
    padding: 0 10px;
    opacity: 0.7;
}

/* 玩家昵称设置 */
.player-name-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
}
.player-name-input {
    flex: 1;
    max-width: 200px;
    padding: 8px 16px;
    border: 1px solid #0ff;
    border-radius: 2px;
    background: rgba(0, 255, 255, 0.05);
    font-size: 0.9rem;
    color: #0ff;
    outline: none;
    transition: all 0.2s ease;
}
.player-name-input:focus {
    border-color: #f0f;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}
.player-name-input::placeholder {
    color: #446;
}
.save-name-btn {
    background: transparent;
    border: 1px solid #f0f;
    padding: 8px 16px;
    border-radius: 2px;
    color: #f0f;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}
.save-name-btn:hover {
    background: rgba(255, 0, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}
.save-name-btn:active {
    transform: translateY(1px);
}

/* 商店 */
.shop-modal-content {
    max-width: 450px;
}
.shop-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
    max-height: 60vh;
    overflow-y: auto;
}
.shop-items::-webkit-scrollbar {
    width: 4px;
}
.shop-items::-webkit-scrollbar-thumb {
    background: #0ff;
    border-radius: 2px;
}
.shop-item {
    display: flex;
    align-items: center;
    background: rgba(0, 255, 255, 0.04);
    border-radius: 4px;
    padding: 12px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    transition: all 0.2s ease;
}
.shop-item:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #0ff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}
.item-icon {
    font-size: 2rem;
    margin-right: 12px;
    width: 50px;
    text-align: center;
}
.item-info {
    flex: 1;
}
.item-name {
    font-weight: bold;
    color: #0ff;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.4);
}
.item-desc {
    font-size: 0.8rem;
    color: #99a;
    margin: 4px 0;
}
.item-price {
    font-weight: bold;
    color: #ff0;
    font-size: 0.9rem;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
}
.buy-btn {
    background: transparent;
    border: 1px solid #0f0;
    padding: 8px 16px;
    border-radius: 2px;
    color: #0f0;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}
.buy-btn:hover {
    background: rgba(0, 255, 0, 0.15);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}
.buy-btn:active {
    transform: translateY(1px);
}
.buy-btn:disabled {
    border-color: #444;
    color: #444;
    box-shadow: none;
    cursor: not-allowed;
}
.shop-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #333;
}
.gold-display {
    font-weight: bold;
    color: #ff0;
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
}
.close-shop-btn {
    background: transparent;
    border: 1px solid #f44;
    padding: 8px 20px;
    border-radius: 2px;
    color: #f44;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}
.close-shop-btn:hover {
    background: rgba(255, 0, 0, 0.15);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* 道具特效动画 */
@keyframes fadeInOut {
    0%   { opacity: 0; transform: translateX(-50%) scale(0.8); }
    20%  { opacity: 1; transform: translateX(-50%) scale(1.1); }
    80%  { opacity: 1; transform: translateX(-50%) scale(1.1); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.8); }
}

/* 指令框 */
.command-modal {
    display: none;
    position: fixed;
    z-index: 1003;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}
.command-modal-content {
    background: rgba(10, 10, 30, 0.98);
    margin: 10% auto;
    padding: 0;
    border-radius: 4px;
    width: 90%;
    max-width: 400px;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(255, 0, 255, 0.15);
    border: 1px solid #0ff;
    overflow: hidden;
}
.command-header {
    background: rgba(0, 255, 255, 0.1);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #0ff;
}
.command-header h3 {
    margin: 0;
    color: #0ff;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}
.close-command-btn {
    background: transparent;
    border: 1px solid #f44;
    color: #f44;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 2px;
    transition: all 0.2s ease;
}
.close-command-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}
.command-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}
.command-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    transition: all 0.2s ease;
    color: #aab;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}
.command-item:hover {
    background: rgba(0, 255, 255, 0.1);
    color: #0ff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}
.command-input-area {
    padding: 15px 20px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
}
.command-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #0ff;
    border-radius: 2px;
    background: rgba(0, 255, 255, 0.05);
    color: #0ff;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}
.command-input:focus {
    outline: none;
    border-color: #f0f;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}
.execute-command-btn {
    background: transparent;
    border: 1px solid #0f0;
    color: #0f0;
    padding: 10px 20px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}
.execute-command-btn:hover {
    background: rgba(0, 255, 0, 0.15);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

/* 排行榜时间显示 */
.rank-time-display {
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid #f0f;
    padding: 10px 20px;
    text-align: center;
    color: #f0f;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
    font-family: 'Courier New', monospace;
}

/* 手机优化 */
@media (max-width: 480px) {
    .game-container { padding: 16px; }
    .char-img { width: 80px; height: 80px; }
    .monster-img { width: 110px; height: 110px; }
    .elbow-btn { font-size: 1.8rem; padding: 16px; }
}
