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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    overflow-x: hidden;
    color: #fff;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#scroll-content {
    position: relative;
    height: 1200vh;
    z-index: 2;
    pointer-events: none;
}

.ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

/* Sound Controls - ADDED */
.sound-controls {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    pointer-events: all;
}

.sound-button {
    background: rgba(255, 215, 0, 0.9);
    border: 2px solid #ff6b6b;
    color: #1a2a6c;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.sound-button:hover {
    background: #ffd700;
    transform: scale(1.05);
}

.sound-button.muted {
    background: rgba(200, 200, 200, 0.7);
    color: #666;
}

.navigation {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: all;
}

.nav-button {
    background: rgba(255, 215, 0, 0.8);
    border: 2px solid #ff6b6b;
    color: #1a2a6c;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.nav-button.active {
    background: #ff6b6b;
    border-color: #ffd700;
    transform: scale(1.1);
}

.nav-button:hover {
    background: #ffd700;
    transform: scale(1.05);
}

.title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffd700;
    font-size: 4rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 0 20px #ff6b6b, 0 0 10px #1a2a6c;
    opacity: 0;
    transition: opacity 0.5s;
}

.title.visible {
    opacity: 1;
}

.instructions {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    text-align: center;
    background: rgba(26, 42, 108, 0.7);
    padding: 10px 20px;
    border-radius: 15px;
    border: 2px solid #ffd700;
}

.scroll-indicator {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 200px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ffd700;
}

.scroll-progress {
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, #ff6b6b, #ffd700);
    transition: height 0.1s;
}

/* Шинэ товчнууд */
.action-buttons {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: all;
}

.action-button {
    background: #ff6b6b;
    border: 2px solid #ffd700;
    color: white;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.action-button:hover {
    background: #ffd700;
    color: #1a2a6c;
    transform: scale(1.05);
}

/* Мэдээллийн хэсэг */
.info-panel {
    position: fixed;
    top: 20%;
    right: 2rem;
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 20;
    pointer-events: all;
    color: #1a2a6c;
    border: 3px solid #ffd700;
    transform: translateX(350px);
    transition: transform 0.5s ease;
}

.info-panel.visible {
    transform: translateX(0);
}

.info-panel h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
    font-size: 1.5rem;
    border-bottom: 2px dashed #ffd700;
    padding-bottom: 5px;
}

.info-panel p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.info-panel .close-button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    float: right;
}

.info-panel .close-button:hover {
    background: #ffd700;
    color: #1a2a6c;
}

/* Бүх дүрсийн мэдээллийн цонх */
.all-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 42, 108, 0.95);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

.all-info-modal.visible {
    opacity: 1;
    visibility: visible;
}

.all-info-content {
    background: white;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    border-radius: 20px;
    padding: 30px;
    overflow-y: auto;
    color: #1a2a6c;
    border: 4px solid #ffd700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.all-info-content h2 {
    color: #ff6b6b;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.island-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.island-card {
    background: #f0f8ff;
    border-radius: 15px;
    padding: 15px;
    border: 2px solid #ffd700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.island-card h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.close-modal-button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
    font-size: 1.1rem;
}

.close-modal-button:hover {
    background: #ffd700;
    color: #1a2a6c;
}

/* Тоглоомын хэсэг */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 42, 108, 0.95);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

.game-modal.visible {
    opacity: 1;
    visibility: visible;
}

.game-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 20px;
    padding: 30px;
    overflow-y: auto;
    color: #1a2a6c;
    border: 4px solid #ffd700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.game-content h2 {
    color: #ff6b6b;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.question-container {
    margin: 20px 0;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 15px;
    border: 2px solid #ffd700;
}

.question-container h3 {
    color: #1a2a6c;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.option-button {
    background: #ffd700;
    border: 2px solid #ff6b6b;
    color: #1a2a6c;
    padding: 15px;
    cursor: pointer;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s;
}

.option-button:hover {
    background: #ff6b6b;
    color: white;
    transform: scale(1.05);
}

.option-button.correct {
    background: #4CAF50;
    color: white;
}

.option-button.incorrect {
    background: #f44336;
    color: white;
}

.score-container {
    margin: 20px 0;
    font-size: 1.5rem;
    color: #ff6b6b;
    font-weight: bold;
}

.game-result {
    margin: 20px 0;
    font-size: 1.8rem;
    color: #ff6b6b;
    font-weight: bold;
}

/* Асуулт-хариултын хэсэг */
.quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 42, 108, 0.95);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

.quiz-modal.visible {
    opacity: 1;
    visibility: visible;
}

.quiz-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 20px;
    padding: 30px;
    overflow-y: auto;
    color: #1a2a6c;
    border: 4px solid #ffd700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.quiz-content h2 {
    color: #ff6b6b;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.quiz-question {
    margin: 20px 0;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 15px;
    border: 2px solid #ffd700;
    font-size: 1.3rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

.quiz-option {
    background: #ffd700;
    border: 2px solid #ff6b6b;
    color: #1a2a6c;
    padding: 15px;
    cursor: pointer;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s;
}

.quiz-option:hover {
    background: #ff6b6b;
    color: white;
    transform: scale(1.05);
}

.quiz-option.correct {
    background: #4CAF50;
    color: white;
}

.quiz-option.incorrect {
    background: #f44336;
    color: white;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.quiz-button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
}

.quiz-button:hover {
    background: #ffd700;
    color: #1a2a6c;
}

.quiz-progress {
    margin: 20px 0;
    font-size: 1.2rem;
    color: #ff6b6b;
}

/* Ашигласан материал модал */
.credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 42, 108, 0.95);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

.credits-modal.visible {
    opacity: 1;
    visibility: visible;
}

.credits-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 20px;
    padding: 30px;
    overflow-y: auto;
    color: #1a2a6c;
    border: 4px solid #ffd700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.credits-section {
    margin: 20px 0;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 15px;
    border: 2px solid #ffd700;
}

.credits-section h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
}

.credits-section ul {
    padding-left: 20px;
    margin: 10px 0;
}

.credits-section li {
    margin: 5px 0;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    border: 2px solid #ffd700;
}

.loading-content h2 {
    margin-bottom: 1rem;
    color: #ffd700;
    font-size: 2rem;
}

.loading-bar {
    width: 300px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
    border: 1px solid #ffd700;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffd700);
    width: 0%;
    transition: width 0.3s ease;
}

.loading-text {
    font-size: 1rem;
    color: #ffd700;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* add to styles.css */
#credits-modal {
  position: fixed;
  inset: 0;
  display: none; /* controlled by JS */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
}
#credits-modal .credits-content {
  max-width: 900px;
  width: calc(100% - 40px);
  background: #fff;
  padding: 24px;
  border-radius: 8px;
}