/* Custom Layout CSS Overrides */

/* Global html and body styles */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #000; /* Black background behind everything */
}

/* Game container and background */
#game-container {
  width: 100vw;
  margin: 0;
  padding: 0;
  box-shadow: none;
  min-height: 100%;
  height: 100%;
  position: relative;
  background: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

#game-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: calc(var(--window-inner-height, 100vh));
  object-fit: cover;
  object-position: center;
  z-index: 0;
  margin: 0;
  padding: 0;
}

/* HUD adjustments */
#hud {
  background-color: rgba(10, 10, 30, 0.8);
  color: #fff;
  border-radius: 0;
  margin: 0;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  width: 100vw;
  box-sizing: border-box;
}

.stat-label {
  color: #f8f8f8;
}

.stat-value {
  color: #f8cb4c;
  font-weight: bold;
}

.stat {
  font-size: 0.7rem;
  margin: 4px 8px;
  flex: 1 1 40%;
}

.stat:nth-child(5) {
  flex: 1 1 100%;
  text-align: left;
}

#conviction-bar-container {
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) inset;
  height: 12px;
  margin-left: 5px;
  width: 100%;
}

#conviction-bar {
  background-color: #f8cb4c;
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.7);
  height: 100%;
}

#conviction-value {
  color: #000;
  text-shadow: 0 0 2px #fff;
}

/* Game area adjustments */
#game-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  min-height: 50%;
  width: 100vw;
  z-index: 2;
}

#saylor-container {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding-left: 20px;
  align-items: flex-end;
  line-height: 0;
  max-height: 40vh;
}

#saylor-image {
  display: block;
  max-width: 65%;
  height: auto;
  max-height: 45vh;
  margin: 0;
  padding: 0;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
  vertical-align: bottom;
}

#speech-bubble {
  position: absolute;
  top: -60px;
  right: 5%;
  left: auto;
  transform: translateX(0);
  background-color: #fff;
  border: 2px solid #f8cb4c;
  border-radius: 20px;
  padding: 15px 20px;
  min-width: 250px;
  max-width: 75%;
  text-align: left;
  z-index: 10;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  font-weight: bold;
  color: #00008B;
  line-height: 1.4;
  font-size: 0.8rem;
}

#speech-bubble:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 20%;
  transform: translateX(-50%);
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: #fff transparent transparent;
  z-index: 1;
}

#speech-bubble:before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 20%;
  transform: translateX(-50%);
  border-width: 12px 12px 0;
  border-style: solid;
  border-color: #f8cb4c transparent transparent;
  z-index: 0;
}

/* Action container */
#action-container {
  flex-shrink: 0;
  padding: 15px;
  background-color: rgba(10, 10, 30, 0.8);
  border-radius: 0;
  margin: 0;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
  z-index: 2;
  width: 100vw;
  box-sizing: border-box;
}

#action-container h3 {
  margin-bottom: 10px;
  text-align: center;
  color: #f8f8f8;
  font-size: 0.8rem;
}

/* Action Buttons - White Card Design */
#actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: auto;
  max-width: 600px;
  margin: 0 auto;
  perspective: 600px;
}

.action-btn {
  padding: 10px 15px;
  padding-right: 19px;
  position: relative;
  background-color: #231F3B;
  color: #f8cb4c;
  font-size: 15px;
  font-weight: bold;
  border: 3px solid #000;
  transform: perspective(800px) rotateX(0deg) translateZ(0);
  transition: all 0.3s ease;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 85%,
    95% 100%,
    0 100%
  );
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.3),
    inset 0 0 0 2px rgba(248, 203, 76, 0.2);
  overflow: visible;
  text-align: left;
}

/* Bitcoin symbol in corner */
.action-btn::before {
  content: "₿";
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 14px;
  transform: rotate(15deg);
  opacity: 0.7;
  color: #f8cb4c;
}

/* Remove the different left borders for each action type */
.action-btn[id="action-1"],
.action-btn[id="action-2"],
.action-btn[id="action-3"] {
  border-left: 3px solid #000;
}

/* Hover state */
.action-btn:hover {
  background-color: #302C4D;
  color: #ffde80;
  transform: perspective(800px) rotateX(2deg) translateY(-3px) translateZ(0);
  box-shadow: 
    0 7px 10px rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px rgba(248, 203, 76, 0.4);
  text-shadow: 0 0 5px rgba(255, 222, 128, 0.5);
}

/* Selected state */
.action-btn.selected {
  transform: perspective(800px) rotateX(4deg) translateY(-5px) translateZ(0) scale(1.03);
  box-shadow: 
    0 10px 15px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px rgba(248, 203, 76, 0.6),
    0 0 10px rgba(248, 203, 76, 0.4);
  border-color: white;
  z-index: 10;
}

/* Not selected state */
.action-btn.not-selected {
  opacity: 0.6;
  transform: perspective(800px) rotateX(0deg) translateY(0) scale(0.97);
  filter: saturate(0.7);
}

/* Calendar Animation */
#calendar-animation,
#date-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: calc(var(--window-inner-height, 100vh));
  background-color: rgba(10, 10, 30, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

#calendar-animation.hidden,
#date-transition-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Headlines for date transition */
#headlines {
  width: 80%;
  max-width: 600px;
  margin-top: 30px;
  text-align: center;
}

.headline {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  margin: 10px 0;
  border-radius: 5px;
  animation: headline-slide-in 0.5s ease-out forwards;
  font-size: 14px;
}

.headline.fade-out {
  animation: headline-fade-out 0.5s ease-in forwards;
}

/* Action Result Popup */
#action-result-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: calc(var(--window-inner-height, 100vh));
  background: rgba(10, 10, 30, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5vh;
  z-index: 2000;
  overflow: hidden;
  padding: 20px;
  perspective: 1000px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

#action-result-popup.visible {
  opacity: 1;
  visibility: visible;
  animation: popupAppear 0.3s ease forwards;
}

#action-effect-description {
  background: #fff;
  border: 4px solid #000;
  border-radius: 0;
  padding: 15px 20px;
  color: #000;
  font-size: 1rem;
  text-align: center;
  margin: 0;
  width: 90%;
  max-width: 350px;
  position: relative;
  transform: translateY(0);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.4;
  min-height: fit-content;
}

#action-effect-description::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f8cb4c;
  z-index: -1;
  transform-origin: left;
  animation: mangaSlide 0.5s ease-out forwards;
}

#action-effect-description::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* Conviction change indicator */
#conviction-change-indicator {
  position: relative;
  background: #fff;
  border: 3px solid #000;
  padding: 8px 12px;
  border-radius: 8px;
  margin: -15px auto 10px auto;
  z-index: 10;
  font-weight: bold;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

#conviction-change-indicator.positive {
  background: #d4ffda;
  border-color: #2ecc71;
  color: #27ae60;
}

#conviction-change-indicator.negative {
  background: #ffe5e5;
  border-color: #e74c3c;
  color: #c0392b;
}

#conviction-change-indicator.neutral {
  background: #f5f5f5;
  border-color: #95a5a6;
  color: #7f8c8d;
}

#popup-calendar-container {
  width: 90%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
  margin: 0;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
  border: 3px solid #f8cb4c;
}

#popup-calendar-container canvas {
  width: 100% !important;
  height: 100px !important;
  margin: 0;
  background: #fff;
  border-radius: 4px;
  padding: 5px;
  border: 2px solid #000;
}

#popup-calendar-container .summary-text {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #000;
  text-align: center;
}

#popup-headlines {
  display: none;
}

#popup-headlines-container {
  display: flex;
  flex-direction: row;
  position: absolute;
  white-space: nowrap;
}

.popup-headline {
  background: #fff;
  border: 4px solid #000;
  border-radius: 0;
  padding: 8px 15px;
  margin: 0 10px;
  color: #000;
  display: inline-block;
  text-align: center;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: normal;
  max-width: 90%;
  word-wrap: break-word;
  line-height: 1.4;
  flex-shrink: 0;
}

/* Add manga-style effects */
.popup-headline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f8cb4c;
  z-index: -1;
  transform-origin: left;
}

.popup-headline::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}

#continue-button {
  background: #f8cb4c;
  color: #00008B;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 15px 35px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin: 0;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 90%;
  max-width: 350px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

#continue-button:hover, #continue-button:focus {
  background: #ffdc73;
}

/* Calendar page ornaments/design elements */
.calendar-page:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%);
  pointer-events: none;
  z-index: 5;
}

.calendar-page .page-corners:before,
.calendar-page .page-corners:after,
.calendar-page .page-corners span:before,
.calendar-page .page-corners span:after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #f8cb4c;
  z-index: 6;
}

.calendar-page .page-corners:before {
  top: 10px;
  left: 10px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.calendar-page .page-corners:after {
  top: 10px;
  right: 10px;
  border-top: 2px solid;
  border-right: 2px solid;
}

.calendar-page .page-corners span:before {
  bottom: 10px;
  left: 10px;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.calendar-page .page-corners span:after {
  bottom: 10px;
  right: 10px;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

/* Popup date and price display */
.popup-date {
  font-size: 1rem;
  margin-right: 5px;
}

.popup-price {
  font-size: 1rem;
  color: #F7931A;
  font-weight: bold;
  display: inline-block;
}

/* Helper classes */
.hidden {
  display: none !important;
  visibility: hidden !important;
}

/* Animations */
@keyframes popupAppear {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes headline-slide-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes headline-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes mangaSlide {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
} 