@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #f8f8f8;
    background-image: 
        linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px;
    background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2563eb;
    text-shadow: none;
}

header p {
    font-size: 1.1rem;
    color: #666;
    opacity: 1;
}

.quiz-container {
    background: white;
    border: 3px solid #333;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 
        0 0 0 1px #ddd,
        4px 4px 0 0 #333;
    backdrop-filter: none;
    position: relative;
}

.quiz-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: white;
    border-radius: 15px;
    z-index: -1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: white;
    border: 2px solid #333;
    border-radius: 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #2563eb;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.3) 2px,
        rgba(255,255,255,0.3) 4px
    );
    border-radius: 0;
    transition: width 0.5s ease;
    width: 20%;
}

.question-card {
    animation: slideIn 0.5s ease;
}

.question-number {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 2rem;
    font-weight: 500;
    background: #f8f9fa;
    padding: 1.5rem;
    border: 2px solid #333;
    border-radius: 0;
    font-family: 'Courier New', monospace;
}

.answer-section {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.options-group {
    margin-bottom: 1.5rem;
}

.option-button {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 2px solid #333;
    border-radius: 0;
    background: white;
    color: #333;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.option-button:hover {
    background: #f0f9ff;
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 0 #333;
}

.option-button.selected {
    background: #2563eb;
    color: white;
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 0 #333;
}

.option-button:last-child {
    margin-bottom: 0;
}

.submit-btn, .next-btn, .restart-btn {
    background: #2563eb;
    color: white;
    border: 2px solid #333;
    padding: 1rem 2rem;
    border-radius: 0;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover, .next-btn:hover, .restart-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 0 #333;
}

.result-section {
    background: #fff3cd;
    border: 2px solid #333;
    padding: 1.5rem;
    border-radius: 0;
    margin-bottom: 1rem;
    animation: slideIn 0.5s ease;
    font-family: 'Courier New', monospace;
}

.result-text {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.result-text.correct {
    color: #059669;
}

.result-text.incorrect {
    color: #dc2626;
}

.explanation {
    line-height: 1.6;
    color: #333;
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border: 1px solid #333;
    font-family: 'Courier New', monospace;
    white-space: pre-line;
}

.final-results {
    text-align: center;
    animation: slideIn 0.5s ease;
}

.final-results h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.score {
    font-size: 3rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 0 #333;
}

.message {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .quiz-container {
        padding: 1.5rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .submit-btn, .next-btn, .restart-btn {
        width: 100%;
    }
}