* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background-color: #e8e0d0;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  font-family: 'Fredoka', sans-serif;
  overflow-x: hidden;
}

.device-body {
  position: relative;
  width: 380px;
  height: 520px;
  background: linear-gradient(180deg, #c4b8d4 0%, #c4b8d4 32%, #c8bfab 33%, #d9d0b8 35%, #d9d0b8 100%);
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
  border-radius: 8px 8px 12px 14px;
  box-shadow: 
    0 12px 40px rgba(0,0,0,0.25),
    0 4px 12px rgba(0,0,0,0.15),
    inset 0 1px 2px rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.08);
  transition: filter 0.5s ease;
}

.device-body::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

.device-body::after {
  content: '';
  position: absolute;
  top: 5%;
  left: 15%;
  width: 50%;
  height: 15%;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.device-dead {
  filter: saturate(0.3) brightness(0.85);
}

.molding-line {
  position: absolute;
  top: 32.5%;
  left: 5%;
  width: 90%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.08), rgba(0,0,0,0.12), rgba(0,0,0,0.08), transparent);
  z-index: 3;
}

.speaker-grille {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 140px;
  z-index: 3;
}

.speaker-vibrate {
  animation: speakerVibrate 0.05s infinite alternate;
}

@keyframes speakerVibrate {
  0% { transform: translateX(-50%) translate(0, 0); }
  100% { transform: translateX(-50%) translate(0.5px, -0.5px); }
}

.speaker-hole {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #a89e88 0%, #b8ae98 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.toy-button {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.08s ease;
  box-shadow: 
    0 6px 12px rgba(0,0,0,0.2),
    0 3px 6px rgba(0,0,0,0.15),
    inset 0 -3px 6px rgba(0,0,0,0.15),
    inset 0 2px 4px rgba(255,255,255,0.2);
  z-index: 5;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.toy-button:hover:not(:disabled) {
  box-shadow: 
    0 6px 16px rgba(0,0,0,0.25),
    0 3px 6px rgba(0,0,0,0.15),
    inset 0 -3px 6px rgba(0,0,0,0.15),
    inset 0 2px 4px rgba(255,255,255,0.2),
    0 0 15px rgba(255,255,255,0.15);
}

.toy-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.2),
    0 1px 2px rgba(0,0,0,0.15),
    inset 0 -1px 3px rgba(0,0,0,0.2),
    inset 0 3px 6px rgba(0,0,0,0.1);
}

.toy-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-yellow {
  background: radial-gradient(circle at 35% 35%, #e0d46a, #d4c85a 40%, #b8a840 100%);
}

.btn-yellow:hover:not(:disabled) {
  background: radial-gradient(circle at 35% 35%, #e8dc72, #dcd062 40%, #c0b048 100%);
}

.btn-blue {
  background: radial-gradient(circle at 35% 35%, #8fa3c5, #7b8fb5 40%, #6579a0 100%);
}

.btn-blue:hover:not(:disabled) {
  background: radial-gradient(circle at 35% 35%, #97abcd, #8397bd 40%, #6d81a8 100%);
}

.btn-red {
  background: radial-gradient(circle at 35% 35%, #d47070, #c45b5b 40%, #a84545 100%);
}

.btn-red:hover:not(:disabled) {
  background: radial-gradient(circle at 35% 35%, #dc7878, #cc6363 40%, #b04d4d 100%);
}

.btn-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(0,0,0,0.45);
  text-shadow: 0 0.5px 0 rgba(255,255,255,0.2);
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
  user-select: none;
}

.embossed-text {
  font-family: 'Share Tech Mono', monospace;
  color: rgba(0,0,0,0.15);
  text-shadow: 0 1px 0 rgba(255,255,255,0.15);
  letter-spacing: 0.5px;
}

.flavor-text {
  font-family: 'Special Elite', cursive;
  color: #8a8070;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
  min-height: 48px;
  transition: opacity 0.4s ease;
}

.back-panel {
  width: 380px;
  min-height: 520px;
  background: #c8c0a8;
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
  border-radius: 8px 8px 12px 14px;
  box-shadow: 
    0 12px 40px rgba(0,0,0,0.25),
    0 4px 12px rgba(0,0,0,0.15),
    inset 0 1px 2px rgba(255,255,255,0.15),
    inset 0 -2px 4px rgba(0,0,0,0.1);
  padding: 40px 35px;
}

.back-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
}

.battery-slot {
  width: 60px;
  height: 28px;
  background: #3a3530;
  border-radius: 4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.battery-icon {
  width: 50px;
  height: 22px;
  background: linear-gradient(180deg, #5a8a5a, #4a7a4a);
  border-radius: 3px;
  position: absolute;
  top: 3px;
  left: 3px;
  cursor: grab;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 6px;
  width: 6px;
  height: 10px;
  background: #7aa07a;
  border-radius: 0 2px 2px 0;
}

.battery-removed {
  left: 80px;
  opacity: 0.7;
  transform: rotate(15deg);
}

.device-hum {
  animation: deviceHum 4s ease-in-out infinite;
}

@keyframes deviceHum {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.001); }
}

.glitch-effect {
  animation: glitch 0.3s ease-in-out 3;
}

@keyframes glitch {
  0% { filter: none; transform: translate(0); }
  20% { filter: hue-rotate(90deg) saturate(2); transform: translate(-2px, 1px); }
  40% { filter: hue-rotate(-90deg) invert(0.1); transform: translate(2px, -1px); }
  60% { filter: hue-rotate(180deg) saturate(0.5); transform: translate(-1px, 2px); }
  80% { filter: hue-rotate(-45deg) brightness(1.2); transform: translate(1px, -2px); }
  100% { filter: none; transform: translate(0); }
}

.title-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
}

.subtitle-text {
  font-family: 'Share Tech Mono', monospace;
}

.watermark {
  position: fixed;
  bottom: 8px;
  right: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: rgba(0,0,0,0.06);
  pointer-events: none;
  user-select: none;
}

.flip-btn {
  font-family: 'Share Tech Mono', monospace;
  background: #b8b0a0;
  color: #5a5548;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.flip-btn:hover {
  background: #a8a090;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.tri-screw {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #888 0%, #666 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.3), 0 1px 3px rgba(0,0,0,0.3);
  cursor: help;
}

.fcc-tooltip {
  position: relative;
}

.fcc-tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2520;
  color: #c45b5b;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  transition: opacity 0.3s;
  z-index: 100;
  font-family: 'Share Tech Mono', monospace;
}

.fcc-tooltip:hover .fcc-tooltip-text {
  visibility: visible;
  opacity: 1;
}

.brand-name {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: rgba(80, 60, 90, 0.35);
  letter-spacing: 3px;
  text-transform: uppercase;
  z-index: 4;
  text-shadow: 0 0.5px 0 rgba(255,255,255,0.15);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .device-body, .back-panel {
    width: 300px;
    height: auto;
    min-height: 420px;
  }
  
  .toy-button {
    width: 70px;
    height: 70px;
  }
  
  .btn-label {
    font-size: 7px;
  }
  
  .speaker-grille {
    width: 160px;
    height: 110px;
  }
}