/* 16:9 Layout System for Chiki Learning Adventure */
/* Target resolution: 1920x1080 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #1a1a2e;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 100%;
    height: 100%;
    max-width: 1920px;
    max-height: 1080px;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F4FF 100%);
    position: relative;
}

/* Top Section: 75% height */
#top-section {
    height: 75%;
    display: flex;
    flex-direction: row;
}

/* Left column: 25% width - Chiki area */
#chiki-area {
    width: 25%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
}

#menu-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

#chiki-display {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#chiki-image {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

#chiki-image:hover {
    transform: scale(1.02);
}


/* Center column: 50% width - Content area (75% on menu/setup) */
#content-area {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    transition: width 0.3s ease;
}

/* Expanded content area for menu/setup screens */
#content-area.expanded {
    width: 75%;
}

/* Right column: 25% width - Progress area */
#progress-area {
    width: 25%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: width 0.3s ease;
}

/* Hide progress area on menu/setup */
#progress-area.hidden {
    width: 0;
    padding: 0;
    overflow: hidden;
}

#star-bucket {
    width: 120px;
    height: 200px;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    border: 4px solid #8B4513;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#bucket-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, #FFFF00 0%, #FFD700 100%);
    transition: height 0.5s ease-out;
}

#star-count, #stars-container {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-end;
    gap: 2px;
    padding: 5px;
    z-index: 2;
}

/* Bottom Section: 25% height - Answer options and navigation */
#bottom-section {
    height: 25%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(180deg, #E0F4FF 0%, #B0E0FF 100%);
}

#bottom-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 100%;
    max-width: 1400px;
}

#nav-controls {
    display: flex;
    flex-direction: row;
    gap: 20px;
    min-width: 200px;
    justify-content: center;
}

/* Setup mode - center nav controls */
#bottom-content.setup-mode {
    justify-content: center;
}

#bottom-content.setup-mode #nav-controls {
    flex: none;
}

.nav-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background: rgba(255,255,255,0.9);
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
}

/* Larger buttons in setup mode */
#bottom-content.setup-mode .nav-btn {
    padding: 16px 40px;
    font-size: 20px;
    border-radius: 12px;
}

/* Menu mode - center New Adventure button */
#bottom-content.menu-mode {
    justify-content: center;
}

#bottom-content.menu-mode #btn-new-adventure {
    padding: 18px 50px;
    font-size: 22px;
    border-radius: 16px;
}

.nav-btn:hover {
    background: white;
    border-color: #999;
}

#answer-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex: 1;
    max-width: 1100px;
}

.answer-btn {
    flex: 1;
    max-width: 220px;
    height: 140px;
    background: white;
    border: 4px solid #4A90D9;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 42px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.answer-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.answer-btn:active,
.answer-btn.pressed {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.answer-btn.correct {
    background: #90EE90;
    border-color: #228B22;
}

.answer-btn.incorrect {
    background: #FFB6C1;
    border-color: #DC143C;
}

.answer-btn.highlight {
    animation: pulse 0.5s ease infinite;
}

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

.answer-content {
    font-size: 42px;
}

.answer-content img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.key-hint {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 16px;
    color: #888;
    font-weight: normal;
}

/* Hide elements when not in gameplay */
.hidden {
    display: none !important;
}

/* Screen-specific styles */
.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

.screen.active {
    display: flex;
}
