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

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* スタート画面 */
h1 {
    text-align: center;
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s;
}

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

.btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.history-link {
    text-align: center;
    margin-top: 20px;
}

.history-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 1.1em;
}

.history-link a:hover {
    text-decoration: underline;
}

/* クイズ画面 */
.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

.question-number {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.question-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.question-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.poem-text {
    font-size: 1.3em;
    line-height: 1.8;
    color: #333;
    font-weight: 500;
}

.choices-section {
    margin-bottom: 30px;
}

.choices-section h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.choices-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.choice-btn {
    padding: 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 1em;
}

.choice-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.choice-btn.selected {
    border-color: #667eea;
    background: #e7eaf6;
    font-weight: bold;
}

/* 結果画面 */
.result-summary {
    text-align: center;
    margin-bottom: 40px;
}

.accuracy-circle {
    display: inline-block;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.accuracy-number {
    font-size: 4em;
    color: white;
    font-weight: bold;
}

.accuracy-label {
    font-size: 2em;
    color: white;
    margin-left: 5px;
}

.result-text {
    font-size: 1.5em;
    color: #555;
}

.result-details {
    margin-bottom: 30px;
}

.result-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 5px solid #ddd;
}

.result-item.correct {
    border-left-color: #28a745;
}

.result-item.partial {
    border-left-color: #ffc107;
}

.result-item.incorrect {
    border-left-color: #dc3545;
}

.result-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.result-icon {
    font-size: 1.5em;
    margin-right: 10px;
}

.result-icon.correct {
    color: #28a745;
}

.result-icon.partial {
    color: #ffc107;
}

.result-icon.incorrect {
    color: #dc3545;
}

.result-score {
    margin-left: auto;
    font-weight: bold;
    color: #667eea;
    font-size: 1.2em;
}

.result-poem {
    margin-bottom: 10px;
}

.result-poem strong {
    color: #667eea;
}

.user-answer {
    color: #dc3545;
    margin-top: 5px;
}

.correct-answer {
    color: #28a745;
    margin-top: 5px;
}

.button-group {
    display: grid;
    gap: 10px;
}

.button-group .btn-secondary {
    margin-top: 0;
}

/* 履歴画面 */
.sort-controls {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-controls label {
    font-weight: bold;
    color: #555;
}

.sort-controls select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.history-list {
    margin-bottom: 30px;
}

.history-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-username {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.history-date {
    color: #666;
    font-size: 0.9em;
}

.history-accuracy {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.history-score {
    color: #888;
    font-size: 0.9em;
}

.history-score-display {
    text-align: right;
}

.history-score-large {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    line-height: 1;
}

.history-score-small {
    font-size: 0.9em;
    color: #888;
    margin-top: 2px;
}

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

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .accuracy-circle {
        width: 150px;
        height: 150px;
    }
    
    .accuracy-number {
        font-size: 3em;
    }
}
