:root {
    --bg-color: #f0f8ff; /* Alice Blue */
    --text-color: #333;
    --primary-color: #ff6b6b; /* Soft Red/Pink */
}

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

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    touch-action: manipulation;
    overflow: hidden;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    gap: 10px;
}

.fullscreen-btn {
    font-size: 1.5rem;
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}
.fullscreen-btn:active {
    transform: scale(0.9);
}

.back-button {
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    background: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#instruction {
    font-size: 2rem;
    color: #888;
    margin-bottom: 40px;
}

#display-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 40vh;
    position: relative;
}

#big-letter {
    font-size: 15rem;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 4px 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.1s;
    user-select: none;
}

#emoji-display {
    font-size: 6rem;
    line-height: 1;
    text-align: center;
    min-height: 7rem;
    user-select: none;
}

#word-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff6b6b;
    text-align: center;
    min-height: 3rem;
    user-select: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

@keyframes popEmoji {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.animate-pop-emoji {
    animation: popEmoji 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popWord {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.animate-pop-word {
    animation: popWord 0.3s ease-out forwards;
}

/* Animations */
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-pop {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Colorful letter classes */
.color-0 { color: #ff5252; }
.color-1 { color: #ff4081; }
.color-2 { color: #e040fb; }
.color-3 { color: #7c4dff; }
.color-4 { color: #536dfe; }
.color-5 { color: #448aff; }
.color-6 { color: #40c4ff; }
.color-7 { color: #18ffff; }
.color-8 { color: #64ffda; }
.color-9 { color: #69f0ae; }
.color-10 { color: #b2ff59; }
.color-11 { color: #eeff41; }
.color-12 { color: #ffff00; }
.color-13 { color: #ffd740; }
.color-14 { color: #ffab40; }
.color-15 { color: #ff6e40; }

/* Responsive */
@media (max-width: 768px) {
    header { flex-direction: column; gap: 10px; }
    h1 { font-size: 2rem; }
    #big-letter { font-size: 10rem; }
    #emoji-display { font-size: 4rem; min-height: 5rem; }
    #word-display { font-size: 1.8rem; }
}