* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Fredoka', 'Comic Sans MS', system-ui, -apple-system, sans-serif;
    background: #E0F7FA;
    color: #263238;
}

/* Screens */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Menu Screen */
#menu-screen {
    background: linear-gradient(135deg, #FFF9C4 0%, #E1F5FE 100%);
    padding: 24px;
    justify-content: space-between;
    overflow-y: auto;
}

.header {
    text-align: center;
    margin-top: 12px;
}

.title {
    font-size: 2.4rem;
    color: #0288D1;
    text-shadow: 2px 2px 0px #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.subtitle {
    font-size: 1.2rem;
    color: #546E7A;
    margin-top: 6px;
}

/* Section Labels */
.section-title {
    font-size: 1.4rem;
    color: #37474F;
    margin-bottom: 12px;
    font-weight: bold;
}

/* Grid of Images */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 600px;
    margin: 16px 0;
}

.image-card {
    background: #FFFFFF;
    border: 4px solid #B0BEC5;
    border-radius: 20px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    box-shadow: 0 6px 0 #90A4AE;
}

.image-card:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #90A4AE;
}

.image-card.active {
    border-color: #FF4081;
    box-shadow: 0 6px 0 #C2185B;
    background: #FFF0F5;
}

.image-card canvas {
    border-radius: 12px;
    width: 100px;
    height: 100px;
}

.image-card span {
    font-size: 1.1rem;
    font-weight: bold;
    color: #37474F;
}

/* Difficulty Selector */
.diff-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 12px 0;
}

.diff-btn {
    min-width: 85px;
    min-height: 85px;
    background: #FFFFFF;
    border: 4px solid #B0BEC5;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #37474F;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 #90A4AE;
    transition: transform 0.15s, border-color 0.15s;
}

.diff-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #90A4AE;
}

.diff-btn.active {
    background: #E8F5E9;
    border-color: #4CAF50;
    box-shadow: 0 6px 0 #2E7D32;
    color: #1B5E20;
}

/* Big Action Button */
.big-btn {
    min-width: 240px;
    min-height: 75px;
    background: #4CAF50;
    color: #FFFFFF;
    border: none;
    border-radius: 35px;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 0 #2E7D32;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0 24px 0;
    transition: transform 0.15s;
}

.big-btn:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #2E7D32;
}

/* Game Screen */
#game-screen {
    display: none;
    position: relative;
}

.top-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.icon-btn {
    pointer-events: auto;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 4px solid #0288D1;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 #01579B;
    cursor: pointer;
}

.icon-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #01579B;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
}

/* Victory Overlay */
.overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.victory-card {
    background: #FFFFFF;
    border-radius: 32px;
    padding: 36px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.victory-title {
    font-size: 2.2rem;
    color: #FF4081;
}

.victory-stars {
    font-size: 3.5rem;
}
