/* ==========================================================================
   Retro Handheld Console Component Styles
   Colors:
   - Shell: #E7DCC4 (cream)
   - Accent/Dark: #151A25
   - Screen Green: #C8E09B
   - Secondary Blue: #91B9C7
   ========================================================================== */

.console-wrapper {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  perspective: 1000px;
}

.retro-device {
  background-color: var(--color-cream);
  border: 4px solid var(--color-dark);
  border-radius: 28px 28px 48px 28px;
  box-shadow: 8px 8px 0px var(--color-dark), 0 20px 30px rgba(0,0,0,0.12);
  padding: 24px 20px 32px 20px;
  position: relative;
  transition: transform 0.2s ease;
  user-select: none;
}

@media (max-width: 480px) {
  .retro-device {
    padding: 16px 12px 24px 12px;
    border-width: 3px;
    border-radius: 20px 20px 36px 20px;
    box-shadow: 4px 4px 0px var(--color-dark);
  }
}

/* Top Decorative Slots */
.device-top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.power-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  font-weight: 800;
  color: #555;
}

.power-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #38ef7d;
  box-shadow: 0 0 8px #38ef7d;
  border: 1.5px solid var(--color-dark);
  animation: ledPulse 2s infinite ease-in-out;
}

@keyframes ledPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px #38ef7d; }
}

.device-brand-badge {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  font-weight: 900;
  background-color: var(--color-dark);
  color: var(--color-screen-green);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 1px;
}

/* Screen Housing / Bezel */
.screen-housing {
  background-color: var(--color-dark);
  border-radius: 12px 12px 24px 12px;
  padding: 16px 14px;
  border: 3px solid #0B0E14;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
  margin-bottom: 22px;
}

.screen-brand-text {
  display: flex;
  justify-content: space-between;
  color: #7988A1;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0 2px;
}

/* Screen Display */
.screen-display {
  background-color: var(--color-screen-green);
  border: 2px solid #000;
  border-radius: 6px;
  padding: 12px;
  color: var(--color-green-dark);
  font-family: var(--font-pixel);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 16px rgba(43, 76, 40, 0.25);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Scanlines overlay */
.screen-display::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.08) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 5;
}

/* Screen Top HUD */
.screen-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 900;
  border-bottom: 1.5px dashed var(--color-green-dark);
  padding-bottom: 6px;
  margin-bottom: 8px;
  z-index: 6;
  position: relative;
}

.hud-mode {
  background: var(--color-green-dark);
  color: var(--color-screen-green);
  padding: 1px 6px;
  border-radius: 2px;
}

.hud-signal {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Pixel Bird Animation Stage */
.pixel-stage {
  height: 90px;
  position: relative;
  margin: 6px 0;
  border-bottom: 1.5px dashed var(--color-green-dark);
  overflow: hidden;
}

/* Base Station Alpha (Left) */
.tower {
  position: absolute;
  bottom: 4px;
  width: 32px;
  height: 60px;
  z-index: 2;
}

.tower-alpha {
  left: 10px;
}

.tower-beta {
  right: 10px;
}

.tower svg {
  width: 100%;
  height: 100%;
  fill: var(--color-green-dark);
}

.tower-label {
  font-size: 0.6rem;
  font-weight: 900;
  text-align: center;
  color: var(--color-green-dark);
  margin-top: -2px;
}

/* Signal Waves */
.signal-wave {
  position: absolute;
  top: 8px;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--color-green-dark);
  border-radius: 50%;
  opacity: 0;
}

.tower-alpha .signal-wave {
  left: 10px;
  animation: wavePulse 2.4s infinite linear;
}

.tower-beta .signal-wave {
  right: 10px;
  animation: wavePulse 2.4s infinite linear 1.2s;
}

@keyframes wavePulse {
  0% { transform: scale(0.3); opacity: 0.9; }
  60% { transform: scale(1.8); opacity: 0.4; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* Pixel Bird Flight */
.pixel-bird-container {
  position: absolute;
  top: 14px;
  left: 45px;
  width: 44px;
  height: 36px;
  z-index: 3;
  animation: birdFlight 6s infinite ease-in-out;
  transform-origin: center;
}

@keyframes birdFlight {
  0% {
    left: 45px;
    top: 22px;
    transform: scaleX(1) translateY(0);
  }
  20% {
    top: 12px;
    transform: scaleX(1) translateY(-4px);
  }
  45% {
    left: calc(100% - 90px);
    top: 24px;
    transform: scaleX(1) translateY(2px);
  }
  50% {
    left: calc(100% - 85px);
    top: 20px;
    transform: scaleX(-1) translateY(0);
  }
  70% {
    top: 10px;
    transform: scaleX(-1) translateY(-4px);
  }
  95% {
    left: 50px;
    top: 24px;
    transform: scaleX(-1) translateY(2px);
  }
  100% {
    left: 45px;
    top: 22px;
    transform: scaleX(1) translateY(0);
  }
}

.bird-wings {
  animation: birdFlap 0.35s infinite alternate ease-in-out;
  transform-origin: 18px 12px;
}

@keyframes birdFlap {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-22deg); }
}

.carried-packet {
  animation: packetBounce 0.35s infinite alternate ease-in-out;
}

@keyframes packetBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(2px); }
}

/* Screen Mode Info View */
.screen-mode-view {
  min-height: 64px;
  z-index: 6;
  position: relative;
}

.mode-tab-content {
  display: none;
}

.mode-tab-content.is-active {
  display: block;
}

.mode-headline {
  font-size: 0.8rem;
  font-weight: 900;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.mode-desc {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--color-green-dark);
}

.screen-disclaimer-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-green-dark);
  opacity: 0.85;
  margin-top: 4px;
  border-top: 1px dotted var(--color-green-dark);
  padding-top: 4px;
}

/* Controls Section */
.controls-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 0 4px;
  margin-top: 6px;
}

/* D-Pad (Cross Keys) */
.dpad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dpad-label {
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  font-weight: 800;
  color: #6C7A8F;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.dpad-cross {
  position: relative;
  width: 110px;
  height: 110px;
}

.dpad-btn {
  position: absolute;
  background-color: var(--color-dark);
  border: 2px solid #000;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  font-weight: 900;
  transition: background-color 0.1s ease, transform 0.05s ease;
  user-select: none;
}

.dpad-btn:hover {
  background-color: #2F3B52;
}

.dpad-btn:active,
.dpad-btn.is-active {
  background-color: var(--color-screen-green);
  color: var(--color-dark);
}

.dpad-btn:focus-visible {
  outline: 2px solid var(--color-coral);
  z-index: 10;
}

.dpad-up {
  top: 0;
  left: 37px;
  width: 36px;
  height: 38px;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 -2px 0 #000 inset;
}

.dpad-down {
  bottom: 0;
  left: 37px;
  width: 36px;
  height: 38px;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 0 #000 inset;
}

.dpad-left {
  top: 37px;
  left: 0;
  width: 38px;
  height: 36px;
  border-radius: 6px 0 0 6px;
  box-shadow: -2px 0 0 #000 inset;
}

.dpad-right {
  top: 37px;
  right: 0;
  width: 38px;
  height: 36px;
  border-radius: 0 6px 6px 0;
  box-shadow: 2px 0 0 #000 inset;
}

.dpad-center {
  position: absolute;
  top: 37px;
  left: 37px;
  width: 36px;
  height: 36px;
  background-color: var(--color-dark);
  z-index: 1;
}

.dpad-center::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #2E384D 0%, #151A25 100%);
  margin: 11px auto;
}

/* Action Buttons (A & B) */
.action-buttons-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ab-cluster {
  display: flex;
  gap: 14px;
  transform: rotate(-15deg);
}

.round-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.round-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--color-dark);
  box-shadow: 2px 3px 0px var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-weight: 900;
  font-size: 1.05rem;
  color: #FFFFFF;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.round-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0;
}

.round-btn-b {
  background-color: #556277;
}

.round-btn-a {
  background-color: var(--color-coral);
}

.round-btn-label {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--color-dark);
  text-transform: uppercase;
}

/* Device Bottom: Select, Start & Speaker */
.device-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 2px dashed #C8B99B;
}

.pill-controls {
  display: flex;
  gap: 12px;
}

.pill-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pill-btn {
  width: 42px;
  height: 14px;
  background-color: #6C7A8F;
  border: 2px solid var(--color-dark);
  border-radius: 10px;
  transform: rotate(-25deg);
  cursor: pointer;
  box-shadow: 1px 1px 0px var(--color-dark);
  transition: transform 0.08s ease;
}

.pill-btn:active {
  transform: rotate(-25deg) scale(0.92);
}

.pill-label {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  font-weight: 800;
  color: #6C7A8F;
}

.speaker-slits {
  display: flex;
  gap: 5px;
  transform: rotate(-25deg);
}

.slit {
  width: 5px;
  height: 38px;
  background-color: #C1B08E;
  border-radius: 3px;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.4);
}

/* Small Screens Tweaks */
@media (max-width: 420px) {
  .retro-device {
    padding: 16px 14px 24px 14px;
  }
  
  .dpad-cross {
    width: 96px;
    height: 96px;
  }
  
  .dpad-up, .dpad-down {
    left: 32px;
    width: 32px;
    height: 33px;
  }
  
  .dpad-left, .dpad-right {
    top: 32px;
    width: 33px;
    height: 32px;
  }
  
  .dpad-center {
    top: 32px;
    left: 32px;
    width: 32px;
    height: 32px;
  }
  
  .round-btn {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
}
