/* Component Styles: Memories, Photo Viewer, Metro Puzzle, Fragments, Video Call */

/* ==================================================
   MEMORIES EXPLORER
   ================================================== */
.memories-container {
  display: flex;
  height: 100%;
  width: 100%;
  background: #ffffff;
}

.memories-sidebar {
  width: 180px;
  background: #f1f2f6;
  border-right: 2px solid #ced6e0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memories-counter {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #57606f;
  margin-bottom: 6px;
}

.memories-grid {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  align-content: flex-start;
}

.memory-card-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 6px;
  border: 1px dashed #ced6e0;
  cursor: pointer;
  background: #fdfdfd;
  transition: all 0.1s;
}

.memory-card-icon:hover {
  background: #eef2f7;
  border-color: #000080;
}

.memory-card-icon.saved {
  border: 1px solid #2ed573;
  background: #f0fff4;
}

.memory-card-icon.locked {
  opacity: 0.5;
  filter: grayscale(100%);
  cursor: not-allowed;
}

.mem-icon-badge {
  font-size: 32px;
  margin-bottom: 6px;
}

.mem-title-text {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.2;
}

.mem-date-tag {
  font-size: 11px;
  color: #747d8c;
  margin-top: 4px;
}

/* ==================================================
   PHOTO VIEWER & MEMORY DETAILS
   ================================================== */
.photo-viewer-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #2f3542;
  color: #ffffff;
  padding: 12px;
  gap: 10px;
}

.photo-card-frame {
  flex: 1;
  background: #1e272e;
  border: 2px solid #57606f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.photo-placeholder {
  max-width: 90%;
  max-height: 75%;
  border: 8px solid #ffffff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  background: #f5f6fa;
  color: #2f3542;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-retro);
}

.photo-polaroid-caption {
  margin-top: 15px;
  font-family: var(--font-mono);
  font-size: 16px;
  color: #2f3542;
  font-weight: bold;
}

/* Boarding Pass for Cox's Bazar */
.boarding-pass {
  width: 90%;
  max-width: 480px;
  background: #fff;
  color: #111;
  border: 2px dashed #e74c3c;
  padding: 16px;
  font-family: var(--font-mono);
  position: relative;
}

.boarding-pass-header {
  border-bottom: 2px solid #111;
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 18px;
}

.boarding-pass-stamp {
  position: absolute;
  top: 35%;
  right: 15%;
  border: 4px solid #e74c3c;
  color: #e74c3c;
  font-size: 26px;
  font-weight: bold;
  padding: 6px 14px;
  transform: rotate(-15deg);
  opacity: 0.85;
}

/* ==================================================
   METRO RAIL PUZZLE
   ================================================== */
.metro-map-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #2c3e50;
  color: #ffffff;
  padding: 16px;
  gap: 12px;
}

.metro-track {
  flex: 1;
  position: relative;
  background: #1a252f;
  border: 2px solid #34495e;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 20px;
}

.metro-station-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 5;
}

.station-circle {
  width: 28px;
  height: 28px;
  background: #95a5a6;
  border: 3px solid #ffffff;
  border-radius: 50%;
  transition: all 0.2s;
}

.metro-station-node.active .station-circle {
  background: #2ecc71;
  box-shadow: 0 0 10px #2ecc71;
}

.metro-station-node.destination .station-circle {
  background: #e74c3c;
}

.station-name {
  font-size: 15px;
  font-family: var(--font-pixel);
  color: #ecf0f1;
}

/* ==================================================
   MEMORY FRAGMENTS ORDERING PUZZLE
   ================================================== */
.fragments-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  background: #ffffff;
  gap: 14px;
}

.fragments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.fragment-slot {
  padding: 10px 14px;
  background: #f1f2f6;
  border: 1px solid #ced6e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 17px;
}

.fragment-slot:hover {
  background: #e4e7eb;
}

.fragment-order-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fragment-order-btns .retro-btn {
  min-width: 44px;
  min-height: 42px;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ==================================================
   BRAZIL VS ARGENTINA SCREEN
   ================================================== */
.match-screen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #111;
  color: #ffffff;
  padding: 20px;
  gap: 20px;
}

.match-teams {
  display: flex;
  align-items: center;
  gap: 30px;
  font-family: var(--font-pixel);
  font-size: 24px;
}

.team-card {
  padding: 20px 30px;
  border: 2px solid #444;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
}

.team-card:hover {
  border-color: #ffa502;
  transform: scale(1.05);
}

.team-card.brazil {
  background: #009c3b;
  color: #ffdf00;
}

.team-card.argentina {
  background: #75aadb;
  color: #ffffff;
}

/* ==================================================
   VIDEO CALL MODAL & END SEQUENCE
   ================================================== */
#videocall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#videocall-overlay.active {
  display: flex;
}

.call-window {
  width: 640px;
  max-width: 95%;
  background: #1e272e;
  border: 3px solid #ff4757;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(255, 71, 87, 0.5);
}

.incoming-call-view {
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  color: #ffffff;
  text-align: center;
}

.call-avatar-pulse {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #ff4757;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  animation: pulse-ring 1.2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
  70% { box-shadow: 0 0 0 25px rgba(255, 71, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.active-call-view {
  display: none;
  flex-direction: column;
  height: 480px;
  background: #000000;
  position: relative;
}

.active-call-feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: #ffffff;
  text-align: center;
  font-size: 22px;
  line-height: 1.6;
  position: relative;
}

.webcam-noise {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 71, 87, 0.08) 0%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

.tomato-cam-label {
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: #ff4757;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cam-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ff4757;
  animation: rec-blink 1s infinite;
}

@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Memory Saving Sequence Overlay */
.saving-seq-card {
  padding: 16px;
  background: #2f3542;
  border: 1px solid #57606f;
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 85%;
  animation: seq-appear 0.4s ease-out;
}

@keyframes seq-appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================================================
   PHASE 19: FINAL COMPLETE SCREEN
   ================================================== */
#screen-ending {
  background: #000000;
  color: #ffffff;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  font-family: var(--font-retro);
  z-index: 110000;
}

.ending-content {
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.ending-dedication {
  font-family: var(--font-pixel);
  font-size: 26px;
  color: #ff4757;
  letter-spacing: 2px;
}

.ending-quote {
  font-size: 22px;
  color: #ced6e0;
  font-style: italic;
  line-height: 1.5;
}

.ending-badge {
  margin-top: 20px;
  padding: 10px 24px;
  border: 2px solid #2ed573;
  color: #2ed573;
  font-family: var(--font-pixel);
  font-size: 16px;
}

/* ==================================================
   PUZZLE & MINI-GAME STYLES
   ================================================== */
.tag-btn {
  background: #eef1f5;
  border: 1px solid #ced6e0;
  color: #2f3542;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-btn:hover {
  background: #2ed573;
  color: #ffffff;
  border-color: #26af5f;
}

.diff-spot-target:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.5);
}

.video-memory-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.match-left-item:hover, .match-right-item:hover {
  transform: translateX(2px);
}

.locked-contact {
  opacity: 0.75;
}
.locked-contact:hover {
  background-color: #f1f2f6 !important;
}

.ending-line {
  font-family: var(--font-retro);
  letter-spacing: 1px;
}

/* ==================================================
   MOBILE RESPONSIVE OVERRIDES FOR COMPONENTS & PUZZLES
   ================================================== */
@media (max-width: 768px), (max-height: 560px), (pointer: coarse) {
  /* Memories Archive */
  .memories-container {
    flex-direction: column;
  }
  .memories-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid #ced6e0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    gap: 6px;
  }
  .memories-sidebar > div:not(.memories-counter) {
    display: none;
  }
  .memories-counter {
    margin-bottom: 0;
    font-size: 13px;
  }
  .memories-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    padding: 8px;
  }
  .memory-card-icon {
    padding: 8px 4px;
  }
  .mem-icon-badge {
    font-size: 26px;
    margin-bottom: 2px;
  }
  .mem-title-text {
    font-size: 12px;
  }
  .mem-date-tag {
    font-size: 10px;
  }

  /* Photo Viewer */
  .photo-viewer-container {
    padding: 8px;
  }
  .photo-card-frame {
    padding: 8px;
    overflow-y: auto;
  }
  .photo-placeholder {
    max-width: 100%;
    padding: 12px;
    max-height: 85%;
  }
  .boarding-pass {
    width: 98%;
    padding: 10px;
    font-size: 13px;
  }
  .boarding-pass-stamp {
    font-size: 18px;
    padding: 4px 8px;
    top: 25%;
    right: 8%;
  }

  /* Metro Map */
  .metro-map-container {
    padding: 10px;
  }
  .metro-track {
    padding: 10px 6px;
  }
  .station-circle {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }
  .station-name {
    font-size: 11px;
    text-align: center;
  }

  /* Fragment & Sequence Puzzles */
  .fragments-container {
    padding: 10px;
    gap: 8px;
  }
  .fragment-slot {
    padding: 8px 10px;
  }
  .fragment-slot > div:nth-child(2) > div:first-child {
    font-size: 14px !important;
  }
  .fragment-order-btns .retro-btn {
    min-width: 48px;
    min-height: 44px;
    font-size: 18px;
    padding: 6px 12px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Photo Match Puzzle */
  .match-columns-grid {
    gap: 6px;
  }
  .match-left-item, .match-right-item {
    font-size: 12px !important;
    padding: 8px 8px !important;
    min-height: 46px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Video Memory Challenge */
  .video-memory-grid {
    gap: 6px !important;
  }
  .video-memory-card {
    padding: 8px 4px !important;
    min-height: 70px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Brazil vs Argentina */
  .match-screen-container {
    padding: 14px;
    gap: 14px;
  }
  .match-teams {
    gap: 14px;
  }
  .team-card {
    padding: 12px 16px;
    min-width: 95px;
  }

  /* Video Call */
  .call-window {
    width: 96vw;
    max-height: 94dvh;
  }
  .incoming-call-view {
    padding: 24px 14px;
  }
  .active-call-feed {
    padding: 16px;
    font-size: 18px;
  }
  .saving-seq-card {
    width: 96%;
    padding: 10px 8px;
  }

  /* Ending Screen */
  #screen-ending {
    padding: 20px 14px;
  }
  .ending-dedication {
    font-size: 20px;
  }
  .ending-quote {
    font-size: 16px;
  }
}

/* ==================================================
   SHWAPNIL FIGHT MOBILE ARENA & TOUCH CONTROLS
   ================================================== */
.fight-touch-btn {
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.08s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.fight-touch-btn:active {
  transform: scale(0.92);
}

#joystick-zone {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Portrait Mobile Layout: Handheld Console View (Screen on top, Controls below) */
@media (max-width: 820px) and (orientation: portrait) {
  #win-shwapnil_fight_showdown {
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  #win-shwapnil_fight_showdown .window-body {
    padding: 0 !important;
  }

  #win-shwapnil_fight_showdown .window-inner-frame {
    border: none !important;
  }

  #fight-canvas-box {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    background: #080512 !important;
    overflow: hidden !important;
  }

  #fightGameCanvas {
    width: 100% !important;
    height: auto !important;
    max-height: 48vh !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    border-bottom: 2px solid #ff0077 !important;
  }

  #fightTouchControls {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    flex: 1 !important;
    min-height: 180px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 14px !important;
    background: linear-gradient(180deg, #0e071a 0%, #150926 100%) !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
  }

  #fightDesktopControlsFooter {
    display: none !important;
  }
}

/* Landscape Mobile Layout: Fullscreen Arena with Floating Controls */
@media (orientation: landscape) and (max-height: 600px) {
  #win-shwapnil_fight_showdown {
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  #win-shwapnil_fight_showdown .window-body {
    padding: 0 !important;
  }

  #win-shwapnil_fight_showdown .window-inner-frame {
    border: none !important;
  }

  #fight-canvas-box {
    position: relative !important;
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  #fightGameCanvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  #fightTouchControls {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    padding: 10px 16px !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
  }

  #fightDesktopControlsFooter {
    display: none !important;
  }
}


