.device {
  position: relative;
  height: 100%;
  z-index: 4;
}

.lcd {
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(80, 180, 70, 0.08), transparent 50%),
    #061008;
  color: #c8ffb0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: "Share Tech Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.6);
}

.panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 10px 6px;
  gap: 6px;
  justify-content: center;
}
#panel-play {
  justify-content: flex-start;
}
.panel.hidden,
.hidden { display: none !important; }

.tiny {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8fd878;
}

.boot-brand {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #f0d878;
  text-align: center;
}

.boot-title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(16px, 3.8vw, 22px);
  line-height: 1.45;
  text-align: center;
  margin: 8px 0 4px;
  color: #c8ffb0;
}
.boot-title.runaway { color: var(--warn); }

.boot-line, .boot-hint {
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  color: #9ee888;
}
.boot-hint { font-size: 11px; margin-top: auto; }

.lcd-btn {
  align-self: center;
  background: #123018;
  color: #c8ffb0;
  border: 2px solid #5a9a48;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.lcd-btn.primary {
  background: #1c4a24;
  border-color: #8fd878;
  box-shadow: 0 0 8px rgba(120, 255, 90, 0.15);
}
.lcd-btn:active { transform: translateY(1px); }

.name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #9ee888;
}
.name-field input {
  background: #06100a;
  border: 1px solid #5a9a48;
  color: #c8ffb0;
  padding: 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hatch-egg {
  width: 84px;
  height: 108px;
  margin: 8px auto;
  background:
    radial-gradient(circle at 35% 30%, #f7f0d8, #d9c48a 55%, #b89a5a);
  border-radius: 50% 50% 48% 48% / 58% 58% 42% 42%;
  box-shadow: inset -8px -10px 0 rgba(0,0,0,0.12), 0 8px 0 #3a2a10;
  position: relative;
  animation: egg-wobble 1.4s ease-in-out infinite;
}
.hatch-egg-stamp {
  position: absolute;
  inset: 38% 18% auto;
  text-align: center;
  font-family: "Black Ops One", sans-serif;
  font-size: 11px;
  color: #7a1f18;
  transform: rotate(-12deg);
}
@keyframes egg-wobble {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}

.hud-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.04em;
}
.hud-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #d8ffc8;
}
.hud-stage, .hud-right {
  color: #f0d878;
  font-size: 12px;
  text-align: right;
}
.hud-stage { text-align: left; color: #9ee888; }

.scene {
  position: relative;
  flex: 1;
  min-height: 96px;
  max-height: 110px;
  border: 1px solid #1f3a24;
  background: linear-gradient(#3a424c 0 46%, #5a5854 46% 100%);
  overflow: hidden;
}

.shop-wall {
  position: absolute;
  inset: 0 0 54% 0;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.12) 0 18px, transparent 18px 36px),
    linear-gradient(#4a5360, #323840);
}
.rack {
  position: absolute;
  left: 6px;
  top: 10px;
  width: 22px;
  height: 42px;
  background: repeating-linear-gradient(#2a2e34 0 4px, #c9a227 4px 6px);
  opacity: 0.85;
}
.table {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 18%;
  height: 10px;
  background: #2b241c;
  box-shadow: 0 10px 0 #1a160f;
}

.barbie, .cart, .chopper {
  position: absolute;
  bottom: 28%;
  opacity: 0;
  transition: opacity 300ms ease, transform 800ms ease;
  pointer-events: none;
}
.barbie {
  left: 8%;
  width: 34px;
  height: 16px;
  background: #e94ea0;
  border-radius: 3px 8px 3px 3px;
  box-shadow: 8px 8px 0 #222, 22px 8px 0 #222;
}
.cart {
  right: 10%;
  width: 28px;
  height: 18px;
  background: #8aa;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}
.chopper {
  left: 50%;
  width: 40px;
  height: 14px;
  background: #222;
  transform: translateX(-50%);
  box-shadow: -10px 6px 0 #111, 16px 6px 0 #444;
}
.scene.show-barbie .barbie,
.scene.show-cart .cart,
.scene.show-chopper .chopper { opacity: 0.9; }

.mess {
  position: absolute;
  bottom: 10%;
  left: 20%;
  width: 18px;
  height: 8px;
  background: #6b4a1e;
  border-radius: 50%;
  opacity: 0;
}
.scene.messy .mess { opacity: 0.85; }

.sally {
  position: absolute;
  bottom: 22%;
  left: -40px;
  width: 34px;
  height: 22px;
  background:
    radial-gradient(circle at 80% 30%, #eee 0 6px, transparent 7px),
    radial-gradient(circle at 40% 50%, #eee 0 10px, transparent 11px);
  animation: sally-walk 4.5s linear forwards;
}
@keyframes sally-walk {
  to { left: 110%; }
}

.goose-wrap {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 118px;
  transform: translateX(-50%);
  transform-origin: 50% 90%;
}
.goose { width: 100%; height: auto; overflow: visible; cursor: pointer; }
.goose .g-chain { pointer-events: auto; cursor: pointer; }
.goose .g-shadow { fill: rgba(0,0,0,0.28); }
.goose .g-body, .goose .g-wing, .goose .g-neck, .goose .g-head { fill: #f3efe4; }
.goose .g-beak, .goose .g-foot { fill: #e07a2f; }
.goose .g-eye { fill: #1a1a1a; }
.goose .g-chain { fill: none; stroke: #f0d060; stroke-width: 2.4; }
.goose .g-chain circle { fill: #f0d060; stroke: none; }
.goose .g-lid { fill: #222; }
.goose .g-lid rect:last-child { fill: #0b1a10; }

.goose-wrap.gosling { width: 78px; }
.goose-wrap.gosling .g-body,
.goose-wrap.gosling .g-wing,
.goose-wrap.gosling .g-neck,
.goose-wrap.gosling .g-head { fill: #f2d36b; }
.goose-wrap.fancy .g-chain,
.goose-wrap.lead .g-chain,
.goose-wrap.legend .g-chain { display: inline !important; }
.goose-wrap.lead .g-lid,
.goose-wrap.legend .g-lid { display: inline !important; }
.goose-wrap.legend .g-body { fill: #f7f4ee; filter: drop-shadow(0 0 4px #f0d060); }

.goose-wrap.idle { animation: bob 1.6s ease-in-out infinite; }
.goose-wrap.honk { animation: honk 420ms ease; }
.goose-wrap.eat { animation: eat 700ms ease; }
.goose-wrap.weld { animation: weldpose 500ms ease; }
.goose-wrap.sleep { animation: none; transform: translateX(-50%) rotate(-18deg); }
.goose-wrap.sad { animation: sad 1.8s ease-in-out infinite; }
.goose-wrap.chaos { animation: chaos 280ms linear infinite; }

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}
@keyframes honk {
  0% { transform: translateX(-50%) scale(1); }
  40% { transform: translateX(-50%) scale(1.08) rotate(-6deg); }
  100% { transform: translateX(-50%) scale(1); }
}
@keyframes eat {
  50% { transform: translateX(-50%) translateY(8px) rotate(12deg); }
}
@keyframes weldpose {
  0%, 100% { transform: translateX(-50%); }
  30% { transform: translateX(-40%) rotate(8deg); }
}
@keyframes sad {
  0%, 100% { transform: translateX(-50%) rotate(4deg); }
  50% { transform: translateX(-50%) rotate(-4deg); }
}
@keyframes chaos {
  50% { transform: translateX(-46%) rotate(8deg); }
}

.zzz {
  position: absolute;
  right: 6px;
  top: -6px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: var(--amber);
  animation: zzz 1.2s ease-in-out infinite;
}
@keyframes zzz {
  50% { transform: translateY(-8px); opacity: 0.4; }
}

.speech {
  position: absolute;
  right: 8%;
  top: 10%;
  background: #08140c;
  color: #c8ffb0;
  border: 1px solid #5a9a48;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
  max-width: 46%;
}

.weld-flash {
  position: absolute;
  inset: 0;
  background: #dfffff;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.weld-flash.go {
  animation: flash 280ms linear;
}
@keyframes flash {
  0%, 100% { opacity: 0; }
  30% { opacity: 0.85; }
  55% { opacity: 0.15; }
  70% { opacity: 0.6; }
}

.meters {
  display: grid;
  gap: 4px;
}
.meter {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #9ee888;
}
.bar {
  height: 10px;
  background: #102016;
  border: 1px solid #3a6840;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #3a9a40, #b8ff9a);
  box-shadow: 0 0 4px rgba(120,255,90,0.25);
  transition: width 240ms ease, background 240ms ease;
}
.bar.chaos i { background: linear-gradient(90deg, #9a4a18, #ff8a60); }
.bar.grind i { background: linear-gradient(90deg, #9a7a20, #f0d878); }
.meter.low i { background: var(--warn); }

.ticker {
  min-height: 36px;
  font-size: 12px;
  line-height: 1.4;
  color: #f0d878;
  border-top: 1px dashed #3a6840;
  padding-top: 6px;
}

.codex {
  list-style: none;
  overflow: auto;
  flex: 1;
  font-size: 12px;
  line-height: 1.35;
  display: grid;
  gap: 6px;
}
.codex li {
  border: 1px solid #3a6840;
  padding: 6px;
  color: #9ee888;
}
.codex li.found {
  color: #c8ffb0;
  border-color: #5a9a48;
}

.ke-mode .meter span::after {
  content: "*";
  color: #f0d878;
}

@media (max-width: 520px) {
  .hud-name { font-size: 13px; }
  .boot-title { font-size: 15px; }
  .meter { font-size: 11px; }
  .ticker { font-size: 11px; }
}
