* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', sans-serif;
}

body {
    overflow: hidden;
    background: linear-gradient(180deg, #87CEEB 0%, #98D8C8 100%);
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #98D8C8 100%);
}

/* 顶部栏 */
.top-bar {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.top-bar > * {
    pointer-events: auto;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.avatar-frame {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar-frame.default { border: 3px solid #ccc; }
.avatar-frame.bronze { border: 3px solid #cd7f32; }
.avatar-frame.silver { border: 3px solid #c0c0c0; }
.avatar-frame.pink { border: 3px solid #ff69b4; }
.avatar-frame.blue { border: 3px solid #4169e1; }
.avatar-frame.green { border: 3px solid #32cd32; }
.avatar-frame.rainbow { 
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, red, orange, yellow, green, blue, purple) border-box;
}
.avatar-frame.starlight { 
    border: 3px solid #ffd700;
    animation: starGlow 2s infinite;
}
.avatar-frame.crown { 
    border: 3px solid #ffd700;
    box-shadow: 0 0 10px #ffd700;
}

@keyframes starGlow {
    0%, 100% { box-shadow: 0 0 5px #ffd700; }
    50% { box-shadow: 0 0 20px #ffd700; }
}

.avatar {
    font-size: 24px;
}

.player-name {
    font-weight: 600;
    color: #333;
}

.coins {
    font-weight: 700;
    color: #ffd700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4px 10px;
    border-radius: 12px;
    color: white;
}

.location-indicator {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 右侧面板 */
.right-panel {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.action-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 3px solid white;
    font-size: 26px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.action-btn:active {
    transform: scale(0.95);
}

/* 聊天按钮 */
.chat-buttons {
    position: absolute;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.chat-toggle-btn, .tree-hole-btn {
    padding: 14px 22px;
    border-radius: 25px;
    border: 2px solid white;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.chat-toggle-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.tree-hole-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 聊天面板 */
.chat-panel {
    position: absolute;
    bottom: 90px;
    right: 25px;
    width: 360px;
    max-width: 90vw;
    height: 480px;
    max-height: 70vh;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
    backdrop-filter: blur(10px);
}

.chat-header {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
}

.close-btn:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.system {
    align-self: center;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 12px;
    padding: 5px 10px;
}

.message.other {
    align-self: flex-start;
    background: #f0f0f0;
    color: #333;
}

.message.self {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chat-input-area {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #eee;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s;
}

.chat-input-area input:focus {
    border-color: #667eea;
}

.chat-input-area button {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

/* 钓鱼UI */
.fishing-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 150;
    text-align: center;
}

.fishing-stage {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tension-bar-container {
    width: 300px;
    margin: 20px auto;
}

.tension-bar {
    width: 100%;
    height: 30px;
    background: linear-gradient(90deg, #4fc3f7, #81c784, #e57373);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.tension-green {
    position: absolute;
    left: 25%;
    width: 50%;
    height: 100%;
    background: rgba(76, 175, 80, 0.3);
    border: 2px dashed #4caf50;
}

.tension-indicator {
    position: absolute;
    width: 8px;
    height: 100%;
    background: white;
    border: 2px solid #333;
    border-radius: 4px;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.1s;
}

.tension-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.fishing-bobber {
    font-size: 40px;
    margin: 20px 0;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bite-indicator {
    font-size: 28px;
    color: #f44336;
    font-weight: 700;
    animation: shake 0.5s infinite;
    margin: 10px 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.reel-btn {
    padding: 20px 50px;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 35px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
    transition: all 0.2s;
}

.reel-btn:active {
    transform: scale(0.95);
}

/* 模态面板 */
.modal-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 620px;
    max-width: 92vw;
    max-height: 85vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 25px;
    border: 4px solid rgba(102, 126, 234, 0.25);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    z-index: 500;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(15px);
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
}

/* 背包 */
.inventory-stats {
    padding: 15px 20px;
    background: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

.inventory-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.inventory-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.inventory-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.inventory-item .emoji {
    font-size: 40px;
    margin-bottom: 8px;
}

.inventory-item .name {
    font-weight: 600;
    font-size: 14px;
}

.inventory-item .count {
    color: #666;
    font-size: 12px;
}

.inventory-item .price {
    color: #ffd700;
    font-weight: 700;
    font-size: 12px;
}

.sell-all-btn {
    margin: 20px;
    padding: 15px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

/* 商店 */
.shop-tabs {
    display: flex;
    padding: 10px 20px 0;
    background: #f8f9fa;
    gap: 5px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

.shop-content {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.shop-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    border: 3px solid transparent;
}

.shop-item:hover {
    transform: translateY(-5px);
}

.shop-item.owned {
    border-color: #4caf50;
}

.shop-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
}

.shop-item .preview {
    font-size: 50px;
    margin-bottom: 10px;
}

.shop-item .name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.shop-item .price {
    color: #ffd700;
    font-weight: 700;
}

.shop-item .owned-label {
    color: #4caf50;
    font-weight: 600;
    font-size: 12px;
}

/* 提示消息 */
.toast {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 25px;
    z-index: 500;
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.hidden {
    display: none !important;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 响应式 */
@media (max-width: 768px) {
    .modal-panel {
        width: 90vw;
    }
    
    .chat-panel {
        width: 90vw;
        right: 5vw;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .shop-content {
        grid-template-columns: repeat(2, 1fr);
    }
}