* { 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(135deg, #0c1445 0%, #1a0a2e 50%, #2d1b4e 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

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

h1 {
    font-size: 32px;
    color: #00ffff;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.3);
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.diamond-display {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(138, 43, 226, 0.1));
    border: 2px solid rgba(0, 255, 255, 0.4);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.2);
}

.diamond-icon {
    font-size: 50px;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { filter: drop-shadow(0 0 10px #00ffff); }
    50% { filter: drop-shadow(0 0 30px #00ffff); }
}

.diamond-count {
    font-size: 42px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.diamond-label {
    font-size: 12px;
    color: #8a8aff;
    letter-spacing: 3px;
    margin-top: 5px;
}

.excavation-area {
    background: linear-gradient(180deg, #3d2817 0%, #2a1a0f 50%, #1a0f08 100%);
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    box-shadow: inset 0 10px 30px rgba(0,0,0,0.5);
    border: 2px solid #4a3520;
}

.dirt-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.dirt-cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #5a4030, #3a2515);
    border-radius: 5px;
    transition: all 0.2s;
}

.dirt-cell.digging {
    animation: digPulse 0.3s;
}

@keyframes digPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.8); background: #2a1a0f; }
}

.dirt-cell.gem {
    background: linear-gradient(135deg, #00ffff, #8a2be2);
    animation: gemGlow 1s infinite;
}

@keyframes gemGlow {
    0%, 100% { box-shadow: 0 0 10px #00ffff; }
    50% { box-shadow: 0 0 20px #00ffff, 0 0 30px #8a2be2; }
}

.dig-button {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    background: radial-gradient(circle at 30% 30%, #6b5040, #3a2515);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border: 3px solid #7a6050;
}

.dig-button:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(0,0,0,0.5);
}

.dig-button:active {
    transform: scale(0.92);
}

.shovel {
    font-size: 60px;
    transition: transform 0.15s;
}

.dig-button:active .shovel {
    transform: rotate(-20deg);
}

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

.stat {
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 10px;
    padding: 12px 8px;
    font-size: 11px;
    color: #aaa;
}

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

.upgrades {
    margin-top: 20px;
}

.upgrades h2 {
    font-size: 18px;
    color: #00ffff;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

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

.upgrade {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    transition: all 0.2s;
}

.upgrade:hover {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
}

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

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

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

.upgrade-button {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: bold;
    color: #1a0a2e;
    background: linear-gradient(135deg, #00ffff, #8a2be2);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

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

.gem-showcase {
    margin-top: 20px;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 15px;
    padding: 15px;
}

.gem-showcase h3 {
    font-size: 14px;
    color: #8a8aff;
    margin-bottom: 10px;
}

.gems {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.gem-item {
    font-size: 24px;
    animation: float 3s ease-in-out infinite;
}

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

.popup {
    position: fixed;
    font-size: 18px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 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(-70px) scale(1.3); }
}

.upgrade-list::-webkit-scrollbar {
    width: 5px;
}

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

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

@media (max-width: 500px) {
    h1 { font-size: 26px; }
    .diamond-count { font-size: 32px; }
    .dig-button { width: 120px; height: 120px; }
    .shovel { font-size: 50px; }
}
