* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #14151f;
    --bg-secondary: #1b1c28;
    --bg-tertiary: #242533;
    --bg-card: #1f2029;
    --text-primary: #e8e9f0;
    --text-secondary: #9a9bb0;
    --text-muted: #6b6c80;
    --accent: #7c8aff;
    --accent-hover: #9aa4ff;
    --accent-glow: rgba(124, 138, 255, 0.12);
    --border: #2e2f3d;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --code-bg: #1b1c28;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.logo {
    width: 36px;
    height: 36px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

/* Container */
.container {
    display: flex;
    margin-top: 65px;
    min-height: calc(100vh - 65px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1rem;
    position: fixed;
    top: 65px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 1.25rem;
}

.sidebar-section h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

/* Game Selector */
.game-selector {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.game-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    font-weight: 500;
}

.game-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--accent-glow);
}

.game-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.game-btn.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.game-btn.coming-soon:hover {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    background: rgba(124, 138, 255, 0.15);
    color: var(--accent);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}


/* Category Navigation */
.category-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}

.category-item {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.category-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

/* Search */
.search-box {
    margin-bottom: 0.75rem;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Method Navigation */
.method-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 250px;
    overflow-y: auto;
}

.method-item {
    padding: 0.4rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8rem;
    font-family: 'Monaco', 'Consolas', monospace;
}

.method-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.method-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

/* Main Content */
.content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem 3rem;
    max-width: 900px;
}

.content-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.content-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.content-header p {
    color: var(--text-secondary);
}

/* Welcome Card */
.welcome-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.welcome-card h2 {
    margin-bottom: 1rem;
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.quick-start h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Method Card */
.method-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.method-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.method-name {
    font-size: 1.5rem;
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--accent);
}



.method-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Syntax Block */
.syntax-block {
    margin-bottom: 1.5rem;
}

.syntax-block h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    border: 1px solid var(--border);
}

code {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Parameters Table */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.params-table th,
.params-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.params-table th {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.params-table td {
    font-size: 0.9rem;
}

.param-name {
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--accent);
}

.param-type {
    color: var(--warning);
    font-size: 0.85rem;
}

.param-required {
    color: var(--error);
    font-size: 0.75rem;
}

.param-optional {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Returns Section */
.returns-block {
    margin-bottom: 1.5rem;
}

.return-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--success);
    color: white;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* Example Section */
.example-block {
    margin-bottom: 1.5rem;
}

.example-block h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

/* Examples Page */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.example-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.example-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.example-icon {
    font-size: 1.5rem;
}

.example-card-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.example-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.example-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.6rem;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Example Detail Page */
.example-detail {
    max-width: 900px;
}

.back-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent);
}

.example-info {
    margin-bottom: 1.5rem;
}

.example-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.example-section h3 {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.example-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.api-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.api-list li {
    background: var(--bg-tertiary);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
}

.api-list code {
    color: var(--accent);
    font-size: 0.85rem;
}

/* Nav Tab Active State */
.nav-tab {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--accent);
}


/* Sidebar Tabs */
.sidebar-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 4px;
}

.sidebar-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-tab:hover {
    color: var(--text-primary);
}

.sidebar-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 138, 255, 0.3);
}

.sidebar-tab .tab-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.sidebar-tab:hover .tab-icon {
    opacity: 0.8;
}

.sidebar-tab.active .tab-icon {
    opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 0 0 0;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--accent), #6b7aee);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn svg {
    width: 14px;
    height: 14px;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 138, 255, 0.4);
}

/* Examples Nav in Sidebar */
.examples-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.example-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.85rem;
}

.example-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.example-nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

/* Welcome Page Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.quick-link-icon {
    font-size: 1.5rem;
}

.quick-link-text h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.quick-link-text p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Fix sidebar to be flex column */
.sidebar {
    display: flex;
    flex-direction: column;
}
