body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

#control-panel {
    max-width: 600px;
    margin: auto;
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.95em;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 12px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#experiment-view {
    position: relative;
    padding: 0;
    width: 100vw;
    height: 100vh;
}

#reading-task {
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
    line-height: 1.8;
    font-size: 18px;
    transition: filter 0.3s ease-in-out;
}

#reading-task.blurred {
    filter: blur(5px);
    pointer-events: none;
}

#fixation-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    font-weight: bold;
    color: #dc3545;
    z-index: 110;
}

#probe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100;
}

.probe-element {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: none;
}

.probe-element.visible {
    display: block;
}

#stimulus-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.stimulus-position {
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* N-Back stimulus circle */
.nback-circle {
    width: 80px;
    height: 80px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
    animation: stimulus-appear 0.1s ease-in-out;
}

@keyframes stimulus-appear {
    0% { transform: scale(0.8); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Question container */
#question-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#question-text {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    max-width: 600px;
    line-height: 1.4;
}

.highlight-number {
    color: #dc3545;
    font-size: 1.2em;
    font-weight: 900;
    background: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 2px solid #dc3545;
}

/* Feedback styles */
.feedback-correct {
    color: #28a745;
    font-size: 1.1em;
    font-weight: bold;
}

.feedback-incorrect {
    color: #dc3545;
    font-size: 1.1em;
    font-weight: bold;
}

.feedback-timeout {
    color: #fd7e14;
    font-size: 1.1em;
    font-weight: bold;
}

#keyboard-hint {
    font-size: 18px;
    color: #666;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #ddd;
}

/* Response container */
#response-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.placeholder {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 4px dashed #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.placeholder::after {
    content: attr(data-pos);
    font-size: 24px;
    font-weight: bold;
    color: #999;
}

.placeholder:hover {
    background-color: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
}

.placeholder.correct {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.placeholder.incorrect {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Position mapping for four corners */
#pos-0, #placeholder-0 { top: 15vh; left: 15vw; }
#pos-1, #placeholder-1 { top: 15vh; right: 15vw; }
#pos-2, #placeholder-2 { bottom: 15vh; left: 15vw; }
#pos-3, #placeholder-3 { bottom: 15vh; right: 15vw; }

#end-screen, #instruction-screen {
    max-width: 700px;
    margin: 50px auto;
    text-align: left;
    padding: 20px 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.7;
}

#instruction-screen button, #end-screen button {
    display: block;
    margin: 20px auto 10px;
}

#instruction-screen h1, #end-screen h1 {
    text-align: center;
}

#instruction-screen ol, #instruction-screen ul {
    padding-left: 25px;
}

#instruction-screen strong {
    color: #dc3545;
}

#experiment-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #007bff;
}

#experiment-summary h3 {
    margin-top: 0;
    color: #007bff;
}

#experiment-summary p {
    margin: 10px 0;
    font-weight: bold;
}

#experiment-summary span {
    color: #dc3545;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    #pos-0, #placeholder-0 { top: 10vh; left: 10vw; }
    #pos-1, #placeholder-1 { top: 10vh; right: 10vw; }
    #pos-2, #placeholder-2 { bottom: 10vh; left: 10vw; }
    #pos-3, #placeholder-3 { bottom: 10vh; right: 10vw; }
    
    .stimulus-position, .placeholder {
        width: 100px;
        height: 100px;
    }
    
    .nback-circle {
        width: 70px;
        height: 70px;
    }
    
    #question-text {
        font-size: 24px;
        max-width: 90%;
    }
    
    #keyboard-hint {
        font-size: 16px;
    }
}

/* Focus styles for accessibility */
.placeholder:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* Animation for feedback */
@keyframes feedback-flash {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.placeholder.correct, .placeholder.incorrect {
    animation: feedback-flash 0.3s ease-in-out;
} 