/* Time Attack Quiz Front Styles */

.taq-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    font-family: sans-serif;
    color: #fff;
}

/* スタート画面 */
.taq-start {
    text-align: center;
    padding: 40px 20px;
}

.taq-title {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.taq-description {
    font-size: 1.1em;
    margin-bottom: 25px;
    opacity: 0.9;
}

.taq-info {
    margin-bottom: 30px;
    font-size: 1em;
    opacity: 0.85;
}

.taq-info p {
    margin: 5px 0;
}

.taq-start-btn {
    background: #fff;
    color: #667eea;
    border: none;
    padding: 18px 60px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.taq-start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* クイズ画面 */
.taq-quiz {
    padding: 20px;
}

.taq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.taq-progress {
    font-size: 1.1em;
    font-weight: 600;
}

.taq-timer {
    background: rgba(255,255,255,0.2);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

.taq-timer.warning {
    background: #e74c3c;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* タイマーバー */
.taq-timer-bar {
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 25px;
}

.taq-timer-fill {
    height: 100%;
    background: #2ecc71;
    border-radius: 4px;
    transition: width 1s linear, background 0.3s;
    width: 100%;
}

.taq-timer-fill.warning {
    background: #e74c3c;
}

/* 問題画像 */
.taq-question-image {
    text-align: center;
    margin-bottom: 20px;
}

.taq-question-image img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 問題文 */
.taq-question-text {
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.5;
    min-height: 60px;
}

/* 選択肢 */
.taq-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.taq-choice {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 20px;
    font-size: 1.1em;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.taq-choice:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.taq-choice:active {
    transform: scale(0.98);
}

.taq-choice.correct {
    background: #2ecc71;
    border-color: #2ecc71;
}

.taq-choice.incorrect {
    background: #e74c3c;
    border-color: #e74c3c;
}

.taq-choice.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* フィードバック */
.taq-feedback {
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    margin-top: 25px;
    min-height: 50px;
}

.taq-feedback.correct {
    color: #2ecc71;
}

.taq-feedback.incorrect {
    color: #e74c3c;
}

/* 結果画面 */
.taq-result {
    text-align: center;
    padding: 40px 20px;
}

.taq-result-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    opacity: 0.9;
}

.taq-result-rank {
    font-size: 5em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

.taq-result-rank.rank-S { color: #ffd700; }
.taq-result-rank.rank-A { color: #ff6b6b; }
.taq-result-rank.rank-B { color: #4ecdc4; }
.taq-result-rank.rank-C { color: #95e1d3; }
.taq-result-rank.rank-D { color: #dfe6e9; }
.taq-result-rank.rank-E { color: #b2bec3; }

.taq-result-score {
    font-size: 1.8em;
    margin-bottom: 25px;
}

.taq-result-message {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 35px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

/* 結果ボタン */
.taq-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.taq-share-x {
    background: #000;
    color: #fff;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s;
}

.taq-share-x:hover {
    background: #333;
}

.taq-share-fb {
    background: #1877f2;
    color: #fff;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s;
}

.taq-share-fb:hover {
    background: #166fe5;
}

.taq-retry {
    background: #fff;
    color: #667eea;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.taq-retry:hover {
    transform: translateY(-2px);
}

/* レスポンシブ */
@media (max-width: 600px) {
    .taq-container {
        padding: 15px 10px;
        border-radius: 10px;
    }
    
    .taq-title {
        font-size: 1.5em;
    }
    
    .taq-quiz {
        padding: 10px;
    }
    
    .taq-header {
        margin-bottom: 8px;
    }
    
    .taq-progress {
        font-size: 1em;
    }
    
    .taq-timer {
        padding: 5px 12px;
        font-size: 1em;
    }
    
    .taq-timer-bar {
        height: 6px;
        margin-bottom: 10px;
    }
    
    /* 画像を小さく */
    .taq-question-image img {
        max-height: 120px;
    }
    
    .taq-question-image {
        margin-bottom: 10px;
    }
    
    /* 問題文 */
    .taq-question-text {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    /* 選択肢2列固定 */
    .taq-choices {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    /* 選択肢：外枠固定、文字自動縮小 */
    .taq-choice {
        padding: 12px 8px;
        font-size: 0.85em;
        min-height: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.2;
        overflow: hidden;
        word-break: break-word;
    }
    
    /* フィードバックを小さく */
    .taq-feedback {
        font-size: 1.4em;
        margin-top: 12px;
        min-height: 35px;
    }
    
    .taq-result-rank {
        font-size: 4em;
    }
}

/* タップハイライト除去（iOS対策） */
.taq-choice {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.taq-choice:focus {
    outline: none;
}

/* 選択後のリセット用 */
.taq-choice:not(.correct):not(.incorrect):not(.disabled) {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

/* ニックネーム入力 */
.taq-ranking-option {
    margin: 25px 0;
}

.taq-ranking-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1em;
}

.taq-ranking-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.taq-name-input {
    margin-top: 15px;
}

.taq-name-input input {
    width: 200px;
    max-width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    text-align: center;
}

.taq-name-input input:focus {
    outline: 2px solid rgba(255,255,255,0.5);
}

/* ハイスコア表示 */
.taq-high-score {
    color: #ffd700;
    font-size: 0.8em;
    animation: pulse-gold 1s infinite;
}

.taq-error {
    color: #ff6b6b;
    font-size: 0.8em;
}

@keyframes pulse-gold {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ランキング表示 */
.taq-ranking-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-family: sans-serif;
}

.taq-ranking-title {
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

.taq-ranking-period {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.taq-ranking-empty {
    text-align: center;
    color: #888;
    padding: 30px;
}

.taq-ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.taq-ranking-table th,
.taq-ranking-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.taq-ranking-table th {
    background: #667eea;
    color: #fff;
    font-weight: 600;
}

.taq-ranking-table th:first-child {
    border-radius: 8px 0 0 0;
}

.taq-ranking-table th:last-child {
    border-radius: 0 8px 0 0;
}

.taq-ranking-table tbody tr:hover {
    background: #f0f0f0;
}

.taq-ranking-table .rank-col {
    width: 15%;
    font-weight: bold;
}

.taq-ranking-table .name-col {
    width: 35%;
    text-align: left;
}

.taq-ranking-table .score-col {
    width: 25%;
    font-weight: bold;
    color: #667eea;
}

.taq-ranking-table .detail-col {
    width: 25%;
    color: #666;
    font-size: 0.9em;
}

.taq-ranking-table tr.top-1 {
    background: #fff9e6;
}

.taq-ranking-table tr.top-2 {
    background: #f5f5f5;
}

.taq-ranking-table tr.top-3 {
    background: #fef3e6;
}

@media (max-width: 480px) {
    .taq-ranking-table th,
    .taq-ranking-table td {
        padding: 10px 5px;
        font-size: 0.9em;
    }
}

/* ========================================
   カラーテーマ
   ======================================== */

/* スタンダード（standard）- 紫系（デフォルト） */
.taq-container.theme-standard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ロマンティック（romantic）- ピンク系 */
.taq-container.theme-romantic {
    background: linear-gradient(135deg, #e84393 0%, #fd79a8 100%);
}
.theme-romantic .taq-timer-fill {
    background: #e84393;
}
.theme-romantic .taq-timer-fill.warning {
    background: #ff6b6b;
}
.theme-romantic .taq-choice:hover {
    background: rgba(232, 67, 147, 0.1);
    border-color: #e84393;
}

/* ビジネス（business）- ネイビー×ゴールド */
.taq-container.theme-business {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}
.theme-business .taq-timer-fill {
    background: #c9a227;
}
.theme-business .taq-choice:hover {
    background: rgba(201, 162, 39, 0.1);
    border-color: #c9a227;
}

/* シンプル（simple）- モノトーン */
.taq-container.theme-simple {
    background: linear-gradient(135deg, #333333 0%, #666666 100%);
}
.theme-simple .taq-timer-fill {
    background: #333;
}
.theme-simple .taq-choice:hover {
    background: rgba(51, 51, 51, 0.1);
    border-color: #333;
}

/* パステル（pastel）- 淡い紫×青 */
.taq-container.theme-pastel {
    background: linear-gradient(135deg, #a29bfe 0%, #74b9ff 100%);
}
.theme-pastel .taq-timer-fill {
    background: #a29bfe;
}
.theme-pastel .taq-choice:hover {
    background: rgba(162, 155, 254, 0.1);
    border-color: #a29bfe;
}

/* ナチュラル（natural）- グリーン系 */
.taq-container.theme-natural {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}
.theme-natural .taq-timer-fill {
    background: #27ae60;
}
.theme-natural .taq-choice:hover {
    background: rgba(39, 174, 96, 0.1);
    border-color: #27ae60;
}
