* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b0f19;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #f1f5f9;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: radial-gradient(circle at center, #131a2b 0%, #080c14 100%);
}

/* 顶部 HUD */
#hud {
    position: absolute;
    top: 16px;
    left: 20px;
    display: flex;
    gap: 12px;
    z-index: 10;
    pointer-events: none;
}

.hud-card {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hud-label {
    color: #94a3b8;
    margin-right: 6px;
}

.hud-val {
    font-weight: 700;
    color: #e2e8f0;
}

.gold-text {
    color: #fbbf24 !important;
}

/* 排行榜 */
#leaderboard {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 220px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

#leaderboard h3 {
    margin-bottom: 8px;
    font-size: 14px;
    color: #38bdf8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

#leaderboard h4 {
    margin: 10px 0 6px 0;
    font-size: 12px;
    color: #fbbf24;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

#leaderboard-list,
#rank-list {
    list-style-position: inside;
    margin: 0;
    padding: 0;
}

#leaderboard-list li,
#rank-list li {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.lb-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 击杀播报 */
#kill-feed {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    z-index: 15;
    pointer-events: none;
}

#kill-feed .feed-entry {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    color: #e2e8f0;
    transition: opacity 0.8s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#kill-feed .feed-entry.feed-mine {
    border-color: rgba(56, 189, 248, 0.6);
}

#kill-feed .feed-eater {
    color: #38bdf8;
    font-weight: bold;
}

#kill-feed .feed-victim {
    color: #f87171;
}

#kill-feed .feed-gold {
    color: #fbbf24;
    font-weight: bold;
}

#kill-feed .feed-fade {
    opacity: 0;
}

/* 世界事件公告（金币雨等） */
#world-event {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.45);
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 14px;
    color: #fbbf24;
    font-weight: bold;
    z-index: 14;
    pointer-events: none;
    transition: opacity 1.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#world-event.fade-out {
    opacity: 0;
}

/* 安全区状态面板 */
#zone-hud {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(96, 165, 250, 0.4);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    z-index: 13;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#zone-hud-title {
    color: #93c5fd;
    font-weight: bold;
    margin-bottom: 2px;
}

#zone-hud-detail {
    color: #e2e8f0;
}

/* 圈外危险红雾（屏幕边缘红色脉动） */
#danger-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 12;
    opacity: 0;
    transition: opacity 0.4s ease;
    box-shadow: inset 0 0 140px 40px rgba(239, 68, 68, 0.55);
    background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0) 55%, rgba(239, 68, 68, 0.22) 100%);
}

#danger-vignette.active {
    opacity: 1;
    animation: danger-pulse 1.1s ease-in-out infinite;
}

@keyframes danger-pulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

/* ---- 世界聊天 ---- */
#chat-box {
    position: absolute;
    left: 16px;
    bottom: 96px;
    width: 300px;
    z-index: 15;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#chat-messages {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-line {
    align-self: flex-start;
    max-width: 100%;
    background: rgba(15, 23, 42, 0.72);
    border-radius: 6px;
    padding: 2px 8px;
    line-height: 1.45;
    word-break: break-word;
}

.chat-line.chat-mine {
    align-self: flex-end;
    background: rgba(30, 58, 95, 0.78);
}

.chat-name {
    color: #93c5fd;
    margin-right: 4px;
}

.chat-mine .chat-name {
    color: #7dd3fc;
}

.chat-text {
    color: #e2e8f0;
}

/* 新消息提示：面板轻微提亮 */
#chat-box.chat-buzz {
    animation: chat-buzz 0.6s ease;
}

@keyframes chat-buzz {
    0% { filter: brightness(1); }
    35% { filter: brightness(1.6); }
    100% { filter: brightness(1); }
}

#chat-quick {
    display: flex;
    gap: 4px;
}

.chat-emote {
    flex: 1;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1;
    padding: 3px 0;
    cursor: pointer;
}

.chat-emote:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(148, 163, 184, 0.55);
}

#chat-input-row {
    display: flex;
    gap: 4px;
}

#chat-input {
    flex: 1;
    min-width: 0;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    padding: 4px 8px;
}

#chat-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px #60a5fa;
}

#chat-send {
    background: rgba(37, 99, 235, 0.85);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    padding: 4px 12px;
    cursor: pointer;
}

#chat-send:hover {
    background: rgba(37, 99, 235, 1);
}

.lb-gold {
    color: #fbbf24;
    font-weight: 600;
}

/* 消息提示框 */
#notification-box {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
}

.toast {
    padding: 10px 20px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: fade-in-out 3.5s forwards;
    border: 1px solid rgba(255,255,255,0.1);
}

.toast-danger {
    background: rgba(220, 38, 38, 0.85);
    color: #fff;
    border-color: rgba(248, 113, 113, 0.3);
}

.toast-success {
    background: rgba(16, 185, 129, 0.85);
    color: #fff;
    border-color: rgba(52, 211, 153, 0.3);
}

@keyframes fade-in-out {
    0% { opacity: 0; transform: translateY(10px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* 模态框 */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 32px 36px;
    width: 380px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.logo-title {
    font-size: 26px;
    text-align: center;
    color: #38bdf8;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 13px;
    text-align: center;
    color: #94a3b8;
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    background: #0f172a;
    border-radius: 8px;
    padding: 3px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #94a3b8;
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #3b82f6;
    color: #ffffff;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #38bdf8;
}

.error-msg {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: center;
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.6);
}

/* 游客试玩：次要按钮，视觉权重低于主按钮 */
.guest-btn {
    width: 100%;
    margin-top: 10px;
    background: transparent;
    color: #94a3b8;
    border: 1px dashed #475569;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.guest-btn:hover {
    color: #e2e8f0;
    border-color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
}

.guide-tip {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #334155;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}
