/* ═══════════════════════════════════════════════
   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: minmax(0, 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;
  min-width: 0;
}

/* 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); }

/* Sound toggle */
.g-sound-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text2); margin-left: 4px; flex-shrink: 0;
  transition: background .15s, color .15s, transform .15s var(--ease-bounce);
}
@media (hover: hover) and (pointer: fine) {
  .g-sound-btn:hover { background: var(--blue-bg); color: var(--blue); }
}
.g-sound-btn:active { transform: scale(.9); }
.g-sound-btn.is-muted { color: var(--text3); opacity: .6; }

/* 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; overflow: hidden; }
#indiaMap { width: 100%; display: block; cursor: crosshair; user-select: none; max-height: 640px; }
#worldMap { 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; }
@media (hover: hover) and (pointer: fine) {
  .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} to{opacity:1} }

/* 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);
}

/* Modern floating Apple-Style Pill Toasts */
.g-toast {
  position: absolute; 
  top: 16px; 
  left: 50%;
  transform: translate(-50%, -20px) scale(.95);
  padding: 8px 18px; 
  border-radius: 999px; 
  font-size: 13px; 
  font-weight: 700; 
  font-family: var(--font);
  pointer-events: none; 
  opacity: 0; 
  z-index: 60;
  transition: all .24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  white-space: nowrap; 
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
}
.g-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.g-toast--wrong  { background: #ef4444; color: #fff; }
.g-toast--right  { background: #10b981; color: #fff; }
.g-toast--reveal { background: #f97316; color: #fff; }

/* ── NON-OVERLAPPING INLINE CARD (Duolingo Style) ── */
.g-flash-prompt {
  display: none;
  background: var(--bg3) !important;
  border-top: 1px solid var(--border2) !important;
  border-bottom: 1px solid var(--border2) !important;
  border-left: 4px solid #ea580c !important; 
  color: var(--text) !important;
  padding: 16px 20px !important;
  font-family: var(--font);
  text-align: left !important;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03) !important;
  animation: fpIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto !important; 
}

.g-flash-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  margin-bottom: 2px !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.g-flash-capital {
  font-size: 12.5px !important;
  color: var(--text3) !important;
  font-weight: 600 !important;
  margin-bottom: 8px !important;
}

.g-flash-fact {
  font-size: 12px !important;
  color: var(--text2) !important;
  background: var(--bg2) !important;
  padding: 10px 12px !important;
  border-radius: var(--radius-sm) !important;
  border-left: 3px solid #ea580c !important;
  margin-bottom: 12px !important;
  line-height: 1.55 !important;
}

.g-flash-action {
  font-size: 10px !important;
  font-weight: 800 !important;
  color: #ea580c !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  display: inline-block;
  animation: actionPulse 1.6s infinite;
}

@keyframes actionPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Crucial Overlay fix: No backdrop filter blur to keep background elements clean & crisp ── */
.g-overlay {
  position: absolute; inset: 0;
  background: rgba(15, 15, 26, 0.72);
  backdrop-filter: none !important; /* FIXED: No background blur so flashing tiles are perfectly sharp and visible! */
  -webkit-backdrop-filter: none !important;
  display: flex; align-items: center; justify-content: center;
  z-index: 40; transition: opacity .3s;
  overflow-y: auto; padding: 18px;
}
.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);
  max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
@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);
}
@media (hover: hover) and (pointer: fine) {
  .ov-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(79,70,229,.42); }
}
.ov-btn:active { transform: translateY(0); }

/* ── Leave-game confirmation modal (mirrors the quiz "Leave Test?" popup) ── */
.g-exit-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .15s ease-out;
}
.g-exit-overlay.show { opacity: 1; pointer-events: auto; }
.g-exit-card {
  background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 360px; width: 100%; padding: 24px;
  text-align: center; transform: scale(.94) translateY(6px); opacity: 0;
  transition: transform .18s ease-out, opacity .18s ease-out;
}
.g-exit-overlay.show .g-exit-card { transform: scale(1) translateY(0); opacity: 1; }
.g-exit-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--orange-bg); color: var(--orange);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.g-exit-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 8px; letter-spacing: -.1px; }
.g-exit-sub { font-size: 13.5px; color: var(--text2); line-height: 1.5; margin: 0 0 20px; }
.g-exit-actions { display: flex; flex-direction: column; gap: 8px; }
.g-exit-btn {
  height: 42px; border-radius: var(--radius-full); font-size: 14px; font-weight: 600;
  font-family: var(--font); cursor: pointer; border: none; transition: all .15s, transform .1s;
}
.g-exit-btn--stay { background: var(--blue); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .g-exit-btn--stay:hover { background: var(--blue-dark); }
}
.g-exit-btn--stay:active { transform: scale(.97); }
.g-exit-btn--leave {
  background: none; color: var(--text3); border: 1px solid var(--border2); font-size: 13.5px;
}
@media (hover: hover) and (pointer: fine) {
  .g-exit-btn--leave:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-bg); }
}

/* 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;
  min-width: 0;
}
.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;
}

/* Coming soon - Desktop standard 2x2 grid */
.g-cs-grid { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 8px; 
}
.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; }

/* 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: minmax(0, 1fr) minmax(0, 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); }


/* ══════════════════════════════════════════════
   ── PREMIUM MOBILE REDESIGN ──
══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .g-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .g-panel-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .g-panel-card--hist { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  /* ── Page shell ── */
  .game-page { padding: 0 0 36px; gap: 0; }

  /* ── Breadcrumb ── */
  .g-breadcrumb { padding: 12px 16px 0; font-size: 11px; }

  /* ── Header ── */
  .g-page-hdr { padding: 10px 16px 14px; align-items: flex-start; }
  .g-page-hdr-left { gap: 10px; }
  .g-page-icon { font-size: 28px; }
  .g-page-title { font-size: 17px; line-height: 1.25; letter-spacing: -.3px; }
  .g-page-sub { font-size: 12px; line-height: 1.4; margin-top: 2px; }
  .g-meta-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; width: 100%; }
  .g-meta-pills .g-pill { font-size: 11px; padding: 4px 10px; }

  /* ── Map card ── */
  .g-layout { gap: 12px; padding: 0; }
  .g-map-card {
    border-radius: 0;
    border-left: none; border-right: none;
    box-shadow: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  /* ── HUD ── */
  .g-hud {
    position: sticky; top: 0; z-index: 30;
    background: var(--bg2);
    padding: 10px 14px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .g-hud-target { gap: 6px; min-width: 0; flex: 1; }
  .g-hud-lbl { display: none; } 
  .g-hud-name {
    font-size: 16px; letter-spacing: -.3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .g-hud-hindi { font-size: 11.5px; white-space: nowrap; }
  .g-hud-right { gap: 0; flex-shrink: 0; }
  .g-hud-stat { padding: 0 8px; }
  .g-hud-val { font-size: 15px; }
  .g-hud-val small { font-size: 9.5px; }
  .g-hud-key { font-size: 8.5px; }
  .g-hud-div { height: 22px; }
  .g-sound-btn { width: 30px; height: 30px; margin-left: 2px; }
  .g-hud-right .g-zoom-toggle { width: 30px; height: 30px; margin-left: 2px; }
  .g-hud-right .g-zoom-toggle svg { width: 16px; height: 16px; }

  /* ── Progress bar ── */
  .g-progress { height: 4px; }

  /* ── Mobile Map Dimensions ── */
  .g-map-wrap { border-radius: 0; }
  #indiaMap { height: auto !important; max-height: 44vh !important; }
  #worldMap { height: auto !important; max-height: 44vh !important; }

  /* When the start/result card is showing, give the box enough room to fit
     it (icon + title + text + level select + button) without scrolling —
     same idea as .fg-wrap's min-height in the flag game. Stays out of the
     way (map keeps its compact height) once the overlay is hidden. */
  .g-map-wrap:has(.g-overlay:not(.hidden)) { min-height: 460px; }

  /* Larger stroke on state borders so fingers can see boundaries clearly */
  .g-state { stroke-width: 1.1; }

  /* ── Mobile Pill Toasts ── */
  .g-toast {
    top: 10px; left: 50%;
    transform: translate(-50%, -10px) scale(.95);
    font-size: 12.5px; padding: 6px 14px;
    border-radius: 999px;
    width: max-content;
    max-width: 90%;
  }
  .g-toast.show { transform: translate(-50%, 0) scale(1); }
  
  .g-toast--reveal {
    top: 10px !important;
    left: 50% !important;
    transform: translate(-50%, -10px) scale(.95) !important;
    width: max-content !important;
    max-width: 90% !important;
  }
  .g-toast--reveal.show { transform: translate(-50%, 0) scale(1) !important; }

  /* ── Mobile Inline Flash Card ── */
  .g-flash-prompt {
    padding: 12px 16px !important;
    border-radius: 0 !important;
  }
  .g-flash-title { font-size: 13.5px !important; }
  .g-flash-capital { font-size: 11px !important; margin-bottom: 5px !important; }
  .g-flash-fact { font-size: 11px !important; padding: 8px 10px !important; margin-bottom: 8px !important; }
  .g-flash-action { font-size: 9px !important; }

  /* ── Attempts bar ── */
  .g-attempts { padding: 12px 16px; gap: 10px; }
  .g-att-lbl { font-size: 12px; }
  .g-pip { width: 13px; height: 13px; }

  /* ── Right panel stacked layout ── */
  .g-panel-col { padding: 4px 14px 0; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .g-panel-card {
    padding: 14px; border-radius: var(--radius-sm);
    box-shadow: none; border: 1px solid var(--border2);
  }
  .g-panel-card--hist { max-height: 200px; grid-column: 1 / -1; }
  .g-panel-card:last-child { grid-column: 1 / -1; }
  .g-p-title { font-size: 10px; margin-bottom: 10px; }

  /* ── Mobile 2x2 Grid ── */
  .g-cs-grid { 
    display: grid !important; 
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important; 
    overflow-x: unset !important;
    padding-bottom: 0 !important;
  }
  .g-cs-item { 
    display: flex !important;
    flex-direction: row !important; 
    align-items: center !important; 
    justify-content: flex-start !important;
    gap: 7px !important; 
    padding: 10px 10px !important; 
    border-radius: var(--radius-sm) !important; 
    background: var(--bg3) !important; 
    border: 1px solid var(--border2) !important; 
    font-size: 11px !important; 
    color: var(--text3) !important; 
    font-weight: 600 !important; 
    opacity: .8 !important;
    width: 100% !important;
  }

  /* How to play */
  .g-how-list { gap: 8px; }
  .g-how-list li { font-size: 12px; }
  .g-how-num { width: 18px; height: 18px; font-size: 10px; }

  /* Stats grid */
  .g-stat-box { padding: 10px 8px; }
  .g-stat-val { font-size: 21px; }
  .g-stat-lbl { font-size: 9.5px; }

  /* Overlay card */
  .g-overlay { padding: 14px; }
  .ov-card { padding: 26px 20px; width: 100%; max-width: 440px; }
  .ov-icon { font-size: 42px; margin-bottom: 10px; }
  .ov-title { font-size: 18px; }
  .ov-sub { font-size: 13px; margin-bottom: 20px; }
  .ov-score { font-size: 38px; }
  .ov-btn { padding: 14px 0; font-size: 15px; border-radius: var(--radius-sm); }

  /* SEO content section */
  .g-seo-content { padding: 24px 16px 0; margin-top: 28px; }
  .g-seo-content h2 { font-size: 17px; }
  .g-seo-content h3 { font-size: 14.5px; margin: 20px 0 8px; }
  .g-seo-content p { font-size: 13.5px; }
  .g-seo-state-chip { font-size: 11.5px; padding: 5px 10px; }
  .g-seo-faq summary { font-size: 13px; }
}

/* ── Extra-small phones ── */
@media (max-width: 380px) {
  .g-hud-right > :nth-child(3),
  .g-hud-right > :nth-child(4) { display: none; }
  .g-hud-name { font-size: 14.5px; }
  .g-hud-stat { padding: 0 6px; }
}

/* ── Touch interaction polish for the clickable map (all sizes) ── */
.g-state {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.g-zoom-toggle, .g-sound-btn, .ov-btn, .g-seo-toggle-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── SEO CONTENT SECTION ── */
.g-seo-content {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border2);
  color: var(--text2);
  font-size: 14.5px;
  line-height: 1.7;
}
.g-seo-content h2 {
  font-size: 21px;
  font-weight: 800;
  color: var(--text1);
  margin: 0 0 12px;
}
.g-seo-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text1);
  margin: 24px 0 10px;
}
.g-seo-content p { margin: 0 0 12px; max-width: 820px; }
.g-seo-content strong { color: var(--text1); font-weight: 600; }

.g-seo-state-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.g-seo-state-chip {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 6px 12px;
}
.g-seo-state-chip small { color: var(--text3); font-weight: 400; }

.g-seo-faq { max-width: 760px; }
.g-seo-faq details {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
}
.g-seo-faq summary {
  font-weight: 600;
  color: var(--text1);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}
.g-seo-faq summary::-webkit-details-marker { display: none; }
.g-seo-faq summary::before { content: '+ '; color: var(--blue); font-weight: 800; }
.g-seo-faq details[open] summary::before { content: '– '; }
.g-seo-faq details p { margin: 10px 0 0; font-size: 13.5px; }

@media (max-width: 580px) {
  .g-seo-content { font-size: 14px; }
  .g-seo-content h2 { font-size: 18px; }
}
/* ────────────────────────────────────────────────
   FLAG MATCH GAME — flag grid + cards
──────────────────────────────────────────────── */
.fg-wrap { position: relative; background: var(--bg3); padding: 22px 18px; min-height: 500px; }

.fg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: min-content;
  align-items: start;
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
}

.fg-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease-bounce), box-shadow .15s, border-color .15s, opacity .2s;
  box-shadow: var(--shadow);
}
@media (hover: hover) and (pointer: fine) {
  .fg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow2); }
}
.fg-card:active { transform: scale(.96); }

.fg-flag-box {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  overflow: hidden;
  background: #eef2f6;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border2);
}
.fg-flag-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fg-flag-missing { font-size: 26px; opacity: .35; }

.fg-card.correct {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(16,185,129,.25);
  animation: gPop .4s var(--ease-bounce);
}
.fg-card.correct .fg-flag-box { box-shadow: inset 0 0 0 2px #10b981; }

.fg-card.wrong { animation: gShake .35s ease; }
.fg-card.wrong .fg-flag-box { box-shadow: inset 0 0 0 2px #ef4444; }

.fg-card.reveal {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(249,115,22,.3);
  animation: gFlash 0.7s ease infinite;
  cursor: pointer;
}
.fg-card.reveal .fg-flag-box { box-shadow: inset 0 0 0 2px #f97316; }

.fg-card.disabled { opacity: .35; pointer-events: none; cursor: default; transform: none; }

.fg-badge {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #fff;
  box-shadow: var(--shadow);
}
.fg-card.correct .fg-badge, .fg-card.reveal .fg-badge { background: #10b981; }
.fg-card.wrong .fg-badge { background: #ef4444; }

@media (max-width: 640px) {
  .fg-wrap { padding: 16px 12px; min-height: 460px; }
  .fg-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: none; }
  .fg-card { padding: 8px; }
  .fg-badge { width: 19px; height: 19px; font-size: 11px; top: -6px; right: -6px; }
}

/* ────────────────────────────────────────────────
   NUMBER SPRINT — tap 1→50 in order, against the clock
──────────────────────────────────────────────── */
.ng-wrap { position: relative; background: var(--bg3); padding: 22px 18px; min-height: 500px; }

/* Big countdown, sits above the grid */
.ng-timer-row { display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.ng-timer {
  font-size: 40px; font-weight: 900; color: var(--text); letter-spacing: -1px; line-height: 1;
  font-variant-numeric: tabular-nums; transition: color .25s;
}
.ng-timer small { font-size: 16px; font-weight: 700; color: var(--text3); margin-left: 2px; }
.ng-timer--danger { color: var(--red); animation: ngPulse .5s ease infinite; }
@keyframes ngPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.ng-grid {
  display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center;
  gap: 10px;
  max-width: 700px;
  margin: 0 auto;
}

.ng-tile {
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 19px; font-weight: 800; color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow);
  transition: transform .15s var(--ease-bounce), box-shadow .15s, border-color .15s, background .15s, color .15s;
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) and (pointer: fine) {
  .ng-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow2); border-color: var(--blue-light); }
}
.ng-tile:active { transform: scale(.94); }

.ng-tile.found {
  background: var(--green-border); color: #fff; border-color: var(--green-border);
  cursor: default; pointer-events: none;
  animation: ngFound .35s var(--ease-bounce);
}
@keyframes ngFound {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.ng-tile.wrong {
  background: var(--red-border); color: #fff; border-color: var(--red-border);
  animation: gShake .4s ease;
}

/* Big "find this number next" hint above the grid, mirrors other games' HUD target style */
.ng-next-val {
  font-size: 30px; font-weight: 900; color: var(--blue);
  transition: transform .2s var(--ease-bounce), color .2s;
}

@media (max-width: 640px) {
  .ng-wrap { padding: 16px 12px; min-height: 460px; }
  .ng-timer { font-size: 32px; }
  .ng-timer small { font-size: 13px; }
  .ng-grid { gap: 7px; }
  .ng-tile { width: 44px; height: 44px; font-size: 15px; border-radius: 8px; }
}

/* ng-wrap: expand when start/result overlay is showing so the card fits without scroll */
@media (max-width: 640px) {
  .ng-wrap:has(.g-overlay:not(.hidden)) { min-height: 460px; }
}
/* ────────────────────────────────────────────────
   PERIODIC TABLE GAME: Element Hunt, Quiz Match, Explore
──────────────────────────────────────────────── */

/* ── Mode tabs ── */
.pt-tabs { 
  display: flex; 
  gap: 12px; /* Increased tab gap */
  margin-bottom: 16px; /* Space below tabs */
  width: 100%; 
}
.pt-tab {
  flex: 1; min-width: 110px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 46px; /* Taller touch target on all devices */
  border-radius: var(--radius-sm);
  background: var(--bg2); border: 1.5px solid var(--border2);
  color: var(--text2); font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: transform .15s var(--ease-bounce), box-shadow .2s, border-color .2s, color .2s, background .2s;
}
.pt-tab span.pt-tab-emoji { font-size: 16px; }
@media (hover: hover) and (pointer: fine) {
  .pt-tab:hover { transform: translateY(-2px); border-color: var(--blue-light); }
}
.pt-tab.active[data-tab="hunt"]    { background: linear-gradient(135deg, var(--blue), var(--purple)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(79,70,229,.32); }
.pt-tab.active[data-tab="quiz"]    { background: linear-gradient(135deg, #f59e0b, #ec4899); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(236,72,153,.32); }
.pt-tab.active[data-tab="explore"] { background: linear-gradient(135deg, #10b981, #06b6d4); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(16,185,129,.32); }

@media (max-width: 640px) {
  .pt-tabs {
    gap: 8px;
    margin-bottom: 12px;
  }
  .pt-tab {
    min-width: 90px;
    height: 44px; /* Taller with better breathing room on mobile */
    font-size: 12px;
    padding: 0 10px;
  }
  .pt-tab span.pt-tab-emoji { font-size: 14px; }
}

/* ── HUD rows (mode-specific) ── */
.pt-hud-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; width: 100%; }
.pt-hud-row.hidden { display: none; }
/* Scoped 'hidden' utility for shared right-panel components, only used on this page */
.g-how-list.hidden, .g-stats-grid.hidden { display: none; }
.pt-lives { font-size: 17px; letter-spacing: 2px; display: flex; gap: 1px; }
.pt-lives span { transition: transform .25s var(--ease-bounce), opacity .25s; display: inline-block; }
.pt-lives span.lost { opacity: .25; transform: scale(.7) rotate(-15deg); filter: grayscale(1); }

/* Per-question ring timer (quiz mode) */
.pt-qring { position: relative; width: 34px; height: 34px; flex-shrink: 0; }
.pt-qring svg { transform: rotate(-90deg); }
.pt-qring circle { fill: none; stroke-width: 4; }
.pt-qring .pt-qring-bg { stroke: var(--bg4); }
.pt-qring .pt-qring-fg { stroke: var(--blue); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .25s; }
.pt-qring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Discover progress bar (explore mode) ── */
.pt-discover-wrap { display: flex; align-items: center; gap: 10px; width: 100%; }
.pt-discover-bar { flex: 1; height: 10px; background: var(--bg4); border-radius: 999px; overflow: hidden; }
.pt-discover-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10b981, #06b6d4); transition: width .5s var(--ease-out); }
.pt-discover-lbl { font-size: 12.5px; font-weight: 700; color: var(--text2); white-space: nowrap; }

/* Reset Explore progress button (Classroom friendly UX) */
.pt-explore-reset-btn {
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text3);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.pt-explore-reset-btn:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

/* ── Main wrap ── */
.pt-wrap { position: relative; background: var(--bg3); padding: 20px 16px; min-height: 560px; }

/* Big countdown (hunt mode) */
.pt-timer-row { display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.pt-timer { font-size: 32px; font-weight: 900; color: var(--text); letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; transition: color .25s; }
.pt-timer small { font-size: 13px; font-weight: 700; color: var(--text3); margin-left: 2px; }
.pt-timer--danger { color: var(--red); animation: ngPulse .5s ease infinite; }

/* ── The grid itself: 18 columns, mirrors the real periodic table ── */
.pt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.pt-scroll.hidden { display: none; }
:root { --pt-tile: 39px; --pt-gap: 3px; }
.pt-grid {
  --c: var(--border2);
  display: grid;
  grid-template-columns: repeat(18, var(--pt-tile));
  grid-template-rows: repeat(7, var(--pt-tile)) 12px repeat(2, var(--pt-tile));
  gap: var(--pt-gap);
  width: max-content;
  margin: 0 auto;
}
.pt-tile {
  --c: var(--border2);
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-top: 3px solid var(--c);
  border-radius: 7px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease-bounce), box-shadow .15s, border-color .15s, background .15s, opacity .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow: hidden;
}
@media (hover: hover) and (pointer: fine) {
  .pt-tile:hover:not(.pt-tile--placeholder) { transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 14px rgba(0,0,0,.12); z-index: 2; border-color: var(--c); }
}
.pt-tile:active:not(.pt-tile--placeholder) { transform: scale(.94); }
.pt-tile-num { position: absolute; top: 2px; left: 3px; font-size: 6.5px; font-weight: 700; color: var(--text3); line-height: 1; }
.pt-tile-sym { font-size: 13px; font-weight: 800; color: var(--c); line-height: 1; }
.pt-tile-star { position: absolute; bottom: 1px; right: 2px; font-size: 6px; opacity: .55; }

.pt-tile--placeholder {
  background: var(--bg4); border: 1px dashed var(--border2); border-top: 1px dashed var(--border2);
  cursor: default; display: flex; align-items: center; justify-content: center;
  font-size: 6.5px; font-weight: 700; color: var(--text3); pointer-events: none;
}

/* ── Premium Keyboard Accessibility focus-rings ── */
.pt-tile:focus-visible, 
.pt-quiz-opt:focus-visible, 
.pt-tab:focus-visible,
.pt-explore-reset-btn:focus-visible {
  outline: 2px solid var(--blue) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

/* ── Gamified Flame glow effect for high streaks (3+) ── */
.g-hud-val.high-streak {
  color: #f97316 !important;
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
  animation: streakPulse 1.2s infinite ease-in-out;
}
@keyframes streakPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ── Crucial Premium fix: Avoid clipping beneath surrounding boxes during animations ── */
.pt-tile.found,
.pt-tile.wrong,
.pt-tile.pt-reveal-flash {
  z-index: 15 !important; /* FIXED: sits under the popup overlay (40) so it never overlaps the card */
  position: relative !important;
}

.pt-tile.found {
  background: var(--green-border); border-color: var(--green-border);
  animation: ngFound .4s var(--ease-bounce);
}
.pt-tile.found .pt-tile-sym, .pt-tile.found .pt-tile-num { color: #fff; }

.pt-tile.wrong { animation: gShake .4s ease; }

/* ── PERFECT 3-TIME RAPID BLINK ANIMATION (Stays fully visible, static, glowing brightly on its own place) ── */
.pt-tile.pt-reveal-flash {
  border-color: #f97316 !important;
  border-width: 2px !important;
  animation: ptRevealFlashAnim 0.35s ease-in-out 3 !important; /* Blinks exactly 3 times in original place */
  transition: none !important; /* Prevents layout framework's sliding/drop dropdown behaviors */
  background-color: #ffedd5 !important; /* Holds this peach glow state once done blinking */
  box-shadow: 0 0 16px 6px #f97316, inset 0 0 10px #f97316 !important;
  color: #000000 !important;
}

/* Synced Text inherit logic (Forces chemical symbols + atomic numbers to glow inline with container) */
.pt-tile.pt-reveal-flash .pt-tile-sym,
.pt-tile.pt-reveal-flash .pt-tile-num {
  color: inherit !important;
}

@keyframes ptRevealFlashAnim {
  0%, 100% {
    background-color: #ffedd5 !important;
    box-shadow: 0 0 16px 6px #f97316, inset 0 0 10px #f97316 !important;
    color: #000000 !important;
  }
  50% {
    background-color: #f97316 !important;
    box-shadow: 0 0 28px 12px #f97316, inset 0 0 5px #ffffff !important;
    color: #ffffff !important;
  }
}

/* Explore Mode: locked/remaining elements styling (Sticker Book Effect) */
.pt-tile.undiscovered {
  filter: grayscale(0.8) opacity(0.35);
  border-top-color: var(--border2);
}
.pt-tile.discovered {
  filter: none;
  opacity: 1;
  animation: gPop 0.4s var(--ease-bounce);
}

.pt-tile.disabled { opacity: .3; pointer-events: none; }
.pt-tile.dim { opacity: .35; }

/* During Hunt: dim non-relevant categories slightly so the table feels fair but whole */
.pt-grid.hunt-mode .pt-tile--placeholder { opacity: .4; }

/* ── Quiz card ── */
.pt-quiz-card { 
  display: none; 
  flex-direction: column; 
  align-items: center; 
  gap: 24px; /* More breathable spacing between question and options */
  padding: 20px 8px 8px; 
  max-width: 480px; 
  margin: 0 auto; 
}
.pt-quiz-card.show { display: flex; }
.pt-quiz-q {
  text-align: center; font-size: 17px; font-weight: 800; color: var(--text);
  line-height: 1.45; min-height: 48px; display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.pt-quiz-q strong { color: var(--blue); }
.pt-quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.pt-quiz-opt {
  --c: var(--border2);
  display: flex; align-items: center; justify-content: center; /* Centered layout for clean single-token quiz choices */
  background: var(--bg2); border: 1.5px solid var(--border2); border-left: 4px solid var(--c);
  border-radius: var(--radius-sm); 
  padding: 14px 16px; /* Breathable spacing on mobile & desktop */
  min-height: 52px; /* Taller touch targets */
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  font-family: var(--font); text-align: center;
  transition: transform .15s var(--ease-bounce), box-shadow .15s, border-color .15s, background .15s, opacity .2s;
  box-shadow: var(--shadow);
}
@media (hover: hover) and (pointer: fine) {
  .pt-quiz-opt:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow2); }
}
.pt-quiz-opt:active:not(:disabled) { transform: scale(.97); }
.pt-quiz-opt-sym { font-size: 19px; font-weight: 900; color: var(--c); width: 100%; text-align: center; }
.pt-quiz-opt-name { font-size: 14px; font-weight: 700; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; text-align: center; }
.pt-quiz-opt.correct { background: var(--green-bg); border-color: #10b981 !important; animation: gPop .4s var(--ease-bounce); }
.pt-quiz-opt.wrong   { background: var(--red-bg); border-color: #ef4444 !important; animation: gShake .35s ease; }
.pt-quiz-opt.disabled-opt { opacity: .45; pointer-events: none; }
.pt-quiz-progress-row { display: flex; gap: 5px; width: 100%; max-width: 320px; }
.pt-quiz-dot { flex: 1; height: 5px; border-radius: 999px; background: var(--bg4); }
.pt-quiz-dot.done { background: var(--green-border); }
.pt-quiz-dot.bad  { background: var(--red-border); }
.pt-quiz-dot.current { background: var(--blue-light); }

/* ── Info card (Explore mode) ── */
.pt-info-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: 45;
  opacity: 0; pointer-events: none; transition: opacity .25s; padding: 18px;
}
.pt-info-overlay.show { opacity: 1; pointer-events: auto; }
.pt-info-card {
  --c: var(--blue);
  background: var(--bg2); border-radius: var(--radius); border-top: 5px solid var(--c);
  padding: 28px 26px; text-align: center; max-width: 320px; width: 92%;
  box-shadow: var(--shadow3); animation: ovPop .35s var(--ease-bounce);
}
.pt-info-sym { font-size: 52px; font-weight: 900; color: var(--c); line-height: 1; margin-bottom: 4px; }
.pt-info-num { font-size: 12px; color: var(--text3); font-weight: 700; margin-bottom: 10px; }
.pt-info-name { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.pt-info-cat { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--c); color: #fff; margin-bottom: 14px; opacity: .92; }
.pt-info-fact { font-size: 13px; color: var(--text2); line-height: 1.6; background: var(--bg3); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 18px; }
.pt-info-close { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--c); color: #fff; border: none; border-radius: var(--radius-sm); padding: 11px 0; width: 100%; font-size: 13.5px; font-weight: 700; font-family: var(--font); cursor: pointer; transition: opacity .15s; }
.pt-info-close:active { opacity: .85; }
.pt-info-new { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: #10b981; background: var(--green-bg); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; animation: gPop .4s var(--ease-bounce); }

/* Start Overlay Difficulty Selector */
.pt-diff-selector {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
  background: var(--bg3);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
}
.pt-diff-btn {
  flex: 1;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}
.pt-diff-btn:hover {
  color: var(--text2);
}
.pt-diff-btn.active {
  background: var(--bg2);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Milestone toast */
.g-toast--milestone { background: linear-gradient(135deg, #10b981, #06b6d4); color: #fff; }

/* ── Category legend (right panel) ── */
.pt-legend { display: flex; flex-direction: column; gap: 7px; }
.pt-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); }
.pt-legend-dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 900px) {
  :root { --pt-tile: 36px; }
}
@media (max-width: 640px) {
  .pt-wrap { padding: 14px 8px; min-height: 480px; }
  :root { --pt-tile: 34px; --pt-gap: 2px; }
  .pt-tile-sym { font-size: 10px; }
  .pt-tile-num { font-size: 5.5px; }
  .pt-timer { font-size: 26px; }
  .pt-tab { min-width: 96px; height: 40px; font-size: 12px; gap: 5px; }
  .pt-tab span.pt-tab-emoji { font-size: 14px; }
  .pt-quiz-q { font-size: 15px; }
  .pt-quiz-opt-sym { font-size: 16px; width: 28px; }
  .pt-quiz-opt-name { font-size: 11.5px; }
  .pt-info-sym { font-size: 42px; }

  /* ── Mobile Layout Polish: No squishing, wrap clues safely ── */
  #ptHudHunt.pt-hud-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
  }
  #ptHudHunt .g-hud-target {
    width: 100% !important;
    margin-bottom: 2px !important;
  }
  #ptHudHunt .g-hud-right {
    width: 100% !important;
    justify-content: space-between !important;
    margin-top: 4px !important;
  }
  
  /* Make sure mobile question never gets truncated/cut on narrow screens */
  #huntClue {
    white-space: normal !important;
    overflow: visible !important;
    line-height: 1.4 !important;
    font-size: 14px !important;
    display: block !important;
    max-width: 100% !important;
  }
}