/* Mobile usability and resilient card artwork. */
.cover img,
.detail-cover img,
.trg-feed-media img {
  display: block;
  position: relative;
  z-index: 1;
  max-width: 100%;
  opacity: 1;
}

.cover::after {
  z-index: 2;
  inset: auto 0 0;
  height: 38%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(8, 7, 17, .82));
}

.game-catalog-card .cover::after {
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(8, 7, 17, .76));
}

.cover-fallback { z-index: 1; }

@media (max-width: 650px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  .profile-hero {
    grid-template-columns: 86px minmax(0, 1fr) !important;
    align-items: start;
    gap: 16px;
    padding: 20px;
    margin-top: 24px;
    text-align: left;
  }

  .profile-avatar { margin: 0; }
  .profile-avatar img,
  .profile-avatar .avatar-fallback { width: 82px; height: 82px; }
  .profile-info h1 { font-size: clamp(28px, 9vw, 38px); overflow-wrap: anywhere; }
  .profile-info > p { font-size: 13px; }
  .profile-info .trust-badges { justify-content: flex-start; }

  .profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    margin-top: 14px;
  }

  .profile-stats > div {
    min-width: 0;
    padding: 10px 5px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
  }

  .profile-stats b { font-size: 17px; overflow-wrap: anywhere; }
  .profile-stats span { font-size: 8px; line-height: 1.25; }
  .profile-hero > div:last-child { grid-column: 1 / -1; }
  .trg-profile-review-history { padding-top: 32px; }
  .trg-profile-review-history .section-head { margin-bottom: 18px; }

  .game-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .game-catalog-card .card-body { padding: 11px; }
  .game-catalog-card h3 { font-size: 15px; line-height: 1.15; }
  .game-catalog-card .meta,
  .game-catalog-card p { font-size: 10px; }
  .game-catalog-card .platform { top: 7px; left: 7px; padding: 3px 5px; font-size: 8px; }
  .game-catalog-card .score-badge { right: 7px; bottom: 7px; width: 38px; height: 38px; font-size: 14px; }
  .game-catalog-card .game-card-signals { grid-template-columns: 1fr; gap: 5px; }
  .game-catalog-card .game-card-signals a { justify-content: center; min-height: 32px; padding: 5px; font-size: 9px; }

  .trg-public-setup { padding: 24px 0 38px; }
  .trg-public-setup .section-head { gap: 12px; margin-bottom: 18px; }
  .trg-public-platforms { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 7px; }
  .trg-platform-chip { padding: 6px 9px; font-size: 9px; }
  .trg-setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .trg-setup-card { display: flex; min-width: 0; min-height: 0; padding: 0; flex-direction: column; }
  .trg-setup-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #0b0a14; }
  .trg-setup-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .trg-setup-card-copy { padding: 12px; }
  .trg-setup-card-copy h3 { font-size: 14px; margin: 5px 0 10px; overflow-wrap: anywhere; }
  .trg-setup-card-copy span,
  .trg-setup-card-copy a,
  .trg-setup-card-copy small { font-size: 9px; }
}

@media (max-width: 370px) {
  .game-catalog-grid { gap: 8px; }
  .game-catalog-card .card-body { padding: 9px; }
  .game-catalog-card h3 { font-size: 14px; }
}

/* The image is positioned over the fallback gradient, never underneath it. */
.trg-news-image {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
}

.trg-news-image img {
  position: absolute !important;
  inset: 0;
  z-index: 2;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center;
  margin: 0 !important;
}

@media (max-width: 900px) {
  .menu-toggle {
    position: relative;
    display: grid !important;
    place-content: center;
    gap: 5px;
    width: 52px !important;
    height: 52px !important;
    flex: 0 0 52px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(164, 103, 238, .58) !important;
    border-radius: 15px !important;
    background: radial-gradient(circle at 30% 20%, rgba(255, 63, 159, .2), transparent 42%), linear-gradient(145deg, #1b1530, #0c0a16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(78, 35, 130, .24);
    color: transparent !important;
  }

  .menu-toggle::before {
    content: '';
    position: absolute;
    inset: -55% 25%;
    transform: rotate(28deg);
    background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .18), transparent);
    transition: transform .35s ease;
  }

  .menu-toggle span {
    position: relative;
    z-index: 1;
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, #ffad47, #ff4fa8 55%, #9b6cff);
    box-shadow: 0 0 9px rgba(255, 79, 168, .32);
    transition: transform .24s ease, opacity .18s ease, width .24s ease;
  }

  .menu-toggle span:nth-child(2) { width: 18px; justify-self: end; }
  .menu-toggle[aria-expanded="true"] { border-color: rgba(255, 73, 168, .8) !important; box-shadow: 0 0 24px rgba(171, 72, 255, .3); }
  .menu-toggle[aria-expanded="true"]::before { transform: rotate(208deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { width: 0; opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav-menu.open {
    display: grid;
    gap: 7px;
    padding: 14px max(18px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid rgba(157, 99, 238, .42);
    background: radial-gradient(circle at 18% 0, rgba(255, 63, 159, .15), transparent 35%), radial-gradient(circle at 82% 100%, rgba(34, 211, 238, .11), transparent 38%), rgba(10, 8, 19, .98);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .52);
    animation: trg-mobile-menu-in .22s ease both;
  }

  .nav-menu.open li { animation: trg-mobile-link-in .25s ease both; }
  .nav-menu.open li:nth-child(2) { animation-delay: .025s; }
  .nav-menu.open li:nth-child(3) { animation-delay: .05s; }
  .nav-menu.open li:nth-child(4) { animation-delay: .075s; }
  .nav-menu.open li:nth-child(5) { animation-delay: .1s; }
  .nav-menu.open a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid rgba(111, 87, 151, .24);
    border-radius: 11px;
    background: rgba(255, 255, 255, .025);
    color: #ddd5ea;
    font-size: 14px;
  }
  .nav-menu.open a::before { content: '◆'; margin-right: 10px; color: #ff4fa8; font-size: 8px; }
}

@keyframes trg-mobile-menu-in { from { opacity: 0; transform: translateY(-10px) scaleY(.96); } }
@keyframes trg-mobile-link-in { from { opacity: 0; transform: translateX(-8px); } }

@media (max-width: 650px) {
  .trg-news-image {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
    background: #171124;
  }

  .trg-news-rail { grid-auto-columns: minmax(270px, 86vw) !important; }

  .dashboard {
    display: block;
    padding: 22px 0 48px;
  }

  .dashboard-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 22px;
    padding: 10px;
    overflow: visible;
  }

  .dashboard-nav a {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid rgba(108, 84, 145, .22);
    background: rgba(255, 255, 255, .025);
    font-size: 11px;
  }

  .dashboard .page-head { gap: 16px; }
  .dashboard .page-head h1 { font-size: clamp(32px, 10vw, 44px); overflow-wrap: anywhere; }
  .dashboard .page-head .btn { width: 100%; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .dash-stat { min-width: 0; padding: 14px; }
  .dash-stat b { font-size: 20px; overflow-wrap: anywhere; }

  .dashboard .table-wrap { padding: 15px; overflow: hidden; }
  .dashboard .table-wrap h2 { margin-bottom: 12px; font-size: 23px; }
  .dashboard table,
  .dashboard tbody,
  .dashboard tr,
  .dashboard td { display: block; width: 100%; min-width: 0; }
  .dashboard thead { display: none; }
  .dashboard tr { margin: 0 0 12px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .025); }
  .dashboard td { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 9px; padding: 7px 0; border: 0; overflow-wrap: anywhere; }
  .dashboard td::before { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .dashboard td:nth-child(1)::before { content: 'Review'; }
  .dashboard td:nth-child(2)::before { content: 'Game'; }
  .dashboard td:nth-child(3)::before { content: 'Score'; }
  .dashboard td:nth-child(4)::before { content: 'Status'; }
  .dashboard td:nth-child(5)::before { content: 'Action'; }

  .dashboard input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  .dashboard select,
  .dashboard textarea,
  .trg-setup-editor input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  .trg-setup-editor select,
  .trg-setup-editor textarea {
    min-height: 46px;
    padding: 11px 12px;
    border-color: rgba(129, 91, 181, .48);
    border-radius: 11px;
    background: linear-gradient(145deg, #11101d, #0a0912);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-menu.open,
  .nav-menu.open li,
  .menu-toggle span,
  .menu-toggle::before { animation: none !important; transition: none !important; }
}
