﻿/* ============================================
   TOOLSHAY - PREMIUM UI SYSTEM v2.0
   Modern Dark Theme with Glassmorphism
   iOS 26 Compatible
   ============================================ */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* === CSS VARIABLES === */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #161625;
    --bg-card: rgba(22, 22, 37, 0.8);
    --bg-card-solid: #1a1a2e;
    --bg-input: rgba(30, 30, 50, 0.8);
    --bg-hover: rgba(99, 102, 241, 0.08);

    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dim: rgba(99, 102, 241, 0.15);
    --accent-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);

    --success: #10b981;
    --success-dim: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.15);
    --info: #3b82f6;
    --info-dim: rgba(59, 130, 246, 0.15);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(99, 102, 241, 0.12);
    --border-light: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(99, 102, 241, 0.3);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 4px 20px rgba(99, 102, 241, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* iOS Safe Area */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* === RESET === */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
html { 
    scroll-behavior: smooth;
    /* iOS 26 dynamic viewport */
    height: 100%;
    height: 100dvh;
}
body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* iOS overscroll fix */
    overscroll-behavior: none;
    overscroll-behavior-y: contain;
    /* Safe area padding */
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    /* iOS scroll performance */
    -webkit-overflow-scrolling: touch;
}

/* iOS Input Zoom Prevention */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* iOS Dynamic Island Safe Area */
@supports (padding-top: env(safe-area-inset-top)) {
    .top-bar {
        padding-top: calc(12px + var(--safe-top));
    }
    .main-area {
        padding-bottom: var(--safe-bottom);
    }
}

/* === ANIMATED BACKGROUND === */
.bg-mesh {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
}
.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}
.bg-noise {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* === GLASS CARD === */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.glass-solid {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

/* === HEADER / TOP BAR === */
.top-bar {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    padding-top: calc(12px + var(--safe-top));
    display: flex; justify-content: space-between; align-items: center;
}
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }

/* === AVATAR === */
.avatar {
    width: 42px; height: 42px; border-radius: var(--radius-md);
    object-fit: cover; border: 2px solid var(--accent);
    box-shadow: var(--accent-glow);
}
.avatar-sm { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.avatar-lg { width: 56px; height: 56px; border-radius: var(--radius-lg); }

/* === USER INFO === */
.user-info .name {
    font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
    letter-spacing: 0.3px;
}
.user-info .status {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.5px;
    text-transform: uppercase;
}
.status-active { color: var(--success); }
.status-inactive { color: var(--danger); }

/* === BALANCE BADGE === */
.balance-badge {
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    padding: 8px 16px; border-radius: var(--radius-full);
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-weight: 600;
    color: var(--accent-light); font-size: 0.85rem;
    cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.balance-badge:hover {
    background: rgba(99, 102, 241, 0.2);
    box-shadow: var(--accent-glow);
    transform: translateY(-1px);
}

/* === BUTTONS === */
.btn {
    padding: 12px 24px; border: none; border-radius: var(--radius-md);
    font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none; letter-spacing: 0.3px;
}
.btn-primary {
    background: var(--accent-gradient); color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}
.btn-primary:active { transform: scale(0.98); }
.btn-outline {
    background: var(--accent-dim); color: var(--accent-light);
    border: 1px solid var(--border-accent);
}
.btn-outline:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}
.btn-danger {
    background: var(--danger-dim); color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-success {
    background: var(--success-dim); color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.btn-sm { padding: 8px 16px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-icon {
    width: 40px; height: 40px; padding: 0; border-radius: var(--radius-md);
    background: var(--accent-dim); border: 1px solid var(--border-accent);
    color: var(--accent-light); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); font-size: 14px;
}
.btn-icon:hover { background: rgba(99, 102, 241, 0.25); box-shadow: var(--accent-glow); }

/* === FORM INPUTS === */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block; font-size: 0.75rem; font-weight: 600;
    color: var(--text-secondary); text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 8px;
}
.input-wrap { position: relative; }
.input-wrap .input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--accent-light); font-size: 14px; z-index: 2;
}
.form-input {
    width: 100%; padding: 14px 16px 14px 44px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-sans); font-size: 0.9rem; font-weight: 500;
    transition: var(--transition);
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input-plain { padding-left: 16px; }
select.form-input {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.eye-toggle {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); cursor: pointer; font-size: 14px; z-index: 2;
    transition: var(--transition);
}
.eye-toggle:hover { color: var(--accent-light); }

/* === CARDS === */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    transition: var(--transition);
}
.card:hover { border-color: var(--border-accent); }
.card-gradient-top::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 2px; background: var(--accent-gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px; border: 1px solid var(--border-light);
}
.card-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border-light);
}
.card-info-row:last-child { border-bottom: none; }
.card-info-row .label { color: var(--text-secondary); font-size: 0.85rem; }
.card-info-row .val { font-weight: 700; font-size: 0.85rem; }

/* === HERO BANNER === */
.hero-banner {
    margin: 16px 0;
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    position: relative; overflow: hidden;
}
.hero-banner::before {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(
        135deg, transparent, transparent 10px,
        rgba(255,255,255,0.02) 10px, rgba(255,255,255,0.02) 20px
    );
}
.hero-banner::after {
    content: ''; position: absolute; top: -50%; right: -20%;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.hero-banner h3 {
    color: #fff; font-size: 1.4rem; font-weight: 800;
    line-height: 1.3; position: relative; z-index: 1;
}
.hero-banner p {
    color: rgba(255,255,255,0.75); font-weight: 500; font-size: 0.85rem;
    text-transform: uppercase; letter-spacing: 2px;
    position: relative; z-index: 1; margin-bottom: 4px;
}

/* === SECTION TITLE === */
.section-title {
    display: flex; justify-content: space-between; align-items: center;
    margin: 28px 0 16px; padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.section-title h2 {
    font-size: 0.95rem; font-weight: 700; letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 10px;
}
.section-title h2 i { color: var(--accent-light); font-size: 1.1rem; }
.section-title .count {
    font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--text-muted); letter-spacing: 0.5px;
}

/* === GAME GRID === */
.game-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 14px; padding-bottom: 30px;
}
.game-item {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px; text-align: center;
    position: relative; cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}
.game-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}
.game-item:active { transform: scale(0.97); }
.game-thumb {
    width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-md);
    object-fit: cover; margin-bottom: 10px;
    border: 1px solid var(--border-light);
}
.game-item .game-name {
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); letter-spacing: 0.5px;
}
.status-dot {
    position: absolute; top: 10px; right: 10px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger); border: 2px solid var(--bg-primary);
}
.game-item.active { border-color: var(--accent); }
.game-item.active .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}
.game-item.active .game-name { color: var(--accent-light); }
.game-tag {
    position: absolute; top: 8px; left: 8px;
    font-size: 0.6rem; font-weight: 700;
    padding: 3px 10px; border-radius: var(--radius-full);
    text-transform: uppercase; letter-spacing: 0.5px; z-index: 2;
}
.tag-hot { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.tag-new { background: var(--success-dim); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }

/* === SIDEBAR MENU === */
.menu-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); z-index: 2001; display: none;
}
.menu-sidebar {
    position: fixed; top: 0; left: -300px; width: 280px; height: 100vh;
    background: var(--bg-secondary); border-right: 1px solid var(--border);
    z-index: 2002; padding: 28px 18px;
    display: flex; flex-direction: column;
    transition: left 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
}
.menu-sidebar.active { left: 0; }
.menu-header {
    display: flex; align-items: center; gap: 14px;
    padding-bottom: 20px; border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.menu-header img {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    object-fit: cover; border: 2px solid var(--accent);
}
.menu-user h4 { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.menu-user p { color: var(--text-muted); font-size: 0.75rem; }
.menu-items { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.menu-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; border-radius: var(--radius-md);
    color: var(--text-secondary); text-decoration: none;
    font-weight: 500; font-size: 0.9rem;
    border: 1px solid transparent; transition: var(--transition);
}
.menu-item i { font-size: 16px; color: var(--accent-light); width: 22px; text-align: center; }
.menu-item:hover {
    background: var(--bg-hover); border-color: var(--border);
    color: var(--text-primary); transform: translateX(4px);
}
.menu-item.active {
    background: var(--accent-dim);
    border-left: 3px solid var(--accent);
    color: var(--accent-light);
}

/* === BOTTOM SHEET === */
.sheet {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: none; align-items: flex-end; justify-content: center;
    z-index: 3000;
}
.sheet.open { display: flex; }
.sheet-content {
    background: var(--bg-card-solid);
    width: 100%; max-width: 520px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px; border: 1px solid var(--border); border-bottom: none;
    animation: slideUp 0.35s ease;
}
.sheet-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.sheet-header h2 { font-size: 1rem; font-weight: 700; }
.close-icon {
    font-size: 1.3rem; color: var(--text-muted); cursor: pointer;
    transition: var(--transition); padding: 4px;
}
.close-icon:hover { color: var(--danger); }

/* === KEY CARD === */
.key-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px; margin: 16px 0;
    position: relative; overflow: hidden;
}
.key-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 2px; background: var(--accent-gradient);
}
.key-card .label {
    font-size: 0.7rem; font-weight: 600;
    letter-spacing: 2px; color: var(--text-muted);
    text-transform: uppercase; margin-bottom: 8px;
}
.key-card .value {
    font-family: var(--font-mono); font-size: 1.1rem;
    font-weight: 700; color: var(--accent-light);
    word-break: break-all;
}
.key-card.no-key .value { color: var(--danger); font-size: 0.95rem; }
.key-expiry {
    margin-top: 10px; font-size: 0.8rem;
    display: flex; align-items: center; gap: 6px;
}
.key-expiry.forever { color: var(--success); }

/* === TABS === */
.tab-row {
    display: flex; gap: 4px; margin-bottom: 24px;
    background: var(--bg-input); border-radius: var(--radius-md);
    padding: 4px;
}
.tab-btn {
    flex: 1; padding: 11px; border: none;
    background: transparent; font-family: var(--font-sans);
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.3px;
    color: var(--text-muted); cursor: pointer;
    border-radius: var(--radius-sm); transition: var(--transition);
}
.tab-btn.active {
    background: var(--accent-dim); color: var(--accent-light);
    box-shadow: var(--accent-glow);
}
.tab-btn:hover:not(.active) { color: var(--text-secondary); }

/* === CONTAINER === */
.container {
    max-width: 520px; margin: 0 auto; padding: 0 16px;
    position: relative; z-index: 10;
}

/* === AUTH WRAPPER (LOGIN/REGISTER) === */
.auth-wrap {
    position: relative; z-index: 10;
    width: 100%; max-width: 420px; padding: 20px;
}
.logo-area { text-align: center; margin-bottom: 32px; }
.logo-icon {
    width: 72px; height: 72px; border-radius: var(--radius-xl);
    background: var(--accent-gradient);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
    box-shadow: var(--shadow-glow);
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}
.logo-text {
    font-size: 1.3rem; font-weight: 800;
    letter-spacing: 2px; color: #fff;
}
.logo-sub {
    font-size: 0.75rem; color: var(--text-muted);
    letter-spacing: 1.5px; margin-top: 6px; text-transform: uppercase;
}
.auth-card {
    background: var(--bg-card); backdrop-filter: blur(24px);
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 28px 24px; position: relative; overflow: hidden;
}
.auth-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 2px; background: var(--accent-gradient);
}
.extras {
    display: flex; justify-content: space-between;
    align-items: center; margin: 8px 0 22px; font-size: 0.85rem;
}
.remember {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-secondary); cursor: pointer; font-weight: 500;
}
.remember input { accent-color: var(--accent); width: 16px; height: 16px; }
.forgot {
    color: var(--accent-light); text-decoration: none;
    font-weight: 600; font-size: 0.8rem; transition: var(--transition);
}
.forgot:hover { text-shadow: 0 0 10px rgba(99,102,241,0.3); }
.contact-link { text-align: center; margin-top: 24px; }
.contact-link a {
    color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
    transition: var(--transition);
}
.contact-link a:hover { color: var(--accent-light); }

/* === PREDICTION PANEL (GAME PAGES) === */
.pred-panel {
    flex-shrink: 0; height: 280px;
    background: var(--bg-card-solid);
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column;
    transition: height 0.3s ease;
    position: relative; overflow: hidden;
}
.pred-panel::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 2px; background: var(--accent-gradient);
}
.pred-panel.expanded { height: 55vh; }
.pred-panel.collapsed { height: 50px; }
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; cursor: pointer; flex-shrink: 0;
    background: rgba(15, 15, 26, 0.95);
    border-bottom: 1px solid var(--border);
}
.panel-header-left { display: flex; align-items: center; gap: 10px; }
.panel-title {
    font-size: 0.8rem; font-weight: 700;
    letter-spacing: 1px; color: var(--accent-light); text-transform: uppercase;
}
.panel-status {
    font-family: var(--font-mono); font-size: 0.65rem;
    padding: 3px 10px; border-radius: var(--radius-full);
    background: var(--success-dim); color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}
.panel-toggle {
    width: 30px; height: 30px; border-radius: var(--radius-sm);
    background: var(--accent-dim); border: 1px solid var(--border-accent);
    color: var(--accent-light); display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 12px; transition: var(--transition);
}
.panel-toggle:hover { background: rgba(99,102,241,0.25); }
.pred-content { flex: 1; overflow-y: auto; padding: 12px; }
.pred-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px;
    position: relative; overflow: hidden;
}
.pred-card::before {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0;
    width: 3px; background: var(--accent-gradient); border-radius: 3px;
}
.pred-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 8px;
}
.pred-row:last-child { margin-bottom: 0; }
.pred-label {
    font-size: 0.85rem; color: var(--text-secondary);
    display: flex; align-items: center; gap: 8px;
}
.pred-label i { font-size: 0.8rem; color: var(--accent-light); width: 16px; }
.pred-value { font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; }
.pred-value.session { color: var(--accent-light); }
.pred-value.result { font-size: 1.05rem; }
.pred-value.tai { color: var(--danger); text-shadow: 0 0 8px rgba(239,68,68,0.3); }
.pred-value.xiu { color: var(--success); text-shadow: 0 0 8px rgba(16,185,129,0.3); }
.pred-value.confidence { color: var(--warning); }
.conf-bar-wrap {
    width: 100%; height: 6px; background: rgba(255,255,255,0.05);
    border-radius: 3px; margin-top: 8px; overflow: hidden;
}
.conf-bar { height: 100%; border-radius: 3px; background: var(--accent-gradient); transition: width 0.5s ease; }
.history-title {
    font-size: 0.75rem; font-weight: 700; letter-spacing: 1px;
    color: var(--text-muted); text-transform: uppercase;
    margin: 16px 0 10px; display: flex; align-items: center; gap: 8px;
}
.history-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.history-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.history-item {
    padding: 8px 4px; border-radius: var(--radius-sm); text-align: center;
    font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700;
    border: 1px solid var(--border);
}
.history-item.h-tai { background: var(--danger-dim); color: var(--danger); border-color: rgba(239,68,68,0.2); }
.history-item.h-xiu { background: var(--success-dim); color: var(--success); border-color: rgba(16,185,129,0.2); }
.history-item .h-session { font-size: 0.55rem; color: var(--text-muted); display: block; margin-bottom: 2px; }

/* === GAME LAYOUT === */
.app-layout { display: flex; flex-direction: column; height: 100vh; }
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.game-frame-wrap { flex: 1; position: relative; overflow: hidden; transition: flex 0.3s ease; }
.game-frame-wrap.minimized { flex: 0.4; }
.game-iframe { width: 100%; height: 100%; border: none; background: #000; }
.game-title { font-size: 0.85rem; font-weight: 700; color: var(--accent-light); letter-spacing: 1px; }
.game-subtitle { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.5px; }
.mode-btn {
    padding: 7px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: transparent;
    color: var(--text-muted); font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.5px; cursor: pointer; transition: var(--transition);
}
.mode-btn.active {
    background: var(--accent-dim); border-color: var(--accent);
    color: var(--accent-light); box-shadow: var(--accent-glow);
}
.mode-btn:hover { border-color: var(--border-accent); color: var(--text-secondary); }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.35); }

/* === ANIMATIONS === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.fa-rotate { animation: spin 1s linear infinite; }
.form-hidden { display: none; }

/* === PRICING GRID (muakey) === */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px; text-align: center;
    cursor: pointer; transition: var(--transition);
    position: relative; overflow: hidden;
}
.pricing-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}
.pricing-card.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.pricing-card .price {
    font-size: 1.2rem; font-weight: 800;
    color: var(--accent-light); margin: 8px 0 4px;
}
.pricing-card .duration {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-primary);
}
.pricing-card .desc {
    font-size: 0.75rem; color: var(--text-muted);
    margin-top: 4px;
}

/* === DATA TABLE === */
.data-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th {
    padding: 12px 16px; text-align: left;
    background: var(--bg-secondary); color: var(--text-secondary);
    font-weight: 600; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}
.data-table tr:hover td { background: var(--bg-hover); }

/* === BADGE === */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: var(--radius-full);
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.3px;
}
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-info { background: var(--info-dim); color: var(--info); }
.badge-accent { background: var(--accent-dim); color: var(--accent-light); }

/* === STATS CARDS === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px; text-align: center;
}
.stat-card .stat-value {
    font-size: 1.5rem; font-weight: 800;
    color: var(--accent-light);
    font-family: var(--font-mono);
}
.stat-card .stat-label {
    font-size: 0.75rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-top: 4px;
}

/* === RESPONSIVE === */
@media (min-width: 768px) {
    .main-area { flex-direction: row; }
    .pred-panel {
        width: 360px; height: auto;
        border-top: none; border-left: 1px solid var(--border);
    }
    .pred-panel::before { top: 0; left: 0; right: auto; bottom: 0; width: 2px; height: auto; }
    .pred-panel.expanded { width: 50vw; }
    .pred-panel.collapsed { width: 50px; }
    .game-frame-wrap.minimized { flex: 1; }
}
@media (max-width: 480px) {
    .pred-panel { height: 240px; }
    .balance-badge { padding: 6px 12px; font-size: 0.8rem; }
    .user-info .name { font-size: 0.8rem; }
    .hero-banner h3 { font-size: 1.2rem; }
    .hero-banner { padding: 22px 18px; }
    .auth-card { padding: 22px 18px; }
    .logo-text { font-size: 1.1rem; }
    .pricing-grid { grid-template-columns: 1fr; }
}

/* === UTILITIES === */
.text-accent { color: var(--accent-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.font-mono { font-family: var(--font-mono); }

/* ============================================
   iOS 26 SPECIFIC FIXES
   ============================================ */

/* iOS Safe Area - Bottom Navigation */
.bottom-nav,
.fixed-bottom {
    padding-bottom: calc(16px + var(--safe-bottom));
}

/* iOS Scroll Container Fix */
.scroll-container,
.main-content,
.content-wrapper {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

/* iOS Input Styling */
input, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: var(--radius-md);
}

/* iOS Touch Feedback */
.btn, .card, .menu-item, .key-card, .game-card {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* iOS Active State */
@media (hover: none) {
    .btn:active,
    .card:active,
    .menu-item:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* iOS Momentum Scrolling */
.scrollable {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* iOS Notch/Dynamic Island Fix */
@supports (padding-top: env(safe-area-inset-top)) {
    .top-bar,
    .header,
    .navbar {
        padding-top: max(12px, env(safe-area-inset-top));
    }
    
    .bottom-bar,
    .footer,
    .tab-bar {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .fullscreen-modal,
    .sheet-content {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* iOS Landscape Mode */
@media (orientation: landscape) and (max-height: 500px) {
    .top-bar {
        padding: 8px 16px;
        padding-left: calc(16px + var(--safe-left));
        padding-right: calc(16px + var(--safe-right));
    }
    
    .pred-panel {
        top: 60px;
        max-height: calc(100dvh - 80px);
    }
}

/* iOS PWA Standalone Mode */
@media (display-mode: standalone) {
    body {
        padding-top: var(--safe-top);
    }
    
    .top-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }
    
    .main-area {
        padding-top: calc(60px + var(--safe-top));
    }
}

/* iOS Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
    
    .glass {
        background: rgba(22, 22, 37, 0.85);
    }
}

/* iOS Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* iOS High Contrast */
@media (prefers-contrast: high) {
    :root {
        --border: rgba(99, 102, 241, 0.3);
        --text-primary: #ffffff;
        --text-secondary: #d1d5db;
    }
}

/* iOS Font Size Accessibility */
@supports (font: -apple-system-body) {
    body {
        font: -apple-system-body;
        font-family: var(--font-sans);
    }
}

/* Prevent iOS rubber-band effect on fixed elements */
.fixed-element {
    position: fixed;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* iOS iframe scroll fix */
iframe {
    -webkit-overflow-scrolling: touch;
    overflow: auto;
}

/* Game frame iOS fix */
.game-iframe {
    width: 100%;
    height: 100%;
    height: 100dvh;
    border: none;
    -webkit-overflow-scrolling: touch;
}

.game-frame-wrap {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
}