:root { --primary: #007AFF; --bg: #ffffff; --text: #1d1d1f; --muted: #6e6e73; --card-border: #e5e5ea; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Getsmore Bubble BG & Layout */
.bubble-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 0; pointer-events: none; }
.bubble { position: absolute; border-radius: 50%; opacity: 0.4; filter: blur(60px); }
.bubble-1 { width: 400px; height: 400px; background: #ff9a9e; top: -100px; left: -100px; animation: float 10s infinite alternate; }
.bubble-2 { width: 500px; height: 500px; background: #a1c4fd; bottom: -150px; right: -100px; animation: float 12s infinite alternate-reverse; }
.bubble-3 { width: 300px; height: 300px; background: #d4fc79; top: 40%; left: 50%; animation: float 14s infinite alternate; }
@keyframes float { 0% { transform: translate(0, 0); } 100% { transform: translate(50px, 50px); } }

/* Focus Mode while playing */
body.playing-mode #global-header,
body.playing-mode .global-footer,
body.playing-mode .info-container,
body.playing-mode .bubble-bg,
body.playing-mode .typing-container h1 {
    display: none !important;
}
body.playing-mode .app-wrapper {
    padding: 10px 5px;
    justify-content: center;
}
body.playing-mode .game-box {
    box-shadow: none;
    border: none;
    padding: 10px 5px;
    background-color: transparent !important;
}

.app-wrapper { flex: 1; position: relative; z-index: 10; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 40px 15px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; }
.game-box { background: #fff; border-radius: 30px; padding: 30px 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.08); border: 1px solid var(--card-border); display: flex; flex-direction: column; align-items: center; position: relative; width: 100%; box-sizing: border-box;}

.info-container { width: 100%; max-width: 1000px; margin: 40px auto 0; background: #fff; border-radius: 30px; padding: 40px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid var(--card-border); text-align: left; position: relative; z-index: 10; box-sizing: border-box; }
.info-container h2 { font-size: 1.8rem; color: var(--text); margin-bottom: 20px; font-weight: 800; letter-spacing: -0.5px; }
.info-container ul { margin-bottom: 30px; padding-left: 20px; }
.info-container li { margin-bottom: 12px; color: #444; font-size: 1rem; line-height: 1.6; }
.faq-container { margin-top: 20px; }
.faq-item { border-bottom: 1px solid var(--card-border); margin-bottom: 10px; }
.faq-question { width: 100%; background: none; border: none; text-align: left; padding: 15px 0; font-size: 1.1rem; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-answer p { padding-bottom: 15px; color: var(--muted); line-height: 1.6; font-size: 0.95rem; }
.faq-item.active .faq-answer { max-height: 500px; }

/* Game Specific Styles */
.typing-container {
    background: radial-gradient(circle at center, #2a2a40 0%, #151522 100%);
    color: #c8c8d0;
    padding: 30px 40px;
    border-radius: 20px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
.typing-container h1 {
    color: #00e5ff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 2.2rem;
    font-weight: 800;
}
.stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: bold;
}
.text-display {
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    line-height: 1.6;
    text-align: left;
    max-width: 900px;
    margin: 0 auto 10px auto;
    padding: 20px 30px;
    background: #1e1e2f;
    border-radius: 12px;
    user-select: none;
    position: relative;
    min-height: 150px;
    height: 20vh; 
    overflow-y: auto;
    scroll-behavior: smooth;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.text-display::-webkit-scrollbar { width: 8px; }
.text-display::-webkit-scrollbar-track { background: #1e1e2f; border-radius: 8px; }
.text-display::-webkit-scrollbar-thumb { background: #444460; border-radius: 8px; }
.text-display::-webkit-scrollbar-thumb:hover { background: #00e5ff; }
.text-display span {
    transition: color 0.1s, background-color 0.1s;
}
.correct { color: #00e5ff; }
.incorrect { color: #ff4757; background: rgba(255, 71, 87, 0.2); }
.active { border-bottom: 2px solid #00e5ff; animation: blink 1s infinite; }
@keyframes blink { 50% { border-color: transparent; } }
.input-area {
    position: absolute;
    opacity: 0;
    top: -1000px;
}
.difficulty-select {
    background: #1e1e2f;
    color: #00e5ff;
    border: 2px solid #444460;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}
.settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}
.stats div {
    display: flex;
    align-items: center;
    gap: 5px;
}
.keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 15px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
}
.key-row {
    display: flex;
    gap: 4px;
}
.key {
    background: #1e1e2f;
    border: 2px solid #444460;
    border-radius: 6px;
    min-width: 40px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: #c8c8d0;
    transition: all 0.1s;
    box-shadow: 0 4px 0 #151522;
    border-top-width: 4px;
}
.key.finger-lp { background-color: #ff7675; color: #1e1e2f; border-color: #d63031; }
.key.finger-lr { background-color: #ffeaa7; color: #1e1e2f; border-color: #fdcb6e; }
.key.finger-lm { background-color: #55efc4; color: #1e1e2f; border-color: #00b894; }
.key.finger-li { background-color: #81ecec; color: #1e1e2f; border-color: #00cec9; }
.key.finger-ri { background-color: #74b9ff; color: #1e1e2f; border-color: #0984e3; }
.key.finger-rm { background-color: #a29bfe; color: #1e1e2f; border-color: #6c5ce7; }
.key.finger-rr { background-color: #fd79a8; color: #1e1e2f; border-color: #e84393; }
.key.finger-rp { background-color: #fab1a0; color: #1e1e2f; border-color: #e17055; }
.key.finger-thumb { background-color: #dfe6e9; color: #1e1e2f; border-color: #b2bec3; }
.key.special { background-color: #35354a; color: #8888a0; border-color: #2a2a40; font-size: 0.8rem; border-top-color: #444460; }
.key.tab { width: 70px; }
.key.caps { width: 85px; }
.key.enter { width: 85px; flex-grow: 1; }
.key.shift { width: 110px; }
#key-shift-right { flex-grow: 1; }
.key.backspace { width: 110px; flex-grow: 1; }
.key.backslash { width: 60px; flex-grow: 1; }
.key.space { width: 250px; }
.key.pressed { background: #00e5ff; color: #1e1e2f; transform: translateY(4px); box-shadow: 0 0 0 #151522; border-color: #00e5ff; }
.key.expected { box-shadow: 0 0 15px 5px rgba(0, 229, 255, 0.4); border-color: #00e5ff; animation: pulse 1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 5px rgba(0, 229, 255, 0.4); } 50% { box-shadow: 0 0 20px rgba(0, 229, 255, 0.8); } 100% { box-shadow: 0 0 5px rgba(0, 229, 255, 0.4); } }

.hands-container { display: flex; justify-content: center; gap: 50px; margin-top: 15px; }
.hand { display: flex; align-items: flex-end; gap: 8px; height: 85px; }
.finger { width: 25px; background-color: #444460; border-radius: 12px 12px 0 0; transition: all 0.2s ease-in-out; border-top: 5px solid transparent; }
.pinky { height: 45px; }
.ring { height: 65px; }
.middle { height: 75px; }
.index { height: 68px; }
.thumb { height: 38px; }
.left-hand .thumb { transform: rotate(-25deg) translateX(10px); transform-origin: bottom right; }
.right-hand .thumb { transform: rotate(25deg) translateX(-10px); transform-origin: bottom left; }
.finger.finger-lp { background-color: #ff7675; border-top-color: #d63031; }
.finger.finger-lr { background-color: #ffeaa7; border-top-color: #fdcb6e; }
.finger.finger-lm { background-color: #55efc4; border-top-color: #00b894; }
.finger.finger-li { background-color: #81ecec; border-top-color: #00cec9; }
.finger.finger-ri { background-color: #74b9ff; border-top-color: #0984e3; }
.finger.finger-rm { background-color: #a29bfe; border-top-color: #6c5ce7; }
.finger.finger-rr { background-color: #fd79a8; border-top-color: #e84393; }
.finger.finger-rp { background-color: #fab1a0; border-top-color: #e17055; }
.finger.finger-thumb { background-color: #dfe6e9; border-top-color: #b2bec3; }
.finger.active-finger { background-color: #00e5ff; box-shadow: 0 0 15px 5px rgba(0, 229, 255, 0.4); transform: translateY(-5px); }

.typing-container button {
    padding: 10px 20px;
    font-size: 1.1rem;
    color: #1e1e2f;
    background-color: #00e5ff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}
.typing-container button:hover { background-color: #00b3cc; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 1; transition: opacity 0.3s ease; }
.modal.hidden { opacity: 0; pointer-events: none; }
.modal-content { background-color: #2a2a40; color: #fff; padding: 40px 60px; border-radius: 16px; text-align: center; box-shadow: 0 4px 25px rgba(0, 229, 255, 0.3); border: 2px solid #00e5ff; max-width: 90%; }
.modal-content h2 { margin-top: 0; font-size: 2.5rem; margin-bottom: 20px; color: #fff;}
.modal-stats { font-size: 1.5rem; margin-bottom: 30px; }
.modal-stats p { margin: 10px 0; }
.modal-stats span { color: #00e5ff; font-weight: bold; font-size: 2.5rem; }

#custom-text-input { width: 100%; background: #1e1e2f; color: #c8c8d0; border: 2px solid #444460; border-radius: 8px; padding: 15px; font-family: monospace; font-size: 1rem; resize: vertical; margin-bottom: 20px; outline: none; box-sizing: border-box; }
#custom-text-input:focus { border-color: #00e5ff; }

/* Dark Theme Support */
body.dark-theme { background-color: #000; color: #f5f5f7; --bg: #000; --text: #f5f5f7; --card-border: #38383a; }
body.dark-theme .game-box, body.dark-theme .info-container { background-color: #1c1c1e; }
body.dark-theme .info-container h2 { color: #eee; }
body.dark-theme .info-container li, body.dark-theme .faq-answer p { color: #aaa; }
body.dark-theme .faq-question { color: #eee; }

@media (max-width: 768px) {
    .stats { font-size: 1rem; }
    .typing-container h1 { font-size: 1.8rem; }
    .hands-container { display: none; /* Hide visual hands on very small screens to save space */ }
    .text-display { font-size: 1.1rem; padding: 15px; }
    .key { min-width: 20px; font-size: 0.8rem; height: 32px; border-top-width: 2px;}
    .key.space { width: 150px; }
    .key.special { font-size: 0.6rem; }
}
