/* Pandemic Manager: AI Edition - Pixel Art Style (CSS Only) */

/* Research page layout - inner wrapper constrains width (skel container can be full) */
.research-content {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .research-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Research page structure */
.research-paper-block {
  margin-bottom: 3rem;
}

/* Game-style intro card - matches pixel-art game aesthetic */
.game-intro-card {
  background-color: #1a1a1a !important;
  background-image: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06)) !important;
  background-size: 100% 2px, 3px 100% !important;
  border: 4px solid #2c3e50 !important;
  box-shadow: 
    0 0 0 4px #1a1a1a,
    0 0 0 8px #2c3e50,
    10px 10px 0 rgba(0,0,0,0.5) !important;
  padding: 3rem !important;
  margin-bottom: 4rem !important;
  font-family: 'VT323', 'Courier New', monospace !important;
  position: relative !important;
  overflow: hidden !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.game-intro-tagline {
  font-size: 4em !important;
  font-weight: normal !important;
  color: #e74c3c !important;
  text-shadow: 4px 4px 0 #000 !important;
  line-height: 1 !important;
  margin: 0 0 1.5rem 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  font-family: 'VT323', monospace !important;
}

.game-intro-title {
  font-size: 2.2em !important;
  color: #f1c40f !important;
  margin: 0 0 1rem 0 !important;
  text-transform: uppercase !important;
  line-height: 1.2 !important;
  border-bottom: 2px dashed #f1c40f !important;
  padding-bottom: 1rem !important;
  display: inline-block !important;
  font-family: 'VT323', monospace !important;
}

.game-intro-meta {
  color: #bdc3c7 !important;
  font-size: 1.5em !important;
  margin: 0 0 2rem 0 !important;
  line-height: 1.4 !important;
  font-family: 'VT323', monospace !important;
}

.game-intro-cta {
  display: inline-block !important;
  background: #27ae60 !important;
  color: #fff !important;
  font-weight: bold !important;
  padding: 1rem 2rem !important;
  border: 4px solid #1e8449 !important;
  font-size: 1.8em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  box-shadow: 
    inset 2px 2px 0 rgba(255,255,255,0.4),
    inset -2px -2px 0 rgba(0,0,0,0.4),
    4px 4px 0 #000 !important;
  font-family: 'VT323', monospace !important;
  margin-right: 1rem !important;
  margin-bottom: 1rem !important;
}

.game-intro-cta.secondary {
  background: #2980b9;
  border-color: #1a5276;
  box-shadow: 
    inset 2px 2px 0 rgba(255,255,255,0.4),
    inset -2px -2px 0 rgba(0,0,0,0.4),
    4px 4px 0 #000;
}

.game-intro-cta:hover {
  transform: translateY(2px);
  box-shadow: 
    inset 2px 2px 0 rgba(255,255,255,0.4),
    inset -2px -2px 0 rgba(0,0,0,0.4),
    2px 2px 0 #000;
  color: #fff !important;
}

.game-intro-cta:active {
  transform: translateY(4px);
  box-shadow: none;
}

.game-intro-why {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid #555;
  padding: 1.5rem;
  margin-top: 2rem;
}

.game-intro-heading {
  font-size: 1.8em;
  color: #2ecc71;
  text-transform: uppercase;
  margin: 0 0 1rem 0;
  text-shadow: 2px 2px 0 #000;
}

.game-intro-body {
  font-size: 1.4em;
  color: #ecf0f1;
  line-height: 1.5;
  margin: 0 0 1.5rem 0;
}

.game-intro-bullets {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.game-intro-bullets li {
  font-size: 1.3em;
  color: #bdc3c7;
  line-height: 1.4;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: flex-start;
}

.game-intro-bullets li::before {
  content: ">";
  color: #e74c3c;
  font-weight: bold;
  margin-right: 10px;
  animation: blink 1s step-end infinite;
}

.game-intro-bullets .bullet-label {
  color: #fff;
  text-transform: uppercase;
  margin-right: 8px;
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (max-width: 768px) {
  .game-intro-card {
    padding: 1.5rem;
  }
  .game-intro-tagline {
    font-size: 2.5em;
  }
  .game-intro-title {
    font-size: 1.5em;
  }
}

.paper-header {
  margin-bottom: 1.5rem;
}
.paper-header h3 {
  margin-bottom: 0.5rem;
}
.paper-meta {
  color: #666;
  font-size: 0.9em;
  margin: 0;
}
.paper-request {
  margin-top: 1rem;
  font-size: 0.9em;
  color: #666;
}
.paper-divider {
  margin: 2.5rem 0;
  border: none;
  border-top: 1px solid #ddd;
}

.research-paper-block .game-viewport {
  max-width: 100%;
  margin: 1rem 0;
}

.game-viewport {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: #222;
  image-rendering: pixelated;
  font-family: 'Courier New', Courier, monospace; /* Pixel-like font */
}

.game-hidden {
  display: none !important;
}

/* --- TITLE SCREEN --- */
.game-title-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #2c3e50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 200;
  color: #fff;
  text-align: center;
  padding: 40px;
}
.game-title-screen h2 {
  font-size: 2.5em;
  color: #e74c3c;
  text-shadow: 4px 4px 0 #000;
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}
.game-title-screen p {
  font-size: 1.1em;
  max-width: 600px;
  margin-bottom: 30px;
  line-height: 1.6;
}
.game-start-btn, .restart-btn {
  background: #27ae60;
  color: #fff;
  border: 4px solid #2ecc71;
  padding: 15px 40px;
  font-size: 1.5em;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 0 #1e8449;
  transition: transform 0.1s;
}
.game-start-btn:hover, .restart-btn:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 #1e8449;
}
.game-start-btn:active, .restart-btn:active {
  transform: translateY(6px);
  box-shadow: none;
}

/* --- TOP BAR --- */
.game-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: rgba(20, 20, 30, 0.9);
  border-bottom: 2px solid #4a5568;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 100;
  color: #eee;
}

.game-day {
  font-weight: 700;
  color: #fff;
  font-size: 1.1em;
  text-shadow: 2px 2px 0 #000;
}

.game-survival {
  color: #a0aec0;
  font-size: 0.9em;
}

.game-agent-info {
  color: #cbd5e0;
  font-size: 0.85em;
  margin-left: auto;
}

/* --- OVERWORLD TERRAIN --- */
.game-overworld {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 15;
  /* Pixel art grass pattern */
  background-color: #5ba346;
  background-image: 
    radial-gradient(#6abf54 15%, transparent 16%),
    radial-gradient(#6abf54 15%, transparent 16%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

/* Roads */
.game-overworld::before {
  content: "";
  position: absolute;
  /* Horizontal Road */
  top: 45%; left: 0; width: 100%; height: 12%;
  background: #9ca0a3; /* Asphalt grey */
  border-top: 4px solid #7f8c8d;
  border-bottom: 4px solid #7f8c8d;
  box-shadow: inset 0 0 0 2px #555;
}

.game-overworld::after {
  content: "";
  position: absolute;
  /* Vertical Road */
  top: 0; left: 45%; width: 10%; height: 100%;
  background: #9ca0a3;
  border-left: 4px solid #7f8c8d;
  border-right: 4px solid #7f8c8d;
  box-shadow: inset 0 0 0 2px #555;
}

/* --- BUILDINGS (SVG Sprites) --- */
.game-buildings {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 16; /* Above roads */
}

.game-building {
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  /* Removed drop-shadow to avoid boxy look with non-transparent images */
}

/* Building Label */
.game-building .label {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 2px 6px;
  border: 2px solid #fff;
  border-radius: 4px;
  font-size: 0.7em;
  white-space: nowrap;
  font-weight: bold;
  z-index: 25;
}

/* HOME: House with Roof */
.game-building.home {
  left: 8%; top: 40%; width: 14%; height: 25%;
  background-image: url("../images/game-assets/building_home.png");
}

/* WORK: Office Block */
.game-building.work {
  left: 42%; top: 15%; width: 16%; height: 35%;
  background-image: url("../images/game-assets/building_work.png");
}

/* SCHOOL: Schoolhouse */
.game-building.school {
  left: 72%; top: 15%; width: 16%; height: 25%;
  background-image: url("../images/game-assets/building_school.png");
}

/* SOCIAL: Club */
.game-building.social {
  left: 68%; top: 55%; width: 18%; height: 25%;
  background-image: url("../images/game-assets/building_social.png");
}

/* HOSPITAL: Clinic */
.game-building.hospital {
  left: 10%; top: 15%; width: 18%; height: 25%;
  background-image: url("../images/game-assets/building_hospital.png");
}

/* Trees (PNG) */
.game-tree {
  position: absolute;
  width: 32px; height: 32px;
  z-index: 17;
  background-image: url("../images/game-assets/tree.png");
  background-size: contain;
  background-repeat: no-repeat;
}

/* --- CHARACTERS (PNG Sprites) --- */
.game-character {
  position: absolute;
  width: 48px; height: 48px; /* Larger for visibility */
  transform: translate(-50%, -50%);
  z-index: 30;
  transition: left 0.1s linear, top 0.1s linear;
}

.sprite-body {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  image-rendering: pixelated;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
}

/* Male Sprite */
.game-character.male .sprite-body {
  background-image: url("../images/game-assets/sprite_male.png");
}

/* Female Sprite */
.game-character.female .sprite-body {
  background-image: url("../images/game-assets/sprite_female.png");
}

/* Animation */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.game-character.walking .sprite-body {
  animation: bob 0.2s infinite;
}

/* --- INTERIORS --- */
.game-location-view {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 15;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}

/* Home Interior */
.game-location-view.scene-home {
  background-image: url("../images/game-assets/interior_home.png");
}
/* Remove CSS furniture */
.game-location-view.scene-home::before, .game-location-view.scene-home::after { content: none; }

/* Work Interior */
.game-location-view.scene-work {
  background-image: url("../images/game-assets/interior_work.png");
}
.game-location-view.scene-work::before, .game-location-view.scene-work::after { content: none; }

/* Social Interior */
.game-location-view.scene-social {
  background-image: url("../images/game-assets/interior_social.png");
}
.game-location-view.scene-social::before, .game-location-view.scene-social::after { content: none; }

/* School Interior */
.game-location-view.scene-school {
  background-image: url("../images/game-assets/interior_school.png");
}
.game-location-view.scene-school::before, .game-location-view.scene-school::after { content: none; }

/* Hospital Interior */
.game-location-view.scene-hospital {
  background-image: url("../images/game-assets/interior_hospital.png");
}

/* --- UI ELEMENTS --- */
.game-decision-container {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 120;
  pointer-events: none;
}

.game-decision-box {
  background: #fff;
  border: 4px solid #2c3e50;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
  border-radius: 0;
  padding: 16px;
  max-width: 600px;
  width: 100%;
  font-family: 'Courier New', monospace;
  pointer-events: auto;
}

.game-decision-box h3 {
  color: #2c3e50;
  font-size: 1.1em;
  text-transform: uppercase;
  border-bottom: 2px dashed #ccc;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.game-decision-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.game-decision-btn {
  background: #3498db;
  color: #fff;
  border: 2px solid #2980b9;
  box-shadow: 0 4px 0 #2980b9;
  border-radius: 0;
  padding: 8px 16px;
  font-family: inherit;
  text-transform: uppercase;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s;
}

.game-decision-btn:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2980b9;
  background: #5dade2;
}

.game-decision-btn:active {
  transform: translateY(4px);
  box-shadow: none;
}

.game-back-btn {
  position: absolute;
  top: 60px; /* Below topbar */
  left: 20px;
  background: #e74c3c;
  border: 2px solid #c0392b;
  box-shadow: 0 4px 0 #c0392b;
  color: #fff;
  border-radius: 0;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 110;
  cursor: pointer;
}
.game-back-btn:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c0392b;
}

/* Hint Text */
.game-move-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(0,0,0,0.8);
  border: 1px solid #fff;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  font-size: 0.7em;
  letter-spacing: 1px;
  color: #fff;
  border-radius: 4px;
  z-index: 50;
  transition: all 0.2s;
}
.game-move-hint.highlight {
  background: #f1c40f;
  color: #2c3e50;
  border-color: #f39c12;
  font-weight: bold;
  transform: translateX(-50%) scale(1.1);
}

/* Zone Highlights */
.game-zone {
  position: absolute;
  border: 2px dashed rgba(255,255,255,0.4);
  background: transparent;
}
.game-zone.active {
  background: rgba(255,255,255,0.2);
  border-color: #fff;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* Toast */
.game-toast {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  border: 2px solid #34495e;
  z-index: 200;
  text-align: center;
  max-width: 80%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from { top: -50px; opacity: 0; }
  to { top: 70px; opacity: 1; }
}

/* End Screen */
#game-end-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 150;
  pointer-events: none;
}
.game-end-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-align: center;
  padding: 40px;
  pointer-events: auto;
}
.game-end-screen h2 {
  font-size: 3em;
  color: #e74c3c;
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
}
.game-end-screen.victory h2 {
  color: #2ecc71; /* Green for win */
  text-shadow: 0 0 10px #27ae60;
}
.game-end-screen p {
  font-size: 1.2em;
  max-width: 600px;
  margin-bottom: 20px;
}
.game-end-screen .score {
  font-size: 1.5em;
  color: #f1c40f;
  font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
  .game-building { transform: scale(0.8); }
}
