:root{
  --bg:#0b1220;
  --bg2:#0f1b2e;
  --card: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.12);
  --text:#eaf0ff;
  --muted: rgba(234,240,255,.78);

  --blue:#3b82f6;
  --green:#22c55e;
  --orange:#f59e0b;
  --cyan:#06b6d4;

  --shadow: 0 14px 40px rgba(0,0,0,.45);
  --radius: 18px;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 10% 0%, rgba(59,130,246,.20), transparent 60%),
              radial-gradient(1200px 600px at 90% 0%, rgba(34,197,94,.18), transparent 60%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
}

.top{
  padding:28px 18px 8px;
  text-align:center;
}
.top h1{ margin:0 0 6px; font-size:34px; letter-spacing:.2px; }
.top p{ margin:0; color: var(--muted); }

.grid{
  max-width:980px;
  margin:18px auto;
  padding:18px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:14px;
}

.card{
  display:block;
  padding:18px;
  border-radius: var(--radius);
  text-decoration:none;
  color:inherit;
  background: var(--card);
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  position: relative;
  overflow: hidden;
}
.card::before{
  content:"";
  position:absolute;
  inset:0;
  opacity:.18;
  background: linear-gradient(120deg, currentColor, transparent 55%);
  pointer-events:none;
}
.card:hover{
  transform: translateY(-3px);
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.18);
}
.card h2{ margin:0 0 8px; }
.card p{ margin:0; color: var(--muted); }

.accent-blue{ color: var(--blue); }
.accent-green{ color: var(--green); }
.accent-orange{ color: var(--orange); }
.accent-cyan{ color: var(--cyan); }

.foot{
  text-align:center;
  padding:20px 18px 30px;
  color: rgba(234,240,255,.6);
}

/* Game pages */
.gamewrap{
  max-width:980px;
  margin:0 auto;
  padding:18px;
}
.bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.btn{
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}
.btn:hover{ background: rgba(255,255,255,.12); }
.panel{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  color: rgba(234,240,255,.88);
}
.center{
  display:grid;
  place-items:center;
  gap:14px;
}
canvas{
  width:100%;
  max-width:520px;
  background: rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.14);
  border-radius:16px;
  display:block;
}

/* Manual / Si luhet */
.manual{
  width:100%;
  max-width:820px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding:14px 14px 10px;
}
.manual h3{
  margin:0 0 8px;
  font-size:18px;
}
.manual ul{
  margin:0 0 10px 18px;
  color: rgba(234,240,255,.86);
}
.manual .tip{
  margin:0 0 8px;
  color: rgba(234,240,255,.72);
  font-size: 14px;
  line-height:1.45;
}

/* ===== Memory Game (Grid) ===== */
.board{
  width:100%;
  max-width:560px;
  display:grid;
  gap:10px;
  align-content:start;
}

.tile{
  aspect-ratio: 1/1;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  display:grid;
  place-items:center;
  font-size:28px;
  cursor:pointer;
  user-select:none;
  color:#eaf0ff;
}

.tile.revealed{
  background: rgba(34,197,94,.16);
  border-color: rgba(34,197,94,.30);
}

.tile.matched{
  opacity:.55;
  cursor:default;
}

