/* ============================================================================
   NALA.BABY — FULL THEME + MOBILE-SAFE CANVAS OVERLAY
============================================================================ */

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    hyphens: auto;
}

body {
    background: #ffeef2;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background: #ff9ec4;
    padding: 2rem;
    text-align: center;
    color: #fff;
    border-bottom: 5px solid #ff6fa3;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
}

/* Main Layout */
main {
    padding: 2rem;
    max-width: 900px;
    margin: auto;
}

section {
    margin-bottom: 2rem;
    background: #fff0f5;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Section text */
section h2 {
    color: #ff6fa3;
    margin-bottom: 1rem;
}

section p {
    margin-bottom: 1rem;
}

/* Links */
a {
    color: #ff6fa3;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

/* Footer (RESTORED) */
footer {
    background: #ff9ec4;
    text-align: center;
    padding: 1.5rem;
    color: #fff;
    border-top: 5px solid #ff6fa3;
}

.contact-links a {
    display: inline-block;
    margin: 0.5rem 1rem;
    padding: 0.5rem 1rem;
    background: #ff6fa3;
    color: white;
    border-radius: 10px;
    transition: 0.3s;
}

.contact-links a:hover {
    background: #ff4477;
}

/* Letter Select */
#letterSelect {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    font-size: 1.2rem;
    padding: 0.5rem 0.8rem;
    background: #ff9ec4;
    color: #fff;
    border: none;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

/* Score / Grade / Message */
#score, #grade, #message {
    text-align: center;
    font-weight: bold;
}

#score {
    font-size: 1.5rem;
    color: #ff6fa3;
    margin-top: 0.25rem;
}

#grade {
    font-size: 1.6rem;
    color: #555;
}

#message {
    font-size: 1.7rem;
    color: #ff4fa3;
    display: none;
}

/* ============================================================================
   CANVAS WRAPPER — FIXED (NOT HUGE ON MOBILE)
   - sizes from container, not viewport
   - square via aspect-ratio
============================================================================ */
#canvasWrapper {
    position: relative;

    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;

    margin: 20px auto;

    background: #fff;
    border: 4px solid #ff6fa3;
    border-radius: 15px;
    overflow: hidden;
}

#letterCanvas,
#drawCanvas {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    touch-action: none;
}

#letterCanvas {
    z-index: 1;
    pointer-events: none;
}

#drawCanvas {
    z-index: 2;
    pointer-events: auto;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    header h1 {
        font-size: 2.2rem;
    }

    main {
        padding: 1rem;
    }

    section {
        padding: 1rem;
    }

    #score { font-size: 1.35rem; }
    #grade { font-size: 1.45rem; }
    #message { font-size: 1.5rem; }
}

/* ============================================================================
   THEME SCROLLBARS (Firefox + Chromium/Safari)
   Uses existing site colors: bg #ffeef2, accent #ff6fa3, hover #ff4477
============================================================================ */

:root {
  --scrollbar-track: #ffeef2;
  --scrollbar-thumb: #ff6fa3;
  --scrollbar-thumb-hover: #ff4477;
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Chromium / Safari */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 3px solid var(--scrollbar-track); /* gives the “padded” look */
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}
