/* fktds.css — FKT Difficulty Scorer */

.fktds-wrap {
    font-family: 'Georgia', serif;
    max-width: 760px;
    margin: 2rem auto;
    color: #1a1a1a;
}

/* ── Upload zone ── */

.fktds-upload-zone {
    border: 2px dashed #b0a090;
    border-radius: 6px;
    padding: 3rem 2rem;
    text-align: center;
    background: #faf8f5;
    transition: border-color .2s, background .2s;
    cursor: pointer;
}

.fktds-upload-zone.drag-over {
    border-color: #4a3728;
    background: #f0ebe3;
}

.fktds-upload-icon {
    font-size: 3rem;
    line-height: 1;
    color: #7a6555;
    margin-bottom: .5rem;
}

.fktds-upload-title {
    font-size: 1.15rem;
    font-weight: bold;
    margin: 0 0 .25rem;
}

.fktds-upload-or {
    color: #888;
    margin: .25rem 0;
    font-size: .9rem;
}

.fktds-upload-hint {
    font-size: .8rem;
    color: #999;
    margin: .75rem 0 0;
}

.fktds-btn {
    display: inline-block;
    padding: .5rem 1.4rem;
    background: #4a3728;
    color: #fff !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: .9rem;
    font-family: inherit;
    border: none;
    text-decoration: none;
    transition: background .15s;
}

.fktds-btn:hover {
    background: #2e2018;
}

/* ── Progress ── */

.fktds-progress {
    text-align: center;
    padding: 2rem 1rem;
}

.fktds-bar-track {
    height: 6px;
    background: #e0d8ce;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.fktds-bar {
    height: 100%;
    width: 0%;
    background: #4a3728;
    border-radius: 3px;
    transition: width .3s ease;
    animation: fktds-pulse 1.4s ease-in-out infinite;
}

@keyframes fktds-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .55; }
}

.fktds-progress-label {
    font-size: .9rem;
    color: #666;
    margin: 0;
}

/* ── Error ── */

.fktds-error {
    background: #fdf0f0;
    border-left: 4px solid #c0392b;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    color: #7b241c;
    font-size: .95rem;
}

/* ── Results ── */

.fktds-results-inner {
    border: 1px solid #d8cfc4;
    border-radius: 6px;
    overflow: hidden;
}

/* Score header */

.fktds-score-header {
    background: #4a3728;
    color: #fff;
    padding: 1.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.fktds-score-number {
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 1;
    letter-spacing: -.02em;
}

.fktds-score-meta {
    flex: 1;
}

.fktds-score-label {
    font-size: 1.4rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.fktds-score-subtitle {
    font-size: .85rem;
    opacity: .75;
    margin-top: .2rem;
}

/* Sections */

.fktds-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e8e0d6;
}

.fktds-section:last-child {
    border-bottom: none;
}

.fktds-section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7a6555;
    margin: 0 0 1rem;
    font-family: sans-serif;
}

/* Stats grid */

.fktds-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .75rem 1.5rem;
}

.fktds-stat-item {
    display: flex;
    flex-direction: column;
}

.fktds-stat-label {
    font-size: .75rem;
    color: #888;
    font-family: sans-serif;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.fktds-stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: .1rem;
}

/* Grade distribution bars */

.fktds-dist-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
    font-size: .85rem;
    font-family: sans-serif;
}

.fktds-dist-label {
    width: 110px;
    text-align: right;
    color: #555;
    flex-shrink: 0;
}

.fktds-dist-track {
    flex: 1;
    height: 10px;
    background: #ede7de;
    border-radius: 5px;
    overflow: hidden;
}

.fktds-dist-fill {
    height: 100%;
    border-radius: 5px;
    background: #4a3728;
    transition: width .4s ease;
}

/* colour: uphill bands are warm, downhill are cool */
.fktds-dist-fill.uphill   { background: #7a4030; }
.fktds-dist-fill.downhill { background: #2e5070; }
.fktds-dist-fill.flat     { background: #6a7a50; }

.fktds-dist-pct {
    width: 42px;
    text-align: right;
    color: #444;
    flex-shrink: 0;
}

/* Score breakdown */

.fktds-breakdown {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .4rem 1rem;
    font-size: .95rem;
    font-family: sans-serif;
}

.fktds-breakdown-label { color: #333; }
.fktds-breakdown-value { font-weight: bold; text-align: right; font-variant-numeric: tabular-nums; }
.fktds-breakdown-divider {
    grid-column: 1 / -1;
    border: none;
    border-top: 1px solid #d8cfc4;
    margin: .4rem 0;
}
.fktds-breakdown-total  { font-weight: bold; font-size: 1.05rem; }

/* Scale reference */

.fktds-scale {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: .85rem;
    font-family: sans-serif;
}

.fktds-scale li {
    display: flex;
    gap: .75rem;
    padding: .2rem 0;
    color: #555;
}

.fktds-scale li span:first-child {
    width: 60px;
    font-variant-numeric: tabular-nums;
    color: #888;
}

.fktds-scale li.active {
    color: #4a3728;
    font-weight: bold;
}

.fktds-scale li.active span:first-child {
    color: #4a3728;
}

/* Caveats */

.fktds-caveats {
    font-size: .82rem;
    font-family: sans-serif;
    color: #666;
    line-height: 1.6;
    background: #faf8f5;
}

.fktds-caveats ol {
    margin: 0;
    padding-left: 1.4rem;
}

.fktds-caveats li {
    margin-bottom: .5rem;
}

/* Download button */

.fktds-actions {
    padding: 1.25rem 2rem;
    background: #f5f0ea;
    border-top: 1px solid #d8cfc4;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.fktds-btn-download {
    background: transparent;
    border: 2px solid #4a3728;
    color: #4a3728 !important;
    padding: .45rem 1.2rem;
    font-size: .875rem;
}

.fktds-btn-download:hover {
    background: #4a3728;
    color: #fff !important;
}

.fktds-btn-reset {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: .85rem;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
}

.fktds-btn-reset:hover { color: #333; }

.fktds-actions-note {
    font-size: .78rem;
    color: #aaa;
    font-family: sans-serif;
    margin-left: auto;
}

/* Responsive */

@media ( max-width: 520px ) {
    .fktds-score-header { flex-direction: column; gap: .75rem; }
    .fktds-section { padding: 1.25rem 1rem; }
    .fktds-actions { padding: 1rem; }
    .fktds-dist-label { width: 80px; font-size: .75rem; }
}

/* ---------------------------------------------------------------------------
   Shared unit toggle
   Identical block in every plugin in the suite, so the control looks and
   behaves the same wherever it appears.
   --------------------------------------------------------------------------- */

.fkt-units {
	display: flex;
	align-items: center;
	gap: .4rem;
	justify-content: flex-end;
	margin: 0 0 1rem;
	font-family: Georgia, "Times New Roman", serif;
}

.fkt-units-label {
	font-size: .82rem;
	color: #8a8178;
	margin-right: .2rem;
	letter-spacing: .02em;
}

.fkt-units-btn {
	font-family: Georgia, "Times New Roman", serif;
	font-size: .85rem;
	line-height: 1;
	padding: .42rem .85rem;
	border: 1px solid #cfc7bd;
	background: #fff;
	color: #6b6259;
	cursor: pointer;
	border-radius: 3px;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.fkt-units-btn + .fkt-units-btn { margin-left: -1px; }

.fkt-units-btn:hover {
	border-color: #4a3728;
	color: #4a3728;
}

.fkt-units-btn.is-on {
	background: #4a3728;
	border-color: #4a3728;
	color: #fff;
	cursor: default;
}

.fkt-units-btn:focus-visible {
	outline: 2px solid #4a3728;
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.fkt-units { justify-content: flex-start; }
}
