/* Game-specific CSS for Racing Typer */
:root {
--primary-highlight: #00e676;
--secondary-highlight: #ffc107;
--background-main: #263238;
--background-light: #37474f;
--text-color: #eceff1;
--correct-char: #00c853;
--incorrect-char: #ff1744;
--current-char-bg: #4dd0e1;
--pending-char: #90a4ae;
--border-color: #64ffda;
}
/* IMPORTANT: The original 'body' selector from your game's CSS has been removed.
Global body styles are handled by main.css. Your game styles are applied
within the .game-container. */
.game-container {
background-color: rgba(0, 0, 0, 0.6);
border: 2px solid var(--border-color);
border-radius: 12px;
box-shadow: 0 0 25px rgba(100, 255, 218, 0.4);
width: 90%;
max-width: 900px;
padding: 25px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
/* Added to help center the game within the main site's container */
margin: 0 auto;
}
.header-bar {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.game-title {
font-family: 'Orbitron', sans-serif;
color: var(--secondary-highlight);
font-size: 2em;
margin: 0;
text-shadow: 0 0 8px var(--secondary-highlight);
}
.stats-bar {
display: flex;
gap: 15px;
}
.stat {
font-size: 1em;
color: var(--primary-highlight);
text-shadow: 0 0 4px var(--primary-highlight);
}
.game-screen {
display: none;
width: 100%;
text-align: center;
padding: 15px 0;
}
.game-screen.active {
display: block;
}
/* Pre-game Countdown Styles */
.countdown-screen {
display: flex;
justify-content: center;
align-items: center;
min-height: 250px;
flex-grow: 1;
}
.countdown-number {
font-family: 'Orbitron', sans-serif;
font-size: 7em;
color: var(--primary-highlight);
text-shadow: 0 0 25px var(--primary-highlight);
animation: countdown-pulse 1s ease-in-out infinite alternate;
}
@keyframes countdown-pulse {
from { transform: scale(0.9); opacity: 0.8; }
to { transform: scale(1.05); opacity: 1; }
}
.typing-area {
font-size: 1.6em;
line-height: 1.6;
background-color: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
padding: 20px;
margin-bottom: 25px;
min-height: 160px;
text-align: left;
white-space: pre-wrap;
word-wrap: break-word;
overflow-y: auto;
max-height: 250px;
user-select: none;
}
.typing-area span {
display: inline-block;
transition: background-color 0.08s, color 0.08s;
padding: 0 1px;
color: var(--pending-char); /* Default color for untyped characters */
}
/* MODIFIED: Target spans with inline 'lime' color for correct characters */
.typing-area span[style*="color: lime"] {
color: var(--correct-char) !important;
}
/* MODIFIED: Target spans with inline 'red' color for incorrect characters */
.typing-area span[style*="color: red"] {
color: var(--incorrect-char) !important;
background-color: rgba(255, 23, 68, 0.2);
border-radius: 2px;
}
/* NEW: Style for the highlight class from JS */
.typing-area span.highlight {
background-color: var(--current-char-bg);
color: var(--background-main);
border-radius: 3px;
box-shadow: 0 0 4px var(--current-char-bg);
padding: 0 1px;
animation: highlight-pulse 1s infinite alternate;
}
/* Optional: Highlight pulse animation */
@keyframes highlight-pulse {
from { box-shadow: 0 0 2px var(--current-char-bg); }
to { box-shadow: 0 0 8px var(--current-char-bg); }
}
.typing-input {
width: calc(100% - 30px);
padding: 15px;
font-size: 1.4em;
border: 2px solid var(--border-color);
border-radius: 8px;
margin-bottom: 30px;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.7);
color: var(--text-color);
resize: none;
outline: none;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
text-align: center;
font-family: 'Share Tech Mono', monospace;
}
.typing-input:focus {
border-color: var(--secondary-highlight);
box-shadow: 0 0 12px rgba(255, 193, 7, 0.6);
}
.typing-input.error-state {
border-color: var(--incorrect-char);
box-shadow: 0 0 12px rgba(255, 23, 68, 0.6);
}
.typing-input.finished {
background-color: rgba(0, 0, 0, 0.3);
border-color: var(--pending-char);
cursor: not-allowed;
}
.btn {
background-color: var(--primary-highlight);
color: var(--background-main);
padding: 12px 30px;
font-size: 1.2em;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
font-family: 'Orbitron', sans-serif;
text-transform: uppercase;
letter-spacing: 0.8px;
font-weight: bold;
box-shadow: 0 4px 12px rgba(0, 230, 118, 0.3);
}
.btn:hover {
background-color: var(--secondary-highlight);
transform: translateY(-2px);
box-shadow: 0 6px 15px rgba(255, 193, 7, 0.4);
color: var(--background-main);
}
.btn:active {
transform: translateY(0);
box-shadow: 0 2px 8px rgba(0, 230, 118, 0.2);
}
/* Race Track Styling */
.race-track {
width: 100%;
height: 140px;
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 8px;
padding: 8px;
box-sizing: border-box;
position: relative;
overflow: hidden;
}
.track-line {
width: calc(100% - 16px);
height: 55px;
background-color: var(--background-light);
border-radius: 4px;
margin-bottom: 8px;
position: relative;
display: flex;
align-items: center;
padding-left: 55px;
box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}
.track-line:last-child {
margin-bottom: 0;
}
.player-label {
position: absolute;
left: 4px;
font-family: 'Orbitron', sans-serif;
font-size: 0.8em;
text-transform: uppercase;
color: var(--text-color);
z-index: 2;
text-shadow: 0 0 4px rgba(0,0,0,0.4);
}
.car {
width: 45px;
height: 35px;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0%;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
transition: left 0.08s linear;
z-index: 1;
}
.user-car {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 60"><path fill="%2300e676" d="M90 20L80 5H10L0 20v20l10 15h70l10-15z"/><circle fill="%23263238" cx="25" cy="45" r="10"/><circle fill="%23263238" cx="75" cy="45" r="10"/><rect x="15" y="10" width="70" height="20" fill="%23eceff1" rx="5" ry="5"/><polygon fill="%2300e676" points="20 15 30 15 25 25 20 15"/><polygon fill="%2300e676" points="70 15 80 15 75 25 70 15"/></svg>');
}
.bot-car {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 60"><path fill="%23ffc107" d="M90 20L80 5H10L0 20v20l10 15h70l10-15z"/><circle fill="%23263238" cx="25" cy="45" r="10"/><circle fill="%23263238" cx="75" cy="45" r="10"/><rect x="15" y="10" width="70" height="20" fill="%23eceff1" rx="5" ry="5"/><polygon fill="%23ffc107" points="20 15 30 15 25 25 20 15"/><polygon fill="%23ffc107" points="70 15 80 15 75 25 70 15"/></svg>');
}
/* Finish Line */
.finish-line {
position: absolute;
right: 8px;
top: 0;
bottom: 0;
width: 4px;
background-color: var(--secondary-highlight);
box-shadow: 0 0 8px var(--secondary-highlight);
z-index: 0;
}
/* Results Screen */
#results-screen h2 {
font-family: 'Orbitron', sans-serif;
font-size: 2.2em;
margin-bottom: 15px;
color: var(--primary-highlight);
text-shadow: 0 0 12px var(--primary-highlight);
}
#results-screen p {
font-size: 1.2em;
margin-bottom: 8px;
color: var(--text-color);
}
#results-screen p span {
color: var(--secondary-highlight);
font-weight: bold;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.game-container {
padding: 20px;
}
.game-title {
font-size: 1.8em;
}
.stats-bar {
flex-direction: column;
gap: 5px;
align-items: flex-end;
}
.stat {
font-size: 0.9em;
}
.typing-area {
font-size: 1.3em;
padding: 15px;
min-height: 140px;
}
.typing-input {
font-size: 1.1em;
padding: 12px;
}
.btn {
padding: 10px 25px;
font-size: 1.1em;
}
.race-track {
height: 110px;
padding: 6px;
}
.track-line {
height: 45px;
padding-left: 45px;
}
.car {
width: 38px;
height: 30px;
}
.player-label {
font-size: 0.75em;
left: 3px;
}
#results-screen h2 {
font-size: 1.8em;
}
#results-screen p {
font-size: 1em;
}
.countdown-number {
font-size: 5em;
}
}
@media (max-width: 480px) {
.game-container {
padding: 15px;
border-width: 1px;
}
.game-title {
font-size: 1.5em;
}
.stats-bar {
gap: 8px;
}
.typing-area {
font-size: 1.1em;
padding: 10px;
min-height: 100px;
}
.typing-input {
font-size: 1em;
padding: 10px;
}
.btn {
padding: 8px 18px;
font-size: 0.9em;
}
.race-track {
height: 90px;
padding: 4px;
}
.track-line {
height: 35px;
padding-left: 35px;
}
.car {
width: 30px;
height: 25px;
}
.player-label {
font-size: 0.65em;
}
.finish-line {
right: 4px;
width: 3px;
}
#results-screen h2 {
font-size: 1.5em;
}
#results-screen p {
font-size: 0.9em;
}
.countdown-number {
font-size: 3.5em;
}
}
