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

body {
    background: #1a1a2e;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    user-select: none;
}

#wallet-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 2px solid #9945ff;
}

#game-logo {
    font-size: 22px;
    font-weight: bold;
    background: linear-gradient(135deg, #9945ff, #14f195);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

#wallet-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#wallet-balance {
    font-size: 14px;
    color: #14f195;
}

#wallet-btn {
    background: linear-gradient(135deg, #9945ff, #7b3fe4);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

#wallet-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(153, 69, 255, 0.5);
}

#wallet-btn.connected {
    background: linear-gradient(135deg, #14f195, #0ec47a);
}

#game-container {
    position: relative;
    width: 100vw;
    height: calc(100vh - 50px);
    margin-top: 50px;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

#player-stats {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.stat {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.stat-value {
    font-size: 16px;
    font-weight: bold;
}

#toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.tool-slot {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.tool-slot:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.tool-slot.active {
    border-color: #14f195;
    background: rgba(20, 241, 149, 0.15);
    box-shadow: 0 0 12px rgba(20, 241, 149, 0.3);
}

#location-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 30, 0.95);
    border-radius: 16px;
    border: 2px solid rgba(153, 69, 255, 0.4);
    padding: 20px;
    min-width: 350px;
    max-height: 70vh;
    overflow-y: auto;
    pointer-events: auto;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    font-size: 18px;
    color: #14f195;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

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

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.inv-slot {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.inv-slot:hover {
    background: rgba(255, 255, 255, 0.12);
}

.inv-slot .count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 10px;
    color: #ccc;
}

#market-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.market-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.market-tab.active {
    background: rgba(153, 69, 255, 0.3);
    border: 1px solid #9945ff;
}

.market-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.market-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.market-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.market-item-icon {
    font-size: 28px;
}

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

.market-item-price {
    font-size: 12px;
    color: #14f195;
}

.market-buy-btn {
    background: linear-gradient(135deg, #9945ff, #7b3fe4);
    border: none;
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.market-buy-btn:hover {
    transform: scale(1.05);
}

#fishing-panel {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}

#fishing-minigame {
    text-align: center;
}

#fishing-bar {
    width: 300px;
    height: 40px;
    background: rgba(0, 40, 80, 0.9);
    border-radius: 20px;
    border: 2px solid #14f195;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

#fishing-target {
    position: absolute;
    height: 100%;
    width: 60px;
    background: rgba(20, 241, 149, 0.3);
    border-radius: 18px;
    left: 120px;
}

#fishing-hook {
    position: absolute;
    height: 100%;
    width: 8px;
    background: #fff;
    border-radius: 4px;
    left: 0;
    transition: none;
}

#fishing-panel p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

#minimap {
    position: absolute;
    bottom: 20px;
    right: 20px;
    pointer-events: auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

#minimapCanvas {
    display: block;
}

#chat-box {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 300px;
    pointer-events: auto;
}

#chat-messages {
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

#chat-messages::-webkit-scrollbar {
    width: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.chat-msg {
    margin-bottom: 3px;
}

.chat-msg .sender {
    color: #14f195;
    font-weight: 600;
}

#chat-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 8px 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

#chat-input:focus {
    border-color: #9945ff;
}

#loading-screen {
    position: fixed;
    inset: 0;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#loading-content {
    text-align: center;
}

#loading-content h1 {
    font-size: 48px;
    background: linear-gradient(135deg, #9945ff, #14f195);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

#loading-content p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

#loading-bar {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

#loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #9945ff, #14f195);
    border-radius: 3px;
    transition: width 0.3s;
}

.notification {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(15, 15, 30, 0.95);
    border: 1px solid #14f195;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    z-index: 200;
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 2.7s;
    pointer-events: none;
}

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
