/* ====== Neon Gaming Look (scoped) ====== */
.gh-memory {
  --bg: #060912;
  --panel: rgba(16,22,46,.6);
  --stroke: rgba(255,255,255,.08);
  --text: #e8ecff;
  --muted: #a9b7ff;
  --accent: #6c7cff;
  --accent2: #33e0ff;
  --success: #17d490;
  --radius: 16px;
  --glow: 0 10px 30px rgba(51,224,255,.25);
  --inner: inset 0 0 0 1px rgba(255,255,255,.05);
  --glass: blur(10px) saturate(120%);
  --speed: .22s;
  color: var(--text);
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  position: relative;
}

/* theme variants */
.gh-memory.theme-classic { --accent:#6c7cff; --accent2:#33e0ff; }
.gh-memory.theme-animals{ --accent:#ff6aa6; --accent2:#ffce73; }
.gh-memory.theme-fruits { --accent:#e64ba5; --accent2:#ffb3de; }
.gh-memory.theme-sports { --accent:#16d0a9; --accent2:#7affd9; }
.gh-memory.theme-vehicles{ --accent:#ffb703; --accent2:#ffe573; }

.gh-memory .mm-aurora{
  position:absolute; inset:-20% -10% -20% -10%; z-index:0;
  background:
    radial-gradient(800px 600px at 20% 10%, rgba(108,124,255,.35), transparent 60%),
    radial-gradient(800px 600px at 80% 20%, rgba(51,224,255,.35), transparent 60%),
    radial-gradient(700px 700px at 50% 90%, rgba(255,183,3,.20), transparent 65%),
    linear-gradient(180deg, #070c1b 0%, #060912 100%);
  pointer-events:none;
}

.gh-memory .mm-shell{
  position:relative; z-index:1;
  width:min(1100px,96vw); margin:32px auto 46px;
  background:var(--panel); backdrop-filter:var(--glass);
  border:1px solid var(--stroke); border-radius:var(--radius);
  box-shadow:var(--glow), var(--inner);
  padding:18px 18px 22px;
}

/* header */
.gh-memory .mm-header{ display:grid; grid-template-columns:1fr auto; gap:14px; align-items:center; }
.gh-memory .mm-title{
  margin:0; font-size:34px; font-weight:900; letter-spacing:.3px;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.gh-memory .mm-meters{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.gh-memory .mm-meter{
  background:rgba(255,255,255,.06); border:1px solid var(--stroke);
  border-radius:12px; padding:8px 12px; min-width:90px; text-align:center;
  box-shadow:var(--inner);
}
.gh-memory .mm-meter .label{ display:block; color:var(--muted); font-size:12px; }
.gh-memory .mm-meter .value{ display:block; font-size:18px; font-weight:900; color:#fff; }

/* controls */
.gh-memory .mm-controls{ display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; margin:16px 0 18px; }
.gh-memory .mm-selects{ display:flex; gap:10px; flex-wrap:wrap; }
.gh-memory .mm-field{ display:flex; flex-direction:column; gap:6px; color:var(--muted); font-size:13px; }

.gh-memory .select-wrap{ position:relative; }
.gh-memory .select-wrap .chev{ position:absolute; right:12px; top:50%; transform:translateY(-50%); font-size:12px; color:var(--muted); pointer-events:none; }

/* FIX: readable dropdowns on dark UI */
.gh-memory select{
  appearance:none; width:190px;
  color-scheme: dark; /* hint native menus to use dark palette */
  background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:12px;
  color:#fff; padding:10px 34px 10px 12px; outline:none; box-shadow:var(--inner);
}
.gh-memory select option,
.gh-memory select optgroup {
  background-color:#0e1537; /* dark menu */
  color:#fff;
}

/* actions */
.gh-memory .mm-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.gh-memory .mm-btn{
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  color:#0a0e21; border:none; border-radius:12px; padding:10px 16px; font-weight:900; letter-spacing:.2px; cursor:pointer;
  box-shadow:var(--glow); transition:transform .08s ease, filter var(--speed);
}
.gh-memory .mm-btn:hover,.gh-memory .mm-btn:focus{ transform:translateY(-1px); filter:brightness(1.06); }
.gh-memory .mm-btn.ghost{ background:transparent; color:#fff; border:1px solid rgba(255,255,255,.16); }

/* sound toggle */
.gh-memory .mm-sound{
  width:42px; height:42px; border-radius:12px; border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06); color:#fff; cursor:pointer; outline:none;
  display:grid; place-items:center; box-shadow:var(--inner); transition:filter var(--speed), transform .08s;
}
.gh-memory .mm-sound:hover{ transform:translateY(-1px); filter:brightness(1.1); }
.gh-memory .mm-sound .ico{ width:22px; height:22px; display:block; }
.gh-memory .mm-sound .off{ display:none; }
.gh-memory .mm-sound.is-muted{ color:#d2dae9; border-color:rgba(255,255,255,.12); }
.gh-memory .mm-sound.is-muted .on{ display:none; }
.gh-memory .mm-sound.is-muted .off{ display:block; }

/* stage — CLEAN (no color block behind the board) */
.gh-memory .mm-stage{
  position:relative; border-radius:var(--radius);
  padding:14px; overflow:hidden;
  /* intentionally no background/border */
}

/* board (transparent) with soft neon frame */
.gh-memory .mm-board{
  --cols:4; --rows:4;
  position:relative;
  display:grid; gap:12px; padding:12px; border-radius:18px;
  grid-template-columns:repeat(var(--cols),1fr);
  grid-template-rows:repeat(var(--rows), minmax(64px, 1fr));
  min-height:320px;
  background: transparent;           /* removed solid fill */
  border: none;                      /* removed border */
  box-shadow: none;
}
.gh-memory .mm-board::before{
  content:"";
  position:absolute; inset:-6px;
  border-radius:22px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  filter: blur(22px);
  opacity:.28;
  z-index:-1;
}
.gh-memory .mm-board::after{
  content:"";
  position:absolute; inset:0;
  border-radius:18px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), inset 0 0 28px rgba(0,0,0,.28);
  pointer-events:none;
}

/* cards */
.gh-memory .card{ position:relative; perspective:1000px; border-radius:14px; overflow:hidden; user-select:none; box-shadow:0 10px 20px rgba(0,0,0,.25), var(--inner); }
.gh-memory .card-btn{ position:absolute; inset:0; border:none; background:transparent; cursor:pointer; }
.gh-memory .face{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:clamp(22px,5.2vw,34px); font-weight:900; border-radius:14px; backface-visibility:hidden; transform-style:preserve-3d; transition:transform var(--speed) ease;
}
.gh-memory .front{ background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.25)); border:1px solid rgba(255,255,255,.1); }
.gh-memory .back{ background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#0a0e21; transform:rotateY(180deg); text-shadow:0 1px 0 rgba(255,255,255,.35); }
.gh-memory .card.flipped .front{ transform:rotateY(180deg); }
.gh-memory .card.flipped .back{ transform:rotateY(0deg); }
.gh-memory .card.matched .back{ animation:mm-pulse .6s ease; box-shadow:0 0 0 2px rgba(23,212,144,.85), 0 0 24px rgba(23,212,144,.35); }
@keyframes mm-pulse{ 0%{transform:rotateY(0) scale(1);} 50%{transform:rotateY(0) scale(1.04);} 100%{transform:rotateY(0) scale(1);} }
.gh-memory .card.shake .front, .gh-memory .card.shake .back{ animation:mm-shake .35s ease; }
@keyframes mm-shake{ 0%,100%{transform:translateX(0);} 25%{transform:translateX(-6px);} 75%{transform:translateX(6px);} }

/* overlays */
.gh-memory .mm-confetti{ position:absolute; inset:0; pointer-events:none; z-index:2; }
.gh-memory .mm-preview{ position:absolute; z-index:3; right:14px; top:14px; display:flex; gap:8px; align-items:center; }
.gh-memory .mm-preview .pill{ background:rgba(0,0,0,.45); color:#fff; border:1px solid rgba(255,255,255,.15); padding:6px 10px; border-radius:999px; font-weight:900; box-shadow:var(--inner); }
.gh-memory .mm-btn.mini{ padding:7px 10px; border-radius:999px; font-size:12px; }

.gh-memory .mm-overlay{ position:absolute; inset:0; z-index:4; display:grid; place-items:center; background:rgba(5,10,22,.55); }
.gh-memory .mm-card{
  width:min(460px,92vw); background:rgba(19,26,56,.85); border:1px solid var(--stroke); border-radius:18px;
  backdrop-filter:var(--glass); box-shadow:var(--glow), var(--inner); padding:16px 16px 18px; text-align:center;
}
.gh-memory .mm-card-title{ margin:0 0 8px; font-size:26px; font-weight:900; background:linear-gradient(90deg,var(--accent),var(--accent2)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.gh-memory .mm-summary{ color:var(--muted); display:grid; gap:6px; margin:10px 0 14px; }
.gh-memory .mm-card-actions{ display:flex; justify-content:center; gap:10px; }

/* how-to */
.gh-memory .mm-howto{ margin-top:14px; background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:12px; padding:10px 12px; }
.gh-memory .mm-inline-toggle{ background:transparent; color:var(--accent2); font-weight:900; border:none; cursor:pointer; }
.gh-memory .mm-howto-content{ display:none; color:var(--muted); margin-top:6px; }

/* mobile */
@media (max-width:900px){ .gh-memory .mm-header{ grid-template-columns:1fr; } .gh-memory .mm-meters{ justify-content:space-between; } }
@media (max-width:680px){
  .gh-memory .mm-controls{ grid-template-columns:1fr; }
  .gh-memory select{ width:100%; }
  .gh-memory .mm-actions{ justify-content:stretch; }
  .gh-memory .mm-actions .mm-btn{ flex:1; }
  .gh-memory .mm-board{ min-height:54vw; gap:10px; }
}
