/* ==========================================================================
   POKI.COM EXACT HOMEPAGE REPLICA - STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;800;900&display=swap');

:root {
  --poki-bg: #83ffe7;
  --poki-blue: #009cff;
  --poki-blue-dark: #0077c7;
  --poki-yellow: #ffb703;
  --poki-pink: #ff477e;
  --poki-purple: #7b2cbf;
  --poki-dark: #0f172a;
  --poki-radius: 16px;
  --font-main: 'Outfit', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--poki-bg);
  min-height: 100vh;
  padding: 8px;
  overflow-x: hidden;
  color: var(--poki-dark);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--poki-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--poki-blue);
  border-radius: 8px;
}

/* Poki Floating Header Pill Overlay (Exact Poki Top-Left Header) */
.floating-header {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 9999;
}

.poki-brand-pill {
  background: #ffffff;
  border-radius: 18px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.poki-brand-pill:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 156, 255, 0.3);
}

.poki-logo-badge {
  background: var(--poki-blue);
  color: #ffffff;
  font-weight: 900;
  font-size: 22px;
  padding: 3px 12px;
  border-radius: 12px;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 0 var(--poki-blue-dark);
}

.poki-logo-badge span {
  color: var(--poki-yellow);
}

.poki-mini-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-action-btn {
  width: 26px;
  height: 26px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mini-action-btn:hover {
  background: #e2e8f0;
}

/* Fullscreen Grid Container */
.grid-wrapper {
  width: 100%;
  max-width: 100%;
}

/* Poki Bento Wall Grid */
.poki-wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  grid-auto-rows: 88px;
  grid-auto-flow: dense;
  gap: 8px;
}

@media (min-width: 768px) {
  .poki-wall-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    grid-auto-rows: 115px;
    gap: 10px;
  }
}

@media (min-width: 1200px) {
  .poki-wall-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-rows: 130px;
    gap: 10px;
  }
}

/* Game Card Link Tile */
.game-card-link {
  position: relative;
  border-radius: var(--poki-radius);
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  user-select: none;
  grid-column: span 1;
  grid-row: span 1;
  text-decoration: none;
  display: block;
  border: 3px solid #ffffff;
  
  /* Scroll Reveal initial state */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  will-change: transform, opacity;
}

.game-card-link.reveal {
  animation: cardFadeIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Shimmer Loading Placeholder */
.game-card-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(241,245,249,0) 0%, rgba(241,245,249,0.8) 50%, rgba(241,245,249,0) 100%);
  transform: translateX(-100%);
  animation: shimmer 1.6s infinite;
  z-index: 1;
  pointer-events: none;
}

.game-card-link.loaded::before {
  display: none;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Exact Poki Bento Sizing Modifiers */
.game-card-link.hero {
  grid-column: span 2;
  grid-row: span 2;
}

.game-card-link.wide {
  grid-column: span 2;
  grid-row: span 1;
}

.game-card-link.tall {
  grid-column: span 1;
  grid-row: span 2;
}

/* Hover Dynamics */
.game-card-link:hover {
  transform: scale(1.06) translateY(-4px) !important;
  z-index: 50;
  box-shadow: 0 16px 36px rgba(0, 156, 255, 0.4);
  border-color: var(--poki-blue);
}

.game-card-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.3s ease;
}

.game-card-link img.is-loaded {
  opacity: 1;
}

.game-card-link:hover img {
  transform: scale(1.05);
}

/* Recent Play Clock Badge (small icon top left of tile) */
.recent-icon {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--poki-blue);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

/* Title Overlay on Hover */
.card-title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 6px 6px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}

.game-card-link:hover .card-title-overlay {
  opacity: 1;
  transform: translateY(0);
}

.card-title-pill {
  background: #ffffff;
  color: var(--poki-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95%;
}

/* Category Badges */
.card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--poki-pink);
  color: white;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  z-index: 5;
}

.card-badge.popular { background: var(--poki-purple); }
.card-badge.hot { background: #ff5722; }
.card-badge.new { background: #00c853; }
.card-badge.top { background: var(--poki-blue); }

/* Disguised Responsive Ad Card Tile */
.game-card-link.ad-slot-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  border-color: rgba(255, 255, 255, 0.8);
}

.ad-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  z-index: 5;
  letter-spacing: 0.5px;
}

.ad-slot-card .adsbygoogle {
  width: 100% !important;
  height: 100% !important;
  border-radius: 14px;
  overflow: hidden;
}

.ad-placeholder-text {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  pointer-events: none;
}
