*{box-sizing:border-box}
:root{
--bg1:#68d8ff;
--bg2:#ffe38c;
--pink:#ff66c4;
--orange:#ff9f43;
--yellow:#ffe66d;
--mint:#7effc8;
--purple:#9f7bff;
--white:#fff;
--text:#5b2451;
}

html,body{
margin:0;
min-height:100%;
font-family:Arial,sans-serif;
background:
linear-gradient(180deg,var(--bg1),#d9f8ff 35%,var(--bg2));
color:var(--text);
overflow-x:hidden;
}

body:before{
content:"";
position:fixed;
inset:0;
pointer-events:none;
background:
radial-gradient(circle at 15% 15%,rgba(255,255,255,.8),transparent 8%),
radial-gradient(circle at 80% 12%,rgba(255,255,255,.7),transparent 9%),
radial-gradient(circle at 20% 80%,rgba(255,102,196,.22),transparent 16%),
radial-gradient(circle at 75% 75%,rgba(126,255,200,.22),transparent 16%);
}

.topbar{
position:sticky;
top:0;
z-index:10;
display:flex;
justify-content:space-between;
align-items:center;
padding:14px;
background:rgba(255,255,255,.72);
backdrop-filter:blur(10px);
border-bottom:2px solid rgba(255,102,196,.25);
}

.logo{
font-weight:900;
color:var(--pink);
font-size:14px;
letter-spacing:1px;
}

nav{
display:flex;
gap:8px;
}

nav a{
text-decoration:none;
color:#7a4773;
font-size:13px;
font-weight:900;
padding:8px 10px;
border-radius:999px;
}

nav a.active{
background:linear-gradient(135deg,var(--yellow),var(--pink));
color:#5b2451;
}

.wrap{
max-width:520px;
margin:0 auto;
padding:18px 12px 40px;
}

.hidden{display:none!important}

.intro{
min-height:calc(100vh - 70px);
display:flex;
flex-direction:column;
align-items:center;
justify-content:center;
text-align:center;
gap:18px;
}

.hero-bubble{
width:130px;
height:130px;
border-radius:40%;
display:grid;
place-items:center;
font-size:72px;
background:
radial-gradient(circle at 30% 30%,#fff,var(--yellow),var(--pink),var(--purple));
box-shadow:
0 15px 0 rgba(159,123,255,.15),
0 0 35px rgba(255,102,196,.35);
animation:float 1.8s infinite ease-in-out;
}

@keyframes float{
50%{transform:translateY(-10px) rotate(5deg)}
}

h1{
margin:0;
font-size:clamp(36px,11vw,62px);
line-height:.9;
color:var(--pink);
text-shadow:0 3px 0 #fff;
}

p{
margin:0;
max-width:360px;
line-height:1.6;
font-size:16px;
color:#7d4f77;
}

button{
border:none;
cursor:pointer;
font-family:inherit;
font-weight:900;
}

#playBtn,.restart,.intro button{
padding:16px 34px;
border-radius:22px;
background:linear-gradient(135deg,#fff,var(--yellow),var(--orange),var(--pink));
color:#5b2451;
box-shadow:0 8px 0 #c44b97;
font-size:16px;
}

button:active{
transform:translateY(4px);
box-shadow:0 3px 0 #c44b97;
}

.stats{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:8px;
margin-bottom:12px;
}

.stats div{
background:rgba(255,255,255,.8);
border-radius:18px;
padding:10px;
text-align:center;
box-shadow:0 8px 0 rgba(159,123,255,.12);
}

.stats span{
display:block;
font-size:12px;
font-weight:900;
color:#8d4e87;
}

.stats b{
font-size:22px;
color:var(--pink);
}

.board-shell{
padding:10px;
border-radius:28px;
background:linear-gradient(145deg,#fff,var(--yellow),var(--pink));
box-shadow:0 14px 0 rgba(159,123,255,.12);
}

.board{
display:grid;
grid-template-columns:repeat(8,1fr);
gap:5px;
padding:7px;
height:min(88vw,500px);
background:linear-gradient(135deg,#b9f6ff,#ffe7aa);
border-radius:22px;
}

.tile{
border-radius:14px;
display:grid;
place-items:center;
font-size:clamp(18px,6vw,32px);
background:rgba(255,255,255,.45);
}

.player{
background:radial-gradient(circle,#fff,var(--yellow),var(--orange));
box-shadow:0 0 18px rgba(255,230,109,.8);
}

.wall{
background:repeating-linear-gradient(
45deg,
#ff89d6 0 8px,
#ffe66d 8px 16px
);
}

.collect{
background:radial-gradient(circle,#fff,#7effc8,#68d8ff);
}

.enemy{
background:radial-gradient(circle,#fff,#9f7bff,#5b2451);
box-shadow:0 0 15px rgba(159,123,255,.6);
}

.portal{
background:radial-gradient(circle,#fff,#68d8ff,#9f7bff);
box-shadow:0 0 20px rgba(104,216,255,.8);
}

.message{
margin:12px 0;
padding:12px;
border-radius:18px;
background:rgba(255,255,255,.75);
text-align:center;
font-weight:900;
}

.controls{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:10px;
max-width:300px;
margin:0 auto;
}

.controls button{
height:64px;
border-radius:20px;
background:linear-gradient(#fff,var(--yellow),var(--pink));
font-size:28px;
color:#5b2451;
}

.controls button:nth-child(1){grid-column:2}
.controls button:nth-child(2){grid-column:1}
.controls button:nth-child(3){grid-column:2}
.controls button:nth-child(4){grid-column:3}

.restart{
width:100%;
margin-top:12px;
}

@media(max-width:390px){
.topbar{flex-direction:column}
.controls button{height:58px}
}
