:root {
    --bg: #0a0e1a;
    --surface: rgba(255, 255, 255, 0.05);
    --primary: #46ae54;
    --text-main: #e4e4e4;
    --text-dim: #666;
    --error: #ff4757;
    --border: rgba(255, 255, 255, 0.1);
}

.theme-light {
    --bg: #f5f5f7;
    --surface: rgba(0, 0, 0, 0.05);
    --primary: #2e7d32;
    --text-main: #1d1d1f;
    --text-dim: #86868b;
    --border: rgba(0, 0, 0, 0.1);
}

.theme-forest {
    --bg: #1b2621;
    --primary: #a3e635;
    --text-main: #ecfdf5;
    --text-dim: #4ade80;
}

* { box-sizing: border-box; transition: all 0.2s ease; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    /* overflow-x: hidden; */
}

#container { 
    width: 100%; 
    /* max-width: 1000px; */
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.titleheading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

#title { font-size: 1.8rem; font-weight: 600; display: flex; align-items: center; gap: 15px;font-family:Georgia, 'Times New Roman', Times, serif; }
#title img { width: 40px; }

.logo ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
.actuallogo { font-size: 1.3rem; cursor: pointer; opacity: 0.7; }
.actuallogo:hover { opacity: 1; color: var(--primary); }

nav { display: flex; justify-content: center; margin: 2rem 0; }
.middlenav {
    background: var(--surface);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border: 1px solid var(--border);
    list-style: none;
}
.nav-divider { color: var(--border); font-weight: 300; pointer-events: none; }
.middlenavcontent, .timer-opt { 
    cursor: pointer; 
    color: var(--text-dim); 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    letter-spacing: 1px; 
}
.middlenavcontent.active, .timer-opt.active { color: var(--primary); font-weight: 700; }

.workspace { 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.stats-header { 
    display: flex; 
    justify-content: center; 
    gap: 4rem; 
    margin-bottom: 3rem; 
}

.stat-item { display: flex; flex-direction: column; min-width: 100px; }
.stat-val { font-size: 2.8rem; font-weight: 600; color: var(--primary); line-height: 1; }
.stat-lbl { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; margin-top: 5px; }

#display-text-container {
    display:block;
    position: relative;
    padding: 1.5rem;
    min-height: 180px;
    cursor: text;
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: left;
}

#display-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    line-height: 1.6;
    width:100%;
    text-align: left; 
    transition: opacity 0.3s, filter 0.3s;
    word-break: break-word;
    user-select: none;
}

#display-text.finished { opacity: 0.4; filter: blur(2px); pointer-events: none; }

#hidden-input { position: absolute; opacity: 0; pointer-events: none; }

.char { color: var(--text-dim); position: relative; }
.char.correct { color: var(--text-main); }
.char.incorrect { color: var(--error); background: rgba(255, 71, 87, 0.1); border-radius: 2px; }
.char.current { 
    border-left: 3px solid var(--primary); 
    margin-left: .2px; 
    margin-right: -.2px;
    animation: caret 0.8s infinite; 
}
@keyframes caret { 50% { border-color: transparent; } }

#next {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.8rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 3rem;
    align-self: center; 
}
#next:hover { background: var(--primary); color: white; border-color: var(--primary); }

.modal-box {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--bg);
    border: 1px solid var(--border);
    width: 380px;
    padding: 2rem;
    border-radius: 20px;
    z-index: 100;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-box.scale-1 { transform: translate(-50%, -50%) scale(1); }
.box-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.close-btn { cursor: pointer; color: var(--text-dim); font-size: 1.2rem; }

.avatar-large { width: 70px; height: 70px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.8rem; color: white; }
.p-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 1rem; }
.p-stat-box { background: var(--surface); padding: 10px; border-radius: 10px; font-size: 0.75rem; text-align: center; }
.p-stat-val { display: block; font-size: 1.2rem; font-weight: bold; color: var(--primary); }

.setting-item { margin-bottom: 1.5rem; text-align: left; }
.theme-selector { display: flex; gap: 12px; margin-top: 10px; }
.theme-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); cursor: pointer; }
.theme-btn.dark { background: #0a0e1a; }
.theme-btn.light { background: #f5f5f7; border-color: #ccc; }
.theme-btn.forest { background: #1b2621; }

.edit-input {
    background: var(--surface);
    border: 1px solid var(--primary);
    color: var(--text-main);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: inherit;
}

input[type=range] { width: 100%; accent-color: var(--primary); margin-top: 10px; }

