body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: #fffaf0;
    color: #444;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

header h1 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #ff6b6b;
    font-weight: 800;
}

/* モード切り替えボタン */
.mode-select {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.sub-select {
    margin-bottom: 15px;
}

.mode-select button {
    flex: 1;
    padding: 6px 4px;
    font-size: 0.8rem;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 800;
    border: 2px solid #ffb142;
    background-color: #fff;
    color: #ffb142;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-select button.active {
    background-color: #ffb142;
    color: #fff;
    box-shadow: 0 3px 10px rgba(255, 177, 66, 0.3);
}

.label-hint {
    font-size: 0.85rem;
    color: #b2bec3;
    margin-bottom: 5px;
    font-weight: 800;
}

/* カードのデザイン */
.card {
    background-color: #ffffff;
    width: 100%;
    height: 310px;
    border-radius: 24px;
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.3);
    border: 4px solid #ffeaa7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: transform 0.1s, box-shadow 0.2s;
}

.card:active {
    transform: scale(0.97);
}

.card-front, .card-back {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* 上下の分数表示スタイル（表面用） */
.fraction-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-weight: 800;
    color: #0984e3;
    line-height: 1.1;
}

.numerator {
    font-size: 3rem;
}

.denominator {
    font-size: 3rem;
}

.fraction-line {
    width: 70px;
    height: 4px;
    background-color: #0984e3;
    border: none;
    margin: 4px 0;
    border-radius: 2px;
}

/* 裏面の小さい分数表示スタイル */
.back-fraction-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-weight: 800;
    color: #0984e3;
    line-height: 1;
    margin-bottom: 12px;
}

#back-num {
    font-size: 1.5rem;
}

#back-den {
    font-size: 1.5rem;
}

.back-fraction-line {
    width: 35px;
    height: 2px;
    background-color: #0984e3;
    border: none;
    margin: 2px 0;
    border-radius: 1px;
}

.answer-main {
    font-size: 2rem;
    font-weight: 800;
    color: #d63031;
    margin-bottom: 6px;
}

.answer-sub {
    font-size: 1.4rem;
    color: #e17055;
    font-weight: 800;
}

/* フッター */
footer {
    margin-top: 20px;
}

#hint-text {
    font-size: 0.9rem;
    color: #b2bec3;
    font-weight: 800;
}

.seo-text-box {
    margin-top: 40px;
    background-color: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: left;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}
.seo-text-box h2 {
    font-size: 1.2rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 12px;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.back-btn {
    display: inline-block;
    margin: 15px 0 0 15px;
    text-decoration: none;
    color: #555;
    font-weight: bold;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}