/**
 * Extracted from inline <style> in index.php
 */
:root {
    --bg-body: #121212;
    --bg-surface: #1e1e1e;
    --bg-panel: #232323;
    --text-primary: #f5f5f5;
    --text-secondary: #b5b5b5;
    --text-muted: #7a7a7a;
    --border-color: #2d2d2d;
    --accent: #22c55e;
    --accent-muted: rgba(34, 197, 94, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

header { text-align: center; margin-bottom: 40px; }

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

header h4 {
    margin-top: 8px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 1rem;
}

header h4 a { color: var(--accent); font-weight: 600; }

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
}

.search-box form { display: flex; flex-direction: column; gap: 16px; }

.search-box input[type="text"] {
    width: 100%;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    background: #262626;
}

.search-box button {
    border: none;
    border-radius: 10px;
    padding: 18px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent);
    color: #0f0f0f;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-box button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.2);
}

.stats {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 32px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.stats strong { color: var(--text-primary); font-weight: 600; }

.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section .count {
    background: var(--accent-muted);
    color: var(--accent);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

ul {
    list-style: none;
    max-height: 520px;
    overflow-y: auto;
}

ul::-webkit-scrollbar { width: 6px; }
ul::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 3px; }

li {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

li:hover { border-color: var(--accent); background: #272727; }

li.grade-5 { border-left: 4px solid #059669; cursor: pointer;}
li.grade-4 { border-left: 4px solid #10b981; cursor: pointer;}
li.grade-3 { border-left: 4px solid #34d399; cursor: pointer;}
li.grade-2 { border-left: 4px solid #f59e0b; cursor: pointer;}
li.grade-1 { border-left: 4px solid #f97316; cursor: pointer;}

.highlight { font-weight: 600; color: var(--text-primary); }

.word-info { display: flex; gap: 10px; font-size: 0.85rem; color: var(--text-muted); }

.grade-badge {
    background: var(--accent-muted);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
}

.not-found {
    background: var(--bg-panel);
    border: 1px solid #ef4444;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
}

.not-found h2 { color: #f87171; margin-bottom: 12px; }
.not-found a {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.9rem;
    color: var(--accent);
}

.random-list li {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 14px;
    margin: 4px;
    display: inline-block;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.random-list li:hover { background: var(--accent); color: #0f0f0f; }

.about-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    margin-top: 32px;
}

.about-section h2 { font-size: 1.4rem; margin-bottom: 16px; color: var(--text-primary); }
.about-section p { color: var(--text-secondary); font-size: 1rem; margin-bottom: 12px; }

footer {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a { color: var(--accent); font-weight: 600; }

@media (max-width: 640px) {
    .panel, .section, .about-section { padding: 20px; }
    header h1 { font-size: 2rem; }
    .search-box input[type="text"] { padding: 16px 18px; }
    .search-box button { padding: 14px; }
    .word-info { flex-direction: column; align-items: flex-end; }
}
