/* ============================================================
   TOOLSHUB4U — QUICK GAMES (gm workspace)
   Uses the tw2 glass-card design block + game-specific styles.
   ============================================================ */

.gm { padding-top: 2.2rem; }
.gm__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.6rem;
  box-shadow: var(--shadow-lg);
}
.gm__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.gm__title { font-size: 1.3rem; font-weight: 800; margin: 0; }
.gm__badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 999px; padding: 0.3rem 0.8rem;
}
.gm-status { margin: 0.9rem 0 0; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; min-height: 1.4em; }
.gm-stats {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0 0;
}
.gm-stat {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.35rem 0.75rem;
  font-size: 0.78rem; color: var(--text-secondary);
}
.gm-stat strong { color: var(--text-primary); font-weight: 700; margin-right: 0.25rem; }
.gm-btn {
  font: inherit; font-size: 0.88rem; font-weight: 700;
  border: none; cursor: pointer; border-radius: var(--radius-md);
  padding: 0.5rem 1.1rem; transition: transform 0.12s ease, box-shadow 0.12s ease;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white); box-shadow: var(--shadow-glow);
}
.gm-btn:hover { transform: translateY(-1px); }
.gm-btn:active { transform: translateY(1px); }
.gm-btn--ghost { background: var(--surface-hover); color: var(--text-primary); box-shadow: none; border: 1px solid var(--border); }

/* Tic Tac Toe */
.gm-t3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; max-width: 340px; }
.gm-t3__cell {
  aspect-ratio: 1; font-size: 2.4rem; font-weight: 800;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  color: var(--text-primary); display: flex; align-items: center; justify-content: center;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.gm-t3__cell:hover { border-color: var(--primary); }
.gm-t3__cell.is-x { color: var(--primary); }
.gm-t3__cell.is-o { color: #f59e0b; }
.gm-t3__cell.is-win { background: color-mix(in srgb, #10b981 18%, transparent); border-color: #10b981; }
.gm-t3__msg { margin: 0.9rem 0; font-size: 0.9rem; min-height: 1.4em; }

/* Memory */
.gm-mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; max-width: 420px; }
.gm-mem__card {
  aspect-ratio: 1; border: 1px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; position: relative; overflow: hidden;
  background: var(--bg-tertiary); transition: transform 0.15s ease;
}
.gm-mem__card:hover { transform: translateY(-2px); }
.gm-mem__card .gm-mem__back {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg); transition: opacity 0.18s ease;
}
.gm-mem__card .gm-mem__face {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; color: var(--primary); opacity: 0;
  transition: opacity 0.18s ease;
}
.gm-mem__card.is-up .gm-mem__back { opacity: 0; }
.gm-mem__card.is-up .gm-mem__face { opacity: 1; }

/* Snake */
.gm-snake { display: block; width: 100%; max-width: 480px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-tertiary); }
.gm-snake__start { margin-top: 0.9rem; }

/* Number guessing */
.gm-guess__row {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.85rem; padding: 0.3rem 0.7rem;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 0.3rem;
}
.gm-guess__msg { margin: 0.9rem 0 0.5rem; font-size: 0.9rem; min-height: 1.4em; }
.gm-guess__msg--win { color: var(--success); font-weight: 700; }
.gm-guess__msg--err { color: var(--error); }
.gm-guess__controls { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.gm-guess__input {
  font: inherit; font-size: 1rem; width: 8rem; padding: 0.55rem 0.8rem;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
}
.gm-guess__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

/* RPS */
.gm-rps { display: flex; flex-direction: column; gap: 1rem; max-width: 460px; }
.gm-rps__btns { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.gm-rps__btn {
  flex: 1; min-width: 96px; padding: 1rem 0.6rem; cursor: pointer;
  font-size: 0.82rem; font-weight: 700; color: var(--text-primary);
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 0.4rem;
  align-items: center; transition: border-color 0.12s ease, transform 0.12s ease;
}
.gm-rps__btn:hover { border-color: var(--primary); transform: translateY(-2px); }
.gm-rps__ico { width: 26px; height: 26px; }
.gm-rps__board {
  display: flex; justify-content: center; gap: 2.5rem; align-items: center;
  padding: 1.2rem; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.gm-rps__slot { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--text-secondary); }
.gm-rps__slot .icon { width: 40px; height: 40px; color: var(--text-primary); }
.gm-rps__slot.is-win .icon { color: #10b981; }
.gm-rps__slot.is-lose .icon { color: var(--error); }
.gm-rps__vs { font-weight: 800; color: var(--text-tertiary); font-size: 0.8rem; }
.gm-rps__result { font-size: 0.9rem; min-height: 1.4em; text-align: center; }

/* Hangman */
.gm-hang { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.gm-hang__word {
  font-family: ui-monospace, monospace; font-size: 1.6rem; letter-spacing: 0.35em;
  color: var(--text-primary); min-height: 2rem; word-break: break-all;
}
.gm-hang__keys { display: flex; flex-wrap: wrap; gap: 0.35rem; max-width: 480px; }
.gm-hang__key {
  font: inherit; font-size: 0.85rem; font-weight: 700; width: 2.2rem; height: 2.2rem;
  border-radius: var(--radius-sm); cursor: pointer;
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
}
.gm-hang__key:hover:not(:disabled) { border-color: var(--primary); }
.gm-hang__key:disabled { opacity: 0.45; cursor: default; }
.gm-hang__key.is-hit { background: color-mix(in srgb, #10b981 22%, transparent); border-color: #10b981; }
.gm-hang__key.is-miss { background: color-mix(in srgb, #ef4444 22%, transparent); border-color: #ef4444; }
.gm-hang__draw { width: 150px; height: 170px; }
.gm-hang__stage { position: relative; width: 150px; height: 170px; }
.gm-hang__post { position: absolute; left: 18px; bottom: 8px; width: 8px; height: 130px; background: var(--text-secondary); border-radius: 3px; }
.gm-hang__beam { position: absolute; left: 18px; top: 8px; width: 90px; height: 8px; background: var(--text-secondary); border-radius: 3px; }
.gm-hang__rope { position: absolute; left: 96px; top: 16px; width: 4px; height: 26px; background: var(--text-tertiary); }
.gm-hang__part { position: absolute; background: var(--text-primary); border-radius: 50%; }
.gm-hang__part--head { left: 84px; top: 42px; width: 28px; height: 28px; }
.gm-hang__part--body { left: 96px; top: 70px; width: 5px; height: 48px; border-radius: 3px; }
.gm-hang__part--arm-l { left: 74px; top: 78px; width: 26px; height: 5px; border-radius: 3px; transform: rotate(24deg); }
.gm-hang__part--arm-r { left: 96px; top: 78px; width: 26px; height: 5px; border-radius: 3px; transform: rotate(-24deg); }
.gm-hang__part--leg-l { left: 78px; top: 114px; width: 24px; height: 5px; border-radius: 3px; transform: rotate(28deg); }
.gm-hang__part--leg-r { left: 94px; top: 114px; width: 24px; height: 5px; border-radius: 3px; transform: rotate(-28deg); }
.gm-hang__msg { font-size: 0.9rem; min-height: 1.4em; }

/* Reaction time */
.gm-react {
  width: 100%; min-height: 220px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); cursor: pointer;
  background: var(--bg-tertiary); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem; font-size: 1rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.gm-react.is-ready { background: #dc2626; color: #fff; }
.gm-react.is-go { background: #16a34a; color: #fff; font-weight: 800; }
.gm-react__msg { margin-top: 0.8rem; font-size: 0.85rem; color: var(--text-secondary); min-height: 1.4em; }

/* Color match */
.gm-color { display: flex; flex-direction: column; gap: 1rem; max-width: 460px; }
.gm-color__target { width: 100%; height: 96px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.gm-color__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.gm-color__tile {
  aspect-ratio: 1.4; border-radius: var(--radius-lg); border: 2px solid rgba(255, 255, 255, 0.12);
  cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gm-color__tile:hover { transform: scale(1.04); }
.gm-color__tile.is-picked { box-shadow: 0 0 0 3px var(--text-primary); transform: scale(0.96); }
.gm-color__msg { font-size: 0.9rem; min-height: 1.4em; }
