/* ── Reset & Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ── Screens ─────────────────────────────────────────── */
.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Login ───────────────────────────────────────────── */
#login-screen {
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 { font-size: 24px; margin-bottom: 8px; }
.subtitle { color: var(--text-dim); margin-bottom: 24px; }

#login-form { display: flex; flex-direction: column; gap: 12px; }

input, select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus { border-color: var(--accent); }

button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover { opacity: 0.85; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.error { color: var(--red); margin-top: 12px; font-size: 13px; min-height: 20px; }

/* ── Header ──────────────────────────────────────────── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

header h1 { font-size: 20px; }
.header-right { display: flex; align-items: center; gap: 16px; }
#user-info { color: var(--text-dim); font-size: 13px; }

/* ── Main ────────────────────────────────────────────── */
main {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.panel h2 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text);
}

/* ── Form ────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.form-group select,
.form-group input[type="number"] {
    width: 100%;
    max-width: 300px;
}

.hint {
    font-size: 12px;
    color: var(--yellow);
    margin-top: 6px;
}

.form-actions { display: flex; gap: 12px; margin-top: 16px; }

/* ── Stats ───────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-card.found .stat-value { color: var(--green); }
.stat-card.failed .stat-value { color: var(--red); }
.stat-card.speed .stat-value { color: var(--accent); }

.status-line {
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
    min-height: 20px;
}

.ban-message {
    margin-top: 12px;
    padding: 12px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    text-align: center;
    color: var(--red);
    font-weight: 600;
}

/* ── Found List ──────────────────────────────────────── */
.badge {
    background: var(--green);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.found-list {
    max-height: 400px;
    overflow-y: auto;
}

.empty {
    color: var(--text-dim);
    text-align: center;
    padding: 40px;
}

.found-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--green);
    border-radius: var(--radius);
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.found-item .id-text {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: var(--green);
}

.found-item a {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
}

.found-item a:hover { text-decoration: underline; }

.found-item .copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
}

.found-item .copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
