@import url('https://fonts.googleapis.com/css2?family=Alegreya:wght@600;700&family=Nunito:wght@400;600;700&display=swap');
/* Google Fonts import: Alegreya (headings), Nunito (body) */


/* Brand palette + typography variables (centralize theme values) */
:root {
    --tr-orange:#ff8400;
    --tr-font-heading:'Alegreya',serif;
    --tr-font-body:'Nunito',sans-serif;
    --tr-text-light:#fff;
    --tr-bg:#fafafa;
}

body {
    font-family:var(--tr-font-body);
    background: linear-gradient(135deg, #fff8f0 0%, #f0f4ff 100%);
    margin:0;
    color:#222;
}

/* === Header Bar === */
/* Solid orange strip with white text; inherits brand variables */
/*
header {
    background:var(--tr-orange);
    color:var(--tr-text-light);
    box-shadow: 0 2px 12px rgba(255,132,0,0.08);
}
header h1 {
    font-family:var(--tr-font-heading);
    font-weight:700;
    margin:0;
    color:var(--tr-text-light);
}
*/

/* === Reusable Outline Button Variant (Orange) === */
/* Leverages Bootstrap CSS variable interface to create a brand-colored outline that fills on hover */
.btn-outline-orange {
    color:var(--tr-orange);
    border:2px solid var(--tr-orange);
    background:transparent;
    transition:.2s;
}

.btn-outline-orange:hover,
.btn-outline-orange:focus {
    background:var(--tr-orange);
    color:#fff;
    box-shadow:0 0 0 .2rem rgba(255,132,0,.25);
}

.btn-outline-orange:disabled {
    opacity:.55;
    cursor:not-allowed;
}

/* Sample passage */
#sample-text {
    font-family: 'Fira Mono', 'Consolas', monospace;
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--tr-orange); /* changed from #ddd */
    font-size:.85rem;
    line-height:1.35;
    max-height:120px;
    overflow-y:auto;
    white-space:pre-wrap;
    transition: opacity .3s ease;
}

#sample-text.is-fading-out {
    opacity: .18;        /* was 0 */
    pointer-events: none;
}

/* Typing highlight system */
.typing-wrapper {
    position:relative;
    font-family:inherit;
    border: 2px solid var(--tr-orange);
    border-radius: 0.5rem;
    background: #fff;
    transition: border-color 0.2s;
}

/* Typing area: white background, black text */
#user-input {
    background: #fff;
    color: #111;
    font-size: 1rem;
    line-height: 1.5;
    padding: .5rem .75rem;
    border-radius: 0.5rem;
    border: none;
    position: relative;
    z-index: 1;
}

/* Highlight overlay: white background, sits under text */
#highlight-layer {
    background: #fff;
    border-radius: 0.5rem;
    position: absolute;
    inset: 0;
    padding: .5rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    pointer-events: none;
    z-index: 2;
}

/* Highlighted characters */
.hl-correct {
    background: #d6f8d6;
    color: #176c17;
    font-weight: bold;
}
.hl-incorrect {
    background: #ffd6d6;
    color: #a40000;
    font-weight: bold;
}
.hl-pending {
    color: #bbb;
}

/* Results */
#results-area {
    border: 2px solid var(--tr-orange);
    border-radius:.5rem;
    padding:1.25rem 1rem;
    background:#fff;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
#results-area h2 {
    color:var(--tr-orange);
    font-weight:700;
    margin-bottom:1rem;
}
#results-area p {
    margin:0 0 .6rem;
    font-weight:600;
}
#best-results li {
  padding: 2px 0;
}
#results-area:hover {
    background: var(--tr-orange);
    color: #fff;
    box-shadow: 0 0 0 .2rem rgba(255,132,0,.18), 0 4px 24px rgba(0,0,0,0.10);
    border-color: var(--tr-orange);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
#results-area:hover h2,
#results-area:hover p,
#results-area:hover li,
#results-area:hover span {
    color: #fff;
    transition: color 0.2s;
}

/* === Mobile Tweaks === */
/* Slightly reduce padding / button size to fit narrow screens comfortably */
@media (max-width: 575.98px) {
	header .my-4 { margin-top:1.5rem !important; margin-bottom:1.5rem !important; }
	.btn-lg { padding:0.55rem 1.05rem; font-size:1rem; }
}

/* Legacy selectors (.tr-header/.tr-instructions-btn) retained earlier in case of revert; safe to remove later if unused */
@media (max-width: 575.98px) {
	.tr-header .container { /* No effect now (header markup changed), kept for reference */
		padding-left: 1rem;
		padding-right: 1rem;
	}
	.tr-instructions-btn {
		padding: 0.4rem 0.85rem;
		font-size: 0.9rem;
	}
}

/* === Instructions Modal Styling (brand theming) === */
.modal-header {
    background: var(--tr-orange);
    color: #fff;
}
.modal-header .modal-title {
    font-weight: 600;
}
.modal-header .btn-close {
    filter: invert(1);
}
.modal-content {
    border: 2px solid var(--tr-orange);
    border-radius: .65rem;
}
.modal-footer {
    background: #fff;
}

.hero-img-wrapper {
    width: 90vw;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    background: #fff8f0;
    border-radius: 1.5rem;
}

.typing-hero {
    width: 100%;
    max-width: none;
    border-radius: 1.5rem;
    box-shadow: none;
    border: none;
    margin: 0;
    display: block;
    animation: floatY 3s ease-in-out infinite;
    background: #fff8f0;
    object-fit: cover;
    min-height: 180px;
    max-height: 320px;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0);}
    50% { transform: translateY(-14px);}
}

/* Make the Select Difficulty label orange */
.input-group-text {
    background: var(--tr-orange);
    color: #fff;
    border: 2px solid var(--tr-orange);
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

/* Make the dropdown border orange and add focus/hover effect */
.form-select {
    border: 2px solid var(--tr-orange);
    border-left: none;
    color: #222;
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-select:focus {
    border-color: var(--tr-orange);
    box-shadow: 0 0 0 0.15rem rgba(255,132,0,0.15);
}

.text-orange { color: var(--tr-orange) !important; }
.site-title { letter-spacing: 0.04em; }

