/* ════════════════════════════════════════════════════
   ZenPlay — Mobile Landscape Enforcement
   Add to zenplay.css
   ════════════════════════════════════════════════════ */

/* ── Rotate overlay ── */
.zp-rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0A1F1F;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

/* Show ONLY on mobile portrait */
@media screen and (max-width: 768px) and (orientation: portrait) {
  .zp-rotate-overlay {
    display: flex !important;
  }
  /* Hide game area in portrait — avoid broken layout */
  .canvas-wrap,
  #game-container {
    visibility: hidden;
  }
}

.zp-rotate-phone {
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
  animation: zp-rotate-anim 2s ease-in-out infinite;
}

@keyframes zp-rotate-anim {
  0%   { transform: rotate(0deg);   }
  30%  { transform: rotate(0deg);   }
  60%  { transform: rotate(90deg);  }
  90%  { transform: rotate(90deg);  }
  100% { transform: rotate(0deg);   }
}

.zp-rotate-title {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--zen-text, #E8EDE8);
  margin-bottom: 0.5rem;
}

.zp-rotate-sub {
  font-size: 13px;
  color: var(--zen-sub, #8FA89E);
  line-height: 1.6;
  max-width: 260px;
}

/* ── PWA install banner ── */
.zp-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--zen-mid, #163535);
  border-top: 1px solid var(--zen-border, #234040);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.zp-install-banner.show {
  transform: translateY(0);
}

.zp-install-banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.zp-install-banner-text {
  flex: 1;
  font-size: 13px;
  color: var(--zen-text, #E8EDE8);
}

.zp-install-banner-text strong {
  display: block;
  margin-bottom: 2px;
}

.zp-install-banner-text span {
  font-size: 11px;
  color: var(--zen-sub, #8FA89E);
}

.zp-install-btn {
  background: var(--zen-green, #29B474);
  color: var(--zen-dark, #0A1F1F);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body, sans-serif);
}

.zp-install-close {
  background: none;
  border: none;
  color: var(--zen-dim, #4A6560);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ── Mobile bottom nav ── */
.zp-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--zen-mid, #163535);
  border-top: 1px solid var(--zen-border, #234040);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}

@media screen and (max-width: 768px) {
  .zp-mobile-nav {
    display: flex;
  }
  /* Add padding to body so content not hidden behind bottom nav */
  body {
    padding-bottom: 60px;
  }
}

.zp-mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  text-decoration: none;
  color: var(--zen-dim, #4A6560);
  font-size: 10px;
  transition: color 0.2s;
  gap: 3px;
}

.zp-mobile-nav-item.active,
.zp-mobile-nav-item:hover {
  color: var(--zen-green, #29B474);
}

.zp-mobile-nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* Animated nav icons */
.zp-nav-icon-endless { animation: zp-spin 8s linear infinite; display: inline-block; }
.zp-nav-icon-fire    { animation: zp-flicker 1.5s ease-in-out infinite; display: inline-block; }
.zp-nav-icon-snake   { animation: zp-wiggle 2s ease-in-out infinite; display: inline-block; }

@keyframes zp-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes zp-flicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.1); }
}

@keyframes zp-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(-10deg); }
  75%       { transform: rotate(10deg); }
}

/* ── Favourites heart button on game cards ── */
.zp-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(10, 26, 10, 0.7);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  z-index: 5;
  backdrop-filter: blur(4px);
}

.zp-fav-btn:hover { transform: scale(1.15); }
.zp-fav-btn.active { color: #E85D8A; }

/* ── Dynamic game card hover ── */
.zp-game-card {
  position: relative;
  overflow: hidden;
}

.zp-game-card:hover .zp-game-thumb {
  transform: scale(1.05);
}

.zp-game-card:hover .zp-game-card-overlay {
  opacity: 1;
}

.zp-game-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,26,10,0.95) 0%,
    rgba(10,26,10,0.4) 60%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  pointer-events: none;
}

.zp-game-card-play-btn {
  background: var(--zen-green, #29B474);
  color: var(--zen-dark, #0A1F1F);
  border: none;
  border-radius: 6px;
  padding: 7px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-family: var(--font-display, 'Syne', sans-serif);
}

.zp-game-card-stats {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.zp-game-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(41,180,116,0.3);
  color: var(--zen-green, #29B474);
  font-weight: 600;
}

.zp-game-tag.hot   { background: rgba(232,93,93,0.3); color: #E85D5D; }
.zp-game-tag.new   { background: rgba(77,166,232,0.3); color: #4DA6E8; }

/* ── Game carousel / rotating band ── */
.zp-game-carousel {
  position: relative;
  overflow: hidden;
  padding: 0.5rem 0;
  margin: 0.5rem 0;
}

.zp-carousel-track {
  display: flex;
  gap: 10px;
  animation: zp-carousel-scroll 30s linear infinite;
  width: max-content;
}

.zp-carousel-track:hover {
  animation-play-state: paused;
}

@keyframes zp-carousel-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.zp-carousel-item {
  flex-shrink: 0;
  width: 120px;
  background: var(--zen-mid, #163535);
  border: 1px solid var(--zen-border, #234040);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.zp-carousel-item:hover {
  border-color: var(--zen-green, #29B474);
  transform: translateY(-2px);
}

.zp-carousel-thumb {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: var(--zen-muted, #1E4545);
}

.zp-carousel-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--zen-text, #E8EDE8);
  padding: 6px 8px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zp-carousel-plays {
  font-size: 9px;
  color: var(--zen-dim, #4A6560);
  text-align: center;
  padding-bottom: 6px;
}
