/* TELIMINE public shell: zero bottom gap, edge-aligned cards & responsive dock */
:root {
  --tm-shell-width: 1440px;
  --tm-shell-gutter: clamp(10px, 2vw, 28px);
  --tm-shell-radius: 22px;
}

.tm-public-main {
  box-sizing: border-box;
  width: min(100%, var(--tm-shell-width));
  margin-inline: auto;
  min-width: 0;
  padding: 8px var(--tm-shell-gutter) 0;
}

/* Prevent trailing empty bands from last child margins inside any page */
.tm-public-main > *:last-child,
.page-section > *:last-child,
.tm-pg > *:last-child {
  margin-bottom: 0 !important;
}

#mount-pages, #mount-overlays, #mount-bottom, #mount-categories { min-width: 0; }
.tm-public-main :where(section, article, .card, [class*="card"]):not(.tm-nav):not(.tm-sheet) { min-width: 0; }
.tm-public-main img, .tm-public-main video, .tm-public-main iframe { max-width: 100%; }
.tm-public-main img { height: auto; }

.tm-public-main :where(button, a, input, select, textarea) {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-duration: .18s;
}
.tm-public-main :where(button, a):hover { transform: translateY(-1px); }
.tm-public-main :where(button, a):active { transform: scale(.98); }
.tm-public-main :where(button, a):focus-visible,
.tm-public-main :where(input, select, textarea):focus-visible {
  outline: 2px solid rgb(var(--c-primary) / .75);
  outline-offset: 2px;
}

/* Pointer-only desktop tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; z-index: 99999; left: 50%; top: calc(100% + 7px);
  max-width: min(240px, 80vw); width: max-content; padding: 7px 10px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.14); background: #111827; color: #f8fafc;
  font: 600 11px/1.35 'Plus Jakarta Sans', sans-serif; letter-spacing: .01em;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity .14s ease 650ms, transform .14s ease 650ms, visibility 0s linear 650ms;
}
[data-tip]::before {
  content: ""; position: absolute; z-index: 99998; left: 50%; top: calc(100% + 2px);
  width: 7px; height: 7px; background: #111827; border-left: 1px solid rgba(255,255,255,.14);
  border-top: 1px solid rgba(255,255,255,.14); transform: translate(-50%, 3px) rotate(45deg);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .14s ease 650ms, transform .14s ease 650ms, visibility 0s linear 650ms;
}
@media (hover: hover) and (pointer: fine) {
  [data-tip]:hover::after, [data-tip]:hover::before { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 650ms; }
}
@media (hover: none), (pointer: coarse) {
  [data-tip]::after, [data-tip]::before { display: none !important; content: none !important; }
}

/* Bottom Navigation Bar (Mobile Edge-to-Edge, Desktop Floating Pill) */
#tmBottomBar {
  background: rgb(var(--c-card) / .92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgb(var(--c-line) / .09);
  padding-bottom: var(--tm-safe-bottom);
}
#tmBottomBarInner { width: min(100%, 760px); max-width: 760px; margin-inline: auto; }
#tmBottomBar .tm-nav { min-width: 0; border-radius: 14px; transition: background .2s, color .2s, transform .2s; }
#tmBottomBar .tm-nav:hover, #tmBottomBar .tm-nav.active { background: rgb(var(--c-primary) / .12); color: rgb(var(--c-primary)); }

@media (min-width: 768px) {
  body { padding-bottom: calc(82px + var(--tm-safe-bottom)); }
  .tm-public-main { padding-top: 18px; padding-inline: clamp(16px, 2vw, 28px); }
  #tmBottomBar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 12px;
    width: min(calc(100% - 40px), 820px);
    border: 1px solid rgb(var(--c-line) / .12);
    border-radius: 20px;
    box-shadow: 0 18px 55px rgba(20, 20, 40, .14);
  }
  #tmBottomBarInner { padding: 8px 14px; }
}

@media (max-width: 767px) {
  .tm-public-main { padding-inline: 10px; padding-top: 8px; }
  #tmBottomBarInner { max-width: 100%; }
  .tm-public-main .page-section.px-4, .tm-public-main .page-section > .px-4 { padding-inline: 4px; }
  .tm-public-main .page-section.pt-10 { padding-top: 12px; }
  .tm-public-main .page-section.pt-6 { padding-top: 10px; }
}

/* Compact, Zero-Gap Game Cards Grid */
.tm-pg { padding: 8px 4px 0; }
.tm-pg-head { margin-bottom: 12px; gap: 9px; }
.tm-cards-grid { gap: 6px !important; }
.tm-gimg { margin-bottom: 4px; border-radius: 12px; aspect-ratio: 1 / 1; }
.tm-gname { font-size: clamp(10px, .78rem, 12px); margin-inline: 1px; }
.tm-gtag { font-size: 9px; margin-inline: 1px; }
.tm-gcard[data-wrap="1"], [data-card-wrap="1"] .tm-gcard:not([data-wrap="0"]) { padding: 0; border-radius: 12px; overflow: hidden; }

@media (min-width: 480px) {
  .tm-cards-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}
@media (min-width: 768px) {
  .tm-pg { padding: 10px 4px 0; }
  .tm-cards-grid { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 8px !important; }
}
@media (min-width: 1200px) {
  .tm-cards-grid { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; gap: 9px !important; }
}
@media (prefers-reduced-motion: reduce) { .tm-public-main :where(button, a) { transition-duration: .01ms !important; } }
