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

body {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
    font-family: system-ui, sans-serif;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.game-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

h1 {
    font-size: 36px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.gold-display {
    background: linear-gradient(135deg, #2a2a4a, #1a1a3a);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.gold-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.gold-count {
    font-size: 48px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.gold-label {
    font-size: 14px;
    color: #b8860b;
    letter-spacing: 2px;
    margin-top: 5px;
}

.mine-shaft {
    background: linear-gradient(180deg, #3d3d3d 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    position: relative;
    box-shadow: inset 0 10px 30px rgba(0,0,0,0.5);
}

.mine-button {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    background: radial-gradient(circle at 30% 30%, #5a5a5a, #2a2a2a);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 -5px 20px rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

.mine-button:hover {
    transform: scale(1.05);
}

.mine-button:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 -2px 10px rgba(255,255,255,0.1);
}

.pickaxe {
    font-size: 70px;
    transition: transform 0.1s;
}

.mine-button:active .pickaxe {
    transform: rotate(-30deg);
}

.spark-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.spark {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffd700;
    border-radius: 50%;
    animation: spark 0.6s ease-out forwards;
}

@keyframes spark {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0) translateY(-50px); }
}

.depth-indicator {
    margin-top: 15px;
    color: #888;
    font-size: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.stat {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 15px 10px;
    font-size: 12px;
    color: #ccc;
}

.stat span {
    display: block;
    font-size: 20px;
    color: #ffd700;
    font-weight: bold;
    margin-top: 5px;
}

.upgrades {
    margin-top: 20px;
}

.upgrades h2 {
    font-size: 20px;
    color: #ffd700;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.upgrade {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2a2a4a, #1a1a3a);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 12px 15px;
    transition: all 0.2s;
}

.upgrade:hover {
    border-color: #ffd700;
    transform: translateX(5px);
}

.upgrade-info {
    text-align: left;
}

.upgrade-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.upgrade-effect {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

.upgrade-button {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: bold;
    color: #1a1a2e;
    background: linear-gradient(135deg, #ffd700, #b8860b);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.upgrade-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.upgrade-button:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.achievements {
    margin-top: 20px;
}

.achievement-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: #1a1a2e;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: bold;
    animation: slideIn 0.5s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
}

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

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-20px); }
}

.popup {
    position: fixed;
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: floatUp 1s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}

/* Scrollbar styling */
.upgrade-list::-webkit-scrollbar {
    width: 6px;
}

.upgrade-list::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 3px;
}

.upgrade-list::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 3px;
}

/* Mobile responsive */
@media (max-width: 500px) {
    h1 { font-size: 28px; }
    .gold-count { font-size: 36px; }
    .mine-button { width: 150px; height: 150px; }
    .pickaxe { font-size: 50px; }
    .stats { grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .stat { padding: 10px 5px; font-size: 10px; }
    .stat span { font-size: 16px; }
}
