        :root {
            --bg-color: #0f0f0f;
            --surface-color: #1a1a1a;
            --card-bg: #242424;
            --primary-color: #d4a373; 
            --primary-hover: #e6b98d;
            --text-color: #e0e0e0;
            --text-muted: #888888;
            --success: #2ecc71;
            --danger: #e74c3c;
            --accent: #3498db;
            --rankname: #a08264;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            font-family: 'Segoe UI', Roboto, sans-serif;
            margin: 0;
            display: -webkit-flex;
            display: flex;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-align-items: center;
            align-items: center;
            height: 100vh;
            overflow: hidden;
            user-select: none;
        }

        #app {
            background-color: var(--surface-color);
            width: 90vw;
            height: 100vh;
            display: -webkit-flex;
            display: flex;
            -webkit-flex-direction: column;
            flex-direction: column;
            position: relative;
            box-shadow: 0 0 50px rgba(0,0,0,0.8);
            margin: 0 auto;
        }

        @media (orientation: landscape) {
            #app { width: 40vw; height: 95vh; border-radius: 30px; }
        }
        
        @media (orientation: portrait) and (min-width: 600px) {
            #app { height: 95vh; border-radius: 30px; }
        }

        /* Header */
        .header {
            padding: 30px 20px 10px;
            text-align: center;
        }
        .header h1 {
            margin: 0;
            font-weight: 300;
            letter-spacing: 2px;
            color: var(--primary-color);
            text-transform: uppercase;
            font-size: 1.2rem;
        }

        /* Views */
        .view {
            display: none;
            -webkit-flex: 1;
            flex: 1;
            padding: 20px 20px 60px 20px;
            -webkit-flex-direction: column;
            flex-direction: column;
            animation: fadeIn 0.4s ease;
            overflow-y: auto;
        }
        .view.active { 
            display: -webkit-flex; 
            display: flex; 
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: scale(0.98); }
            to { opacity: 1; transform: scale(1); }
        }

        /* Cards & Buttons */
        .card-grid {
            display: -webkit-flex;
            display: flex;
            -webkit-flex-direction: column;
            flex-direction: column;
            margin-top: 40px;
        }
        .main-btn {
            background: var(--card-bg);
            border: 1px solid #333;
            color: white;
            padding: 25px;
            border-radius: 20px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: 0.2s;
            display: -webkit-flex;
            display: flex;
            -webkit-align-items: center;
            align-items: center;
            -webkit-justify-content: space-between;
            justify-content: space-between;
            margin-bottom: 15px; /* Ersatz für gap */
            box-sizing: border-box;
        }
        .main-btn:active { background: #333; transform: translateY(2px); border-color: var(--primary-color); }
        .main-btn i { font-size: 1.5rem; color: var(--primary-color); }

        .btn-small {
            background: var(--primary-color);
            color: black;
            border: none;
            padding: 10px 15px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            box-sizing: border-box;
        }
        .btn-small:active { opacity: 0.8; }

        /* User Profile Info Area */
        .user-info-bar {
            background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
            padding: 20px;
            border-radius: 20px;
            margin-bottom: 20px;
            border-left: 5px solid var(--primary-color);
        }
        .user-info-header { 
            display: -webkit-flex; display: flex; 
            -webkit-justify-content: space-between; justify-content: space-between; 
            -webkit-align-items: baseline; align-items: baseline; 
        }
        .user-name { font-size: 1.5rem; font-weight: bold; margin: 0; }
        .user-balance { font-size: 1.2rem; color: var(--success); font-weight: bold; }
        .user-stats-small { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; }

        /* Numpad Style (Kompatibel gemacht) */
        .display-box {
            background: #000;
            padding: 15px;
            border-radius: 15px;
            text-align: center;
            margin-bottom: 20px;
            border: 1px solid #333;
        }
        .display-val { font-size: 2.5rem; font-family: monospace; color: var(--primary-color); }
        
        .numpad {
            display: -webkit-flex;
            display: flex;
            -webkit-flex-wrap: wrap;
            flex-wrap: wrap;
            -webkit-justify-content: space-between;
            justify-content: space-between;
        }
        .num-btn {
            background: var(--card-bg);
            border: none;
            color: white;
            padding: 20px;
            font-size: 1.5rem;
            border-radius: 15px;
            cursor: pointer;
            width: calc(33.333% - 7px); /* Simuliert grid mit 10px gap */
            margin-bottom: 10px;
            box-sizing: border-box;
        }
        .num-btn:active { background: var(--primary-color); color: black; }
        .num-btn.confirm { background: var(--primary-color); color: black; font-weight: bold; }
        .num-btn.cancel { background: #331111; color: var(--danger); width: 100%; } /* Breiter Cancel Button */

        /* Stats List */
        .stats-list { margin-top: 20px; margin-bottom: 20px; }
        .stat-item {
            background: var(--card-bg);
            padding: 5px 15px;
            border-radius: 10px;
            margin: 5px 0; 
            display: -webkit-flex;
            display: flex;
            -webkit-justify-content: space-between;
            justify-content: space-between;
            -webkit-align-items: center;
            align-items: center;
            cursor: pointer;
            border: 1px solid transparent;
        }
        .stat-item:active {
            border-color: var(--primary-color);
        }
        
        /* Admin forms */
        .admin-section {
            background: #222;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
        }
        .admin-section h3 { margin-top: 0; color: var(--primary-color); border-bottom: 1px solid #444; padding-bottom: 5px; }
        .form-group { margin-bottom: 15px; }
        .form-group input {
            width: 100%;
            padding: 10px;
            background: #111;
            border: 1px solid #444;
            color: white;
            border-radius: 5px;
            box-sizing: border-box;
            font-size: 1rem;
        }
        .history-list {
            max-height: 200px;
            overflow-y: auto;
            font-size: 0.9rem;
        }
        .history-item {
            display: -webkit-flex;
            display: flex;
            -webkit-justify-content: space-between;
            justify-content: space-between;
            padding: 5px 0;
            border-bottom: 1px solid #333;
        }
        
        /* Hellere C-Taste */
        .num-btn.clear-btn { background: #4a4a4a; font-weight: bold; }

        /* Full Image Overlay */
        .img-overlay {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(15, 15, 15, 0.95);
            display: none;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-align-items: center;
            align-items: center;
            z-index: 2000;
            border-radius: inherit;
        }
        .img-overlay.active { 
            display: -webkit-flex;
            display: flex; 
            animation: fadeIn 0.3s ease; 
        }
        .full-user-img {
            max-width: 80vw;
            max-height: 80vh;
            border: 4px solid #e0e0e0;
            border-radius: 10px;
            object-fit: contain;
            box-shadow: 0px 10px 30px rgba(0,0,0,0.8);
        }
        .close-img-btn {
            position: absolute;
            top: 20px;
            right: 20px;
            background: #242424;
            color: white;
            border: 2px solid #555;
            border-radius: 50%;
            width: 45px;
            height: 45px;
            font-size: 1.5rem;
            cursor: pointer;
            display: -webkit-flex;
            display: flex;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-align-items: center;
            align-items: center;
            box-shadow: 0px 4px 10px rgba(0,0,0,0.5);
        }
        .close-img-btn:active { background: var(--danger); border-color: var(--danger); }

        /* Festklebender Button am unteren Rand */
        .sticky-btn {
            position: -webkit-sticky;
            position: sticky;
            bottom: 20px; /* Abstand zum unteren Bildschirmrand */
            z-index: 100;
            /* Erzeugt einen weichen Schatten, der die Liste darunter leicht verblasst */
            box-shadow: 0 0 20px 15px var(--surface-color); 
        }

        /* Scrollbar */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: var(--bg-color); }
        ::-webkit-scrollbar-thumb { background: #555; border-radius: 10px; }

        /* --- STEAMPUNK NUMPAD & BUTTON UPDATE --- */
        /* --- STEAMPUNK NUMPAD & BUTTON UPDATE --- */
        .num-btn {
            color: var(--primary-color) !important;
            border: 1px solid rgba(212, 163, 115, 0.2) !important;
            background: linear-gradient(145deg, #252525, #181818) !important;
            letter-spacing: 2px;
            font-weight: bold !important;
            text-shadow: 0 0 10px rgba(212, 163, 115, 0.2);
            
            /* Anti-Zoom und Anti-Markieren */
            touch-action: manipulation !important;
            -webkit-user-select: none !important; /* Für alte iPads / Safari */
            user-select: none !important;         /* NEU: Für moderne Browser */
            -webkit-touch-callout: none !important;
        }

        .num-btn:active {
            background: rgba(212, 163, 115, 0.1) !important;
            border-color: var(--primary-color) !important;
        }

        /* Die C-Taste etwas abheben (gedämpftes Rot/Kupfer) */
        .num-btn.clear-btn {
            color: #c96b52 !important;
            font-weight: bold !important;
        }

        /* Der Abbrechen-Button unterm Numpad */
        .num-btn.cancel {
            color: #c96b52 !important; /* Rötliches Kupfer passend zur C-Taste */
            text-transform: uppercase; /* Alles großgeschrieben wirkt technischer */
            letter-spacing: 3px;
            font-weight: bold !important;
            font-size: 1.1rem !important;
        }

        /* Der OK-Button (wird in der Action-View auf dem Numpad angezeigt) */
        .num-btn.confirm {
            color: #d4af37 !important; /* Ein edles Steampunk-Gold */
            text-transform: uppercase;
            letter-spacing: 2px;
            font-weight: bold !important;
            text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
        }

        /* --- iPAD 2 FIX: STICKY BUTTON --- */
        .sticky-btn {
            position: fixed !important;
            bottom: 20px !important;
            left: 50% !important;
            -webkit-transform: translateX(-50%) !important; /* Wichtig für das alte iPad! */
            transform: translateX(-50%) !important;
            width: 90% !important;
            max-width: 450px !important;
            z-index: 4000 !important;
            box-shadow: 0 10px 30px rgba(0,0,0,0.9) !important;
        }

        /* Damit die untersten Einträge in der Liste nicht hinter dem Button versteckt bleiben: */
        .view {
            padding-bottom: 100px !important; 
        }

        /* Hebt das doppelte Padding auf der Statistik-Seite für moderne PCs auf */
        #view-stats {
            padding-bottom: 20px !important; 
        }

        /* --- KUPFER-STYLING FÜR ALLE ZURÜCK/ABBRECHEN BUTTONS --- */

        /* Wir zielen auf alle Buttons ab, die "goHome()" ausführen oder die Klasse "cancel-btn" haben */
        button[onclick="goHome()"],
        button[onclick^="cancel"],
        .cancel-btn {
            color: #c96b52 !important;
            text-transform: uppercase !important;
            letter-spacing: 3px !important;
            font-weight: bold !important;
            font-size: 1.1rem !important;
            
            /* Optional: Falls du möchtest, dass sie auch den dunklen Hintergrund wie im Numpad haben, 
            entferne einfach die "/*" bei den nächsten beiden Zeilen: */
            background: linear-gradient(145deg, #252525, #181818) !important;
            border: 1px solid rgba(201, 107, 82, 0.3) !important;
        }