:root {
    --bg-color: #e0f7fa; /* Soft cyan background */
    --text-color: #333;
    --primary-color: #29b6f6;
    --tooth-color: #fff;
    --tooth-dirty: #fff59d; /* Yellowish plaque */
    --tooth-gross: #a1887f; /* Brownish dirt */
    --gum-color: #f48fb1;
    --face-color: #ffccbc;
}

* {
    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;
    touch-action: manipulation;
    overflow: hidden; /* Prevent scrolling */
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 600px;
}

header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.back-btn {
    font-size: 2rem;
    text-decoration: none;
    margin-right: 15px;
}

h1 {
    font-size: 2rem;
    color: var(--primary-color);
    flex-grow: 1;
    text-align: center;
}

.play-area {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.character {
    display: flex;
    justify-content: center;
    align-items: center;
}

.face {
    background-color: var(--face-color);
    width: 300px;
    height: 350px;
    border-radius: 150px 150px 100px 100px;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.eyes {
    display: flex;
    justify-content: space-around;
    padding-top: 60px;
}

.eye {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    position: relative;
}

.eye::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #000;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mouth-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.mouth {
    background-color: #000;
    width: 240px;
    height: 120px;
    border-radius: 20px 20px 60px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 20px;
    position: relative;
    overflow: hidden;
}

.teeth-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.tooth {
    width: 30px;
    height: 40px;
    background-color: var(--tooth-dirty);
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}

.tooth.clean {
    background-color: var(--tooth-color);
}

.tooth.gross {
    background-color: var(--tooth-gross);
}

.tooth:active {
    transform: scale(0.9);
}

.bottom-teeth .tooth {
    align-self: flex-end;
}

.toolbar {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #fff;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}

.tool {
    background-color: var(--bg-color);
    border: 3px solid transparent;
    border-radius: 15px;
    padding: 10px 20px;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool span {
    font-size: 1rem;
    font-family: inherit;
    font-weight: bold;
    margin-top: 5px;
}

.tool.active {
    background-color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.celebration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 40px;
    border-radius: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #ff4081;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.play-again-btn {
    display: block;
    margin: 15px auto 0;
    padding: 12px 30px;
    font-size: 1.5rem;
    background: #29b6f6;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.play-again-btn:active {
    transform: scale(0.95);
}

.face.smile-wide .mouth {
    border-radius: 20px 20px 80px 80px;
}

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

.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);
}