:root{--card-bg:#ffffff;--card-border:#ccc;--matched:#c8f7c5}
html,body{height:100%;margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial}
body{display:flex;align-items:center;justify-content:center;background:#f6f7fb}
#app{width:100%;max-width:1100px;padding:18px;box-sizing:border-box}
h1{text-align:center;margin:0 0 12px}
#controls{display:flex;gap:8px;align-items:center;justify-content:center;margin-bottom:12px;flex-wrap:wrap}
#content{display:flex;justify-content:center;align-items:flex-start;gap:18px}
#grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.card{width:120px;height:80px;border-radius:8px;border:1px solid var(--card-border);display:flex;align-items:center;justify-content:center;background:var(--card-bg);cursor:pointer;font-size:18px;word-break:break-word;text-align:center;padding:6px}
.card.revealed{background:#fff;color:#000}
.card.matched{background:var(--matched)}
#sidebar{width:240px}
#foundList{list-style:none;padding:0;margin:0;max-height:560px;overflow:auto}
#foundList li{padding:6px;border-bottom:1px solid #eee;cursor:pointer}
#moves{font-weight:600}
#gridInfo{margin-left:8px}

@media (max-width:720px){
  .card{width:80px;height:60px;font-size:14px}
  /* Stack content vertically on small screens and show the sidebar below the grid */
  #content{flex-direction:column;align-items:center}
  #sidebar{display:block;width:100%;max-width:480px;margin-top:12px}
  #foundList{max-height:240px}
}
