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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: none;
}

header p {
    font-size: 1.1rem;
    opacity: 0.8;
    color: #5a6c7d;
}

.demo-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding: 8px 16px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 20px;
    display: inline-flex;
}

.demo-badge {
    background: #856404;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.demo-text {
    font-size: 0.85rem;
    color: #856404;
    font-weight: 500;
}

.auth-status {
    margin-bottom: 20px;
    text-align: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-indicator.pending {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.status-indicator.authenticating {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
}

.status-indicator.verifying {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #74c0fc;
}

.status-indicator.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.status-indicator.failed {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.status-icon {
    font-size: 1.2rem;
}

.challenge-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.challenge-card {
    margin-bottom: 20px;
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.challenge-type {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

.timer {
    background: #495057;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.challenge-content {
    min-height: 200px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1.6;
}

.auth-challenge {
    text-align: center;
}

.auth-prompt {
    text-align: center;
    color: #6c757d;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 200px;
}

.memory-cell {
    width: 60px;
    height: 60px;
    background: #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.memory-cell.highlighted {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.memory-cell.clickable:hover {
    background: #667eea;
    color: white;
}

.memory-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.memory-digit {
    width: 50px;
    height: 50px;
    background: #6c757d;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.pattern-sequence {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.pattern-item {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#answerInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.3s ease;
}

#answerInput:focus {
    outline: none;
    border-color: #6c757d;
}

#submitBtn {
    padding: 15px 25px;
    background: #495057;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#submitBtn:hover:not(:disabled) {
    background: #343a40;
    transform: none;
}

#submitBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #6c757d;
    width: 0%;
    transition: width 0.3s ease;
}

.controls {
    text-align: center;
    margin: 20px 0;
}

.primary-btn, .secondary-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.primary-btn {
    background: #495057;
    color: white;
}

.secondary-btn {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
}

.primary-btn:hover, .secondary-btn:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.results {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.result-message {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
}

.success {
    color: #28a745;
}

.error {
    color: #dc3545;
}

.auth-details {
    background: #ffffff;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.8;
}

.auth-result {
    text-align: center;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    margin-top: 20px;
}

.result-success {
    color: #28a745;
}

.result-failure {
    color: #dc3545;
}

.retry-btn {
    background: #495057;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.retry-btn:hover {
    background: #343a40;
    transform: none;
}

.logic-problem {
    background: #ffffff;
    border: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .challenge-container {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .controls button {
        margin: 5px 0;
        width: 100%;
    }
}