/* CSS Reset & Basic Styles */
:root {
    --primary-color: #00A6EA;
    --secondary-color: #F7B500;
    --background-color: #f4f9ff;
    --text-color: #333;
    --white-color: #fff;
    --correct-color: #4CAF50;
    --incorrect-color: #F44336;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-tap-highlight-color: transparent;
}

/* Game Container */
#game-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--white-color);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Screen Management */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    min-height: 100vh;
    animation: fadeIn 0.5s ease-in-out;
}
.screen.active {
    display: flex;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Character & Speech Bubble */
.character-area {
    text-align: center;
    margin: 20px 0;
}
.character-img {
    width: 120px;
    height: auto;
    animation: bounce 2s infinite ease-in-out;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.speech-bubble {
    background-color: var(--background-color);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 15px;
    position: relative;
    margin-top: 20px;
    text-align: left;
    font-size: 16px;
    line-height: 1.6;
}
.speech-bubble:after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent var(--primary-color) transparent;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #007bb5);
    color: var(--white-color);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}
.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #d99a00);
    color: var(--white-color);
}
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

/* Start Screen */
#start-screen h1 {
    font-size: 28px;
    color: var(--primary-color);
    text-align: center;
}
.course-selection {
    width: 100%;
    margin-top: 30px;
}

/* Main Screen */
#main-header {
    width: 100%;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
}
.map-area {
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
    background: #f9f9f9;
    text-align: center;
}
.map-area img {
    width: 100%;
    max-width: 300px;
    border-radius: 8px;
}
.main-content, .main-footer {
    width: 100%;
}

/* Goal Screen */
#goal-screen h2 {
    font-size: 28px;
    color: var(--secondary-color);
    text-align: center;
    animation: tada 1s ease;
}
@keyframes tada {
  from { transform: scale3d(1, 1, 1); }
  10%, 20% { transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg); }
  30%, 50%, 70%, 90% { transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); }
  40%, 60%, 80% { transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); }
  to { transform: scale3d(1, 1, 1); }
}
#goal-summary {
    font-size: 20px;
    text-align: center;
    margin: 20px 0;
}
.coupon-area {
    border: 3px dashed var(--secondary-color);
    background-color: #fffaf0;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
    width: 90%;
    display: none; /* 全問正解時のみ表示 */
}
.coupon-area.visible { display: block; }
.coupon-area h3 { margin-top: 0; color: var(--primary-color); }
.coupon-area p { font-size: 14px; }
.coupon-img {
    width: 100px; height: 100px; margin: 10px auto;
    background-color: var(--secondary-color); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: bold; border-radius: 10px;
    transform: rotate(-5deg);
}

/* Modal Styles */
.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0,0,0,0.6);
    align-items: center; justify-content: center;
    animation: fadeIn 0.3s;
}
.modal.active { display: flex; }
.modal-content {
    background-color: #fff; margin: auto; padding: 20px;
    border-radius: 15px; width: 90%; max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out; text-align: center;
}
@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-content h3 { margin-top: 0; font-size: 22px; }
.choice-btn { background-color: #e7e7e7; color: var(--text-color); }

#result-modal-content h3 { font-size: 32px; margin-bottom: 10px; }
#result-modal-content .result-text { font-size: 18px; font-weight: bold; margin-bottom: 20px; }