/* 7xstudio - Sliding Puzzle Stylesheet (2026) */

:root {
  --neon-cyan: #00f3ff;
  --neon-magenta: #ff007f;
  --neon-green: #39ff14;
  --neon-orange: #ffaa00;
  --dark-bg: #0a0a14;
  --panel-bg: rgba(16, 16, 32, 0.7);
  --border-glow: 0 0 10px rgba(0, 243, 255, 0.4);
}

html, body {
  height: 100%;
  height: -webkit-fill-available;
  background-color: var(--dark-bg);
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
}

/* Override .game-wrapper to lock 9:16 aspect ratio and phone sizing */
.game-wrapper {
  position: relative;
  width: 100vw;
  width: 100dvw;
  height: 177.78vw;
  height: 177.78dvw;
  max-width: 450px;
  max-height: 800px;
  background: radial-gradient(circle at center, #101026 0%, #05050d 100%);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), inset 0 0 25px rgba(255, 255, 255, 0.01);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

@media (min-aspect-ratio: 9/16) {
  .game-wrapper {
    height: 100vh;
    height: 100dvh;
    width: 56.25vh;
    width: 56.25dvh;
  }
}

/* Ensure gameplay partner layer is relative and constrained inside wrapper */
.partner-panel-layout {
  position: relative !important;
  width: 100% !important;
  height: 64px !important;
  background: rgba(2, 4, 10, 0.85) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  z-index: 100 !important;
  top: 0 !important;
  left: 0 !important;
}

/* Ensure gameplay partner layer bottom is relative and constrained inside wrapper */
.partner-panel-layout-bottom {
  position: relative !important;
  width: 100% !important;
  height: 64px !important;
  background: rgba(2, 4, 10, 0.85) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  z-index: 100 !important;
  bottom: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.partner-panel-layout-bottom.hidden,
.layout-divider.hidden {
  display: none !important;
}

/* Partner Box formatting */
.partner-holder-top, .partner-holder-bottom {
  width: 320px !important;
  height: 50px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
}

/* Ensure HUD is relative and fits exactly under the ad banner */
.hud-layer {
  position: relative !important;
  width: 100% !important;
  height: 45px !important;
  background: #0f0f20 !important; /* Cyberpunk dark slate */
  border-bottom: 2px solid var(--neon-cyan) !important; /* Neon Accent Line */
  display: flex !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 99 !important;
  box-sizing: border-box !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
}

/* Canvas container fills the rest of the height */
.canvas-container {
  position: relative;
  width: 100% !important;
  flex: 1 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden;
  background-color: #000;
  max-width: none !important; /* Managed by wrapper instead */
  max-height: none !important;
  border-radius: 0 !important; /* Rounded corners handled by wrapper */
  border: none !important;
}

/* Canvas dimensions managed automatically by container */
#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #030308;
}

/* Nav button updates inside standard HUD */
.hud-layer .hud-back-btn {
  background: transparent !important;
  color: var(--neon-cyan) !important;
  text-decoration: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 16px !important;
  height: 100% !important;
  cursor: pointer !important;
  border: none !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

.hud-layer .hud-back-btn:hover {
  background: rgba(0, 243, 255, 0.1) !important;
  color: #ffffff !important;
}

.hud-layer .hud-back-btn svg {
  width: 20px !important;
  height: 20px !important;
  stroke: currentColor !important;
  display: block !important;
}

/* Fullscreen toggle button formatting inside HUD */
.hud-fullscreen-btn {
  background: none !important;
  border: none !important;
  color: var(--neon-cyan) !important;
  cursor: pointer !important;
  padding: 0 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  outline: none !important;
  height: 100% !important;
}

.hud-fullscreen-btn:hover {
  transform: scale(1.15) !important;
  color: #ffffff !important;
}

.hud-fullscreen-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  display: block !important;
}

/* Reset / Shuffle level button formatting inside HUD */
.hud-reset-btn {
  background: none !important;
  border: none !important;
  color: var(--neon-cyan) !important;
  cursor: pointer !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  outline: none !important;
  height: 100% !important;
}

.hud-reset-btn:hover {
  transform: rotate(45deg) scale(1.15) !important;
  color: #ffffff !important;
}

.hud-reset-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  display: block !important;
}

/* Overlay general updates - Dark Opaque Slate with Neon Border */
.overlay-layer {
  background: rgba(5, 5, 12, 0.85); /* Deep opaque dark background */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 90;
}

.overlay-card {
  background: rgba(10, 10, 22, 0.95); /* Cyberpunk dark panel */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 90%;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Brand Header on top of Card */
.menu-brand-header {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 15px;
  padding: 0 10px;
}

.brand-logo {
  height: 24px;
  filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.2));
  border: none;
}

/* Dividers */
.layout-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
  z-index: 9;
  flex-shrink: 0;
}

/* Custom Overlays for Status HUD inside Canvas Container */
.game-status-overlay {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  z-index: 10;
  text-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
}

#status-level {
  color: var(--neon-cyan);
}

#status-moves {
  color: var(--neon-magenta);
}

#status-time {
  color: var(--neon-orange);
}

.cumulative-score-overlay {
  position: absolute;
  top: 44px;
  left: 15px;
  right: 15px;
  text-align: center;
  pointer-events: none;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.8px;
  z-index: 10;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Glassmorphism Start & Game Over Cards Custom Styles */
.start-card {
  border: 1px solid rgba(0, 243, 255, 0.25);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 243, 255, 0.15);
}

.game-over-card {
  border: 1px solid rgba(255, 0, 127, 0.25);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 0, 127, 0.15);
}

.level-clear-card {
  border: 1px solid rgba(57, 255, 20, 0.25);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6), 0 0 20px rgba(57, 255, 20, 0.15);
  max-width: 320px;
  width: 90%;
  background: rgba(10, 24, 15, 0.9);
}

.neon-text-green {
  color: var(--neon-green) !important;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
  font-weight: 800;
  text-align: center;
  margin-top: 10px;
}

.neon-border-green {
  border-color: var(--neon-green) !important;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.3) !important;
}

.neon-border-green:hover {
  background: var(--neon-green) !important;
  color: #000000 !important;
}

/* Typography styles */
.logo-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.1;
  text-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.score-display {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 15px;
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.score-value {
  font-weight: 800;
  font-size: 16px;
  color: #ffffff;
}

/* UI transition animations */
.animate-pop {
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Ads layout adjustments */
.partner-slot-wrapper {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.partner-label {
  font-size: 9px;
  letter-spacing: 1px;
  opacity: 0.4;
}

.partner-box-large {
  width: 300px;
  height: 250px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

/* Double Button Row Layout */
.button-row-double {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  margin-bottom: 5px;
}

/* Premium Cyberpunk Pill Buttons */
.menu-btn {
  background: rgba(0, 243, 255, 0.05) !important;
  border: 1px solid rgba(0, 243, 255, 0.3) !important;
  color: var(--neon-cyan) !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  border-radius: 30px !important;
  padding: 11px 16px !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  text-transform: uppercase;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.menu-btn:hover {
  background: var(--neon-cyan) !important;
  color: #05050d !important;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
  transform: translateY(-1px);
}

.menu-btn:active {
  transform: translateY(0);
}

/* Full Width Primary Play Button (Neon Pink/Magenta) */
.main-start-btn {
  width: 100% !important;
  margin-top: 8px;
  margin-bottom: 8px;
  flex: none;
  font-size: 14px;
  background: rgba(255, 0, 127, 0.05) !important;
  border: 1px solid rgba(255, 0, 127, 0.35) !important;
  color: var(--neon-magenta) !important;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.1);
}

.main-start-btn:hover {
  background: var(--neon-magenta) !important;
  color: #05050d !important;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.5);
}

/* Pill Shaped Transparent Outline Return Button */
.home-link-pill {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6) !important;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  border-radius: 30px;
  padding: 8px 20px;
  transition: all 0.2s ease;
  margin-top: 4px;
  margin-bottom: 4px;
  display: inline-block;
  text-transform: uppercase;
  text-align: center;
}

.home-link-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff !important;
}

/* Description styling */
.menu-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-top: 8px;
  margin-bottom: 12px;
  text-align: center;
  max-width: 90%;
}

/* Compact overrides for start menus on smaller viewports */
@media (max-height: 720px) {
  .overlay-card {
    padding: 16px 15px !important;
  }
  .logo-title {
    font-size: 26px !important;
  }
  .menu-desc {
    font-size: 11px !important;
    margin-bottom: 6px !important;
    line-height: 1.3 !important;
  }
  .menu-btn {
    padding: 8px 12px !important;
    font-size: 11px !important;
  }
  .button-row-double {
    margin-top: 8px !important;
  }
  .main-start-btn {
    margin-top: 4px !important;
    margin-bottom: 4px !important;
  }
  .home-link-pill {
    margin-top: 4px !important;
    margin-bottom: 2px !important;
    padding: 6px 16px !important;
    font-size: 10px !important;
  }
  .partner-slot-wrapper {
    margin-top: 6px !important;
  }
}
