/* Car Wash Blitz - kids edition */
:root { --ink: #2a2440; --sky: #7fd3ff; --green: #43c05a; --yellow: #ffd84a; --pink: #ff7ac8; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); font-family: Fredoka, system-ui, sans-serif; color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }

.scr { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; z-index: 2; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.scr.show { display: flex; }

/* title */
#title { justify-content: center; gap: min(2vh, 14px); background: radial-gradient(circle at 50% 30%, #b8ecff, #4fbfff); overflow: hidden; }
.logo { margin: 0; text-align: center; font-family: "Lilita One", Fredoka, sans-serif; line-height: .9; letter-spacing: 1px; }
.logo span { display: block; font-size: min(9vh, 7vw); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.logo b { display: block; font-size: min(15vh, 12vw); color: var(--yellow); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 rgba(0, 0, 0, .2); transform: rotate(-3deg); }
.logo em { display: inline-block; font-style: normal; font-size: min(7vh, 5.5vw); color: #fff; background: var(--pink); border: 4px solid var(--ink); border-radius: 18px; padding: 2px 14px; margin-top: 6px; transform: rotate(4deg); }
.title-car { width: min(40vh, 34vw); height: auto; animation: bob 1.2s ease-in-out infinite; }
.play { width: min(26vh, 22vw); height: min(26vh, 22vw); border-radius: 50%; background: var(--green); color: #fff; font-size: min(12vh, 10vw); border: 6px solid var(--ink); box-shadow: 0 8px 0 rgba(0, 0, 0, .25); padding-left: 2%; animation: pulse 1.2s ease-in-out infinite; }
.play:active { transform: translateY(4px) scale(.97); box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.parent-btn { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .6); border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 600; opacity: .8; }
.bub { position: absolute; bottom: -60px; width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .2); animation: rise 7s linear infinite; }
.bub:nth-child(1) { left: 8%; animation-delay: 0s; } .bub:nth-child(2) { left: 22%; width: 24px; height: 24px; animation-delay: 2s; }
.bub:nth-child(3) { left: 78%; width: 56px; height: 56px; animation-delay: 1s; } .bub:nth-child(4) { left: 90%; animation-delay: 3.5s; } .bub:nth-child(5) { left: 60%; width: 20px; height: 20px; animation-delay: 5s; }

/* garage + book */
#garage, #book { background: linear-gradient(#9fe0ff, #6fc8ff); }
.bar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; flex: 0 0 auto; }
.bar-title { font-size: 40px; }
.rb { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); font-size: 30px; display: grid; place-items: center; box-shadow: 0 5px 0 rgba(0, 0, 0, .2); }
.rb.pill { width: auto; border-radius: 34px; padding: 0 16px; display: flex; gap: 6px; }
.rb.pill b { font-size: 26px; }
.rb.nonstop { width: auto; height: 72px; border-radius: 36px; padding: 0 22px; font-size: 34px; background: #43c05a; animation: pulse 1.4s ease-in-out infinite; }
.rb.ghost { visibility: hidden; }
.rb:active, .car:active { transform: translateY(3px); }
.cars { flex: 1; width: 100%; overflow-y: auto; touch-action: pan-y; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 4px 18px 24px; align-content: start; }
.car { position: relative; background: #fff; border: 5px solid var(--ink); border-radius: 28px; padding: 6px; box-shadow: 0 6px 0 rgba(0, 0, 0, .2); }
.car canvas { width: 100%; height: auto; display: block; }
.car.locked { background: #dfe8f1; }
.car .lock { position: absolute; right: 10px; top: 8px; font-style: normal; font-size: 28px; display: flex; align-items: center; gap: 2px; }
.car .lock b { font-size: 22px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 14px; padding: 0 8px; }
.car.going { border-color: var(--green); }
.car.shake { animation: shake .4s; }
.stks { flex: 1; width: 100%; overflow-y: auto; touch-action: pan-y; display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px; padding: 4px 18px 24px; align-content: start; }
.stk { aspect-ratio: 1; border-radius: 22px; background: rgba(255, 255, 255, .45); border: 4px dashed rgba(42, 36, 64, .3); display: grid; place-items: center; font-size: 30px; font-weight: 700; color: rgba(42, 36, 64, .3); }
.stk.got { background: #fff; border: 4px solid var(--ink); font-size: 52px; color: inherit; }
.stk.gold { background: linear-gradient(#fff6b0, #ffd84a); }

/* grown-ups */
.modal { position: fixed; inset: 0; z-index: 10; background: rgba(20, 20, 40, .55); display: grid; place-items: center; padding: 12px; }
.modal[hidden] { display: none; }
.card { background: #fff; border-radius: 24px; border: 4px solid var(--ink); padding: 16px 20px; width: min(420px, 100%); max-height: 96vh; overflow-y: auto; text-align: center; touch-action: pan-y; }
.card.wide { width: min(560px, 100%); text-align: left; }
.card h2 { margin: 0 0 6px; font-family: "Lilita One", Fredoka, sans-serif; font-weight: 400; }
.card p { margin: 6px 0; }
.small { font-size: 14px; }
.gin { height: 44px; font-size: 32px; font-weight: 700; border-bottom: 3px solid var(--ink); margin: 4px auto 10px; width: 120px; }
.gin.bad { color: #e33; animation: shake .4s; }
.keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.keys button { height: 44px; border-radius: 12px; background: #eef3f8; border: 2px solid #c9d3df; font-size: 20px; font-weight: 700; }
.keys .del { grid-column: span 2; }
.txt { background: none; margin-top: 8px; text-decoration: underline; }
.sw { display: flex; gap: 10px; align-items: center; font-size: 18px; padding: 6px 0; }
.sw input { width: 24px; height: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn { display: inline-block; padding: 10px 16px; border-radius: 14px; background: #eef3f8; border: 3px solid var(--ink); font-weight: 700; text-decoration: none; color: var(--ink); font-size: 15px; }
.btn.green { background: var(--green); color: #fff; } .btn.red { background: #ff5f5f; color: #fff; }

/* turn sideways */
#rotate { position: fixed; inset: 0; z-index: 20; background: var(--sky); display: none; place-items: center; font-size: 120px; }
body.portrait #rotate { display: grid; }
.rphone { display: inline-block; animation: turn 2s ease-in-out infinite; }
.rarrow { position: absolute; margin-top: 220px; font-size: 70px; color: #fff; }

@keyframes bob { 50% { transform: translateY(-8px) rotate(-1deg); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes rise { to { transform: translateY(-120vh); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (max-height: 420px) { .rb { width: 52px; height: 52px; font-size: 24px; } .cars { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; } .bar { padding: 6px 14px; } }
