body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fdf6e3;
    margin: 0;
    padding: 0;
    color: #333;
}

html {
    overflow-y: scroll;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

h1 {
    font-size: 48px;
    color: #2c3e50;
    margin-bottom: 10px;
}

#total-count,
#current-index,
#current-score {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.quiz-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.character-box {
    font-size: 180px;
    width: 240px;
    height: 240px;
    border: 3px solid #2c3e50;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.character-box:hover {
    transform: scale(1.05);
}

.quiz-area, .answer-area {
    display: grid;
    grid-template-columns: 60px 60px;
    grid-template-rows: repeat(4, 60px);
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.box {
    width: 60px;
    height: 60px;
    border: 2px dashed #3498db;
    background-color: #ecf0f1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.2s;
}

.box:hover {
    background-color: #d6eaf8;
    transform: scale(1.05);
}

/* quiz box positions */
#quiz-tone5-box    { grid-column: 1; grid-row: 1; }
#quiz-top-box      { grid-column: 1; grid-row: 2; }
#quiz-middle-box   { grid-column: 1; grid-row: 3; }
#quiz-bottom-box   { grid-column: 1; grid-row: 4; }
#quiz-tone-box     { grid-column: 2; grid-row: 3; }

/* answer box positions */
#ans-tone5-box     { grid-column: 1; grid-row: 1; }
#ans-top-box       { grid-column: 1; grid-row: 2; }
#ans-middle-box    { grid-column: 1; grid-row: 3; }
#ans-bottom-box    { grid-column: 1; grid-row: 4; }
#ans-tone-box      { grid-column: 2; grid-row: 3; }

.choices {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-top: 20px;
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 1000px;
}

.choices .col {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.choices .col button {
    padding: 8px;
    font-size: 22px;
    width: 48px;
    height: 48px;
    background-color: #fdfefe;
    border: 2px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.choices .col button:hover {
    background-color: #d1ecf1;
    transform: scale(1.05);
}

.result-message {
    margin-top: 20px;
    font-size: 18px;
    color: #b58900;
    height: 28px;
    transition: all 0.3s ease-in-out;
}

.score {
    margin-top: 10px;
    font-size: 20px;
    font-weight: bold;
}

.main-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 40px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 20px;
}

/* 左側按鈕區垂直排列 */
.buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

/* 按鈕一致寬度＆美觀 */

.buttons button {
    width: 120px;
    height: 45px;
    /**/
    padding: 10px 20px;
    margin: 5px;
    font-size: 16px;
    /*
    font-weight: bold;
    */
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.3s, transform 0.2s;
}

.buttons button:hover {
    background-color: #2980b9;
    font-size: 18px;
    transform: scale(1.05);
}

/* 測驗內容區域 */
.test-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.info {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
    line-height: 1.6;
    text-align: left;
}

.popup {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

/* 隱藏視窗 */
.popup-content {
    background-color: #fff;
    margin: 20% auto;
    padding: 20px 30px;
    border-radius: 8px;
    width: fit-content;
    text-align: center;
    font-size: 20px;
    box-shadow: 0 0 10px #333;
}

.popup-content button {
    margin-top: 15px;
    padding: 8px 20px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.popup-content button:hover {
    background-color: #2980b9;
}
