:root {
    --bg-color: #0F172A;
    --accent-color: #FACC15;
    --path-color: rgba(255, 255, 255, 0.1);
    --guide-color: rgba(255, 255, 255, 0.3);
    --stroke-color: #FACC15;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: 'Fredoka', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    text-decoration: none;
    font-size: 1.5rem;
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 50%;
    backdrop-filter: blur(5px);
    transition: background 0.3s;
}

#controls {
    position: absolute;
    top: 20px;
    right: 20px;
    left: 80px; /* Space for back button */
    z-index: 100;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px; /* Hide scrollbar potentially */
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

/* Hide Scrollbar */
#controls::-webkit-scrollbar {
    display: none;
}

.letter-btn, #reset-btn {
    flex: 0 0 auto; /* Prevent shrinking */
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.letter-btn.active {
    background: var(--accent-color);
    color: #333;
    font-weight: bold;
    border-color: var(--accent-color);
}

#trace-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: crosshair;
}

#feedback-area {
    position: absolute;
    bottom: 50px;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 20;
}

#instruction-text {
    color: white;
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    opacity: 0.8;
}

#reward-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#reward-container.hidden {
    display: none;
}

#reward-icon {
    font-size: 8rem;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.5));
    animation: float 3s ease-in-out infinite;
}

#reward-text {
    font-size: 2.5rem;
    color: var(--accent-color);
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    margin-top: 10px;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
