

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg:#0c1025;
  --panel:#171d3c;
  --text:#f7f8ff;
  --muted:#aab2d6;
  --pink:#ff62b0;
  --cyan:#6ce7ff;
  --gold:#ffd36e;
  --line:rgba(255,255,255,.1);
}

* { box-sizing:border-box; }

body {
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(ellipse at 10% 5%,#29244e,transparent 35%),
    radial-gradient(ellipse at 90% 30%,#142d52,transparent 32%),
    #0c1025;
  color:var(--text);
  font-family:Manrope,'Hind Siliguri',sans-serif;
}

button { font:inherit; cursor:pointer; color:inherit; }
.app { width:min(1180px,100%); margin:auto; padding:22px clamp(12px,3vw,32px); }
.topbar,.brand,.actions,.board-heading,.board-footer,footer {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.topbar { margin-bottom:24px; }
.brand { justify-content:flex-start; color:white; text-decoration:none; gap:10px; }
.brand-icon {
  display:grid; place-items:center; width:44px; height:44px;
  border-radius:15px; background:linear-gradient(135deg,#ff73bc,#8a76ff);
  font-size:25px;
}
.brand b { display:block; font-size:13px; letter-spacing:1.8px; }
.brand small { display:block; margin-top:3px; font-size:9px; letter-spacing:2px; color:var(--muted); }
.actions button {
  width:41px; height:41px; border:1px solid var(--line);
  border-radius:13px; background:#ffffff0c; font-size:18px;
}
.hero {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  min-height:200px; padding:clamp(20px,4vw,40px);
  border:1px solid var(--line); border-radius:25px;
  background:linear-gradient(110deg,#25264e,#39254e);
  overflow:hidden;
}
.eyebrow { color:var(--cyan); font-size:10px; letter-spacing:2px; font-weight:800; }
.hero h1 { margin:10px 0; font-size:clamp(29px,4.5vw,48px); line-height:1.12; }
.hero h1 span {
  color:#ff90d0;
  background:linear-gradient(90deg,#ff80c6,#c0a4ff,#73e9ff);
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent;
}
.intro { color:#c2c6e5; font-family:'Hind Siliguri',sans-serif; }
.hero-gem { font-size:clamp(65px,10vw,115px); filter:drop-shadow(0 10px 25px #54d9ff55); }
.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:16px 0; }
.stats>div {
  padding:14px 16px; background:var(--panel);
  border:1px solid var(--line); border-radius:15px;
}
.stats small { display:block; color:var(--muted); font-size:9px; letter-spacing:1.5px; }
.stats strong { display:block; margin-top:5px; font-size:24px; }
.stats>div:nth-child(2) strong { color:var(--gold); }
.stats>div:nth-child(4) strong { color:var(--cyan); }

.game-layout { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(250px,.75fr); gap:17px; }
.board-panel,.side-panel {
  padding:17px; background:#151b37ed;
  border:1px solid var(--line); border-radius:21px;
  box-shadow:0 18px 45px #0003;
}
.board-heading { margin-bottom:13px; font-size:12px; }
.restart {
  border:1px solid var(--line); border-radius:10px;
  padding:8px 11px; background:#ffffff0b; font-size:11px;
}
.board {
  display:grid; grid-template-columns:repeat(8,minmax(0,1fr));
  gap:clamp(3px,.7vw,7px); padding:8px;
  border-radius:15px; border:1px solid var(--line);
  background:linear-gradient(145deg,#090e22,#171d3d);
  max-width:650px; margin:auto;
}
.gem {
  aspect-ratio:1; min-width:0; display:grid; place-items:center;
  padding:0; position:relative; overflow:hidden;
  border-radius:clamp(6px,1.3vw,12px);
  background:linear-gradient(145deg,#ffffff12,#ffffff03);
  border:1px solid #ffffff12; transition:transform .13s,box-shadow .13s;
  touch-action:manipulation;
}
.gem::before {
  content:""; position:absolute; left:15%; right:15%; top:8%; height:25%;
  border-radius:50%; background:#ffffff45; filter:blur(3px);
}
.gem .jewel { font-size:clamp(14px,3.1vw,32px); line-height:1; filter:drop-shadow(0 3px 3px #0006); }
.gem.selected { transform:scale(.91); border:2px solid white; box-shadow:0 0 0 3px #6ce7ff66,0 0 17px #6ce7ff88; }
.gem.hint { animation:hintPulse .55s ease-in-out 3; }
.gem.matched { animation:pop .22s ease-in forwards; }
.board-footer { margin-top:13px; color:#8993bb; font-size:10px; }
.side-panel { display:flex; flex-direction:column; gap:13px; }
.mission {
  display:grid; grid-template-columns:42px 1fr; gap:10px;
  padding:15px; border-radius:15px; background:#25294c;
}
.trophy { display:grid; place-items:center; width:40px; height:40px; border-radius:12px; background:#ffd36e18; font-size:23px; }
.mission small { color:var(--cyan); font-size:9px; letter-spacing:1.5px; }
.mission h2 { font-size:16px; margin:5px 0; }
.mission p,.tip p { font-family:'Hind Siliguri',sans-serif; font-size:12px; line-height:1.6; color:var(--muted); margin:5px 0 0; }
.progress { grid-column:1/-1; height:7px; background:#0c1028; border-radius:9px; overflow:hidden; }
#progress { height:100%; width:0; background:linear-gradient(90deg,#ff68b4,#b28aff,#6ce7ff); transition:width .3s; }
.tip { padding:15px; border:1px solid var(--line); border-radius:14px; background:#ffffff05; }
.tip b { font-size:12px; color:var(--gold); }
.primary,.secondary {
  width:100%; padding:13px; border-radius:12px; font-size:12px; font-weight:800;
}
.primary { color:#10152e; background:linear-gradient(100deg,#ff64b2,#a77bff,#6acfff); }
.secondary { border:1px solid var(--line); background:#ffffff08; }
.primary:hover,.secondary:hover { filter:brightness(1.1); }
.ad-space {
  position:relative; margin-top:20px; min-height:80px;
  display:grid; place-items:center; padding:18px;
  border:1px dashed #ffffff28; border-radius:13px; color:#7781a5;
}
.ad-space small { position:absolute; left:12px; top:7px; font-size:8px; letter-spacing:1.5px; }
.ad-space p { font-size:11px; }
footer { padding:18px 2px 0; color:#7f89ad; font-size:10px; }

.modal {
  position:fixed; inset:0; z-index:9; padding:16px;
  display:grid; place-items:center; background:#070a19d9;
  backdrop-filter:blur(8px);
}
.hidden { display:none !important; }
.modal-card {
  width:min(420px,100%); padding:27px; text-align:center;
  border:1px solid #ffffff25; border-radius:23px;
  background:linear-gradient(145deg,#25294f,#151a35);
}
.modal-emoji { font-size:52px; margin-bottom:8px; }
.modal-card>small { color:var(--cyan); letter-spacing:2px; font-size:9px; }
.modal-card h2 { margin:10px 0; font-size:25px; }
.modal-card p { font-family:'Hind Siliguri',sans-serif; color:#c1c8e6; font-size:14px; line-height:1.7; }
.modal-actions { display:flex; gap:10px; margin-top:20px; }
.modal-actions>* { flex:1; }

@keyframes pop { to { transform:scale(.15); opacity:0; } }
@keyframes hintPulse {
  50% { transform:scale(.88); box-shadow:0 0 0 3px #ffd36e88,0 0 18px #ffd36e88; }
}

@media(max-width:760px) {
  .app { padding:14px 12px; }
  .topbar { margin-bottom:16px; }
  .hero { min-height:160px; padding:20px 16px; border-radius:20px; }
  .hero h1 { font-size:clamp(26px,7vw,35px); }
  .hero-gem { font-size:65px; }
  .intro { font-size:12px; }
  .stats { gap:7px; margin:11px 0; }
  .stats>div { padding:11px 9px; border-radius:12px; }
  .stats small { font-size:8px; letter-spacing:.8px; }
  .stats strong { font-size:19px; }
  .game-layout { grid-template-columns:1fr; gap:12px; }
  .board-panel,.side-panel { padding:11px; }
  .side-panel { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .mission,.tip { grid-column:1/-1; }
  .primary,.secondary { padding:12px 7px; }
  .board-footer { font-size:9px; }
}
@media(max-width:390px) {
  .brand b { font-size:10px; letter-spacing:1px; }
  .brand small { letter-spacing:1.3px; }
  .brand-icon { width:36px; height:36px; }
  .actions button { width:34px; height:36px; }
  .hero-gem { font-size:49px; }
  .gem .jewel { font-size:clamp(13px,4vw,19px); }
  .side-panel { grid-template-columns:1fr; }
  .mission,.tip { grid-column:auto; }
  .board-footer { flex-direction:column; align-items:flex-start; }
}