/* Card 668: Minröj / Minesweeper (/minesweeper/). Loaded after /arcade.css
   and /games.css. Flat tiles only (no 3D), so iOS Safari draws it as designed. */
:root{--cs:44px;--gp:4px;--mp:8px}
.app{height:100vh;height:100dvh}
.opts{grid-template-columns:repeat(3,1fr)}
label.opt .ico{filter:drop-shadow(4px 4px 0 #141414)}
.how{font-weight:800}
.iconsprite{position:absolute;width:0;height:0;overflow:hidden}
.chip .av svg{width:70%;height:70%}
.chip .av.mn{background:var(--paper)}.chip .av.tm{background:var(--blue)}
.boardwrap{flex:1;min-height:0;display:flex;overflow:auto;padding:4px}
.boardwrap>*{margin:auto} /* auto margins centre without clipping when the board is wider/taller than the box */
.mgrid{display:flex;flex-direction:column;gap:var(--gp);padding:var(--mp);background:var(--ink);border-radius:16px;box-shadow:var(--pop)}
.mrow{display:flex;gap:var(--gp)}
.cell{width:var(--cs);height:var(--cs);border-radius:8px;cursor:pointer;display:grid;place-items:center;position:relative;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;
  background:url('/assets/minesweeper/ms-tile.webp?v=1.12.2') center/100% 100% no-repeat,radial-gradient(circle,rgba(255,255,255,.28) 1.4px,transparent 1.8px) 0 0/7px 7px,var(--blue);box-shadow:inset 0 -4px 0 rgba(20,20,20,.35);font:400 calc(var(--cs)*.62)/1 var(--font-display)}
.cell:hover:not(.op){filter:brightness(1.12)}
.cell.op{background:url('/assets/minesweeper/ms-open.webp?v=1.12.2') center/100% 100% no-repeat,var(--paper);box-shadow:none;cursor:default}
.cell.boom{background:var(--red)}
.cell.wrong{background:var(--red-ink);box-shadow:none}
.cell.wrong:after{content:'';position:absolute;inset:18%;background:linear-gradient(45deg,transparent 44%,var(--ink) 44% 56%,transparent 56%),linear-gradient(-45deg,transparent 44%,var(--ink) 44% 56%,transparent 56%);pointer-events:none}
.cell img.art{width:82%;height:82%;object-fit:contain;pointer-events:none}
.cell img.art+svg{display:none}
.cell svg{width:76%;height:76%;overflow:visible;pointer-events:none}
.cell span{pointer-events:none}
.cell.op.pop{animation:cpop 220ms var(--ease-pop)}
@keyframes cpop{0%{transform:scale(.6)}}
.cell:focus-visible{outline:4px solid var(--bg);outline-offset:1px;z-index:2}
.n1{color:#2A5FE6}.n2{color:#0B7A53}.n3{color:#D63027}.n4{color:#6A1FD6}.n5{color:#B0124F}.n6{color:#00727D}.n7,.n8{color:#141414}
.tools{display:flex;justify-content:center;gap:12px}
.tools .pill{min-height:52px;font-size:18px;gap:8px}
.tools .pill svg{width:30px;height:30px}
#flagMode[aria-pressed="true"]{background:var(--red-ink);color:#fff}
.res .fs{font-size:44px}
.res .stk.rec{position:absolute;width:112px;right:-6px;top:-34px;margin:0;transform:rotate(10deg)}.res .stk.rec span{font-size:20px}.stk.rec[hidden]{display:none}
.boomfx{position:fixed;left:50%;top:45%;width:min(64vw,320px);margin-left:calc(min(64vw,320px)/-2);margin-top:calc(min(64vw,320px)/-2);z-index:30}.boomfx[hidden]{display:none}
@media (max-width:640px){
  .opts{grid-template-columns:1fr}
  label.opt{flex-direction:row;gap:12px;justify-content:flex-start;padding:10px 16px}
  label.opt img.ico{height:56px;width:56px}
  .boardwrap{margin:0 calc(8px - var(--pad));padding:0}
  .tools{gap:8px;flex-wrap:wrap}.tools .pill{min-height:48px;font-size:16px;padding:0 12px}.res .fs{font-size:36px}
  .how{font-size:14px}
}
@media (prefers-reduced-motion:reduce){.cell.op.pop{animation:none}}
.quitp h2{font-size:38px}.quitp .acts{display:flex;gap:12px;justify-content:center;margin-top:18px}.quitp .acts>*{min-width:110px;min-height:48px}
.helpb .q{font:400 24px/1 var(--font-display)}
#setup .row .helpb{min-height:52px;font-size:18px}
.helpp{max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow:auto;text-align:left;width:min(600px,100%)}
.helpp h2{text-align:center;font-size:44px}
.helpp h3{font:400 24px/1 var(--font-display);letter-spacing:.04em;margin:16px 0 8px}
.helpp ul{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:10px}
.helpp .rules li{position:relative;padding-left:30px;font-weight:700;line-height:1.35}
.helpp .rules li:before{content:'';position:absolute;left:4px;top:.3em;width:14px;height:14px;border:3px solid var(--ink);border-radius:50%;background:var(--mint)}
.helpp .lvls{margin:0;gap:8px}
.helpp .lvls li{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#fff;border:3px solid var(--ink);border-radius:999px;padding:6px 16px;box-shadow:var(--pop-sm);font:900 14px var(--font-body);text-transform:uppercase}
.helpp .lvls b{font:400 22px/1 var(--font-display);letter-spacing:.04em}
.helpp .acts{display:flex;justify-content:center}.helpp .acts .btn{min-width:180px}
@media (max-width:640px){
  .tools .helpb .bt{display:none}.tools .helpb{padding:0 14px}
  #setup .row .how{flex:1 1 0;min-width:0}#setup .row .helpb{min-height:44px;font-size:16px;padding:0 12px;flex:none}
  .helpp{padding:20px 16px 16px}.helpp h2{font-size:32px}.helpp .rules li{font-size:15px}
}
