/* --- COLOR PALETTE & VARIABLES --- */
:root {
    --dora-blue: #00a6ed;
    --dora-red: #e63946;
    --dora-yellow: #ffb703;
    --dora-white: #ffffff;
    --bg-color: #e0f7fa;
    --text-dark: #1d3557;
}

/* --- GLOBAL STYLES --- */
body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Nunito', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    background-image: radial-gradient(circle at top center, #ffffff 0%, #bde0fe 100%);
    box-sizing: border-box;
}

/* --- TOP BAR (Language & Mute) --- */
#top-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 100;
}

.top-btn {
    background: var(--dora-white);
    color: var(--dora-blue);
    border: 3px solid var(--dora-blue);
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--dora-blue);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.top-btn:hover {
    background: var(--dora-blue);
    color: var(--dora-white);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--text-dark);
}

.top-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--text-dark);
}

#coffee-btn {
    background: var(--dora-yellow);
    color: var(--text-dark);
    border: 3px solid var(--text-dark);
    box-shadow: 0 4px 0 var(--text-dark);
}

#coffee-btn:hover {
    background: #ffc300;
    color: var(--text-dark);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--text-dark);
}

#coffee-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--text-dark);
}

/* --- LOADING SCREEN --- */
#loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, var(--dora-blue) 0%, var(--dora-white) 100%);
    z-index: 1000;
}

.loading-content {
    text-align: center;
    background: var(--dora-white);
    padding: 60px 40px;
    border-radius: 30px;
    border: 6px solid var(--dora-blue);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    max-width: 400px;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    border: 6px solid var(--dora-blue);
    border-top: 6px solid var(--dora-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-text {
    color: var(--dora-blue);
    font-size: 1.5rem;
    margin: 20px 0;
    text-shadow: 2px 2px 0px var(--dora-yellow);
}

.progress-bar {
    width: 100%;
    height: 15px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--dora-blue);
    margin: 20px 0;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dora-blue), var(--dora-yellow));
    width: 0%;
    transition: width 0.3s ease;
}

#loading-percent {
    color: var(--dora-blue);
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
}

/* --- START PAGE --- */
#start-page {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    background-image: radial-gradient(circle at center, #ffffff 0%, #bde0fe 100%);
    z-index: 50;
}

.start-content {
    background: var(--dora-white);
    border: 6px solid var(--dora-blue);
    border-top: 30px solid var(--dora-red);
    border-radius: 30px;
    padding: 60px 40px 40px 40px;
    text-align: center;
    box-shadow: 0 15px 0 var(--dora-blue), 0 25px 30px rgba(0,0,0,0.2);
    position: relative;
    max-width: 500px;
    width: 90%;
    animation: fadeIn 1s ease-in-out;
}

#start-title {
    color: var(--dora-blue);
    font-size: 2.2rem;
    text-shadow: 2px 2px 0px var(--dora-white), 4px 4px 0px var(--dora-yellow);
    margin-bottom: 10px;
}

#start-subtitle {
    font-size: 1.2rem;
    color: #457b9d;
    margin-bottom: 30px;
    font-weight: bold;
}

.btn-modern {
    background: var(--dora-yellow);
    color: var(--text-dark);
    border: 4px solid var(--text-dark);
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 0 var(--text-dark);
    transition: all 0.2s ease;
    font-family: inherit;
    animation: pulse 2s infinite;
}

.btn-modern:hover {
    background: #ffc300;
    transform: translateY(3px);
    box-shadow: 0 5px 0 var(--text-dark);
    animation: none;
}

.btn-modern:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 var(--text-dark);
}

/* --- GAME WRAPPER & HEADER --- */
#game-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    width: 100%;
    gap: 25px;
    margin-top: 60px; /* Space for top bar */
}

#header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: var(--dora-white);
    padding: 15px 25px;
    border: 4px solid var(--dora-blue);
    border-radius: 20px;
    box-shadow: 0 8px 0 var(--dora-blue), 0 15px 20px rgba(0,0,0,0.15);
}

#game-title {
    margin: 0;
    color: var(--dora-blue);
    font-size: 1.8rem;
    text-shadow: 2px 2px 0px var(--dora-white), 3px 3px 0px var(--dora-yellow);
    letter-spacing: 1px;
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}

.status-panel {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-dark);
    background: #f1faee;
    padding: 12px 15px;
    border-radius: 12px;
    border: 2px dashed var(--dora-blue);
    flex: 1;
    margin: 5px;
    text-align: center;
}

.highlight { color: var(--dora-red); font-size: 1.2rem;}
.gadget-text { color: #028090; }

/* --- GAME CONTAINER --- */
#game-container {
    background: var(--dora-white);
    border: 5px solid var(--dora-blue);
    border-top: 25px solid var(--dora-red); /* Doraemon's Collar */
    border-radius: 25px;
    padding: 40px 30px 30px 30px;
    box-shadow: 0 10px 0 var(--dora-blue), 0 20px 25px rgba(0,0,0,0.2);
    position: relative;
}

/* --- DORAEMON BELL --- */
.bell-container, .bell-container-large {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.bell-container { top: -45px; }
.bell-container-large { top: -55px; }

.bell {
    background: var(--dora-yellow);
    border-radius: 50%;
    border: 3px solid #333;
    position: relative;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}

.bell-container .bell { width: 60px; height: 60px; }
.bell-container-large .bell { width: 80px; height: 80px; border-width: 4px; }

.bell-line {
    position: absolute;
    width: 100%;
    background: #333;
    left: 0;
}
.bell-container .bell-line { height: 4px; top: 22px; }
.bell-container-large .bell-line { height: 5px; top: 30px; }

.bell-hole {
    position: absolute;
    background: #333;
    border-radius: 50%;
}
.bell-container .bell-hole { width: 12px; height: 12px; top: 32px; left: 21px; }
.bell-container-large .bell-hole { width: 16px; height: 16px; top: 42px; left: 28px; }

.bell-slit {
    position: absolute;
    background: #333;
}
.bell-container .bell-slit { width: 4px; height: 14px; top: 42px; left: 25px; }
.bell-container-large .bell-slit { width: 5px; height: 18px; top: 55px; left: 33.5px; }

/* --- IMAGES & TEXT --- */
#image-container {
    width: 100%;
    height: auto;
    background: #000;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 4px solid var(--dora-yellow);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

#story-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.5s ease-in-out, transform 0.3s ease;
}

#story-text {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 30px;
    min-height: 120px;
    font-weight: 500;
    white-space: pre-line;
}

/* --- CHOICES (BUTTONS) --- */
#choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.btn {
    background: var(--dora-blue);
    color: var(--dora-white);
    border: 3px solid #0077b6;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1.15rem;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s ease;
    border-radius: 12px;
    box-shadow: 0 6px 0 #0077b6;
    text-align: center;
}

.btn:hover {
    background: #00b4d8;
    transform: translateY(2px);
    box-shadow: 0 4px 0 #0077b6;
}

.btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #0077b6;
}

.danger-btn {
    background: var(--dora-red);
    border-color: #9d0208;
    box-shadow: 0 6px 0 #9d0208;
}
.danger-btn:hover {
    background: #ff4d4d;
    box-shadow: 0 4px 0 #9d0208;
}
.danger-btn:active {
    box-shadow: 0 0 0 #9d0208;
}

/* --- ANIMATIONS --- */
.fade {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
    #choices {
        grid-template-columns: 1fr 1fr;
    }
}