/* ═══════════════════════════════════════════════
   TechBanta — Games Hub CSS
   File: public/assets/css/games.css
   ═══════════════════════════════════════════════ */

/* ────────────────────────────────────────────────
   SIDEBAR — Games Hub Card
──────────────────────────────────────────────── */
.sb-games-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--bg3);
  overflow: hidden;
}

.sb-games-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  font-family: var(--font);
  transition: background .18s;
  gap: 6px;
}
.sb-games-toggle:hover { background: var(--bg4); }

.sb-games-toggle-left { display: flex; align-items: center; gap: 8px; }

.sb-games-icon-wrap {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--purple-bg), var(--blue-bg));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--purple);
}
.sb-games-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sb-games-count {
  font-size: 11px; font-weight: 700;
  background: var(--purple-bg); color: var(--purple);
  border-radius: 999px; padding: 1px 7px;
}
.sb-games-chevron { color: var(--text3); transition: transform .22s var(--ease-out); flex-shrink: 0; }
.sb-games-toggle[aria-expanded="true"] .sb-games-chevron { transform: rotate(180deg); }

.sb-games-list {
  list-style: none;
  max-height: 0; overflow: hidden;
  transition: max-height .3s var(--ease-out), padding .3s;
  padding: 0 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.sb-games-list.open { max-height: 300px; padding: 4px 6px 6px; }

.sb-game-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 7px;
  font-size: 13px; font-weight: 500;
  color: var(--text2); text-decoration: none;
  transition: background .15s, color .15s, transform .15s var(--ease-bounce);
  cursor: pointer; position: relative; overflow: hidden;
}
.sb-game-link::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 0; background: var(--purple); border-radius: 0 3px 3px 0;
  transition: width .2s var(--ease-bounce);
}
.sb-game-link:hover,
.sb-game-link.active { background: var(--purple-bg); color: var(--purple); transform: translateX(3px); }
.sb-game-link:hover::before,
.sb-game-link.active::before { width: 3px; }
.sb-game-link.active { font-weight: 600; }

.sb-game-link--disabled { opacity: .5; cursor: not-allowed; }
.sb-game-link--disabled:hover { background: none; transform: none; }
.sb-game-link--disabled::before { display: none; }

.sb-game-emoji { font-size: 15px; flex-shrink: 0; width: 18px; text-align: center; }
.sb-game-name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-game-badge {
  font-size: 9.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px;
  letter-spacing: .4px; flex-shrink: 0; text-transform: uppercase;
}
.sb-game-badge--new  { background: var(--green-bg);  color: var(--green); }
.sb-game-badge--soon { background: var(--orange-bg); color: var(--orange); }


/* ────────────────────────────────────────────────
   GAME PAGE
──────────────────────────────────────────────── */
.game-page {
  max-width: 1100px; margin: 0 auto;
  padding: 22px 26px 52px;
  display: flex; flex-direction: column; gap: 18px;
}

/* Breadcrumb */
.g-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); }
.g-breadcrumb a { color: var(--text3); text-decoration: none; transition: color .15s; }
.g-breadcrumb a:hover { color: var(--blue); }
.g-breadcrumb .cur { color: var(--text2); font-weight: 500; }
.g-breadcrumb svg { opacity: .5; }

/* Page header */
.g-page-hdr { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.g-page-hdr-left { display: flex; align-items: center; gap: 14px; }
.g-page-icon { font-size: 38px; line-height: 1; filter: drop-shadow(0 2px 8px rgba(79,70,229,.2)); }
.g-page-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: var(--text); margin: 0 0 3px; }
.g-page-sub { font-size: 13px; color: var(--text3); margin: 0; }
.g-meta-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.g-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--text2);
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-full); padding: 5px 13px;
}

/* Layout */
.g-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }

/* Map card */
.g-map-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}

/* HUD */
.g-hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border2);
  flex-wrap: wrap; gap: 12px;
}
.g-hud-target { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.g-hud-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; font-weight: 700; color: var(--text3); }
.g-hud-name {
  font-size: 21px; font-weight: 900; color: var(--text); letter-spacing: -.5px;
  transition: transform .25s var(--ease-bounce), color .25s;
}
.g-hud-hindi { font-size: 14px; color: var(--text3); font-weight: 500; }
.g-hud-right { display: flex; align-items: center; gap: 2px; }
.g-hud-stat { display: flex; flex-direction: column; align-items: center; padding: 0 13px; }
.g-hud-val { font-size: 19px; font-weight: 900; color: var(--text); line-height: 1; transition: transform .2s var(--ease-bounce), color .2s; }
.g-hud-val small { font-size: 11px; font-weight: 500; color: var(--text3); }
.g-hud-key { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; margin-top: 2px; }
.g-hud-div { width: 1px; height: 28px; background: var(--border2); }

/* Progress bar */
.g-progress { height: 3px; background: var(--bg4); }
.g-progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple)); transition: width .5s var(--ease-out); }

/* Map wrap */
.g-map-wrap { position: relative; background: #b8d4e8; }
#indiaMap { width: 100%; display: block; cursor: crosshair; user-select: none; max-height: 640px; }

/* State paths */
.g-state { fill: #c8dba8; stroke: #7aad5a; stroke-width: .8; transition: fill .2s, stroke .2s; cursor: crosshair; }
.g-state:hover { fill: #b2d492; }
.g-state.correct { fill: #10b981 !important; stroke: #059669 !important; stroke-width: 1.5; animation: gPop .4s var(--ease-bounce); }
.g-state.wrong   { fill: #f87171 !important; stroke: #ef4444 !important; animation: gShake .35s ease; }
.g-state.reveal  { fill: #f97316 !important; stroke: #ea580c !important; stroke-width: 1.5; animation: gReveal .5s var(--ease-bounce); }
.g-state.done    { fill: #bbf7d0 !important; stroke: #6ee7b7 !important; stroke-width: .6; pointer-events: none; }
.g-state.flash   { fill: #f97316 !important; stroke: #ea580c !important; stroke-width: 2; cursor: pointer !important; animation: gFlash 0.7s ease infinite; }
@keyframes gPop   { 0%,100%{transform:scale(1)} 50%{transform:scale(1.03)} }
@keyframes gShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
@keyframes gReveal{ 0%{opacity:.3;transform:scale(.97)} 60%{opacity:1;transform:scale(1.04)} 100%{transform:scale(1)} }
@keyframes gFlash { 0%,100%{opacity:1;fill:#f97316} 50%{opacity:0.35;fill:#fdba74} }
@keyframes fpIn   { from{opacity:0;transform:translate(-50%,8px)} to{opacity:1;transform:translateX(-50%)} }

/* Tooltip */
.g-tooltip {
  position: absolute; background: rgba(22,22,42,.88); color: #fff;
  font-size: 12px; font-weight: 600; font-family: var(--font);
  padding: 5px 10px; border-radius: 7px; pointer-events: none;
  transform: translate(-50%, -130%); white-space: nowrap;
  display: none; z-index: 50; backdrop-filter: blur(4px);
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

/* Toasts */
.g-toast {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(.86);
  padding: 11px 26px; border-radius: 12px;
  font-size: 15px; font-weight: 700; font-family: var(--font);
  pointer-events: none; opacity: 0; z-index: 30;
  transition: opacity .18s, transform .22s var(--ease-bounce);
  backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(0,0,0,.18);
  white-space: nowrap; text-align: center;
}
.g-toast.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.g-toast--wrong  { background: rgba(220,38,38,.92); color: #fff; }
.g-toast--right  { background: rgba(5,150,105,.92);  color: #fff; }
.g-toast--reveal { background: rgba(234,88,12,.92);  color: #fff; font-size: 16px; }

/* Overlay */
.g-overlay {
  position: absolute; inset: 0;
  background: rgba(15,15,26,.75); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 40; transition: opacity .3s;
}
.g-overlay.hidden { opacity: 0; pointer-events: none; }
.ov-card {
  background: var(--bg2); border-radius: var(--radius);
  padding: 36px 42px; text-align: center;
  box-shadow: var(--shadow3); max-width: 356px; width: 92%;
  animation: ovPop .35s var(--ease-bounce);
}
@keyframes ovPop { from{transform:scale(.86);opacity:0} to{transform:scale(1);opacity:1} }
.ov-icon  { font-size: 50px; line-height: 1; margin-bottom: 14px; }
.ov-title { font-size: 20px; font-weight: 800; color: var(--text); margin: 0 0 8px; letter-spacing: -.4px; }
.ov-sub   { font-size: 13.5px; color: var(--text3); margin: 0 0 22px; line-height: 1.65; }
.ov-score { font-size: 44px; font-weight: 900; color: var(--blue); letter-spacing: -1.5px; line-height: 1; }
.ov-pct   { font-size: 13px; color: var(--text3); margin: 4px 0 6px; }
.ov-grade { font-size: 14.5px; font-weight: 600; color: var(--text2); margin-bottom: 22px; }
.ov-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 12px 0; width: 100%;
  font-size: 14px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: transform .2s var(--ease-bounce), box-shadow .2s;
  box-shadow: 0 4px 18px rgba(79,70,229,.32);
}
.ov-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(79,70,229,.42); }
.ov-btn:active { transform: translateY(0); }

/* Attempts bar */
.g-attempts {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 20px; border-top: 1px solid var(--border2); background: var(--bg3);
}
.g-att-lbl { font-size: 11.5px; color: var(--text3); font-weight: 500; }
.g-pip {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--border); border: 1.5px solid var(--border2);
  transition: background .2s, border-color .2s, transform .2s var(--ease-bounce);
}
.g-pip.used { background: var(--red); border-color: var(--red-border); transform: scale(1.2); }

/* ── RIGHT PANEL ── */
.g-panel-col { display: flex; flex-direction: column; gap: 14px; }
.g-panel-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow); padding: 18px;
}
.g-panel-card--hist { display: flex; flex-direction: column; max-height: 225px; }
.g-p-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .9px; color: var(--text3);
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}

/* How to play */
.g-how-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.g-how-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--text2); line-height: 1.45; }
.g-how-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue-bg); color: var(--blue);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Live stats grid */
.g-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-stat-box { border-radius: var(--radius-sm); padding: 12px 10px; text-align: center; border: 1px solid var(--border2); }
.g-stat-box--g { background: var(--green-bg);  border-color: var(--green-border); }
.g-stat-box--r { background: var(--red-bg);    border-color: var(--red-border); }
.g-stat-box--b { background: var(--blue-bg);   border-color: var(--blue-light); }
.g-stat-box--p { background: var(--purple-bg); border-color: var(--purple); }
.g-stat-val {
  font-size: 26px; font-weight: 900; color: var(--text); line-height: 1;
  margin-bottom: 3px; font-variant-numeric: tabular-nums;
  transition: transform .2s var(--ease-bounce), color .2s;
}
.g-stat-lbl { font-size: 11px; color: var(--text3); font-weight: 600; }

/* History */
.hist-list { list-style: none; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--border) transparent; display: flex; flex-direction: column; gap: 5px; }
.hist-empty { font-size: 12px; color: var(--text3); text-align: center; padding: 10px 0; font-style: italic; }
.hist-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); padding: 6px 9px; border-radius: 7px; background: var(--bg3); animation: histIn .22s var(--ease-bounce); }
@keyframes histIn { from{opacity:0;transform:translateX(-6px)} to{opacity:1;transform:none} }
.hist-item--c { border-left: 3px solid var(--green); }
.hist-item--w { border-left: 3px solid var(--red); }

/* Coming soon */
.g-cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.g-cs-item { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: var(--radius-sm); background: var(--bg3); border: 1px solid var(--border2); font-size: 12.5px; color: var(--text3); font-weight: 500; opacity: .65; }
.g-cs-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .g-layout { grid-template-columns: 1fr; }
  .g-panel-col { display: grid; grid-template-columns: 1fr 1fr; }
  .g-panel-card--hist { grid-column: 1 / -1; }
}
@media (max-width: 580px) {
  .game-page { padding: 14px 12px 40px; }
  .g-panel-col { grid-template-columns: 1fr; }
  .g-hud { padding: 10px 14px; }
  .g-hud-name { font-size: 17px; }
  .ov-card { padding: 26px 20px; }
}