@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --blue: #202050;
  --blue2: #313173;
  --light: #a9b5df;
  --paper: #f4dce8;
  --pink: #ff7180;
  --red: #e82738;
  --dark: #101022;
  --green: #a9d08d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  background: #09090e;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "VT323", monospace;
  overflow: hidden;
}

button {
  font: inherit;
  cursor: pointer;
}

.game-shell {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  position: relative;
  background: var(--blue);
  overflow: hidden;
  image-rendering: pixelated;
  display: flex;
  flex-direction: column;
}

/* TOPBAR */
.topbar {
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #7e8dc8;
  border-bottom: 5px solid #20213d;
  box-shadow: inset 0 -3px #aeb8e2;
  z-index: 10;
  flex-shrink: 0;
}

.mini-spider, .spider-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: white;
  border: 3px solid #65111b;
  box-shadow: 3px 3px 0 #20213d;
  font-family: "Press Start 2P";
  font-size: 12px;
}

.spider-badge { font-size: 20px; }

.status {
  display: flex;
  gap: 14px;
  color: white;
  font-size: 22px;
  text-shadow: 2px 2px #333;
}

/* PANTALLAS */
.screen {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.game-screen {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  overflow-y: auto;
}

.game-screen.active {
  display: flex;
  animation: boot .28s steps(3, end);
}

@keyframes boot {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* MAP SCREEN */
.map {
  width: 100%;
  height: 52dvh;
  max-height: 380px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(35deg, transparent 47%, #565ba0 48% 50%, transparent 51%),
    linear-gradient(-30deg, transparent 47%, #565ba0 48% 50%, transparent 51%),
    #29295f;
  border: 6px solid #a9b5df;
  box-shadow: inset 0 0 0 4px #4b548c;
}

.map-grid {
  position: absolute;
  inset: 0;
  opacity: .45;
  background:
    repeating-linear-gradient(0deg, transparent 0 40px, #7279b6 41px 44px),
    repeating-linear-gradient(90deg, transparent 0 45px, #7279b6 46px 49px);
}

.location-dot {
  width: 26px;
  height: 26px;
  background: var(--red);
  border: 4px solid #9b1826;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(232,39,56,.15);
  animation: pulse 1s steps(2) infinite;
}

@keyframes pulse {
  50% { transform: translate(-50%, -50%) scale(1.25); }
}

.map-label {
  position: absolute;
  right: 10%;
  top: 55%;
  font-family: Arial, sans-serif;
  font-size: 36px;
  color: #e9dce9;
  letter-spacing: 2px;
}

.alert-box {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 88%;
  background: #ff6e4b;
  border: 4px solid #70262c;
  padding: 10px;
  text-align: center;
  color: #5a2020;
  font-size: 22px;
  line-height: 1;
  box-shadow: 4px 4px 0 #22213e;
}

.alert-title {
  font-size: 15px;
  margin-bottom: 5px;
}

.dialog {
  min-height: 85px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 5px solid #22213e;
  box-shadow: 4px 4px 0 #111;
  padding: 12px;
  font-size: 26px;
  line-height: 1.15;
}

.dialog-name {
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: white;
  border: 3px solid #67101b;
  font-family: "Press Start 2P";
  font-size: 14px;
  flex-shrink: 0;
}

/* MISSION SCREEN */
.mission-art {
  height: 220px;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #4e4d98 1px, transparent 2px) 0 0 / 12px 12px,
    #29295f;
  border: 5px solid #8995cf;
  overflow: hidden;
}

.hero-silhouette {
  font-size: 90px;
  filter: drop-shadow(6px 6px 0 #101022);
  animation: bob 1.2s steps(3) infinite;
}

@keyframes bob {
  50% { transform: translateY(-8px) rotate(-2deg); }
}

.comic-burst {
  position: absolute;
  right: 15px;
  top: 12px;
  background: var(--red);
  color: white;
  border: 3px solid #64121b;
  padding: 10px 14px;
  font-family: "Press Start 2P";
  font-size: 22px;
  transform: rotate(8deg);
}

.mission-card, .item-info, .final-panel {
  background: var(--paper);
  border: 5px solid #24243f;
  box-shadow: 4px 4px 0 #101022;
  padding: 14px;
}

.eyebrow {
  color: #a51f2c;
  font-family: "Press Start 2P";
  font-size: 10px;
}

.mission-card h1, .item-info h1, .final-panel h1 {
  font-family: "Press Start 2P";
  font-size: 22px;
  line-height: 1.35;
  margin: 8px 0;
}

.mission-card p, .item-info p, .final-panel p {
  font-size: 26px;
  line-height: 1.1;
  margin: 4px 0;
}

/* REVEAL SCREEN */
#revealScreen {
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 45%, #531b2a 0, #17152d 45%, #0d0d19 100%);
}

.reveal-top, .gift-header {
  display: flex;
  justify-content: space-between;
  color: #b8c1ea;
  font-family: "Press Start 2P";
  font-size: 9px;
}

.reveal-box {
  margin: auto 0;
  padding: 24px 12px;
  border: 4px solid #aeb8e2;
  background: rgba(16,16,34,.78);
  position: relative;
  box-shadow: 6px 6px 0 #07070e;
}

.stamp {
  position: absolute;
  right: 8px;
  top: 8px;
  background: var(--red);
  color: white;
  border: 2px solid #72121d;
  padding: 6px;
  font-family: "Press Start 2P";
  font-size: 8px;
  transform: rotate(8deg);
}

.big-spider {
  font-size: 70px;
  filter: drop-shadow(4px 4px 0 #000);
}

.reveal-box h1 {
  font-family: "Press Start 2P";
  color: white;
  font-size: 22px;
  line-height: 1.35;
  text-shadow: 3px 3px #e82738;
}

.reveal-box p {
  color: #f5dce5;
  font-size: 28px;
}

/* GIFT SCREEN */
#giftScreen {
  background: #15152b;
}

.game-cover {
  height: 200px;
  border: 4px solid #aeb8e2;
  background: #29295f;
  position: relative;
  overflow: hidden;
}

.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 5px,
    rgba(255,255,255,.035) 6px 7px
  );
}

.item-info h1 {
  color: #e82738;
  text-shadow: 2px 2px #22213e;
}

.rarity {
  font-family: "Press Start 2P";
  font-size: 9px;
  color: #3b6e3b;
}

.mission-list {
  color: #f0dbe5;
  font-size: 24px;
  line-height: 1.25;
  background: #202044;
  border: 3px solid #535b96;
  padding: 10px 12px;
}

/* FINAL SCREEN */
.final-screen {
  background:
    radial-gradient(circle at center, #34306e, #17162d 70%);
  justify-content: center;
}

.final-panel {
  text-align: center;
}

.heart {
  color: var(--red);
  font-size: 50px;
  animation: heart .9s steps(2) infinite;
}

@keyframes heart {
  50% { transform: scale(1.15); }
}

.final-panel .small {
  font-size: 20px;
  color: #6d6470;
}

.love {
  color: #a51f2c !important;
  font-family: "Press Start 2P";
  font-size: 15px !important;
  margin-top: 16px !important;
}

.divider {
  height: 4px;
  background: #7f7c96;
  margin: 15px 0;
}

/* BOTONES */
.pixel-btn {
  width: 100%;
  padding: 16px 12px;
  border: 4px solid #17172b;
  background: #a9d08d;
  color: #23321d;
  box-shadow: 4px 4px 0 #080811;
  font-family: "Press Start 2P";
  font-size: 12px;
  flex-shrink: 0;
  transition: transform .1s steps(2);
}

.pixel-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #080811;
}

.pixel-btn.red {
  background: var(--red);
  color: white;
}

/* FOOTER */
.bottom-ui {
  height: 60px;
  min-height: 60px;
  background: #7e8dc8;
  border-top: 5px solid #20213d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.health {
  display: flex;
  align-items: center;
  gap: 8px;
}

.heart-pixel {
  color: var(--red);
  font-size: 24px;
  text-shadow: 2px 2px #65111b;
}

.bar {
  width: 80px;
  height: 12px;
  border: 3px solid #20213d;
  background: #33345a;
}

.bar i {
  display: block;
  width: 90%;
  height: 100%;
  background: #b5df90;
}

.footer-buttons {
  display: flex;
  gap: 6px;
}

.footer-buttons button {
  border: 3px solid #20213d;
  background: #ff7254;
  color: #5b2024;
  padding: 5px 8px;
  font-size: 14px;
}