:root {
    --bg-base: #0a0c10;
    --bg-panel: #12151c;
    --bg-hover: #1a1e28;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-green-bg: rgba(16, 185, 129, 0.1);
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --font-ui: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; font-family: inherit; cursor: pointer; }

/* Header */
header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 12, 16, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px; height: 72px;
    display: flex; align-items: center; justify-content: space-between;
}

.logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.logo i { color: var(--accent-green); }

.search-bar {
    display: flex; align-items: center;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 8px; padding: 0 16px; width: 350px; height: 40px;
}
.search-bar i { color: var(--text-muted); margin-right: 10px; }
.search-bar input { background: transparent; border: none; outline: none; color: #fff; width: 100%; }

/* Main Layout */
.container { max-width: 1300px; margin: 0 auto; padding: 32px; flex: 1; width: 100%; }

/* Hero */
.game-hero {
    position: relative; border-radius: 16px; overflow: hidden;
    background: var(--bg-panel); border: 1px solid var(--border);
    display: flex; align-items: center; padding: 40px; margin-bottom: 32px;
}
.game-hero-bg {
    position: absolute; inset: 0;
    background-image: url('https://images.igdb.com/igdb/image/upload/t_1080p/ar4t2.webp');
    background-size: cover; background-position: center 20%; opacity: 0.15; z-index: 0;
}
.game-hero-content { position: relative; z-index: 1; display: flex; gap: 32px; align-items: center; width: 100%; }
.game-cover { width: 160px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.game-info h1 { font-family: var(--font-display); font-size: 2.5rem; margin-bottom: 8px; }
.game-tags { display: flex; gap: 8px; margin-bottom: 16px; }
.tag { background: rgba(255,255,255,0.1); padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }
.game-meta { color: var(--text-muted); font-size: 0.9rem; display: flex; gap: 16px; }

/* Grid */
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.panel-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }

/* Deal Box */
.deal-rating-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 12px;
    padding: 20px; display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
}
.deal-icon {
    width: 48px; height: 48px; background: var(--accent-green); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff; box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}
.deal-text h3 { color: var(--accent-green); font-size: 1.1rem; margin-bottom: 4px; }
.deal-text p { color: var(--text-muted); font-size: 0.9rem; }
.chart-container { position: relative; height: 250px; width: 100%; }

/* Safe Mode */
.safe-mode-wrapper {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px 16px; margin-bottom: 24px;
}
.safe-mode-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.safe-mode-label i { color: var(--accent-green); }
.switch { position: relative; display: inline-block; width: 48px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-base); border: 1px solid var(--border);
    transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px;
    left: 3px; bottom: 3px; background-color: var(--text-muted);
    transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-green); border-color: var(--accent-green); }
input:checked + .slider:before { transform: translateX(24px); background-color: #fff; }

/* Store List */
.store-list { display: flex; flex-direction: column; gap: 12px; }
.store-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-base); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px 20px; transition: all 0.2s;
}
.store-row:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.store-row.grey-market { display: none; }
.store-info { display: flex; align-items: center; gap: 16px; }
.store-icon {
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.2rem; color: #fff;
}
.bg-steam { background: #171a21; border: 1px solid #66c0f4; color: #66c0f4; }
.bg-gog { background: #000; border: 1px solid #8a2be2; color: #8a2be2; }
.bg-fanatical { background: #fa7920; }
.bg-g2a { background: #ef4444; }
.bg-kinguin { background: #ff9900; color: #000; }
.store-name { font-weight: 600; font-size: 1rem; }
.store-region { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 2px;}
.warning-icon { color: var(--accent-red); font-size: 0.8rem; margin-left: 4px; cursor: help; }
.store-price-action { display: flex; align-items: center; gap: 20px; }
.price-block { text-align: right; }
.price-block .current { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--accent-green); }
.price-block .old { font-size: 0.8rem; color: var(--text-muted); text-decoration: line-through; }
.btn-buy {
    background: var(--accent-blue); color: #fff;
    padding: 8px 20px; border-radius: 6px; font-weight: 600; font-size: 0.9rem; transition: background 0.2s;
}
.btn-buy:hover { background: #2563eb; }
.btn-buy.grey-btn { background: var(--bg-panel); border: 1px solid var(--border); color: var(--text-main); }
.btn-buy.grey-btn:hover { border-color: var(--text-muted); }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px; text-align: center; color: var(--text-muted); font-size: 0.9rem; background: var(--bg-panel); margin-top: auto; }
footer a { color: var(--text-main); margin: 0 10px; transition: color 0.2s; }
footer a:hover { color: var(--accent-blue); }

/* Legal Pages */
.legal-content { max-width: 800px; margin: 0 auto; background: var(--bg-panel); padding: 40px; border-radius: 16px; border: 1px solid var(--border); }
.legal-content h1 { font-family: var(--font-display); margin-bottom: 24px; font-size: 2rem; }
.legal-content p { margin-bottom: 16px; color: var(--text-muted); line-height: 1.7; }

@media (max-width: 992px) {
    .content-grid { grid-template-columns: 1fr; }
    .game-hero-content { flex-direction: column; text-align: center; }
    .game-hero { padding: 24px; }
}
@media (max-width: 768px) {
    header { flex-direction: column; height: auto; padding: 16px; gap: 16px; }
    .search-bar { width: 100%; }
    .container { padding: 16px; }
    .game-cover { width: 120px; }
    .game-info h1 { font-size: 1.8rem; }
    .store-row { flex-direction: column; align-items: flex-start; gap: 16px; }
    .store-price-action { width: 100%; justify-content: space-between; }
}