/* ------------------------------
   GENERAL STYLES
------------------------------ */
body {
  margin: 0;
  background: linear-gradient(to bottom right, #f9d4f1, #d0e3ff);
  font-family: 'Press Start 2P', cursive;
  overflow: hidden;
}

/* ------------------------------
   DESKTOP & ICON BAR
------------------------------ */
.desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #d6e5f3;
  padding: 20px;
  box-sizing: border-box;
}

.icon-bar {
  position: absolute;
  top: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: repeat(2, 60px); /* 2 columns of 60px */
  gap: 20px 40px; /* row gap 20px, column gap 40px */
  z-index: 1;
  max-height: 90vh; /* optional to limit height */
  padding-right: 5px; /* for scroll bar space */
}

.icon {
  text-align: center;
  cursor: pointer;
}

.icon-image,
.smile-image {
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
}

.icon-label {
  font-size: 10px;
  margin-top: 5px;
}

/* ------------------------------
   WINDOW BASE STYLES
------------------------------ */
.window {
  position: absolute;
    display: none;     /* Hide by default */
  z-index: 1; /* default */
  width: 80vw;
  max-width: 300px;
  font-size: 10px;
  border: 2px solid black;
  box-shadow: 4px 4px black;
  background: white;
}

.title-bar {
  background: #eee;
  flex-direction: row-reverse; /* swap left & right */
  padding: 6px;  /* smaller top/bottom and left/right padding */
  border-bottom: 2px solid black;
  font-size: 9px;
  display: flex;
  align-items: center; /* vertically center contents */
  justify-content: space-between; /* title on left, buttons on right */
}

.content {
  padding: 15px;
  text-align: center;
}

.window-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  margin-right: 4px;
}

.retro-close {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: black;
  background-color: #ccc;
  border: 2px solid #000;
  padding: 3px;  /* less vertical padding */
  cursor: pointer;
  line-height: 1;
  display: inline-block;
  user-select: none;
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #999;
} 

.retro-close:hover {
  background-color: #999;
  color: white;
}

.advice-buttons button {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  margin: 0 6px 6px 0;
  padding: 6px 8px;
  border: 2px solid black;
  background: #eee;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.advice-buttons button:hover {
  background-color: #ccc;
}



/* ------------------------------
   INDIVIDUAL WINDOW COLORS
------------------------------ */
.window.pink {
  top: 50px;
  left: 190px;
  background: #f449d2;
}


.window.hefty-window {
  top: 70px;
  left: 440px;
  background: #f449d2;
   width: 90vw;       /* make it wider relative to viewport */
  max-width: 450px;  /* or increase max-width */
}

  .window.hefty-eightball {
  top: 70px;
  left: 320px;
  background: #0f0;
  width: 90vw;
  max-width: 500px;
  user-select: none;
  font-family: 'Press Start 2P', monospace;
}

.window.bun {
  top: 60px;
  left: 530px;
  background: #e9f449;
  width: 90vw;       /* make it wider relative to viewport */
  max-width: 600px;  /* or increase max-width */
}

.window.coffee {
  top: 390px;
  left: 590px;
  background: #b29a83;
}

.window.yellow {
  top: 270px;
  left: 480px;
  background: #0ff;
  max-width: 720px;
}

.window.blue {
  top: 350px;
  left: 800px;
  background: #5df3f8;
}

.window.happy {
  top: 280px;
  left: 200px;
  background: #f7eb65;
}

.minimised {
  transform: scale(0.1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* ------------------------------
   BUTTONS
------------------------------ */
button {
  margin: 5px;
  padding: 5px 10px;
  font-size: 10px;
  cursor: pointer;
  border: 2px solid black;
  background: white;
  font-family: 'Press Start 2P', cursive;
  transition: background-color 0.3s ease;
}

button.green {
  background: #39f9a4;
  color: white;
}

button:hover {
  background-color: rgb(31, 31, 31);
  color: #ffffff;
  cursor: pointer;
}

/* ------------------------------
   GAME / UI TEXT
------------------------------ */
.player-controls {
  font-size: 18px;
}

.game-text {
  font-size: 20px;
  line-height: 1.3;
}

.emoji {
  font-size: 32px;
  margin-bottom: 10px;
}

.question {
  font-size: 12px;
  margin: 10px 0;
  font-weight: bold;
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ------------------------------
   SMILEY & TRAIL
------------------------------ */
#bouncing-smile {
  position: absolute;
  width: 55px;
  height: auto;
  pointer-events: auto;
  cursor: pointer;
  z-index: 1000;
  display: none;
}

.trail-smile {
  position: absolute;
  width: 16px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 999;
}

/* ------------------------------
   SMILEY CONTAINER & HOVER
------------------------------ */
.smile-container {
  position: relative;
  display: block;
  width: fit-content;
  height: 100px;
  margin: 0 auto;
}

.smile-container .smile-image {
  display: block;
  width: 100px;
  height: auto;
}

.smile-container .smile-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.smile-container:hover .smile-hover {
  opacity: 1;
}

.smile-container:hover .smile-default {
  opacity: 0;
}

.smile-animated {
  animation: smile-rotate-pause 3s ease-in-out infinite;
}

@keyframes smile-rotate-pause {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(10deg); }
  40%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.smile-container .smile-image-happy {
  display: block;
  width: 100px;
  height: auto;
}

.smile-container .smile-image-happy.smile-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.smile-container:hover .smile-image-happy.smile-hover {
  opacity: 1;
}

.smile-container:hover .smile-image-happy.smile-default {
  opacity: 0;
}

/* ------------------------------
   FOOTER
------------------------------ */
.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #222;
  color: #aaa;
  text-align: center;
  padding: 10px 0;
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  z-index: 1000;
}

/* ------------------------------
   ANIMATED HEART
------------------------------ */
.heart {
  position: fixed;
  top: -40px;
  width: 30px;
  height: 30px;
  pointer-events: none;
  background-image: url('../images/desktop_images/heart.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.8;
  animation-name: fall;
  animation-timing-function: linear;
  animation-duration: 4000ms;
  z-index: 9999;
}

@keyframes fall {
  0% {
    transform: translateY(-40px);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}


.love-animated {
  animation: love-rotate-pause 3s ease-in-out infinite;
}

@keyframes love-rotate-pause {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(0deg); }
  40%  { transform: rotate(0deg); }
  60%  { transform: rotate(-10deg); }
  100% { transform: rotate(0deg); }
}

.sad-heart {
  transition: opacity 0.3s ease;
  opacity: 1;
}

.sad-heart.hide {
  opacity: 0;
}

/* ------------------------------
   RESPONSIVE: MOBILE
------------------------------ */
@media (max-width: 600px) {
  .icon-bar {
    position: relative; /* let it push down content */
    flex-direction: row;
    top: auto;
    left: auto;
    margin: 10px auto;
    gap: 10px;
    justify-content: center;
  }

  .icon-image, .smile-image {
    width: 30px;
    height: 30px;
  }

  .icon-label {
    font-size: 8px;
  }

  .window {
    position: relative; /* allow normal flow */
    width: 90vw;
    max-width: none;
    left: auto !important;
    top: auto !important;
    margin: 20px auto; /* center horizontally and add spacing */
  }

    .desktop {
    display: flex;
    flex-direction: column;
    align-items: left;
    padding: 10px;
    gap: 20px;
    overflow: auto;
  }

}


/* ------------------------------
   HEFTY
------------------------------ */

.hefty-animated {
  animation: bobbing 3s ease-in-out infinite;
}

@keyframes bobbing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.fortune-content {
  background: radial-gradient(circle at center, #2a1a3b, #0e0619);
  color: #f5eaea;
  font-family: 'Press Start 2P', cursive, monospace;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  user-select: none;
  box-shadow:
    inset 0 0 15px #b890ff;
  margin: 10px; /* some spacing from window edges */
}

.fortune-content p.advice-text {
  margin: 15px 0;
  font-size: 14px;
  line-height: 1.4;
  text-shadow: 0 0 6px #d3c1ff;
}

.fortune-content .advice-buttons button {
  background-color: #6a52a0;
  border: 2px solid #8a4fff;
  color: #e9d8ff;
  padding: 10px 14px;
  margin: 6px;
  cursor: pointer;
  font-size: 11px;
  border-radius: 8px;
  box-shadow: 0 0 8px #8a4fff;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.fortune-content .advice-buttons button:hover {
  background-color: #8a4fff;
  color: white;
  box-shadow: 0 0 12px #b890ff;
}

/* Keep your retro close styling as is */
.retro-close {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: black;
  background-color: #ccc;
  border: 2px solid #000;
  padding: 3px;
  cursor: pointer;
  line-height: 1;
  display: inline-block;
  user-select: none;
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #999;
}

.retro-close:hover {
  background-color: #999;
  color: white;
}




/* ------------------------------
   Bun Quiz
------------------------------ */

#quiz-container p {
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

#quiz-container button.quiz-option {
  display: block;
  margin: 6px 0;
  padding: 8px 14px;
  width: 100%;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid #7a5230;
  border-radius: 10px;
  background: #f3e5d1;
  transition: background-color 0.2s ease;
}

#quiz-container button.quiz-option:hover {
  background-color: #d9c5a8;
}


#quiz-result {
  font-size: 1.3rem;
  color: #100f0f;
  padding: 10px;
  text-align: center;        /* Center text and image */
}

#quiz-result p {
  margin-bottom: 12px;       /* Space below the text */
}

#quiz-result img {
  max-width: 200px;          /* Limit image width */
  height: auto;
  border-radius: 12px;       /* Rounded corners */
  box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* subtle shadow */
  margin-top: 10px;
  display: inline-block;
}


#quiz-result button {
  margin-top: 12px;
  padding: 8px 14px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid #7a5230;
  background-color: #f3e5d1;
  transition: background-color 0.2s ease;
}

#quiz-result button:hover {
  background-color: #d9c5a8;
}

.bun-container {
  display: flex;
  align-items: center; /* vertically center the image and buttons */
  gap: 10px; /* space between the image and buttons */
}

.button-group {
  display: flex;
  gap: 10px; /* space between buttons */
}

/* ------------------------------
   Chiptunes
------------------------------ */

.tracker-wrapper {
  font-family: 'Press Start 2P', monospace;
  background: #000;
  color: #0f0;
  padding: 10px;
  border: 2px solid #0ff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 8px;
  overflow-x: auto;
}

.tracker-grid {
  display: grid;
  grid-template-rows: repeat(auto-fit, minmax(20px, auto));
  gap: 4px;
}

.tracker-row {
  display: grid;
  grid-template-columns: 60px repeat(16, 1fr);
  align-items: center;
  gap: 4px;
}

.track-label {
  text-align: right;
  padding-right: 4px;
  color: #0ff;
}

.step {
  width: 16px;
  height: 16px;
  background: #222;
  border: 1px solid #444;
  cursor: pointer;
}

.step.active {
  background: #0ff;
}

.step.playing {
  border: 1px solid #fff;
}


.tracker-controls button {
  font-size: 8px;
  padding: 4px 8px;
  background: #222;
  color: #0ff;
  border: 1px solid #0ff;
  cursor: pointer;
}

.tracker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  font-size: 8px;
}

.tempo-label {
  color: #0ff;
  font-family: 'Press Start 2P', monospace;
}


.tempo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#tempo-slider {
  -webkit-appearance: none;
  width: 120px;
  height: 8px;
  background: #222;
  border: 2px solid #0ff;
  box-shadow: inset -1px -1px 0 #000, inset 1px 1px 0 #0f0;
  cursor: pointer;
  margin-top: 4px;
}

#tempo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 14px;
  background: #0ff;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #000;
  cursor: pointer;
}

#tempo-slider::-moz-range-thumb {
  width: 10px;
  height: 14px;
  background: #0ff;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #000;
  cursor: pointer;
}

.track-label-container {
  display: flex;
  align-items: center;
  gap: 6px;
}
.track-label-container canvas {
  width: 20px;
  height: 20px;
}

.knob {
  cursor: pointer;
  border: 2px solid #0ff;
  background: #000;
  image-rendering: pixelated;
  box-shadow: inset -1px -1px 0 #000, inset 1px 1px 0 #0ff;
  border-radius: 6px;
}




/* ------------------------------
   Magic Eightball
------------------------------ */

 .hefty-animated {
    animation: hefty-strut 3s ease-in-out infinite;
  }

  @keyframes hefty-strut {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
  }



.hefty-eightball-window .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 15px;
}

.hefty-eightball-window .hefty-animated {
  max-width: 140px;
  height: auto;
  user-select: none;
}

.magic-eightball {
  position: relative;
  background: #000;
  border: 6px solid rgb(0, 0, 0);      /* thicker green border */
  border-radius: 50%;
  width: 340px;                 /* bigger circle */
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
box-shadow: -12px 12px 40px rgb(0, 0, 0);
  color: rgb(0, 0, 0);
  font-size: 14px;
  text-align: center;
  padding: 10px;
  user-select: none;
}

/* Inner smaller circle with the answer text */
.magic-eightball > div {
  background: #000;
  border: 4px solid #0f0;
  border-radius: 50%;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f0;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  padding: 15px;
  text-align: center;
  user-select: none;
  animation: orbitingGlow 5s linear infinite;
}

#hefty-ask-btn {
  background: #000;
  border: 2px solid #0f0;
  color: #0f0;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  padding: 12px 25px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}

#hefty-ask-btn:hover {
  background: #0f0;
  color: #000;
}


/* Mystical glowing and floating Hefty */
@keyframes heftyMysticGlow {
  0%, 100% {
    filter: drop-shadow(0 0 5px #0f0);
    transform: translateY(0) rotate(0deg);
  }
  50% {
    filter: drop-shadow(0 0 20px #0f0);
    transform: translateY(-6px) rotate(3deg);
  }
}
.hefty-animated-8ball {
  animation: heftyMysticGlow 3s ease-in-out infinite;
  transition: filter 0.3s ease;
  user-select: none;
}

/* Shake animation for the eightball */
@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-5px, 0) rotate(-10deg); }
  40% { transform: translate(5px, 0) rotate(10deg); }
  60% { transform: translate(-5px, 0) rotate(-10deg); }
  80% { transform: translate(5px, 0) rotate(10deg); }
}

/* Fade-in for answer text */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.magic-eightball.shaking {
  animation: shake 0.5s ease-in-out;
}


@keyframes swirlFadeInText {
  0% {
    opacity: 0;
    transform: rotate(-540deg) scale(0.3) translateY(10px);
  }
  60% {
    opacity: 1;
    transform: rotate(20deg) scale(1.05) translateY(-3px);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg) scale(1) translateY(0);
  }
}

.answer-text.fade-in {
  animation: swirlFadeInText 1s ease-out forwards;
  display: inline-block;
  opacity: 0;
  transform-origin: center;
}


@keyframes orbitingGlow {
  0% {
    box-shadow: inset -8px -8px 15px #0f0;
  }
  25% {
    box-shadow: inset 8px -8px 25px #0f0;
  }
  50% {
    box-shadow: inset 8px 8px 20px #0f0;
  }
  75% {
    box-shadow: inset -8px 8px 25px #0f0;
  }
  100% {
    box-shadow: inset -8px -8px 15px #0f0;
  }
}
