* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 16px;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Hiragino Sans",
        sans-serif;

    background: #f5f5f5;
    color: #333;
}

.screen {
    max-width: 900px;
    margin: 0 auto;
}

.hidden {
    display: none;
}

h1,
h2 {
    text-align: center;
}

input,
textarea,
button {
    width: 100%;
    font-size: 16px;
}

input[type="text"],
input[type="number"] {
    padding: 10px;
    margin-bottom: 12px;
}

textarea {
    width: 100%;
    min-height: 250px;
    resize: vertical;

    padding: 12px;
    margin-top: 8px;
    margin-bottom: 16px;

    line-height: 1.7;
}

button {
    padding: 12px;
    border: none;
    border-radius: 8px;

    cursor: pointer;

    background: #1976d2;
    color: white;
}

button:hover {
    opacity: 0.9;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.button-group button {
    flex: 1;
}

.file-label {
    display: block;
    margin-top: 10px;
    margin-bottom: 6px;
    font-weight: bold;
}

#text-list {
    margin-top: 20px;
}

.text-card {
    background: white;

    border-radius: 10px;

    padding: 16px;

    margin-bottom: 12px;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);
}

.text-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.card-buttons {
    display: flex;
    gap: 8px;
}

.card-buttons button {
    flex: 1;
}

/* ========================
   出題画面
======================== */

#quiz-text {
    background: white;

    padding: 16px;

    border-radius: 10px;

    line-height: 2.2;
    word-break: break-word;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);
}

.blank-input {
    font-size: 16px;

    padding: 4px 6px;

    border: none;

    border-bottom:
        2px solid #1976d2;

    text-align: center;

    background: transparent;

    margin: 0 2px;
}

/* ========================
   採点表示
======================== */

.review-block {
    font-weight: bold;
}

.answer-correct {
    color: #2e7d32;
}

.answer-wrong {
    color: #c62828;
}

.answer-solution {
    color: #2e7d32;
    margin-left: 4px;
}

#quiz-result {
    margin-top: 20px;
    text-align: center;
}

/* ========================
   除外語句設定画面
======================== */

.exclude-description {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

#exclude-text {

    background: white;

    padding: 20px;

    border-radius: 10px;

    line-height: 2.2;

    word-break: break-word;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 通常単語 */

.word-token {
    color: #333;
    cursor: pointer;

    user-select: none;

    transition: 0.15s;
}

/* 大文字始まり候補 */

.word-token.candidate {
    color: #e57373;
}

/* 除外設定済み */

.word-token.excluded {
    color: #d32f2f;
    font-weight: bold;
}

/* タップ時 */

.word-token:hover {
    opacity: 0.7;
}

/* ========================
   スマホ最適化
======================== */

@media (max-width: 600px) {

    body {
        padding: 12px;
    }

    textarea {
        min-height: 200px;
    }

    .button-group {
        flex-direction: column;
    }

    .card-buttons {
        flex-direction: column;
    }

    #quiz-text {
        line-height: 2.4;
    }

    #exclude-text {
        line-height: 2.4;
    }
}
