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

:root {
    --hyperliquid-primary: #065f46;
    --hyperliquid-secondary: #047857;
    --hyperliquid-accent: #10b981;
    --hyperliquid-light: #d1fae5;
    --hyperliquid-dark: #064e3b;
    --hyperliquid-glow: #34d399;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: #e8f4f8;
    color: #2c3e50;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #a8c0d0 0%, #e8f4f8 100%);
    position: relative;
}

/* App Header */
.app-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 10px 15px;
    background: rgba(6, 95, 70, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--hyperliquid-accent);
    z-index: 100;
    gap: 10px;
}

.app-title {
    font-size: 12px;
    color: var(--hyperliquid-glow);
    margin: 0;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.user-stats {
    display: flex;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(16, 185, 129, 0.2);
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 10px;
    color: #fff;
    white-space: nowrap;
}

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

.connect-btn {
    background: var(--hyperliquid-accent);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 10px;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
}

.wallet-badge {
    background: rgba(16, 185, 129, 0.3);
    padding: 5px 8px 5px 12px;
    border-radius: 20px;
    font-size: 10px;
    color: #fff;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.disconnect-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: Arial, sans-serif;
    flex-shrink: 0;
}

.wallet-badge:hover .disconnect-btn {
    opacity: 1;
}

.disconnect-btn:hover {
    background: #dc2626;
    transform: scale(1.15);
}

.refresh-btn {
    background: #10b981;
    color: #fff;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    margin-left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #059669;
    transform: rotate(180deg);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.tab-btn.active {
    background: #fff;
    color: var(--hyperliquid-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn span {
    font-size: 14px;
}

/* Main Content */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 80px;
}

#game-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 480px;
    height: 300px;
    margin-bottom: 15px;
}

#game-container canvas {
    width: 480px !important;
    height: 300px !important;
    border-radius: 16px;
}

.production-rate {
    font-size: 10px;
    color: #64748b;
    text-align: center;
}

.rate-value {
    color: var(--hyperliquid-accent);
    font-weight: bold;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-evenly;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(6, 95, 70, 0.1);
    padding: 1px 1px;
    gap: 1px;
    z-index: 80;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.1s;
    padding: 1px;
    position: relative;
}



.nav-icon-img {
    width: 64px;
    height: 34px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    transition: none;
    pointer-events: none;
}

/* Panel Overlay */
.panel-overlay {
    position: fixed;
    z-index: 10002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
}

.game-panel {
    background: linear-gradient(135deg, var(--hyperliquid-dark) 0%, var(--hyperliquid-primary) 100%);
    border: 3px solid var(--hyperliquid-accent);
    border-radius: 12px;
    max-width: 90%;
    max-height: 80vh;
    width: 440px;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid var(--hyperliquid-accent);
    background: rgba(0, 0, 0, 0.3);
}

.panel-header h2 {
    font-size: 16px;
    color: var(--hyperliquid-glow);
    margin: 0;
    text-shadow: 0 0 10px var(--hyperliquid-glow);
}

.close-panel {
    background: #ef4444;
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-panel:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.panel-content {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
    color: #fff;
}

/* Gacha Styles */
.gacha-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gacha-image {
    width: 150px;
    height: 150px;
    margin: 10px auto 5px;
    display: block;
    image-rendering: pixelated;
}

.gacha-info h3 {
    font-size: 14px;
    color: var(--hyperliquid-glow);
    margin: 5px 0;
}

.gacha-info p {
    font-size: 8px;
    color: var(--hyperliquid-light);
    margin: 3px 0;
}

.pack-price {
    font-size: 12px;
    color: #fbbf24;
    margin: 2px 0;
}

.gacha-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Booster Grid */
.booster-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.booster-item {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--hyperliquid-accent);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.booster-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.booster-name {
    font-size: 7px;
    color: #fff;
    margin-bottom: 3px;
}

.booster-effect {
    font-size: 6px;
    color: var(--hyperliquid-light);
    margin-bottom: 5px;
}

.booster-count {
    font-size: 10px;
    color: var(--hyperliquid-glow);
    font-weight: bold;
}

.booster-info {
    text-align: center;
    padding: 20px;
}

.booster-info p {
    font-size: 10px;
    margin-bottom: 15px;
}

/* Session Timer Styles */
.session-timer {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--hyperliquid-accent);
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    font-size: 10px;
    color: var(--hyperliquid-glow);
    text-align: center;
    font-family: 'Press Start 2P', monospace;
}

.session-complete {
    background: rgba(52, 211, 153, 0.3);
    border: 2px solid var(--hyperliquid-glow);
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    font-size: 10px;
    color: #fff;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Shop Grid */
.shop-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shop-item {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--hyperliquid-accent);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.shop-image {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
}

.shop-icon {
    font-size: 60px;
    width: 80px;
    text-align: center;
}

.shop-info {
    flex: 1;
}

.shop-info h3 {
    font-size: 12px;
    color: var(--hyperliquid-glow);
    margin: 0 0 5px 0;
}

.shop-info p {
    font-size: 8px;
    color: var(--hyperliquid-light);
    margin: 0 0 8px 0;
}

.shop-price {
    font-size: 10px;
    color: #fbbf24;
}

/* Plots Grid */
.plots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.plot-card {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--hyperliquid-accent);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.plot-number {
    font-size: 10px;
    color: var(--hyperliquid-glow);
    margin-bottom: 5px;
}

.plot-level {
    font-size: 12px;
    color: #fff;
    margin: 5px 0;
}

.plot-status {
    font-size: 8px;
    color: var(--hyperliquid-light);
    margin-bottom: 10px;
}

/* User Profile */
.user-info {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--hyperliquid-accent);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.user-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    font-size: 10px;
}

.user-stat:last-child {
    border-bottom: none;
}

.user-stat .label {
    color: var(--hyperliquid-light);
}

.user-stat .value {
    color: var(--hyperliquid-glow);
    font-weight: bold;
}

.user-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Game Buttons */
.game-btn {
    background: var(--hyperliquid-accent);
    color: #fff;
    border: 2px solid var(--hyperliquid-glow);
    padding: 10px 15px;
    font-size: 10px;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    flex: 1;
    min-width: fit-content;
}

.game-btn:hover {
    background: var(--hyperliquid-glow);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.game-btn.secondary {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--hyperliquid-accent);
}

.game-btn.small {
    padding: 6px 10px;
    font-size: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    font-size: 10px;
    color: var(--hyperliquid-light);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: var(--hyperliquid-dark);
    border: 3px solid var(--hyperliquid-accent);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
    position: relative;
}

.modal-content h2 {
    color: var(--hyperliquid-glow);
    font-size: 20px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px var(--hyperliquid-glow);
}

.modal-content p {
    color: var(--hyperliquid-light);
    font-size: 12px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--hyperliquid-glow);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #ffffff;
}

/* Action Button Images */
.action-button-img {
    width: auto;
    height: auto;
    max-width: 200px;
    cursor: pointer;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    transition: transform 0.1s;
    display: block;
    margin: 0 auto;
}

.action-button-img:hover {
    transform: scale(1.02);
}

.action-button-img:active {
    transform: scale(0.98);
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 190px;
    pointer-events: none;
}

.notification {
    background: var(--hyperliquid-dark);
    border: 2px solid var(--hyperliquid-accent);
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transform: translateX(200px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: all;
    font-family: 'Press Start 2P', monospace;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.notification-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 6px;
    color: #fff;
    line-height: 1.3;
    word-break: break-word;
}

.notification-close {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--hyperliquid-accent);
    border: 1px solid #fff;
    color: #000;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    transition: all 0.2s;
}

.notification-close:hover {
    background: var(--hyperliquid-glow);
    transform: scale(1.1);
}

.notification-success {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 95, 70, 0.9));
}

.notification-error {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(6, 95, 70, 0.9));
}

.notification-warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(6, 95, 70, 0.9));
}

.notification-info {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 95, 70, 0.9));
}

.notification-fox {
    border-color: var(--hyperliquid-glow);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.3), rgba(6, 95, 70, 0.95));
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}

@media (max-width: 768px) {
    .notification-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification-message {
        font-size: 9px;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
    }

    .game-stats {
        flex-direction: column;
    }

    .controls {
        flex-direction: column;
    }

    .pixel-button {
        width: 100%;
        font-size: 10px;
        padding: 12px 15px;
    }
}

