@import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Patrick+Hand&display=swap');

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

body {
    background-color: #2b2b2b;
    font-family: 'Patrick Hand', cursive;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #fff;
    margin: 0;
}

#game-container {
    background-color: #2F593E; /* Green chalkboard color */
    border: 12px solid #5C4033; /* Wooden frame */
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 0 50px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 600px;
    min-height: 450px;
    padding: 20px;
    position: relative;
    text-align: center;
}

/* Add a slight chalk dust texture using background-image radial gradients or similar */
#game-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.05"/></svg>');
    pointer-events: none;
    border-radius: 4px;
}

.screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 400px;
}

.hidden {
    display: none !important;
}

h1 {
    font-family: 'Caveat Brush', cursive;
    font-size: 3.5rem;
    color: #f7f7f7;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

h2 {
    font-family: 'Caveat Brush', cursive;
    font-size: 2.8rem;
    margin: 30px 0;
    color: #ffd700;
}

p {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

#mascot {
    max-width: 150px;
    margin-bottom: 20px;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
}

.chalk-button {
    background-color: transparent;
    border: 3px solid #f7f7f7;
    color: #f7f7f7;
    padding: 10px 25px;
    font-size: 1.8rem;
    font-family: 'Caveat Brush', cursive;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease-in-out;
    margin-top: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.chalk-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.chalk-button:active {
    transform: scale(0.95);
}

/* Game Screen Specifics */
#stats-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.5);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#feedback-message {
    font-size: 1.8rem;
    font-weight: bold;
    min-height: 2.5rem; /* prevent layout shift */
}

.correct {
    color: #90ee90;
    animation: pop 0.3s ease-in-out;
}

.incorrect {
    color: #ff6b6b;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
    100% { transform: translateX(0); }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Mixed Input Modes Styles */

#answer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

/* MCQ Mode */
#mcq-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}

.mcq-btn {
    width: 100%;
    margin-top: 0;
    min-height: 60px;
    font-size: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Numpad Mode */
#numpad-display-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

#numpad-display {
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
    border-radius: 5px;
    color: #fff;
    font-size: 2.5rem;
    font-family: 'Patrick Hand', cursive;
    padding: 10px;
    width: 80%;
    max-width: 300px;
    min-height: 60px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

#numpad-display:empty::before {
    content: "?";
    color: rgba(255, 255, 255, 0.4);
}

#numpad-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.numpad-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.numpad-btn {
    flex: 1;
    margin-top: 0;
    font-size: 1.8rem;
    padding: 10px 0;
}

.action-row {
    margin-top: 5px;
}

.action-btn {
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 1.5rem;
}

#numpad-submit {
    flex: 2;
    background-color: rgba(46, 204, 113, 0.4); /* subtle green tint */
}

/* Settings and Options Styles */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    width: 100%;
    max-width: 400px;
}

.option-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
}

.chalk-select {
    background-color: #2F593E;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 5px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.2rem;
    padding: 5px;
    outline: none;
    cursor: pointer;
}

.chalk-select option {
    background-color: #2b2b2b;
}

.start-actions {
    display: flex;
    gap: 15px;
}

/* Stats Screen */
.stats-board {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ffd700;
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
    max-width: 300px;
}

.stats-board p {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Combo multiplier styles */
#combo-display {
    color: #ff9800;
    font-size: 1.2rem;
    margin-left: 5px;
    animation: pop 0.3s ease-in-out;
}

/* Auth Input Styles */
.chalk-input {
    width: 80%;
    max-width: 300px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #fff;
    border-radius: 8px;
    color: #fff;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.2rem;
    outline: none;
}
.chalk-input::placeholder {
    color: rgba(255, 255, 255, 0.9);
}
.chalk-input:focus {
    border-color: #ffd700;
}
