/* =============================================================================
   RETRO-84 PLATFORMER: 1980s Arcade & Microcomputer Monitor Stylesheet
   ============================================================================= */

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

:root {
  --bg-color: #0b0c10;
  --bezel-color: #27282b;
  --bezel-accent: #1a1a1c;
  --screen-bg: #050508;
  --speccy-red: #dd1122;
  --speccy-cyan: #00ddff;
  --speccy-yellow: #ffdd00;
  --speccy-green: #00cc33;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(ellipse at center, #1b1e28 0%, #08090c 100%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  color: #eeeeee;
  font-family: 'VT323', 'Courier New', Courier, monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 10px 24px 10px;
}

/* Header & Vintage Badge */
header {
  text-align: center;
  margin-bottom: 8px;
}

.title-rainbow {
  font-size: clamp(1.6rem, 3.2vh, 2.3rem);
  letter-spacing: 3px;
  text-shadow: 2px 2px #dd1122, -2px -2px #00ddff;
  color: #ffffff;
  margin-bottom: 2px;
  line-height: 1.1;
}

.subtitle {
  font-size: clamp(0.85rem, 1.8vh, 1.1rem);
  color: #00ddff;
  letter-spacing: 1.5px;
  font-weight: bold;
}

.summary-line {
  font-size: clamp(0.75rem, 1.5vh, 0.95rem);
  color: #ffdd00;
  letter-spacing: 1px;
  margin-top: 2px;
}

.sub-controls {
  color: #7a7e8e;
  font-size: 0.9rem;
}

/* CRT Monitor Case Container */
.monitor-frame {
  position: relative;
  background: linear-gradient(145deg, #37383c, #1f2022);
  border: 4px solid #484a50;
  border-radius: 20px;
  padding: 12px 18px 10px 18px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.9),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    inset 0 -4px 8px rgba(0, 0, 0, 0.6);
  width: min(calc((100vh - 170px) * 4 / 3 + 44px), calc(100vw - 20px), 1440px);
  min-width: min(556px, 100%);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Monitor Brand Badge & Power LED */
.monitor-top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 4px;
}

.monitor-brand {
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: #8c909e;
  font-weight: bold;
}

.monitor-led {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #8c909e;
}

.led-light {
  width: 10px;
  height: 10px;
  background-color: #00ff66;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ff66, inset 0 1px 2px #ffffff;
  animation: ledPulse 2s infinite ease-in-out;
}

@keyframes ledPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.6; }
}

/* CRT Screen Wrapper */
.screen-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  background: var(--screen-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    inset 0 0 25px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.7);
}

/* Responsive aspect ratio & mobile padding */
@media (max-width: 560px) {
  body {
    padding: 8px 6px 20px 6px;
  }
  .monitor-frame {
    width: 100%;
    min-width: 0;
    padding: 10px 10px 8px 10px;
    border-radius: 14px;
  }
  .screen-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

/* Game Canvas (Pixel Crisp) */
#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Retro High Score Modal Overlay */
.retro-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 12, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  backdrop-filter: blur(2px);
}

.modal-box {
  background: #0d0d1a;
  border: 3px solid #ffcc00;
  box-shadow: 0 0 18px rgba(255, 204, 0, 0.6), inset 0 0 12px rgba(255, 204, 0, 0.3);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  max-width: 380px;
  width: 90%;
}

.modal-title {
  color: #ff0055;
  font-family: var(--font-retro);
  font-size: 1.3rem;
  margin: 0 0 8px;
  text-shadow: 0 0 8px #ff0055;
}

.modal-sub {
  color: #00ddff;
  font-size: 0.8rem;
  margin: 0 0 12px;
  letter-spacing: 1px;
}

.modal-score {
  color: #00ff88;
  font-family: var(--font-retro);
  font-size: 1.15rem;
  margin-bottom: 14px;
  text-shadow: 0 0 6px #00ff88;
}

.modal-input-wrap {
  margin-bottom: 8px;
}

#playerNameInput {
  width: 80%;
  background: #000;
  border: 2px solid #00ffff;
  border-radius: 4px;
  color: #ffea00;
  font-family: var(--font-retro);
  font-size: 1.4rem;
  text-align: center;
  padding: 8px 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  outline: none;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

#playerNameInput:focus {
  border-color: #ff00aa;
  box-shadow: 0 0 14px rgba(255, 0, 170, 0.8);
}

.modal-hint {
  color: #8899aa;
  font-size: 0.7rem;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.submit-btn {
  background: #ffcc00 !important;
  color: #000 !important;
  font-weight: bold;
  padding: 8px 20px;
  font-size: 0.9rem;
}
.submit-btn:hover {
  background: #ffee55 !important;
  box-shadow: 0 0 12px #ffcc00;
}

/* Monitor Control Panel Buttons */
.monitor-controls {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  padding: 0 4px;
  gap: 16px;
  flex-wrap: wrap;
}

.retro-btn {
  background: linear-gradient(180deg, #44464d, #27282b);
  color: #dddddd;
  border: 2px solid #5a5c64;
  border-radius: 6px;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 3px 0 #18191a;
  transition: all 0.1s ease;
}

.retro-btn:hover {
  background: linear-gradient(180deg, #52545d, #323338);
  color: #ffffff;
}

.retro-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #18191a;
}

/* On-Screen Touch D-Pad for Mobile / Mouse */
.touch-controller {
  display: none;
  width: 100%;
  max-width: 512px;
  margin-top: 14px;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

@media (pointer: coarse), (max-width: 768px) {
  .touch-controller {
    display: flex;
  }
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 3px;
}

.touch-btn {
  background: #33353c;
  color: #ffea00;
  border: 2px solid #555760;
  border-radius: 8px;
  font-size: 1.4rem;
  font-family: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.touch-btn:active {
  background: #ffaa00;
  color: #000;
}

.jump-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jump-btn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(145deg, #dd1122, #990011);
  color: #ffffff;
  border: 3px solid #ff5566;
  font-size: 1.3rem;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.jump-btn:active {
  transform: scale(0.95);
  background: #ff3344;
}

/* Information & Retro Guide */
.info-section {
  max-width: min(1000px, 95vw);
  width: 100%;
  margin-top: 20px;
  background: #14151b;
  border: 2px solid #282a36;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.info-title {
  color: var(--speccy-cyan);
  font-size: 1.4rem;
  letter-spacing: 2px;
  margin-bottom: 10px;
  border-bottom: 1px solid #282a36;
  padding-bottom: 6px;
}

.info-text {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #b8bcc8;
  margin-bottom: 12px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.artifact-card {
  background: #1c1d25;
  border: 1px solid #323545;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.95rem;
  color: #dddddd;
}

.artifact-card strong {
  color: var(--speccy-yellow);
}

.artifact-card span {
  color: #8c909e;
  font-size: 0.85rem;
  display: block;
}

footer {
  margin-top: 25px;
  text-align: center;
  color: #666a78;
  font-size: 0.9rem;
}

.feedback-banner {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(0, 221, 255, 0.05);
  border: 1px dashed var(--speccy-cyan);
  border-radius: 6px;
  color: #ccd5e0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  flex-wrap: wrap;
}

.feedback-icon {
  color: var(--speccy-yellow);
  font-size: 1.2rem;
}

.feedback-link {
  color: var(--speccy-cyan);
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 0.5px;
  border-bottom: 1px dotted var(--speccy-cyan);
  transition: all 0.2s ease;
}

.feedback-link:hover {
  color: var(--speccy-yellow);
  border-bottom-color: var(--speccy-yellow);
  text-shadow: 0 0 8px rgba(255, 221, 0, 0.6);
}

.footer-contact {
  margin-top: 6px;
  color: #8c90a0;
  font-size: 0.95rem;
}

.footer-contact a {
  color: var(--speccy-cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 221, 255, 0.4);
  transition: all 0.2s ease;
}

.footer-contact a:hover {
  color: var(--speccy-yellow);
  border-bottom-color: var(--speccy-yellow);
  text-shadow: 0 0 6px rgba(255, 221, 0, 0.5);
}

