/* Flash — standalone SRS module. v0.1 scaffold. */

:root {
    --bg: #0f1419;
    --surface: #1a2028;
    --surface-2: #232b35;
    --text: #e6edf3;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --good: #3fb950;
    --bad: #f85149;
    --warn: #d29922;
    --border: #30363d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Noto Sans JP', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.flash-app { max-width: 960px; margin: 0 auto; padding: 1rem; }

.flash-header {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.5rem 0 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
}
.flash-header h1 { margin: 0; font-size: 1.5rem; flex: 1; }
.flash-back { color: var(--text-dim); text-decoration: none; }
.flash-back:hover { color: var(--accent); }

.flash-nav { display: flex; gap: 0.25rem; }
.flash-nav-btn {
    background: transparent; color: var(--text-dim); border: 1px solid var(--border);
    padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem;
}
.flash-nav-btn.active { background: var(--surface-2); color: var(--text); border-color: var(--accent); }

.flash-view { display: none; }
.flash-view.active { display: block; }

/* Dashboard */
.brain-metric { text-align: center; padding: 2rem 1rem; }
.brain-value { font-size: 4rem; font-weight: 700; color: var(--accent); }
.brain-label { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.85rem; }

.dashboard-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.dashboard-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem;
}
.dashboard-card h3 { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--text-dim); }

/* Stage columns */
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stage {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 1rem; display: flex; flex-direction: column;
    align-items: center;
}
.stage-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.1rem; }
.stage-frac { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.75rem; }
.column {
    position: relative; width: 100%; max-width: 90px;
    aspect-ratio: 1 / 3; background: #0a0e14; border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
}
.cell {
    position: absolute; left: 0; right: 0;
    transition: background 0.3s ease, opacity 0.3s ease;
}
.cell:hover { outline: 1px solid #fff; z-index: 2; }
.level-meter {
    width: 100%; max-width: 90px; height: 4px; background: var(--border);
    border-radius: 2px; margin-top: 0.6rem; overflow: hidden;
}
.level-meter > div {
    height: 100%; background: linear-gradient(90deg, #3fb950, #58a6ff);
    transition: width 0.4s ease;
}
.level-pct { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.3rem; }

.legend {
    display: flex; gap: 1.5rem; margin-bottom: 1.5rem; font-size: 0.85rem;
    color: var(--text-dim); align-items: center; flex-wrap: wrap;
}
.swatch {
    display: inline-block; width: 14px; height: 14px; border-radius: 3px;
    vertical-align: middle; margin-right: 0.4rem;
}
.ramp {
    display: inline-flex; height: 14px; width: 140px; border-radius: 3px;
    overflow: hidden; border: 1px solid var(--border); vertical-align: middle;
}
.ramp > span { flex: 1; }

.flash-tooltip {
    position: fixed; pointer-events: none; background: rgba(0,0,0,0.9);
    border: 1px solid var(--border); padding: 0.4rem 0.6rem; border-radius: 4px;
    font-size: 0.8rem; display: none; z-index: 10;
}

.activity-grid { display: grid; grid-template-columns: repeat(26, 1fr); gap: 2px; }
.activity-cell { aspect-ratio: 1; background: var(--surface-2); border-radius: 2px; }
.activity-cell.lvl-1 { background: #0e4429; }
.activity-cell.lvl-2 { background: #006d32; }
.activity-cell.lvl-3 { background: #26a641; }
.activity-cell.lvl-4 { background: #39d353; }

.queue-stats { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; color: var(--text-dim); }
.queue-stats span { color: var(--text); font-weight: 700; }

.primary-btn {
    background: var(--accent); color: #0d1117; border: none; padding: 0.7rem 1rem;
    border-radius: 6px; font-weight: 700; cursor: pointer; width: 100%;
}

/* Card */
.card-stage { padding: 2rem 0; min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.card-empty { color: var(--text-dim); text-align: center; }
.card-empty button { margin-left: 0.5rem; }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 2rem; width: 100%; max-width: 500px; touch-action: none; user-select: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.card-front { text-align: center; }
.card-kanji { font-size: 4rem; font-weight: 700; margin-bottom: 0.5rem; }
.card-kanji ruby rt { font-size: 0.4em; color: var(--text-dim); }
.card-furigana { color: var(--text-dim); margin-bottom: 2rem; }

.card-actions { display: flex; gap: 1rem; justify-content: center; }
.recall-btn {
    padding: 0.7rem 1.5rem; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 1rem;
}
.recall-btn.forgot:hover { border-color: var(--bad); color: var(--bad); }
.recall-btn.known:hover { border-color: var(--good); color: var(--good); }

.card-back { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.back-meaning { font-size: 1.4rem; margin-bottom: 0.5rem; }
.back-meta { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1rem; }
.back-example { background: var(--surface-2); padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; }
.swipe-hint { text-align: center; color: var(--text-dim); font-size: 0.85rem; }

/* Settings */
.settings-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 1rem; margin-bottom: 1rem;
}
.settings-card h3 { margin-top: 0; }
.settings-card button {
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
    padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; margin-right: 0.5rem;
}
.settings-card button.danger { border-color: var(--bad); color: var(--bad); }
.settings-row { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.settings-row input { accent-color: var(--accent); }
