/* CW Rust Remover - style.css */

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

:root {
    --bg:       #1a1a1a;
    --surface:  #242424;
    --border:   #3a3a3a;
    --text:     #e0e0e0;
    --muted:    #888;
    --accent:   #4a9eff;
    --accent-h: #6ab4ff;
    --error-bg: #3a1a1a;
    --error:    #ff6b6b;
    --success:  #4a9eff;
    --radius:   6px;
    --max-w:    640px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* Header */
header { text-align: center; margin-bottom: 2.5rem; }
header h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
header .tagline { color: var(--muted); margin-top: 0.35rem; font-size: 0.95rem; }

/* Sections */
.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.section h2 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

/* Fields */
.fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}
.field .hint { font-size: 0.78rem; color: var(--muted); }

input[type="text"],
select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    transition: border-color 0.15s;
}
input[type="text"]:focus,
select:focus {
    border-color: var(--accent);
    outline: none;
}
select { cursor: pointer; }

/* Privacy notice */
.privacy-notice {
    font-size: 0.8rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}
.privacy-notice strong { color: var(--text); }

/* Actions */
.actions { display: flex; justify-content: center; }
button[type="submit"] {
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 2.5rem;
    transition: background 0.15s;
    width: 100%;
}
button[type="submit"]:hover { background: var(--accent-h); }
button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* Status / spinner */
.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 0;
    color: var(--muted);
    font-size: 1rem;
}
.spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Player */
.player {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}
.player h2 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}
audio {
    width: 100%;
    margin-bottom: 1rem;
    accent-color: var(--accent);
}
.player-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.download-btn {
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--accent);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.download-btn:hover { background: var(--accent); color: #fff; }
.new-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: border-color 0.15s, color 0.15s;
}
.new-btn:hover { border-color: var(--text); color: var(--text); }

/* Error */
.error {
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    text-align: center;
}
.error p { color: var(--error); margin-bottom: 1rem; }
.error button {
    background: transparent;
    border: 1px solid var(--error);
    border-radius: var(--radius);
    color: var(--error);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.4rem 1.25rem;
    transition: background 0.15s, color 0.15s;
}
.error button:hover { background: var(--error); color: #fff; }







/* Copy scoring section */
.copy-score-section {
    margin: 1rem 0 0.5rem;
    text-align: left;
}
.copy-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.copy-textarea {
    width: 100%;
    min-height: 90px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.6rem 0.75rem;
    resize: vertical;
    transition: border-color 0.15s;
}
.copy-textarea:focus {
    border-color: var(--accent);
    outline: none;
}
.copy-actions {
    margin-top: 0.5rem;
    text-align: center;
}
.score-btn {
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--accent);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: background 0.15s, color 0.15s;
}
.score-btn:hover { background: var(--accent); color: #fff; }


/* Per-speed breakdown table */
.score-by-speed {
    margin-top: 0.5rem;
}
.speed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-family: "Courier New", Courier, monospace;
}
.speed-table th {
    color: var(--muted);
    font-weight: 500;
    text-align: left;
    padding: 0.2rem 0.5rem 0.3rem 0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.speed-table td {
    color: var(--text);
    padding: 0.2rem 0.5rem 0.2rem 0;
}
.speed-table tr:first-child td { padding-top: 0.4rem; }

/* Score results */
.score-results {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--bg);
}
.score-header {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
    text-align: center;
}
.score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.score-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-align: center;
}
.score-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.25rem;
}
.score-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.score-missed {
    margin-top: 0.5rem;
}
.score-missed-title {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.score-missed-list {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
}
.missed-item {
    color: var(--text);
    padding: 0.1rem 0;
    letter-spacing: 0.05em;
}

/* About / explanation section */
.about-section {
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.support-link {
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}
.support-link:hover { color: var(--accent); }

.about-toggle {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0;
    text-align: left;
    width: 100%;
    transition: color 0.15s;
}
.about-toggle:hover { color: var(--text); }
#aboutContent {
    margin-top: 0.75rem;
}
.about-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}
.about-block h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.6rem;
}
.about-block p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.about-block p:last-child { margin-bottom: 0; }
.about-block ul {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
    padding-left: 1.25rem;
}
.about-block ul li { margin-bottom: 0.35rem; }
.about-block ul li:last-child { margin-bottom: 0; }


/* Speed label in player heading */
.speed-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0.03em;
    text-transform: none;
}

/* Text reveal */
.text-reveal {
    margin: 1rem 0 0.5rem;
    text-align: center;
}
.text-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 1.25rem;
    transition: border-color 0.15s, color 0.15s;
}
.text-toggle-btn:hover { border-color: var(--text); color: var(--text); }
.practice-text {
    margin-top: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: left;
    max-height: 500px;
    overflow-y: auto;
}
.practice-text pre {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    line-height: 1.6;
}

/* Radio button group */
.radio-group { gap: 0.5rem; }
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem 0;
}
.radio-label input[type="radio"] {
    width: auto;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--muted);
    font-size: 0.8rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 480px) {
    .fields { grid-template-columns: 1fr; }
    header h1 { font-size: 1.5rem; }
}
