body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #737069;
    color: #000000;
}

main {
    padding: 1rem;
}

#task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 70vh; 
  overflow-y: auto;
  scroll-behavior: smooth;
  z-index: 1000;
}

#task-list li {
  width: 90%;
  max-width: 500px;
  aspect-ratio: 2 / 1; 
  background: url('assets/taskpopupV2.png') no-repeat center center / contain;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  margin: 1rem auto;
  overflow: hidden;
}

button {
    cursor: pointer;
    background: transparent;
}

.image-button {
  width: 100px;
  height: 100px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  text-indent: -9999px;
  background-color: transparent;
  border: none;
}

.task-details {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin: 0;
    width: auto;
    overflow: hidden;
    height: 100%;
    padding-left: 0;
}

.task-actions {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-details span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 2em;
    color: #222;
    text-align: left;
    width: auto;
    padding-left: 1.5em;
    margin-top: 0.5em;
}

.task-text {
    font-size: 2.2em;
    padding: 1em 1.5em 0.5em 1.5em;
    font-weight: normal;
    display: block;
}

.task-coins {
  position: absolute;
  bottom: 25%;
  left: 1.5em;
  font-size: 1.2em;
  color: #444;
}

.task-due {
  position: absolute;
  bottom: 25%;
  left: 65%;
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  font-size: 1.2em;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#add-task-icon {
    width: 200px;
    cursor: pointer;
    z-index: 1000;
    position: relative;
}

#gacha-button {
    position: fixed;
    top: 0;
    right: 1rem;
    width: 300px;
    cursor: pointer;
    z-index: 1000;
}

#rewards-list {
    list-style: none;
    padding: 0;
}

#rewards-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.inventory-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 0.5rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 1rem;
    border-radius: 4px;
    max-height: 80vh;
    overflow-y: auto;
}

#add-task-modal .modal-content {
    background: url('assets/addtodopopupV1.png') no-repeat center/contain;
    width: 600px;
    height: 600px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#add-task-modal input {
    width: 80%;
    margin-bottom: 0.5rem;
    font-size: 2.2em;
    padding: 1em 1.5em;
    background: transparent;
    border: none;
    outline: none;
}

#add-task-modal .input-row {
    display: flex;
    gap: 1em;
    margin-bottom: 0.5rem;
    width: 100%;
    flex-wrap: nowrap;
}

#add-task-modal input#task-time,
#add-task-modal input#task-due {
    width: 33%;
    min-width: 0;
    margin: 0;
    flex: 1 1 0;
}

#add-task-modal input:first-child {
    margin-top: 0em;
}

.start-button {
    background-image: url('assets/startbuttonV1.png');
    order: 2;
    /* right side */
    position: relative;
}

.pause-button {
    background-image: url('assets/pausebuttonV1.png');
    order: 1;
    /* left side */
    position: relative;
}

.done-button {
    background-image: url('assets/donebuttonV1.png');
    order: 2;
    /* right side */
    position: relative;
}

/* Modal button stays absolute for popup */
#add-task-modal button {
    position: absolute;
    top: 40%;
    right: 0;
}

.glob-image {
    z-index: -1;
    position: fixed;
    animation: glob-dance 5s infinite;
    pointer-events: none;
}

@keyframes glob-dance {
    0% { transform: translateX(0); }
    50% { transform: translateX(50vw); }
    100% { transform: translateX(0); }
}

#reward-animation-container {
  width: 300px;
  height: 100px;
  overflow: hidden;
  position: fixed;
  left: 50%;
  top: 20%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: #fff;
  pointer-events: none;
  z-index: -1;
}

.reward-animation-box {
  position: fixed;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 20%;
  width: 300px;
  height: 100px;
  background: url('assets/gachacontainer.png') no-repeat center/contain;
  z-index: 2500;
  pointer-events: none;
}

.reward-row {
  display: flex;
  height: 100%;
  z-index: 1000;
  transition: transform 2s cubic-bezier(0, 0, 0.2, 1);
}

.reward-row img {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  z-index: 1000;

  object-fit: contain;
}

.reward-pop {
  /* should probably put a 100x100px white square behind it to hide the reward row img...*/
  position: fixed;
  width: 100px;
  height: 100px;
  animation: reward-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 3000;
}

@keyframes reward-pop {
  from {
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    transform: translate(-50%, -50%) scale(1.5);
  }
}

#gacha-result {
  position: fixed;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  top: 30%;
  left: 50%;

  transform: translateX(-50%);

  text-align: center;
  font-weight: bold;
  margin-top: 0.5em;
  font-size: 1.5rem;
  z-index: 5000;
  opacity: 0;
}

#gacha-result.show {
  opacity: 1;
  transition: opacity 0.1s ease-in;
}

#gacha-result.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}
