/* Base style aligned with prior mini-games: clean, bold, animated buttons */
:root{
  --bg:#0b0f1a;
  --card:#101726;
  --accent:#7ae582;
  --accent-2:#6c63ff;
  --text:#e8f0ff;
  --muted:#9fb2d0;
  --danger:#ff6b6b;
  --good:#7ae582;
  --grid:#1a2336;
  --cell:#141c2c;
  --cell-hover:#172234;
  --cell-revealed:#0f1624;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* Floating blocks background animation (like other games landing) */
.bg-anim{
  position:fixed; inset:0; overflow:hidden; z-index:-1;
  background: radial-gradient(1000px 500px at 10% -20%, rgba(108,99,255,0.25), transparent),
              radial-gradient(800px 400px at 110% 120%, rgba(122,229,130,0.22), transparent);
}
.bg-anim::before, .bg-anim::after{
  content:""; position:absolute; inset:-20vmax;
  background:
    repeating-linear-gradient( to bottom, rgba(255,255,255,0.04) 0 2px, transparent 2px 80px),
    repeating-linear-gradient( to right, rgba(255,255,255,0.04) 0 2px, transparent 2px 80px);
  transform:skewY(6deg);
  animation: drift 30s linear infinite;
}
.bg-anim::after{ animation-duration: 48s; opacity:.4 }
@keyframes drift{ from{transform:translateY(0) skewY(6deg)} to{transform:translateY(-40px) skewY(6deg)} }

.header{
  text-align:center;
  padding:36px 16px 12px;
}
.header h1{ font-size: clamp(28px, 3.4vw, 44px); margin:0 0 8px; letter-spacing:.5px }
.header p{ margin:0; color:var(--muted) }

.container{ display:flex; justify-content:center; padding: 8px 16px 48px }
.panel{
  width:min(980px, 100%);
  background:linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:22px;
  padding:18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,0.03);
}

.controls{
  display:grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap:12px; align-items:end; margin-bottom:12px;
}

label{ display:flex; flex-direction:column; gap:6px; font-weight:600; color:var(--muted) }

.input{
  background:var(--card);
  border:1px solid rgba(255,255,255,0.08);
  color:var(--text);
  padding:10px 12px; border-radius:12px; outline:none;
}
.input:focus{ border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(108,99,255,.25) }

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding:12px 16px; border-radius:14px; border:1px solid rgba(255,255,255,0.08);
  background:linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color:var(--text); text-decoration:none; font-weight:700; letter-spacing:.2px;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
  user-select:none; -webkit-user-select:none; cursor:pointer;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 10px 18px rgba(0,0,0,.35) }
.btn:active{ transform: translateY(0) scale(.98) }

.btn-primary{
  background:linear-gradient(180deg, var(--accent-2), #5148ff);
  border-color: rgba(0,0,0,.2);
  color:#fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.4);
}
.btn-primary:hover{ box-shadow: 0 8px 28px rgba(108,99,255,.45), 0 2px 0 rgba(0,0,0,.2) }

.btn-secondary{
  background:linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
}

.btn-home{
  position:fixed; top:16px; right:16px; z-index:10;
}

.statusbar{
  display:flex; gap:16px; align-items:center; flex-wrap:wrap;
  padding:10px 12px; border-radius:12px; background:var(--card);
  margin: 4px 0 12px; border:1px solid rgba(255,255,255,0.06);
}
.stat{ font-weight:700; color:var(--text); padding:4px 8px; background:rgba(255,255,255,0.04); border-radius:10px }

.board{
  display:grid;
  gap:6px;
  padding:12px;
  background:var(--grid);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:18px;
}
.cell{
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border-radius:10px; background:var(--cell); border:1px solid rgba(255,255,255,0.06);
  font-weight:800; font-size:16px; line-height:1; cursor:pointer; user-select:none;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.cell:hover{ background:var(--cell-hover) }
.cell.revealed{ background:var(--cell-revealed); cursor:default; transform:none; border-color: rgba(255,255,255,0.04) }
.cell.flag::after{ content:"🚩"; font-size:16px }
.cell.flower{ color: var(--good) }
.cell.weed{ color: var(--danger) }
.cell.blast{ animation: blast .2s ease-in both }
@keyframes blast{ from{ transform: scale(1) } to{ transform: scale(1.12) } }

.n1{ color:#6ab0ff } .n2{ color:#7ae582 } .n3{ color:#ffd166 }
.n4{ color:#f4a261 } .n5{ color:#ef476f } .n6{ color:#c77dff }
.n7{ color:#ff6b6b } .n8{ color:#ffffff }

.hint{ color:var(--muted); margin:10px 2px }

.modal{
  position:fixed; inset:0; display:grid; place-items:center;
  background: rgba(0,0,0,.5);
}
.hidden{ display:none }
.modal-card{
  width:min(480px, 92%); background: var(--card); border:1px solid rgba(255,255,255,0.06);
  padding:20px; border-radius:18px; text-align:center; box-shadow: 0 10px 30px rgba(0,0,0,.5)
}
.modal-actions{ display:flex; gap:10px; justify-content:center; margin-top:12px }

/* Custom controls visibility */
.custom-only{ display:none }
body.custom .custom-only{ display:flex }

/* Responsive sizing */
@media (max-width: 560px){
  .cell{ width:32px; height:32px; font-size:14px }
  .statusbar{ gap:10px }
}
