* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        html, body {
            height: 100%;
            overflow: hidden;
            position: fixed;
            width: 100%;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
            background: linear-gradient(to bottom, #1a2c38, #0f212e);
            color: white;
            display: flex;
            flex-direction: column;
            touch-action: manipulation;
        }

        /* Header */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #0f212e;
            flex-shrink: 0;
        }

        .logo {
            font-size: 22px;
            font-weight: bold;
        }

        .balance {
            display: flex;
            align-items: center;
            gap: 6px;
            background: #2f4553;
            padding: 6px 14px;
            border-radius: 8px;
            font-weight: bold;
            font-size: 15px;
        }

        .currency {
            color: #fbbf24;
            font-size: 16px;
        }

        /* Main Content */
        .container {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 10px;
            gap: 10px;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* Game Grid */
        .game-section {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 5px 0;
        }

        .grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 6px;
            max-width: 450px;
            width: 100%;
        }

        .tile {
            aspect-ratio: 1;
            background: #2f4553;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            transition: all 0.2s ease;
            position: relative;
        }

        .tile:active:not(:disabled):not(.revealed) {
            transform: scale(0.95);
            background: #3a5563;
        }

        .tile.revealed {
            cursor: default;
            pointer-events: none;
        }

        .tile.gem {
            background: linear-gradient(135deg, #22c55e, #16a34a);
            animation: gemPulse 0.4s ease;
        }

        .tile.mine {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            animation: explode 0.4s ease;
        }

        /* Diamond Icon */
        .diamond-icon {
            width: 60%;
            height: 60%;
            background: linear-gradient(135deg, #86efac 0%, #22d3ee 50%, #a78bfa 100%);
            clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
            animation: sparkle 1s ease-in-out infinite;
        }

        @keyframes sparkle {
            0%, 100% { 
                filter: drop-shadow(0 4px 8px rgba(34, 211, 238, 0.4)) brightness(1);
            }
            50% { 
                filter: drop-shadow(0 4px 12px rgba(34, 211, 238, 0.8)) brightness(1.2);
            }
        }

        @keyframes gemPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.08); }
        }

        @keyframes explode {
            0% { transform: scale(1) rotate(0deg); }
            25% { transform: scale(1.15) rotate(5deg); }
            50% { transform: scale(1.1) rotate(-5deg); }
            75% { transform: scale(1.05) rotate(3deg); }
            100% { transform: scale(1) rotate(0deg); }
        }

        /* Result Display */
        .result-display {
            flex-shrink: 0;
            background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), rgba(59, 130, 246, 0.15));
            border: 1px solid rgba(34, 197, 94, 0.3);
            border-radius: 10px;
            padding: 12px;
            text-align: center;
            animation: slideDown 0.3s ease;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-15px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .result-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 6px;
        }

        .result-multiplier {
            font-size: 17px;
            margin-bottom: 4px;
        }

        .result-amount {
            font-size: 16px;
            color: #22c55e;
        }

        /* Controls */
        .controls {
            flex-shrink: 0;
            background: #0f212e;
            border-radius: 10px;
            padding: 12px;
        }

        .control-group {
            margin-bottom: 12px;
        }

        .control-group:last-child {
            margin-bottom: 0;
        }

        .control-label {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            color: #9ca3af;
            margin-bottom: 6px;
        }

        .input-group {
            display: flex;
            gap: 6px;
        }

        .input-group input,
        .input-group select {
            flex: 1;
            background: #2f4553;
            border: none;
            border-radius: 8px;
            padding: 10px;
            color: white;
            font-size: 15px;
        }

        .input-group input::placeholder {
            color: #6b7280;
        }

        .input-group button {
            background: #2f4553;
            border: none;
            border-radius: 8px;
            padding: 10px 14px;
            color: white;
            cursor: pointer;
            font-weight: bold;
            font-size: 15px;
            flex-shrink: 0;
        }

        .input-group button:active {
            background: #3a5563;
            transform: scale(0.95);
        }

        .profit-display {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #2f4553;
            border-radius: 8px;
            padding: 10px;
            font-size: 14px;
        }

        .profit-label {
            color: #9ca3af;
        }

        .profit-amount {
            color: #22c55e;
            font-weight: bold;
        }

        .button-group {
            display: flex;
            gap: 6px;
        }

        .btn {
            flex: 1;
            padding: 14px;
            border: none;
            border-radius: 8px;
            font-size: 15px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .btn:active:not(:disabled) {
            transform: scale(0.97);
        }

        .btn-green {
            background: #22c55e;
            color: white;
        }

        .btn-green:active:not(:disabled) {
            background: #16a34a;
        }

        .btn-red {
            background: #ef4444;
            color: white;
            flex: 0 0 auto;
            padding: 14px 20px;
        }

        .btn-red:active:not(:disabled) {
            background: #dc2626;
        }

        .btn-purple {
            background: #8b5cf6;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .btn-purple:active:not(:disabled) {
            background: #7c3aed;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.85);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: #1a2c38;
            border-radius: 12px;
            padding: 20px;
            max-width: 380px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-title {
            font-size: 22px;
            font-weight: bold;
            text-align: center;
            margin-bottom: 18px;
        }

        .task-item {
            background: #2f4553;
            border-radius: 8px;
            padding: 14px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .task-icon {
            font-size: 22px;
            flex-shrink: 0;
        }

        .task-info {
            flex: 1;
        }

        .task-title {
            font-weight: bold;
            margin-bottom: 3px;
            font-size: 14px;
        }

        .task-reward {
            font-size: 13px;
            color: #9ca3af;
        }

        .task-btn {
            padding: 7px 14px;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: bold;
            cursor: pointer;
            color: white;
            flex-shrink: 0;
        }

        .task-btn.blue {
            background: #3b82f6;
        }

        .task-btn.green {
            background: #22c55e;
        }

        .task-btn:active {
            transform: scale(0.95);
        }

        /* Footer */
        .footer {
            background: #0f212e;
            padding: 8px;
            text-align: center;
            font-size: 11px;
            color: #6b7280;
            flex-shrink: 0;
        }

        .footer a {
            color: #3b82f6;
            text-decoration: none;
        }

        .footer a:active {
            text-decoration: underline;
        }

        .hidden {
            display: none !important;
        }