/* GLOBALS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body, html {
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: #fff; /* Dark charcoal for a sleek look */
    scroll-behavior: smooth;
    color: #e0e0e0; /* Light grey for text */
}

/* Fullscreen dark background */
.loading-screen {
  position: absolute;
  inset: 0;
  background: #121111;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease;
}

/* Spinner container */
.square-spinner {
  display: grid;
  grid-template-columns: repeat(3, 9px);
  grid-template-rows: repeat(3, 9px);
  gap: 6px;
  transform-origin: center;
  animation: spin 3.8s linear infinite;
}

/* Mini squares */
.square-spinner div {
  width: 10px;
  height: 10px;
  background-color: #64b5f6;
}

/* Spin animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Optional fade-out */
.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}



h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 600;
    color: #ffffff;
}

h2 {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 500;
}

h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #e0e0e0;
}

.news-ticker {
  display: none; /* keep hidden until activated */
  overflow: hidden;
  white-space: nowrap;
  background: #121111; /* matches header */
  color: #e0e0e0; /* light grey text */
  border-bottom: 1px solid #2e2d2d; /* subtle border for depth */
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  padding: 10px 0;
  width: 100%;
  box-sizing: border-box;
  cursor: default; 

}

.ticker-content {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-text 22s linear infinite;
  color: #64b5f6; /* your soft blue accent */
}

.ticker-content strong {
  color: #ffffff;
}

@keyframes scroll-text {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* Optional: pause when hovered for readability */
.news-ticker:hover .ticker-content {
  animation-play-state: paused;
}





.errorMessage {
    color: #ff5252; /* Vibrant red for errors */
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    background-color: #1e1e1e; /* Dark grey background */
    border-radius: 6px;
}

.spacer {
    width: 100%;
    height: 275px;
    box-sizing: border-box;
}

.disableClick {
    pointer-events: none;
}

.tooltip {
    position: fixed;
    background-color: rgba(151, 25, 200, 0.9); /* Darker tooltip */
    border: 1px solid black; /* <-- Added black border */
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    visibility: hidden;
    z-index: 9999;
    
}

.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #2a2a2a;
    border-radius: 6px;
    width: 100%;
    height: 32px;
    margin: 10px auto 0;
}

#timer {
    font-size: 0.9375rem;
    color: #ffffff;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

/* From Uiverse.io by catraco */ 
/*------ Settings ------*/
.muteContainer {
  --color: #a5a5b0;
  --size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: var(--size);
  user-select: none;
  fill: var(--color);
  margin-left: 20px; /* pushes it left from elements on the right */
  margin-right: 20px;

}

.muteContainer .mute {
  position: absolute;
  animation: keyframes-fill .5s;
}

.muteContainer .voice {
  position: absolute;
  display: none;
  animation: keyframes-fill .5s;
}

/* ------ On check event ------ */
.muteContainer input:checked ~ .mute {
  display: none;
}

.muteContainer input:checked ~ .voice {
  display: block;
}

/* ------ Hide the default checkbox ------ */
.muteContainer input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* ------ Animation ------ */
@keyframes keyframes-fill {
  0% {
    transform: rotate(0deg) scale(0);
    opacity: 0;
  }

  50% {
    transform: rotate(-10deg) scale(1.2);
  }
}

/* HEADER */
header {
    display: flex;
    align-items: center;
    background-color: #0c0c0c; /* Darker header */
    color: #ffffff;
    text-align: center;
    padding: 5px 5px;
    justify-content: space-between; /* logo left, nav center, toggles right */
    border-bottom: 1px solid #2e2d2d; /* Slightly lighter border */
}

.logo {
    display: flex;
    align-items: center;
    width: 200px;
    height: 40px;
    margin-right: 12px;
    margin-left: 5px;
    cursor: pointer; /* shows hand icon on hover */
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home {
    margin: 0;
    text-decoration: none; /* Removes the underline */
    color: inherit; /* Uses the color of parent (or set your own) */

}

.navLinks {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 40px;
    list-style-type: none;
    margin-left: auto;
}

.link {
    color: #e0e0e0;
    font-size: 1.125rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.link:hover {
    color: #64b5f6; /* Soft blue accent */
}

.switch {
  font-size: 12px; /* Smaller font if used in label */
  position: relative;
  display: inline-block;
  width: 2.2em;   /* reduced from 3.5em */
  height: 1.2em;  /* reduced from 2em */
  margin-right: 10px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  border: 2px solid #414141;
  border-radius: 50px;
  background-color: grey; /* Initial background */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Toggle ball */
.slider:before {
  position: absolute;
  content: "";
  height: 0.9em;
  width: 0.9em;
  left: 0.15em;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  border-radius: inherit;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

/* When toggled on */
.switch input:checked + .slider {
  background-color: black;
  border-color: #0974f1;
  box-shadow: 0 0 10px rgba(9, 117, 241, 0.6);
}

.switch input:checked + .slider:before {
  transform: translateX(1em) translateY(-50%);
}
  
/* Grid container */
#gridContainer {
  flex: 1;
  width: 100vw;
  overflow: auto;
  position: relative;
  background: transparent; /* Ensure transparent background */
  z-index: 0;
}

/* Canvas for efficient rendering */
#grid {
  position: absolute;
  top: 0;
  left: 0;

  background: transparent; /* Optional, canvas defaults to transparent */
  z-index: 1;
}

/* Info display */
#info {
  position: fixed;
  bottom: 10px;
  left: 10px;
  font-size: 14px;
  color: #333;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 5px 10px;
  border-radius: 3px;
}
  
  /* CONTENT CONTAINER */
.content {
  display: flex;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
  flex: 1;
}

.content.split {
  flex-direction: row;
}

/* checkout */
.payment_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #1e1e1e;
  color: #e0e0e0;
  padding: 10px 20px;
  display: none;
  width: 260px;
  overflow-y: auto;
  position: relative;
  scroll-behavior: smooth;
}

.wrapper {
  margin-bottom: 20px;
  background-color: #2a2a2a;
  color: #e0e0e0;
  padding: 0 20px;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  position: relative;
}

.disableContainer {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  pointer-events: all;
  border-radius: 10px;
  padding: 20px;
  box-sizing: border-box;
  z-index: 100;
}

input[type="range"], input[type="number"] {
  width: 100%;
  font-size: 1rem;
  margin: 0;
  padding: 6px;
  font-family: 'Inter', sans-serif;
}

input[type="range"] {
  height: 8px;
  background: #424242;
  border-radius: 5px;
  accent-color: #64b5f6; /* Blue accent for slider */
}

input[type="range"]:focus {
  outline: none;
}

input[type="number"] {
  width: 70px;
  text-align: center;
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #424242;
  border-radius: 5px;
}

.row, .column, .dialInput {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.dialInput input[type="range"] {
  flex-grow: 1;
}

.addDimension {
  background-color: white;
  color: black;
  border: 1px solid #ccc;
  width: 18px;
  height: 18px;
  font-size: 12px;
  border-radius: 3px;
  line-height: 16px;
  display: inline-block;
  text-align: center;
  padding: 0;
}


.boxInfo {
  margin-top: 8px;
  width: 100%;
  background-color: #333;
  color: #64b5f6; /* Green for info text */
  border-radius: 6px;
  resize: none;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px;
  font-family: 'Inter', sans-serif;
}

#clearSelected {
  width: 100%;
  color: #ffffff;
  text-align: center;
  padding: 12px 0;
  background-color: #424242;
  border: 1px solid #616161;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  height: 8px;
  display:flex;
  align-items: center;
  justify-content: center;
}

#clearSelected:hover {
  background-color: #616161;
}

/* IMAGE AND IMAGE INFO */
#chooseImage {
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#imageLinkInput, #imageDescription {
  margin-top: 12px;
  width: 100%;
  font-size: 0.9375rem;
  resize: none;
  box-sizing: border-box;
  border-radius: 6px;
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #424242;
  padding: 8px;
}

#imageLinkInput:hover, #imageDescription:hover {
  transform: scale(1.02);
}

#uploadImageButton {
  cursor: pointer;
  width: 28px;
  height: auto;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

#uploadImageButton:hover {
  transform: scale(1.1);
}

#imagePreviewContainer {
  position: relative;
  width: 100%;
  height: 150px;
  margin-top: 20px;
  display: none;
  background-color: #333;
  border-radius: 8px;
  padding: 4px;
  box-sizing: border-box;
}

#imagePreviewContainer:hover {
  background-color: #424242;
  transform: scale(1.01);
}

#imagePreview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  justify-content: center;
  box-sizing: border-box;
}

.deleteButton {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: rgba(33, 33, 33, 0.7);
  color: #ffffff;
  font-size: 0.75rem;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  cursor: pointer;
  display: none;
  z-index: 10;
}

#previewGrid {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  background-image: url('images/blocks.png');
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border-radius: 50%;
  background-color: #212121;
  display: none;
}

#addAudioButton {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  background-image: url('images/audioIcon.webp');
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border-radius: 50%;
  background-color: #212121;
  display: none;
}

#selectedAudioFlag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 21px;
  height: 21px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border-radius: 50%;
  background-color:red;
  z-index: -1;
}


#imagePreviewContainer:hover #deleteIcon,
#imagePreviewContainer:hover #addAudioButton,
#imagePreviewContainer:hover #previewGrid {
  display: block;
}

#checkoutButton {
  margin-top: 12px;
  margin-bottom: 10px;
  width: 100%;
  color: #ffffff;
  text-align: center;
  padding: 12px 0;
  background-color: #1976d2; /* Blue accent */
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

#checkoutButton:hover {
  background-color: #1565c0;
}

/* PAYMENT */
#purchaseInfo {
  font-family: monospace;  /* Keeps alignment clean */
  font-size: 13px;          /* Smaller font */ 
  line-height: 1.5;
  height: 115px;
}
#purchaseTab {
  display: none;
}

#purchaseTab:hover #cancelPayment {
  display: block;
}

.payment-methods {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.payment-methods button {
  background-color: #333;
  border: none;
  color: #e0e0e0;
  padding: 10px;
  cursor: pointer;
  border-radius: 6px;
  flex: 1;
  margin-right: 6px;
  transition: background-color 0.2s ease;
}

.payment-methods button.active {
  background-color: #616161;
}

.payment-form {
  display: flex;
  flex-direction: column;
}

.payment-form label {
  margin-bottom: 6px;
  font-size: 0.9375rem;
}

.payment-form input {
  margin-bottom: 16px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background-color: #333;
  color: #e0e0e0;
  font-family: 'Inter', sans-serif;
}

.cc-info {
  margin-bottom: 16px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background-color: #ffffff;
}

#cc-submit {
  background-color: #4caf50; /* Green for submit */
  color: #ffffff;
  border: none;
  padding: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

#cc-submit:hover {
  background-color: #43a047;
}

.hidden {
  display: none;
}

.cc-submit:hover {
  background-color: #5f8d8f; /* Hover effect */
}

.cc-submit:disabled {
  background-color: #616161;
  cursor: not-allowed;
}

.spinner {
  border: 4px solid #f3f3f3;
  display: inline-block;
  border-top: 4px solid #5f8d8f;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  animation: spin 1s linear infinite;
}

.checkmark {
  font-size: 20px;
  color: #81c784; 
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

button {
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.2s ease;
}

.icon-btn-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* RECEIPT/ABOUT */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  max-width: 800px;
  height: auto;
  max-height: 70%;
  background-color: #1e1e1e;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  z-index: 10000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.modal.onShown {
  display: flex;
}

.modalMessage {
  color: #e0e0e0;
  padding: 24px;
  font-size: clamp(0.8rem, 5vw, 1.2rem);
  line-height: 1.6;
  text-align: center;
  width: 100%;
}

.modalMessage p {
  margin: 0;
}

.modalMessage strong {
  color: #64b5f6; /* Red for emphasis */
}

#keyBox {
  background-color: #2a2a2a;
  color: #e0e0e0;
  padding: 16px 32px 16px 24px; /* 24px left for copy button, 32px right for toggle */
  border-radius: 8px;
  margin: 16px 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* Center contents horizontally */
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  min-height: 45px;
}

#keyBox.hidden #keyText {
  color: #616161;
  text-align: center;
}

@keyframes bounceBox {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.05); }
  60%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}

#keyBox.animated {
  animation: bounceBox 0.4s ease;
}

#keyText {
  white-space: nowrap;
  text-align: left;
  cursor: text;
  user-select: text;
  font-size: 1rem;
  flex-grow: 1;
  max-width: calc(100% - 48px);
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
}

#keyText::-webkit-scrollbar {
  display: none;                  /* Chrome, Safari, Opera */
}



#toggleVisibility {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: #e0e0e0;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
}


#toggleVisibility:hover {
  transform: translateY(-50%) scale(1.2);
}

.closeBtn {
  display: inline-block;
  padding: 12px 24px;
  background-color: #64b5f6;
  color: #ffffff;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  user-select: none;
  font-weight: 500;
  margin-top: 16px;
  pointer-events: auto; /* Ensure interactivity */
}

.closeBtn:hover {
  background-color: #2e94e8;
  transform: scale(1.03);
}

.closeBtn:active {
  transform: scale(0.98);
}

#toggleVisibility:hover {
  transform: translateY(-50%) scale(1.2);
}

#copyButton {
  position: absolute;
  left: 8px; /* Smaller padding from the left */
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
  display: none; /* Hidden by default */
  width: 16px;
  height: 16px;
  padding: 0;
  line-height: 0;
}

#copyButton.visible {
  display: inline-block;
}

#copyButton img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none; /* Makes only the span clickable */
}

#copyButton:hover {
  transform: translateY(-50%) scale(1.1);
  color: #ff5252;
}







