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

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    font-family: 'Inter', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.back-home-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #4a9eff;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(74, 158, 255, 0.1);
    border-radius: 10px;
    font-size: 0.9em;
    transition: background 0.3s ease, transform 0.2s ease;
}

.back-home-link:hover {
    background: rgba(74, 158, 255, 0.2);
    transform: translateX(-3px);
}

.header {
    text-align: center;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #14b8a6 0%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.stats-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 12px 15px;
    margin-bottom: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.stat {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(103, 232, 249, 0.15) 100%);
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    border: 1px solid rgba(20, 184, 166, 0.2);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

.stat .label {
    color: #0f172a;
    font-weight: 600;
    margin-right: 5px;
}

.stat span:last-child {
    color: #14b8a6;
    font-weight: bold;
}

.level-progress-container {
    margin-top: 0;
    padding: 8px;
    background: rgba(20, 184, 166, 0.1);
    border-radius: 8px;
}

.level-progress-label {
    font-size: 0.9rem;
    color: #0f172a;
    margin-bottom: 5px;
    text-align: center;
}

.level-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(20, 184, 166, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #14b8a6 0%, #67e8f9 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.stats-panel {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 2px solid rgba(20, 184, 166, 0.3);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

.stats-panel h3 {
    color: #14b8a6;
    margin-bottom: 10px;
    font-size: 1.2rem;
    text-align: center;
    border-bottom: 2px solid rgba(20, 184, 166, 0.2);
    padding-bottom: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
}

.stat-label {
    color: #0f172a;
    font-weight: 600;
}

.stat-row span:last-child {
    color: #14b8a6;
    font-weight: bold;
}

.shop-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.shop-section {
    margin-bottom: 30px;
}

.shop-section h3 {
    color: #14b8a6;
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(20, 184, 166, 0.3);
    padding-bottom: 5px;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(20, 184, 166, 0.2);
    transition: all 0.3s ease;
}

.shop-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(20, 184, 166, 0.4);
}

.shop-item.owned {
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.4);
}

.shop-item.equipped {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.shop-item-info {
    flex: 1;
}

.shop-item-info strong {
    display: block;
    color: #0f172a;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.shop-item-info p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.shop-item-action {
    margin-left: 15px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #14b8a6 0%, #67e8f9 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-small:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.equipped-badge {
    padding: 8px 16px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #0f172a;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.game-notice {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(103, 232, 249, 0.15) 100%);
    border: 2px solid rgba(20, 184, 166, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.1);
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notice-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notice-text {
    flex: 1;
    font-size: 0.9rem;
    color: #0f172a;
    line-height: 1.5;
}

.notice-text strong {
    color: #0d9488;
    font-weight: 600;
}

.game-area {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 3px solid rgba(20, 184, 166, 0.4);
    border-radius: 15px;
    background: #87CEEB;
    cursor: crosshair;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

#gameCanvas:hover {
    box-shadow: 0 6px 30px rgba(20, 184, 166, 0.3);
}

.controls {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.control-info {
    color: #0f172a;
    font-size: 0.9rem;
}

.control-info p {
    margin: 5px 0;
}

.desktop-controls {
    display: block;
}

.mobile-controls {
    display: none;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    background: linear-gradient(135deg, #14b8a6 0%, #67e8f9 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.4);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Splash Screen Styles */
.splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.95) 0%, rgba(34, 139, 34, 0.95) 25%, rgba(160, 82, 45, 0.95) 50%, rgba(101, 67, 33, 0.95) 75%, rgba(139, 69, 19, 0.95) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    pointer-events: auto;
    animation: fadeIn 0.5s ease-in, gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

.splash-overlay.hidden {
    display: none;
}

.splash-content {
    text-align: center;
    max-width: 700px;
    padding: 50px 40px;
    margin: auto;
    animation: slideUp 0.8s ease-out;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 3px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 0 50px rgba(255, 215, 0, 0.1);
}

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

.splash-title h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    animation: glow 2s ease-in-out infinite alternate;
    font-weight: 700;
    letter-spacing: 3px;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    }
    to {
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1));
    }
}

.splash-subtitle {
    font-size: 1.5rem;
    color: #FFD700;
    margin-bottom: 30px;
    font-weight: 400;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.splash-character {
    font-size: 8rem;
    margin: 30px 0;
    animation: arrowFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
    transform-origin: center;
}

@keyframes arrowFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-15px) rotate(-5deg) scale(1.05);
    }
    50% {
        transform: translateY(-25px) rotate(0deg) scale(1.1);
    }
    75% {
        transform: translateY(-15px) rotate(5deg) scale(1.05);
    }
}

.splash-description {
    color: #FFEAA7;
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 30px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.splash-description p {
    margin: 12px 0;
    font-weight: 500;
}

.splash-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
}

.splash-feature {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.2) 100%);
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 25px;
    padding: 15px 25px;
    color: #FFD700;
    font-size: 1.1rem;
    font-weight: 600;
    animation: fadeInScale 0.8s ease-out;
    animation-fill-mode: both;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.splash-feature:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.9);
}

.splash-feature:nth-child(1) { animation-delay: 0.1s; }
.splash-feature:nth-child(2) { animation-delay: 0.2s; }
.splash-feature:nth-child(3) { animation-delay: 0.3s; }
.splash-feature:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.splash-btn {
    margin-top: 30px;
    margin-bottom: 20px;
    padding: 18px 50px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B4513;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
    animation: pulse 2s ease-in-out infinite;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 40px rgba(255, 215, 0, 0.8);
    }
}

.splash-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.9);
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid;
    border-image: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 50%, #3b82f6 100%) 1;
}

.overlay-content h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #14b8a6 0%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.overlay-content p {
    color: #0f172a;
    margin: 10px 0;
    line-height: 1.6;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .stats-container {
        padding: 10px;
        margin-bottom: 8px;
    }

    .stats {
        gap: 8px;
        margin-bottom: 6px;
    }

    .stat {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .level-progress-container {
        padding: 6px;
    }

    .level-progress-label {
        font-size: 0.8rem;
    }

    .game-area {
        padding: 15px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-info {
        text-align: center;
    }

    .desktop-controls {
        display: none;
    }

    .mobile-controls {
        display: block;
    }

    .button-group {
        justify-content: center;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .overlay-content {
        padding: 30px 20px;
        margin: 20px;
    }

    .overlay-content h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }

    .stat {
        font-size: 0.85rem;
        padding: 5px 10px;
    }

    .overlay-content {
        padding: 25px 15px;
    }

    .overlay-content h2 {
        font-size: 1.75rem;
    }

    .splash-content {
        padding: 30px 20px;
        margin: 20px;
        max-width: 90%;
    }

    .splash-title h1 {
        font-size: 2.5rem;
    }

    .splash-subtitle {
        font-size: 1.2rem;
    }

    .splash-character {
        font-size: 5rem;
        margin: 20px 0;
    }

    .splash-description {
        font-size: 1rem;
        margin: 20px 0;
    }

    .splash-feature {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .splash-btn {
        padding: 15px 35px;
        font-size: 1.1rem;
    }
}

