/* 
   Y Amanece - Styles
   Dark cinematic design with warm sunrise accents.
*/

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Sunrise palette */
  --sun-gold:    #ffffff;
  --sun-amber:   #ffffff;
  --sun-coral:   #ffffff;
  --sun-rose:    #ffffff;
  --dawn-violet: #ffffff;
  --night-deep:  #000000;
  --night-mid:   #000000;
  --night-soft:  #000000;

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-muted:     rgba(255, 255, 255, 0.5);

  /* Layout */
  --stream-max-width: 1280px;
  --stream-radius: 0;
}

html {
  font-family: Consolas, monospace;
  background: #000000;
  color: #ffffff;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none; /* Hide scrollbar Firefox */
  -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important; /* Hide scrollbar Chrome/Safari/Opera */
  width: 0 !important;
  height: 0 !important;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  background: #000000;
}

html.manifesto-open,
body.manifesto-open {
  overflow-y: auto;
}

.aurora-bg {
  display: none !important;
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top, 24px)) max(20px, env(safe-area-inset-right, 20px)) max(16px, env(safe-area-inset-bottom, 16px)) max(20px, env(safe-area-inset-left, 20px));
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.stream-section {
  width: 100%;
  max-width: var(--stream-max-width);
  margin-bottom: 0;
  position: relative;
  z-index: 10; /* Keeps video above sun lines that extend upwards */
}

.stream-wrapper {
  position: relative;
  width: 100%;
}

.stream-glow {
  display: none !important;
}

.stream-frame {
  position: relative;
  width: 100%;
  max-width: 1280px;
  padding-bottom: 56.25%; /* 1280x720 aspect ratio (16:9) */
  border-radius: var(--stream-radius);
  overflow: hidden;
  background: #000000;
  box-sizing: border-box;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}

/* 1px solid pure white border, pixel perfect, strictly inside dimensions (maintaining 1280x720) */
.stream-frame::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid #ffffff;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 3;
}

.stream-frame iframe,
.stream-frame video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.location-section {
  width: 100%;
  max-width: var(--stream-max-width);
  margin-bottom: auto;
  position: relative;
  z-index: 2;
}

.location-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  gap: 16px;
  padding: 0;
  margin-top: 16px;
}

/* Green Live Indicator & Radar Ping */
.location-indicator {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 0px;
}

#radar-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

/* Layout Columns */
.location-left-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 192px;
  flex-grow: 1;
  padding-right: 32px;
  position: relative;
  z-index: 2; /* Above tierra1 (z-index 1), below sun rays (z-index 5) */
  user-select: text;
  -webkit-user-select: text;
}

/* Location Display Block (Non-clickable, text selectable) */
.location-display {
  display: flex;
  flex-direction: column;
  gap: 16px;
  user-select: text;
  -webkit-user-select: text;
}

.current-location-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.location-label {
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}

.live-tag {
  color: #00FF7F;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.location-name {
  font-family: Consolas, monospace;
  font-size: 20px;
  font-weight: 400;
  font-style: normal;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin: 0;
}

.next-location-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.next-label,
.next-name {
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.next-label {
  text-transform: uppercase;
}

.next-label.recalculating {
  letter-spacing: 0.15em;
  color: var(--text-muted);
  animation: pulse-recalc 1.8s ease-in-out infinite;
}

@keyframes pulse-recalc {
  0%, 100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1.0;
  }
}

/* Branding */
.branding {
  text-align: left;
  padding: 0;
  margin-top: 16px;
  cursor: pointer;
  user-select: none;
  display: inline-block;
  align-self: flex-start;
}

.brand-text {
  font-family: Consolas, monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: lowercase;
  white-space: nowrap;
  color: #ffff00;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.3s ease;
}

.branding:hover .brand-text,
.branding.active .brand-text {
  color: #ffff00;
  opacity: 0.85;
}

.brand-arrow {
  display: none;
}

/* Animation Area Styles */
.animation-area {
  position: relative;
  width: 256px;
  height: 192px;
  flex-shrink: 0;
  margin-left: auto;
}

.pixel-anim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* Sun Canvas - 12 pixel-perfect rays with zero anti-aliasing */
#sun-canvas {
  position: absolute;
  top: -442px;
  left: -606px;
  width: 1050px;
  height: 820px;
  pointer-events: none;
  z-index: 5; /* Behind video (z-index 10), above text (z-index 2) */
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Smartphone layout */
@media (max-width: 640px) {
  #app {
    padding-top: max(32px, calc(env(safe-area-inset-top, 0px) + 14px));
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .location-left-column {
    min-width: 0;
    height: 192px;
    min-height: 192px;
    justify-content: flex-start;
    padding-right: 8px;
  }

  .location-display {
    gap: 12px;
  }

  .current-location-block {
    width: calc(100vw - 78px);
    margin-right: -128px;
  }

  .next-location-block {
    width: calc(100vw - 180px);
    min-width: 165px;
    margin-right: -128px;
    gap: 0;
  }

  .next-prefix,
  .next-timer-group {
    display: block;
    white-space: nowrap;
  }

  .branding {
    position: absolute;
    bottom: 0;
    left: 0;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
  }

  .brand-arrow {
    display: inline-block;
    color: var(--text-muted);
    font-size: 13px;
    margin-left: 6px;
    line-height: 1;
    vertical-align: middle;
    text-decoration: none !important;
  }

  .branding.active .brand-arrow {
    display: none;
  }

  .animation-area {
    width: 128px;
    height: 192px;
  }

  .animation-area::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 128px;
    height: 1px;
    background: #ffffff;
    z-index: 2;
    pointer-events: none;
  }

  .pixel-anim {
    top: auto;
    left: auto;
    bottom: 0;
    right: 0;
    width: 128px;
    height: 64px;
  }

  #sun-canvas {
    top: -390px;
    left: -678px;
  }
}


/* DEBUG BADGE */
.debug-badge {
  color: #FFD700;
  font-weight: bold;
  font-size: 1.2rem;
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 1000;
  pointer-events: none;
}

/* CLICK GLOW ANIMATION */
@keyframes click-glow {
  0%   { background-color: #333333; }
  50%  { background-color: #bbbbbb; }
  100% { background-color: #333333; }
}

.clicked-glow {
  animation: click-glow 1s ease-in-out 5;
}

/* DEBUG COLUMNS */
.col-name {
  flex: 2;
  display: flex;
  flex-direction: column;
}

.wheel-container.unfolded .col-name {
  flex-direction: row;
  align-items: baseline;
  gap: 16px;
}

.col-platform {
  flex: 1;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  display: none;
}

.col-link {
  flex: 1;
  font-size: 14px;
  text-align: right;
  display: none;
  padding-right: 15px;
}

.col-link a {
  color: #4da6ff;
  text-decoration: none;
}

.col-link a:hover {
  text-decoration: underline;
}

.wheel-container.unfolded .col-platform,
.wheel-container.unfolded .col-link {
  display: block;
}

.wheel-container.unfolded .item-text {
  width: 100%;
}

/* ==========================================================================
   Manifesto / Information Unfold Section
   ========================================================================== */

.manifesto-section {
  width: 100%;
  max-width: var(--stream-max-width);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease, margin 0.6s ease;
  pointer-events: none;
  margin-top: 0;
  position: relative;
  z-index: 2;
}

.manifesto-section.unfolded {
  max-height: 35000px;
  opacity: 1;
  pointer-events: auto;
  margin-top: 56px;
  margin-bottom: 64px;
}

.manifesto-inner {
  width: 100%;
  max-width: 820px;
  padding-top: 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Language selector above text on the right */
.manifesto-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 24px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.lang-btn {
  background: none;
  border: none;
  padding: 3px 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  transition: color 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
}

.lang-btn:hover {
  color: #ffffff;
}

.lang-btn.active {
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid #ffffff;
}

.lang-slash {
  color: var(--text-muted);
  user-select: none;
}

.manifesto-content p {
  font-family: Consolas, monospace;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

/* Credits Section */
.manifesto-credits {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.credit-item {
  display: flex;
  flex-direction: column;
}

.credit-author-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  cursor: pointer;
  font-family: Consolas, monospace;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  width: fit-content;
  transition: color 0.2s ease;
}

.credit-author-btn:hover {
  color: #00FF7F;
}

.credit-author-btn .author-name {
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.credit-author-btn:hover .author-name {
  border-bottom-color: #00FF7F;
}

.credit-arrow {
  font-size: 12px;
  display: inline-block;
  transition: transform 0.3s ease;
  user-select: none;
}

.credit-author-btn.expanded .credit-arrow {
  transform: rotate(180deg);
}

.credit-unfold {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, margin 0.4s ease;
}

.credit-unfold.unfolded {
  max-height: 25000px;
  opacity: 1;
  margin-top: 16px;
  margin-bottom: 12px;
}

.credit-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
}

.credit-photo-wrap {
  flex-shrink: 0;
}

.credit-photo {
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: block;
  background: #111111;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.credit-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-top: 4px;
}

.credit-external-link {
  color: #4da6ff;
  text-decoration: none;
  font-size: 14px;
  font-family: Consolas, monospace;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.credit-external-link:hover {
  color: #99ccff;
  text-decoration: underline;
}

.credit-thoughts-btn {
  background: none;
  border: none;
  padding: 0;
  color: #4da6ff;
  cursor: pointer;
  font-family: Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.credit-thoughts-btn:hover {
  color: #99ccff;
  text-decoration: underline;
}

.credit-thoughts-unfold {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, margin 0.4s ease;
  width: 100%;
  scroll-margin-top: 40px;
}

.credit-thoughts-unfold.unfolded {
  max-height: 25000px;
  opacity: 1;
  margin-top: 24px;
  padding: 0;
  border: none;
  background: transparent;
}

.thoughts-text {
  width: 100%;
}

.thoughts-text p {
  font-family: Consolas, monospace;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}


.thoughts-text p:last-child {
  margin-bottom: 0;
}

.credit-support {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.credit-pamm-link {
  color: var(--text-primary);
  text-decoration: underline;
  transition: color 0.2s ease;
  margin-left: 4px;
}

.credit-pamm-link:hover {
  color: #00FF7F;
}

@media (max-width: 640px) {
  .credit-card {
    flex-direction: column;
    gap: 16px;
  }
  .credit-photo {
    max-width: 100%;
    max-height: 200px;
  }
}
