/**
 * Modern WordPress Flash Theme - Stage Stylesheet
 *
 * Enforces zero-scroll viewport geometry, Flash MovieClip coordinate spaces,
 * and high-assurance WCAG 2.2 AA accessible button skinning.
 *
 * @package ModernWordPress\FlashTheme
 */

/* Flash Viewport & Canvas Bounds */
.flash-stage-viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #070B12;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.flash-stage-canvas {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
}

/* Ambient Vector Grid & CRT Scanline Emulation */
.flash-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(21, 134, 143, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 134, 143, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

.flash-grid-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 35%, rgba(7, 11, 18, 0.85) 100%);
  pointer-events: none;
}

/* Base MovieClip Layering */
.flash-movieclip {
  position: relative;
  z-index: 2;
  will-change: transform, opacity;
  transform-origin: center center;
}

/* Telemetry HUD MovieClip */
.mc-telemetry {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 10;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(21, 134, 143, 0.35);
  border-radius: 9999px;
  padding: 6px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #94A3B8;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.telemetry-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: telemetryPulse 2s infinite ease-in-out;
}

@keyframes telemetryPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.telemetry-label {
  color: #15868F;
  font-weight: 700;
}

.telemetry-coords,
.telemetry-frame {
  color: #CBD5E1;
}

/* Logo MovieClip */
.mc-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  width: 100%;
  max-width: 480px;
  height: 380px;
  max-height: 50vh;
  margin: auto 0;
}

.mc-logo:focus-visible {
  border-radius: 12px;
  outline: 2px solid #15868F;
  outline-offset: 8px;
}

.mc-logo-canvas {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.mc-logo-canvas svg {
  width: 100%;
  height: 100%;
  max-height: 380px;
  overflow: visible;
}

/* Menu MovieClip */
.mc-menu {
  width: 100%;
  max-width: 820px;
  margin-bottom: 20px;
}

.mc-menu-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(21, 134, 143, 0.3);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Flash Button Symbol (Up, Over, Down, Hit States) */
.flash-button-symbol {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(21, 134, 143, 0.4);
  border-radius: 4px;
  color: #15868F;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.825rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  outline: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

/* Hit Area for Touch Target Guarantee (>= 44x44px) */
.btn-hit-area {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.btn-skin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.btn-bracket {
  color: #15868F;
  transition: color 0.15s ease, transform 0.15s ease;
}

.btn-text {
  color: #FFFFFF;
  transition: color 0.15s ease;
}

/* OVER State */
.flash-button-symbol:hover {
  background: rgba(21, 134, 143, 0.22);
  border-color: #15868F;
  box-shadow: 0 0 14px rgba(21, 134, 143, 0.4);
  transform: translateY(-2px);
}

.flash-button-symbol:hover .btn-bracket {
  color: #38BDF8;
  transform: scale(1.15);
}

.flash-button-symbol:hover .btn-text {
  color: #FFFFFF;
  text-shadow: 0 0 8px rgba(21, 134, 143, 0.8);
}

/* DOWN State */
.flash-button-symbol:active {
  transform: scale(0.95);
  background: #15868F;
  border-color: #136E75;
  box-shadow: 0 0 6px rgba(21, 134, 143, 0.6);
}

.flash-button-symbol:active .btn-bracket,
.flash-button-symbol:active .btn-text {
  color: #FFFFFF;
}

/* FOCUS State (WCAG 2.2 AA) */
.flash-button-symbol:focus-visible {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
  border-color: #38BDF8;
}

/* Replay Button Special Styling */
.btn-replay {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(30, 41, 59, 0.6);
}

.btn-replay:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #38BDF8;
}

.flash-skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: #15868F;
  color: #FFFFFF;
  padding: 8px 16px;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  z-index: 100;
  transition: top 0.2s ease;
}

.flash-skip-link:focus {
  top: 20px;
}

/* Responsive Scaling for Small Viewports */
@media (max-height: 600px) {
  .mc-logo {
    height: 220px;
  }
  .mc-menu {
    margin-bottom: 8px;
  }
  .flash-button-symbol {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}
