
/* Retrac Games premium styles with animations and SAES overlay */

/* Base */

:root {
  --rg-bg: #fff6d8;        /* soft creamy yellow */
  --rg-bg-alt: #fffdf6;
  --rg-card-bg: #ffffff;
  --rg-border: #e4d8b6;
  --rg-text: #252525;
  --rg-text-muted: #6b6b6b;
  --rg-accent: #f4b400;   /* warm yellow accent */
  --rg-accent-soft: #ffe6a4;
  --rg-radius-lg: 18px;
  --rg-radius-md: 12px;
  --rg-shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #fffdf4 0, var(--rg-bg) 55%, #ffeec2 100%);
  color: var(--rg-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Simple fade / lift animations */

@keyframes rg-fade-up {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rg-fade-in-scale {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Header */

.rg-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(255, 248, 219, 0.93),
    rgba(255, 248, 219, 0.86),
    transparent
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.rg-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rg-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rg-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  background: #fff;
  object-fit: contain;
}

.rg-title-group {
  display: flex;
  flex-direction: column;
}

.rg-site-title {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rg-site-tagline {
  margin: 0;
  font-size: 0.8rem;
  color: var(--rg-text-muted);
}

.rg-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.rg-nav-link {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--rg-text-muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease;
}

.rg-nav-link--active {
  color: #7a4b00;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.8);
}

.rg-nav-link:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #7a4b00;
  border-color: rgba(250, 223, 150, 0.9);
  transform: translateY(-1px);
}

/* Main layout */

.rg-main {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 18px 32px;
}

/* Hero */

.rg-hero {
  margin-bottom: 22px;
}

.rg-hero-content {
  background: linear-gradient(135deg, var(--rg-accent-soft), #fffdf7);
  border-radius: 24px;
  padding: 18px 18px 18px;
  box-shadow: var(--rg-shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.9);
  animation: rg-fade-up 0.5s ease-out 0.05s both;
}

.rg-hero h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.rg-hero p {
  margin: 0;
  font-size: 0.93rem;
  color: #5c4408;
}

/* Sections */

.rg-section {
  margin-top: 18px;
}

.rg-section-header h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.rg-section-header p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--rg-text-muted);
}

/* Game row & cards */

.rg-game-row {
  margin-top: 14px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  padding-right: 2px;
}

.rg-game-row::-webkit-scrollbar {
  height: 6px;
}

.rg-game-row::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
}

.rg-game-row::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

.rg-game-card {
  min-width: 320px;
  max-width: 360px;
  background: var(--rg-card-bg);
  border-radius: var(--rg-radius-lg);
  box-shadow: var(--rg-shadow-soft);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rg-game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
}

/* Game logo: 250x250 rendered size */

.rg-game-thumb-wrap {
  border-radius: var(--rg-radius-md);
  overflow: hidden;
  background: #111;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rg-game-thumb {
  display: block;
  width: 250px;
  height: 250px;
  max-width: 100%;
  max-height: 250px;
  object-fit: cover;
}

/* Card text */

.rg-game-body {
  padding: 10px 4px 8px;
}

.rg-game-title {
  margin: 0 0 4px;
  font-size: 1rem;
}

.rg-game-meta {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--rg-text-muted);
}

.rg-game-description {
  margin: 0;
  font-size: 0.88rem;
  color: #3c3c3c;
}

.rg-game-footer {
  padding: 2px 4px 0;
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* Buttons */

.rg-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  outline: none;
  background: #111111;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
  transform: translateY(0);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease,
    opacity 0.15s ease;
}

.rg-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
  background: #000000;
}

.rg-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.rg-button--outline {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.06);
}

.rg-button--outline:hover {
  background: #ffffff;
}

/* Game detail page */

.rg-game-detail {
  margin-top: 20px;
}

.rg-game-detail-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--rg-shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.rg-game-detail-info {
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  gap: 12px;
}

/* Game detail logo: 250x250 rendered size */

.rg-game-detail-logo {
  width: 250px;
  height: 250px;
  max-width: 100%;
  max-height: 250px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.rg-game-detail-text {
  flex: 2 1 280px;
  font-size: 0.9rem;
  color: #3d3d3d;
}

.rg-game-feature-list {
  padding-left: 18px;
  margin: 6px 0 0;
  font-size: 0.88rem;
}

/* Game player */

.rg-game-player-wrap {
  margin-top: 18px;
  padding: 14px 12px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--rg-shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.rg-game-player-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.rg-game-player-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #3b2a04;
}

.rg-game-frame-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #000;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  transform-origin: center;
}

.rg-game-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.rg-game-tip {
  margin: 8px 2px 0;
  font-size: 0.8rem;
  color: var(--rg-text-muted);
}

/* Fake fullscreen overlay (no Fullscreen API) */

.rg-game-frame-wrap--fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  z-index: 999;
}

/* Footer */

.rg-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  padding: 10px 18px 18px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--rg-text-muted);
}

/* Ad badge & info icon */

.rg-ad-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #000000cc;
  color: #fff;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  font-weight: 600;
  z-index: 3;
}

.rg-ad-info {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffffdd;
  color: #000;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 4px rgba(0,0,0,0.25);
  z-index: 3;
}

/* Ad Info Popup */

.rg-ad-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.rg-ad-popup.open {
  display: flex;
}

.rg-ad-popup-content {
  background: #ffffff;
  padding: 22px;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  text-align: center;
}

.rg-ad-popup-content h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.rg-ad-popup-content p {
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* Responsive tweaks */

@media (max-width: 720px) {
  .rg-header-inner {
    padding: 10px 14px;
  }

  .rg-main {
    padding: 14px 14px 24px;
  }

  .rg-hero-content {
    padding: 14px 14px 14px;
  }

  .rg-game-detail-header,
  .rg-game-player-wrap {
    padding: 12px 10px 12px;
  }

  .rg-game-frame-wrap {
    border-radius: 16px;
  }

  .rg-game-card {
    min-width: 100%;
    max-width: 100%;
  }
}
