/* Update all text to use comic-bald.ttf */
body {
    font-family: 'Comic Bald', 'Comic Sans MS', cursive, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #333;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    min-height: 100vh;
    overflow: hidden; 
    cursor: url('/cursor.webp'), auto;
    transition: filter 0.3s ease;
}

/* Add custom font face */
@font-face {
    font-family: 'Comic Bald';
    src: url('/comic-bald.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Ensure all text elements use the font */
button, input, select, textarea, li, h1, h2, h3, h4, h5, h6, p, div, span {
    font-family: 'Comic Bald', 'Comic Sans MS', cursive, sans-serif;
}

/* Add custom cursor styling */
body {
    cursor: none; /* Hide default cursor when custom is active */
}

/* Add hover effects for clickable elements */
button:hover {
    cursor: none; /* Hide default cursor on hover */
}

input[type="text"]:hover {
    cursor: none;
}

li[data-slot-index]:hover {
    cursor: none;
}

/* Ensure custom cursor appears above everything */
#gameCanvas {
    cursor: none; /* Hide cursor on canvas */
}

/* Add hover states for game buttons */
.mobile-btn:hover {
    cursor: none;
}

#inventoryList li:hover {
    cursor: none;
}

/* Add subtle hover glow effect */
canvas {
    transition: filter 0.1s ease;
}

canvas:hover {
    filter: brightness(1.05);
}

/* Ensure smooth hover transitions */
.proximity-indicator {
    transition: opacity 0.2s ease;
}

#title-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

#title-image {
    max-width: 80%;
    height: auto;
    margin-bottom: 30px;
    border: 3px solid #555;
    border-radius: 10px;
}

#play-button, #no-math-button {
    padding: 15px 30px;
    font-size: 1.5em;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    margin: 5px;
}

#play-button:hover, #no-math-button:hover {
    background-color: #4cae4c;
}

#no-math-button {
    background-color: #d9534f;
}

#no-math-button:hover {
    background-color: #c9302c;
}

#game-ui-container {
    display: none;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #444;
    border-radius: 5px;
    text-align: center;
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-around; 
    align-items: center; 
    width: 90%; 
    max-width: 800px; 
}

#game-stats p {
    margin: 5px 0;
}

.notebook-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
}

#notebook-icon {
    width: 48px;
    height: 48px;
    margin-right: 8px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#stamina-bar-container {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center; 
    width: 100%; 
    position: relative; 
}

#stamina-bar-container span {
    margin-right: 5px;
    font-size: 0.9em;
}

#stamina-bar-wrapper {
    position: relative;
    width: 100px;
    height: 15px;
}

#stamina-bar {
    width: 100%;
    height: 100%;
    background-color: #555;
    border: 1px solid #777;
    border-radius: 3px;
    overflow: hidden;
}

#stamina-bar-fill {
    height: 100%;
    width: 100%; 
    background-color: #4CAF50; 
    transition: width 0.1s linear; 
}

#staminometer-overlay {
    position: absolute;
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    width: 130px; 
    height: 40px; 
    pointer-events: none; 
    z-index: 2; 
}

#inventory-container {
    padding: 5px;
    background-color: #4a4a4a;
    border-radius: 5px;
    margin-left: 15px; 
    min-width: 180px; 
}

#inventory-container h3 {
    margin: 0 0 8px 0;
    font-size: 1em;
    text-align: left;
}

#inventoryList {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px; 
    justify-content: center;
}

#inventoryList li {
    border: 1px solid #666;
    padding: 8px 12px;
    min-width: 40px; 
    height: 20px; 
    text-align: center;
    background-color: #555;
    border-radius: 3px;
    font-size: 0.85em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none; 
}

#game-canvas-container {
    display: none;
    border: 2px solid #555;
    background-color: #000; 
    display: flex; 
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    display: block; 
    background-color: #222; 
    cursor: url('/cursor.webp'), auto;
}

#message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#message-box {
    background-color: #fff;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    min-width: 250px;
}

#messageText {
    margin-bottom: 15px;
    font-size: 1.2em;
}

#quizAnswerInput {
    display: block; 
    padding: 8px;
    margin-top: 10px;
    margin-bottom: 15px;
    width: 80%;
    max-width: 120px; 
    text-align: center;
    font-size: 1.1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; 
}

#actionButton {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 5px;
}

#actionButton:hover {
    background-color: #4cae4c;
}

#mobile-controls-toggle {
    margin-left: 15px;
    padding: 8px 12px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    align-self: center;
    font-family: inherit;
}

#mobile-controls-toggle:hover {
    background-color: #5a6268;
}

#mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    z-index: 500;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 30px;
    box-sizing: border-box;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    border: 2px solid #fff;
    background-color: rgba(100, 100, 100, 0.5);
    color: #fff;
    font-size: 24px;
    border-radius: 50%;
    user-select: none;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;
}

.mobile-joystick {
    position: relative;
    width: 180px;
    height: 180px;
}

.mobile-joystick .mobile-btn {
    position: absolute;
}

#mobile-up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

#mobile-down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

#mobile-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

#mobile-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#mobile-run {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 165, 0, 0.6);
}

#quiz-progress-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.progress-mark {
    font-size: 1.8em;
    font-weight: bold;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: 5px;
    color: #888;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.progress-mark.correct {
    border-color: #28a745;
    background-image: url('/YCTP_IndicatorsSheet_0.png');
}

.progress-mark.incorrect {
    border-color: #dc3545;
    background-image: url('/YCTP_IndicatorsSheet_1.png');
}

.classroom-floor-blue {
    background-color: #4a90e2;
    background-image: radial-gradient(circle, #5ba3f5 10%, #3a7bd5 100%);
}

/* Add styling for seed-based level sharing */
#levelIdInput {
    padding: 10px;
    width: 300px;
    margin-right: 10px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1px;
}

#loadLevelButton {
    padding: 10px 15px;
    background-color: #337ab7;
    color: white;
    border: none;
    border-radius: 5px;
    font-family: 'Comic Sans MS', cursive;
    cursor: pointer;
    transition: background-color 0.3s;
}

#loadLevelButton:hover {
    background-color: #286090;
}

#exit-door {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

/* Add these styles for the secret mode */
@keyframes glitch {
    0% {
        transform: translate(0);
        filter: hue-rotate(0deg) brightness(1);
    }
    20% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg) brightness(1.2);
    }
    40% {
        transform: translate(-2px, -2px);
        filter: hue-rotate(180deg) brightness(1.5);
    }
    60% {
        transform: translate(2px, 2px);
        filter: hue-rotate(270deg) brightness(1.2);
    }
    80% {
        transform: translate(2px, -2px);
        filter: hue-rotate(360deg) brightness(1);
    }
    100% {
        transform: translate(0);
        filter: hue-rotate(0deg) brightness(1);
    }
}

@keyframes flash {
    0% { opacity: 0; }
    50% { opacity: 0.3; }
    100% { opacity: 0; }
}

#corruption-overlay {
    backdrop-filter: blur(1px);
    mix-blend-mode: multiply;
}

/* Add locker styling */
.locker {
    position: absolute;
    width: 28.8px;
    height: 38.4px;
    background-image: url('/locker.jpg');
    background-size: cover;
    background-position: center;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}