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

body {
    font-family: 'Courier New', monospace;
    background: #1a1a2e;
    color: #eee;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    background: #0f0f23;
    border: 2px solid #16213e;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    width: 1024px;
    height: 768px;
    display: block;
}

#ohio-tagline {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: bold;
    color: #f5f5f5;
    text-shadow: 2px 2px 0 #000;
    z-index: 25;
}

/* Gemini API Loading Overlay */
#gemini-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('GTABackground.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#gemini-loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.loading-content {
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
    padding: 20px;
    text-align: center;
}

#gemini-loading-overlay h2 {
    color: white;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-bar-container {
    width: 80%;
    max-width: 400px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-progress {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #ff6600, #ffcc00);
    border-radius: 8px;
    animation: loading-animation 1.5s infinite ease-in-out;
}

@keyframes loading-animation {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

/* Intro Screen */
#intro-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    background-image: url('Intro Screen.png');
    background-size: cover;
    background-position: center;
    image-rendering: pixelated;
    display: flex;
    justify-content: center;
    align-items: center;
}

#intro-overlay {
    text-align: center;
    text-shadow: 3px 3px 0 #000;
}

#intro-title {
    font-size: 52px;
    color: #fffbe6;
    margin-bottom: 40px;
}

#intro-start-button {
    padding: 18px 60px;
    font-size: 26px;
    font-weight: bold;
    color: #111;
    background: #ffd93b;
    border: 4px solid #000;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 0 0 4px #fff, 0 8px 0 0 #000;
    image-rendering: pixelated;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#intro-start-button:hover {
    transform: translateY(2px);
    box-shadow: 0 0 0 4px #fff, 0 4px 0 0 #000;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    pointer-events: none;
    z-index: 10;
}

#health-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#health-bar {
    width: 200px;
    height: 25px;
    background: #333;
    border: 2px solid #fff;
    border-radius: 3px;
    overflow: hidden;
}

#health-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    transition: width 0.3s ease;
    width: 100%;
}

#health-text {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

#score-display {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
}

/* Dialogue Overlay + Box (Pokemon-style) */
#dialogue-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 20;
}

#dialogue-box {
    width: 90%;
    max-width: 900px;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #fff;
    padding: 16px 20px;
    border-radius: 5px;
    margin-bottom: 28px;
    display: flex;
    gap: 16px;
}

#dialogue-portrait {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
    border: 2px solid #fff;
    background: #111;
}

#dialogue-content {
    flex: 1;
}

#dialogue-text {
    color: #fff;
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 10px;
}

#dialogue-continue {
    color: #888;
    font-size: 14px;
    text-align: right;
    animation: blink 1s infinite;
}

/* Question Modal */
#question-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#question-content {
    background: #16213e;
    border: 3px solid #e94560;
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
}

#question-content h2 {
    color: #e94560;
    margin-bottom: 20px;
    text-align: center;
    animation: pulse 1s infinite;
}

#question-text {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    line-height: 1.5;
}

#answers-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.answer-button {
    background: #0f3460;
    border: 2px solid #533483;
    color: #fff;
    padding: 15px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 5px;
}

.answer-button:hover {
    background: #533483;
    transform: scale(1.05);
}

.answer-button.correct {
    background: #4caf50;
    border-color: #4caf50;
}

.answer-button.incorrect {
    background: #f44336;
    border-color: #f44336;
}

#timer-bar {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
}

#timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.1s linear;
    width: 100%;
}

/* Start Menu */
#start-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 20px;
}

#start-menu h1 {
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    animation: glow 2s ease-in-out infinite;
}

.menu-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
}

#study-sources {
    width: 100%;
    height: 150px;
    padding: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    border-radius: 5px;
    margin: 10px 0;
    resize: vertical;
}

#start-button {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    width: 100%;
}

#start-button:hover {
    background: #c13651;
    transform: scale(1.05);
}

.lore {
    margin-top: 20px;
    max-width: 600px;
    text-align: center;
    font-style: italic;
    opacity: 0.9;
}

/* Game Over Screen */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#game-over h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #e94560;
}

#game-over-message {
    font-size: 20px;
    margin-bottom: 30px;
    color: #fff;
}

#restart-button {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

#restart-button:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* Animations */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

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

@keyframes glow {
    0%, 100% { text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5); }
    50% { text-shadow: 3px 3px 20px rgba(255, 255, 255, 0.8); }
}

.hidden {
    display: none !important;
}
