body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
}

.app-container {
    text-align: center;
    background: #fff;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

header p {
    font-size: 1rem;
    margin: 10px 0;
}

.problem {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 20px 0;
}

.visualization {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.group {
    margin: 0 10px;
    display: flex;
    flex-wrap: wrap;
}

.group div {
    width: 20px;
    height: 20px;
    background: #6a11cb;
    border-radius: 50%;
    margin: 5px;
}

.box {
    display: inline-block;
    border: 2px solid #2575fc;
    border-radius: 10px;
    padding: 10px;
    margin: 10px;
    background-color: #f4f4f9;
    text-align: center;
}

.label {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 10px;
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.key {
    padding: 10px;
    font-size: 1rem;
    background: #2575fc;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.key:hover {
    background: #1a5bbf;
}

footer {
    font-size: 0.8rem;
    margin-top: 20px;
}

.container {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
}

.game-area {
    text-align: center;
    background: #fff;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.score-item {
    text-align: center;
}

.question-box {
    margin: 20px 0;
}

.question-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.question-text .number {
    font-size: 48px;
    font-weight: 700;
}

.question-text .minus,
.question-text .equals {
    font-size: 44px;
    font-weight: 700;
}

.question-mark {
    font-size: 56px;
    font-weight: 800;
    color: #333;
}

.visual-dots {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.dots-container {
    margin: 0 10px;
    text-align: center;
}

.dots {
    display: grid;
    grid-template-columns: repeat(5, 20px);
    grid-auto-rows: 20px;
    gap: 10px;
    justify-content: center;
    padding: 8px 0;
}

.dots > div {
    width: 20px;
    height: 20px;
    background: #6a11cb;
    border-radius: 50%;
}

.answer-section {
    margin: 20px 0;
}

.number-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.number-btn {
    padding: 10px;
    font-size: 1rem;
    background: #2575fc;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.number-btn:hover {
    background: #1a5bbf;
}

.feedback {
    font-size: 28px;
    margin-top: 20px;
    transition: transform 200ms ease, opacity 200ms ease;
}

.feedback.correct {
    color: #ff6b6b;
    text-shadow: 0 6px 20px rgba(255,107,107,0.35);
    transform: scale(1.08);
    animation: pop 900ms ease;
}

.feedback.incorrect {
    color: #1908db;
    transform: translateX(0);
    animation: shake 600ms ease;
}

.hidden {
    display: none !important;
}

@keyframes pop {
    0% { transform: scale(0.6); opacity: 0; }
    60% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-6px); }
    100% { transform: translateX(0); }
}

/* 簡易コンフェッティ */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.95;
    pointer-events: none;
    animation: confetti-fall 1000ms ease forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-120px) scale(0.6); opacity: 0; }
}

.next-btn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    background: #2575fc;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.next-btn:hover {
    background: #1a5bbf;
}