:root {
    --bg-dark: #0a0b0f;
    --bg-card: rgba(18, 20, 28, 0.95);
    --bg-input: rgba(25, 28, 40, 0.9);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-dim: #9ca3af;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --success: #10b981;
    --error: #ef4444;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg-dark); color: var(--text); min-height: 100vh; }

.bg-gradient {
    position: fixed; inset: 0; z-index: -2;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.12), transparent);
}
.bg-grid {
    position: fixed; inset: 0; z-index: -1;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

.container { max-width: 700px; margin: 0 auto; padding: 2rem 1rem; }

/* Header */
.header { text-align: center; margin-bottom: 2rem; }
.logo { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.logo-icon { font-size: 2.5rem; }
.logo-text h1 { font-size: 1.5rem; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.badge { padding: 0.15rem 0.5rem; background: rgba(99,102,241,0.2); border: 1px solid rgba(99,102,241,0.3); border-radius: 999px; font-size: 0.6rem; font-weight: 600; color: var(--accent); text-transform: uppercase; }
.subtitle { color: var(--text-dim); font-size: 0.95rem; }
.author-credit { margin-top: 0.4rem; font-size: 0.8rem; color: var(--text-muted); }
.author-name { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 600; }

/* Glass Card */
.glass-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }

/* Search */
.search-box { display: flex; gap: 0.75rem; }
.search-box input {
    flex: 1; padding: 0.9rem 1rem; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-size: 1rem; transition: all 0.2s;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box button {
    padding: 0 1.5rem; background: var(--gradient); border: none;
    border-radius: var(--radius); color: white; font-size: 0.95rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s; position: relative;
}
.search-box button:hover { box-shadow: 0 0 25px rgba(99,102,241,0.4); }
.search-box button.loading .btn-text { opacity: 0; }
.search-box button.loading .btn-loader { opacity: 1; }
.btn-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; }
.btn-loader::after { content: ''; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.search-hint { margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.search-hint a { color: var(--accent); text-decoration: none; }

/* Loading */
.loading-section { display: none; text-align: center; padding: 2rem; }
.loading-section.visible { display: block; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 1rem; }
#loadingText { color: var(--text-dim); }

/* Game Section */
.game-section { display: none; }
.game-section.visible { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } }
.game-header { display: flex; gap: 1rem; align-items: center; }
#gameImage { width: 180px; height: 85px; border-radius: 8px; object-fit: cover; background: #1a1a2e; }
.game-info h2 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.game-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-dim); }

/* Output */
.output-section { display: none; }
.output-section.visible { display: block; animation: fadeIn 0.3s; }
.output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-weight: 500; }
.output-actions { display: flex; gap: 0.5rem; }
.btn-action { padding: 0.5rem 1rem; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.85rem; cursor: pointer; transition: all 0.2s; }
.btn-action:hover { background: rgba(255,255,255,0.1); }
.btn-action.primary { background: var(--gradient); border: none; }
.code-output { background: rgba(0,0,0,0.4); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; line-height: 1.7; color: #e0e0e0; max-height: 300px; overflow: auto; white-space: pre-wrap; }

/* Footer */
.footer { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.8rem; }

/* Toast */
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px); padding: 0.75rem 1.5rem; background: var(--success); border-radius: var(--radius); color: white; font-weight: 500; opacity: 0; transition: all 0.3s; z-index: 1000; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--error); }

@media (max-width: 600px) {
    .search-box { flex-direction: column; }
    .search-box button { padding: 0.9rem; }
    .game-header { flex-direction: column; text-align: center; }
}
