/* css/style.css */

/* =========================================================
   1. DESIGN TOKENS
========================================================= */

:root {
  --bg: #0a0a0f;
  --panel: rgba(0, 0, 0, 0.72);
  --cyan: #7effd4;
  --orange: #e8754a;
  --cream: #f5dfbd;
  --border: rgba(126, 255, 212, 0.45);
  --danger: #9b1f1f;
}

/* =========================================================
   2. GLOBAL RESET / BASE
========================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--cyan);
  font-family: "Roboto", Arial, sans-serif;
}

button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.78);
  color: var(--cyan);
  padding: 0.85rem 1.2rem;
  font-family: monospace;
  text-transform: uppercase;
}

button:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(126, 255, 212, 0.25);
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
}

.hidden {
  display: none !important;
}

/* =========================================================
   3. SCREEN SYSTEM
========================================================= */

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

.screen-overlay {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
}

/* =========================================================
   4. LANDING SCREEN
========================================================= */

.landing-screen {
  background:
    linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.8)),
    url("../assets/images/core_protocol.svg") center / cover no-repeat;
}

.landing-overlay {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.game-logo {
  width: min(1200px, 85vw);
  display: block;
  margin: 1rem auto 3rem;
  filter: drop-shadow(0 0 18px rgba(126, 255, 212, 0.25));
}

.subtitle {
  letter-spacing: 0.2em;
  font-family: monospace;
}

.landing-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* =========================================================
   5. VIDEO SCREEN
========================================================= */

.video-screen.active {
  display: grid;
  place-items: center;
  background: #000;
}

.video-frame {
  width: min(1100px, 88vw);
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.intro-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border: 2px solid var(--border);
  background: #000;
}

/* =========================================================
   6. TUTORIAL SCREEN
========================================================= */

.tutorial-screen {
  align-items: center;
  justify-content: flex-end;
  padding: 4rem;
  background:
    linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.65)),
    url("../assets/images/tutorial-bg.png") left center / cover no-repeat;
}

.tutorial-screen.active {
  display: flex;
}

.tutorial-panel {
  width: min(760px, 48vw);
  padding: 2.5rem;
  background: rgba(18, 4, 4, 0.86);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* =========================================================
   7. SITE SELECTION SCREEN
========================================================= */

.site-screen {
  align-items: center;
  justify-content: center;
  padding: 4rem;
  background:
    linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.85)),
    url("../assets/images/site-selection-bg.jpg") center / cover no-repeat;
}

.site-screen.active {
  display: flex;
}

.back-arrow {
  position: absolute;
  top: 2rem;
  left: 2rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 1.8rem;
  padding: 0;
  z-index: 5;
}

.site-overlay {
  text-align: center;
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 420px));
  gap: 3rem;
}

.zone-card {
  padding: 1rem;
  text-align: left;
}

.zone-image-wrapper {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.zone-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   8. GAME LAYOUT
========================================================= */

.game-screen {
  grid-template-columns: 260px 1fr 240px;
  grid-template-rows: 110px 1fr 230px;
  gap: 1rem;
  padding: 1.5rem;
  background: #020506;
}

.game-screen.active {
  display: grid;
}

/* =========================================================
   9. TOP HUD
========================================================= */

.hud {
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: 90px 120px repeat(3, minmax(180px, 1fr));
  gap: 1rem;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(126, 255, 212, 0.35);
  padding: 1rem;
}

.menu-small-button,
.turn-box,
.gauge {
  height: 100%;
  min-height: 76px;
}

.menu-small-button {
  border: 3px double var(--cyan);
  display: grid;
  place-items: center;
  padding: 0.5rem;
}

.turn-box {
  display: grid;
  place-items: center;
  text-align: center;
}

.turn-box strong {
  font-size: 2.4rem;
  line-height: 1;
}

.turn-box span {
  color: var(--cream);
  font-size: 0.75rem;
}

.gauge {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
}

.gauge small {
  margin-top: 0.4rem;
  color: var(--cream);
  font-size: 0.8rem;
  line-height: 1;
}

.bar {
  width: 100%;
  height: 32px;
  border: 2px solid var(--cyan);
  padding: 4px;
  background: rgba(0, 0, 0, 0.7);
}

.bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
  transition: width 0.6s ease;
}

/* =========================================================
   10. LEFT / RIGHT PANELS
========================================================= */

.left-panel,
.right-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 1rem;
  overflow: auto;
}

.left-panel h3,
.right-panel h3 {
  color: var(--cream);
  font-size: 0.85rem;
}

.expert-button {
  width: 100%;
  margin-bottom: 1rem;
}

.side-action {
  width: 100%;
  margin: 0.7rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.side-action img {
  width: 28px;
  height: 28px;
}

.side-action.active-mode {
  border-color: var(--orange);
  background: rgba(232, 117, 74, 0.15);
}

.selection-help {
  color: var(--cream);
  font-size: 0.85rem;
  line-height: 1.4;
}

.scan-side-action {
  margin-top: 1.5rem;
  border: 4px double rgba(126, 255, 212, 0.65);
}

/* =========================================================
   11. CENTER MAP + INSTALLED RESOURCE ICONS
========================================================= */

.map-area {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #000;
}

#zone-map {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#resource-layer {
  position: absolute;
  inset: 0;
}

.resource-icon {
  position: absolute;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.resource-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.7));
}

.resource-label {
  position: absolute;
  left: 50%;
  top: 92px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(126, 255, 212, 0.3);
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  color: var(--cyan);
  white-space: nowrap;
}

.resource-progress-label {
  position: absolute;
  left: 50%;
  top: 122px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(232, 117, 74, 0.5);
  padding: 0.22rem 0.5rem;
  font-size: 0.62rem;
  color: var(--orange);
  white-space: nowrap;
}

.resource-icon.pending::after {
  content: none !important;
}

.resource-icon.damaged img {
  filter: drop-shadow(0 0 12px red) brightness(0.7);
}

/* =========================================================
   12. BOTTOM ENERGY ACTION CARDS
========================================================= */

.action-row {
  grid-column: 2 / 3;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.action-card {
  position: relative;
  min-height: 220px;
  text-align: left;
  background: rgba(0, 0, 0, 0.78);
  border: 4px double rgba(126, 255, 212, 0.65);
  padding: 1rem;
  transition: 0.25s ease;
}

.action-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(126, 255, 212, 0.2);
}

.locked-tag {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  font-size: 0.7rem;
  color: var(--orange);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.card-top img {
  width: 44px;
  height: 44px;
}

.card-top h4 {
  margin: 0;
  color: var(--cyan);
  font-size: 1rem;
  line-height: 1.15;
}

.card-stats {
  display: grid;
  gap: 0.5rem;
}

.card-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--cream);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.3rem;
}

/* =========================================================
   13. SHARED MODALS
========================================================= */

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(620px, 92vw);
  background: rgba(14, 7, 7, 0.96);
  border: 2px solid var(--cyan);
  padding: 2rem;
  text-align: center;
}

.call-card {
  border-color: var(--orange);
}

.big-modal-card {
  width: min(900px, 92vw);
  padding: 3rem;
}

.big-event-card {
  width: min(1050px, 94vw);
  min-height: 72vh;
}

.big-event-card img,
.event-card img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  margin-bottom: 1rem;
}

/* =========================================================
   14. EXPERT MODAL
========================================================= */

.expert-card {
  width: min(1000px, 92vw);
  height: min(760px, 90vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.expert-card h2 {
  margin-bottom: 1rem;
}

.expert-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.expert-tabs button {
  font-size: 0.72rem;
  padding: 0.7rem 0.4rem;
}

#expert-image {
  width: 72%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.expert-text-wrapper {
  width: 88%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#expert-title {
  color: var(--orange);
  margin-bottom: 0.7rem;
}

#expert-text {
  margin: 0;
  color: var(--cream);
  font-size: clamp(0.82rem, 1vw, 0.96rem);
  line-height: 1.5;
  text-align: center;
}

.expert-card > button[data-close-expert] {
  margin-top: auto;
}

/* =========================================================
   15. END SCREEN
========================================================= */

.end-screen {
  background:
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.85)),
    url("../assets/images/crisis-bg.jpg") center / cover no-repeat;
}

/* =========================================================
   GEO SITE SELECTION
========================================================= */

#geo-site-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.geo-site-marker {
  position: absolute;

  width: 62px;
  height: 62px;

  border-radius: 50%;

  border: 4px double var(--orange);

  background: rgba(0, 0, 0, 0.88);

  color: var(--orange);

  font-size: 1.4rem;
  font-weight: bold;

  display: grid;
  place-items: center;

  transition: 0.25s ease;
}

.geo-site-marker:hover {
  transform: scale(1.08);

  box-shadow: 0 0 20px rgba(232, 117, 74, 0.45);
}

/* LOWER / MID MAP ONLY */

.marker-a {
  left: 28%;
  top: 60%;
}

.marker-b {
  left: 52%;
  top: 73%;
}

.marker-c {
  left: 74%;
  top: 62%;
}

/* =========================================================
   EVENT IMPACT PANEL
========================================================= */

.event-impact-panel {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 1rem;

  margin: 1.2rem 0 1.5rem;
}

.impact-item {
  background: rgba(0, 0, 0, 0.78);

  border: 1px solid rgba(126, 255, 212, 0.25);

  padding: 0.8rem;

  text-align: center;
}

.impact-label {
  display: block;

  font-size: 0.7rem;

  color: var(--cream);

  margin-bottom: 0.35rem;

  letter-spacing: 0.08em;
}

.impact-item strong {
  font-size: 1.1rem;

  color: var(--cyan);
}

/* NEGATIVE */

.negative-impact {
  color: #ff6b6b !important;
}

/* POSITIVE */

.positive-impact {
  color: #7effd4 !important;
}

/* =========================================================
   COMPACT GAME SCREEN - FIT LAPTOP VIEW
========================================================= */

.game-screen {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;

  grid-template-columns: 220px 1fr 210px;
  grid-template-rows: 86px 1fr 175px;

  gap: 0.7rem;
  padding: 0.8rem;
}

.hud {
  padding: 0.6rem;
  gap: 0.7rem;
}

.menu-small-button,
.turn-box,
.gauge {
  min-height: 58px;
}

.turn-box strong {
  font-size: 1.8rem;
}

.bar {
  height: 24px;
}

.left-panel,
.right-panel {
  padding: 0.75rem;
  font-size: 0.82rem;
}

.map-area {
  min-height: 0;
}

.action-row {
  gap: 0.55rem;
}

.action-card {
  min-height: 160px;
  padding: 0.7rem;
}

.card-top {
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.card-top img {
  width: 32px;
  height: 32px;
}

.card-top h4 {
  font-size: 0.78rem;
}

.card-stats {
  gap: 0.3rem;
}

.card-stat {
  font-size: 0.72rem;
  padding-bottom: 0.18rem;
}

.resource-icon {
  width: 68px;
  height: 68px;
}

.resource-label {
  top: 74px;
  font-size: 0.62rem;
}

.resource-progress-label {
  top: 100px;
  font-size: 0.56rem;
}
