/* --- Base Variables & Reset --- */
:root {
    --bg-dark: #0f1923;
    --card-bg: #1f2d3a;
    --text-main: #ece8e1;
    --text-muted: #8b97a3;
    --accent-red: #ff4655;
    --accent-hover: #ff5866;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* --- Navigation --- */
.navbar {
    width: 100%;
    padding: 20px 40px;
    background-color: rgba(15, 25, 35, 0.9);
    border-bottom: 1px solid #2a3b4c;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent-red);
}

/* --- Main Layout --- */
.container {
    width: 100%;
    max-width: 1000px;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

/* --- Hero Section --- */
.hero {
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* --- Grid Layout for Tests --- */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

/* --- Test Cards --- */
.test-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: #2a3b4c;
}

.icon-placeholder {
    font-size: 3rem;
    margin-bottom: 20px;
}

.test-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.test-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.5;
}

/* --- Buttons --- */
.play-btn {
    background-color: var(--accent-red);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    width: 100%;
}

.play-btn:hover {
    background-color: var(--accent-hover);
}

.play-btn:active {
    transform: scale(0.97);
}

.custom-icon {
    width: 60px;  /* Adjust this value to make it bigger or smaller */
    height: 60px;
    object-fit: contain; /* Ensures the image doesn't stretch weirdly */
    margin-bottom: 20px;
    border-radius: 50%; /* Optional: Makes the image perfectly round */
}

/* --- Reaction Test Specific Styles --- */
.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    margin-right: 20px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text-main);
}

.reaction-container {
    flex-grow: 1; /* Takes up all remaining vertical space */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: var(--card-bg); /* Idle state color */
    transition: background-color 0.1s; /* Very fast transition */
    user-select: none; /* Prevents text highlighting when clicking fast */
}

.reaction-content {
    text-align: center;
    pointer-events: none; /* Ensures the click registers on the container, not the text */
}

.reaction-content h1 {
    font-size: 4rem;
    margin-bottom: 10px;
}

.reaction-content p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
}

/* State Colors */
.state-waiting { background-color: #d32f2f !important; } /* Crimson Red */
.state-ready { background-color: #2ecc71 !important; color: #000; } /* Neon Green */
.state-result { background-color: var(--bg-dark) !important; } /* Dark Blue/Gray */

/* --- Angle Hold Canvas Styles --- */
.canvas-body {
    overflow: hidden; /* Prevent scrolling */
}

.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
}

#gameCanvas {
    background-color: #1a242f;
    border: 2px solid #2a3b4c;
    border-radius: 8px;
    cursor: none; /* Hides the default Windows/Mac cursor! */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.score-display {
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 600;
    margin-left: auto; /* Pushes it to the right of the navbar */
}

#reactionDisplay {
    color: var(--accent-red);
}