:root {
    --primary-color: #4A90E2;
    --success-color: #2ECC71;
    --error-color: #E74C3C;
    --background-color: #F5F7FA;
    --text-color: #334E68;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Tabs Styles */
.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 550px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-btn {
    background-color: #E4E7EB;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-btn.instructions-tab {
    background-color: #CBD5E1;
    border: 2px dashed #94A3B8;
}

.tab-btn.instructions-tab.active {
    background-color: #475569;
    border-color: #475569;
}

/* Controls Panel */
.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 550px;
    margin-bottom: 15px;
    font-weight: bold;
    color: var(--text-color);
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #BCCCDC;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Settings Interface Layout */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 550px;
    margin-bottom: 5px;
}

.gear-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.gear-btn:hover {
    transform: rotate(45deg);
}

.settings-panel {
    display: none;
    background: #E4E7EB;
    padding: 15px;
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    box-sizing: border-box;
    margin-bottom: 15px;
    text-align: left;
    color: var(--text-color);
}

.settings-panel.open {
    display: block;
}

.settings-panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.settings-input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #BCCCDC;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.settings-actions {
    display: flex;
    gap: 10px;
}

.save-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.reset-btn {
    background-color: #9AA5B1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

/* Main App Views Layout Container */
.main-display-box {
    background: white;
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 550px;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

/* View State Swapping Rules */
.view-section {
    display: none;
}

.view-section.active-view {
    display: block;
}

/* GAME LAYOUT BLOCK COMPONENTS */
.image-container {
    width: 100%;
    height: 270px;
    border-radius: 16px;
    overflow: hidden;
    background-color: #ffffff;
    border: 2px solid #E4E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.option-btn {
    background-color: #F0F4F8;
    border: 3px solid #D9E2EC;
    border-radius: 16px;
    padding: 16px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
}

.nav-btn:disabled {
    background-color: #BCCCDC;
    cursor: not-allowed;
}

/* INSTRUCTIONS DOCUMENT COMPONENT LAYOUT */
.instructions-view {
    text-align: left;
    color: #486581;
    line-height: 1.6;
}

.instructions-view h2 {
    margin-top: 0;
    color: #102A43;
    font-size: 24px;
    border-bottom: 2px solid #E4E7EB;
    padding-bottom: 8px;
}

.instructions-view h4 {
    color: #102A43;
    margin: 15px 0 5px 0;
    font-size: 16px;
}

.instructions-view ol {
    padding-left: 20px;
    margin: 8px 0;
}

.instructions-view li {
    margin-bottom: 8px;
}

.code-box {
    background-color: #F0F4F8;
    border: 1px solid #D9E2EC;
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #243E56;
}

/* Game Response Popups Layout Containers */
.feedback-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 10;
    padding: 20px;
    box-sizing: border-box;
}

.feedback-overlay.success { background-color: rgba(46, 204, 113, 0.98); }
.feedback-overlay.error { background-color: rgba(231, 76, 60, 0.95); }
.feedback-overlay.show { opacity: 1; pointer-events: auto; }
.emoji-graphic { font-size: 80px; margin-bottom: 10px; }
.feedback-title { font-size: 36px; font-weight: bold; color: white; margin-bottom: 20px; }

.feedback-sentence {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 15px 25px;
    border-radius: 16px;
    max-width: 90%;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
