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

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e27cb4;
  perspective: 1000px; /* Important for 3D */
  min-height: 100vh;
  background: #111;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 800px;
  padding: 3rem;
  padding-bottom: 5rem; /* Extra space at bottom */
}

header,
main {
  width: 100%;
  margin-bottom: 2rem;
}

h1 {
  font-size: 5rem;
  margin-bottom: 1rem;
  display: inline-block; /* required for transforms */
  transform-style: preserve-3d;
  transform-origin: center center;
}

/* Optional styling utilities */
.bold { font-weight: bold; }
.underline { text-decoration: underline; }
.red { color: rgb(255, 0, 0); }
.large-text { font-size: 1.25rem; }

#generate-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  margin-bottom: 1rem;
  margin-top: 150px; 

  background:
    radial-gradient(circle at 30% 30%, #ff4d4d, #b30000 60%, #7a0000 100%);
  
  box-shadow:
    inset 0 6px 10px rgba(255, 255, 255, 0.3),
    inset 0 -10px 20px rgba(0, 0, 0, 0.5),
    0 10px 20px rgba(0, 0, 0, 0.6);

  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}

/* Pressed state */
#generate-btn:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.2),
    inset 0 -6px 12px rgba(0, 0, 0, 0.6),
    0 4px 10px rgba(0, 0, 0, 0.6);
}

/* Optional: subtle pulse to draw attention */
#generate-btn:hover {
  filter: brightness(1.05);
}

#output {
  font-size: 1.5rem;
  min-height: 2rem;
  margin-bottom: 2rem;
}

#game {
  margin-top: 3rem;
  width: 100%;
}

#game-instructions {
  color: #aaa;
  margin-bottom: 16px;
  font-size: 14px;
}

#game-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

#reaction-box {
  width: 120px;
  height: 120px;
  background: #444;
  cursor: pointer;
  transition: background 0.2s ease;
}

#stats {
  text-align: left;
  font-size: 14px;
  color: #eee;
}

#current-time {
  font-size: 18px;
  margin-bottom: 12px;
}

#highscore .title {
  font-size: 12px;
  color: #888;
  text-transform: lowercase;
  margin-bottom: 4px;
}

#best-time {
  font-size: 16px;
}

#fail-message {
  margin-top: 1px;
  color: red;
  font-size: 180px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#draw-controls {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 10px;
  z-index: 1001;
}

#draw-controls button {
  padding: 8px 14px;
  background: #fff;
  color: #111;
  border: 2px solid #111;
  cursor: pointer;
  margin-top: 50px; 

  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;

  transform: rotate(-1deg);
  box-shadow: 2px 2px 0 #111;

  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background 0.1s ease;
}

#draw-controls button:nth-child(2) {
  transform: rotate(1.5deg);
}

#draw-controls button:hover {
  background: #f5f5f5;
}

#draw-controls button:active {
  transform: translate(2px, 2px) rotate(0deg);
  box-shadow: 0 0 0 #111;
}

#draw-controls button.active {
  background: red;
  color: white;
  border-color: red;
}

#draw-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  pointer-events: none; /* IMPORTANT */
}

/* Apply transition to driftable elements */
.content-wrapper * {
  transition: transform 0.15s ease-out;
}


/* Payment button styling */
#payment-btn {
  background: linear-gradient(to bottom, #f2c853, #efcb54);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px #eea141;
  transition: transform 0.1s, box-shadow 0.1s;
}

#payment-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px #cb5b1f;
}

/* Pop-up styling */
#payment-popup {
  display: none; /* hidden by default */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  background: white;
  border: 7px solid red;
  padding: 20px;
  z-index: 2000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  animation: none;
  text-align: center;
  font-family: sans-serif;
  font-size: 18px;
}

/* Flashing effect */
@keyframes flash {
  0%, 100% { border-color: red; }
  50% { border-color: rgb(255, 0, 144); }
}

/* Close button */
#popup-close {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 50px;
  font-weight: bold;
  color: red;
  cursor: pointer;
  user-select: none;
}

/* Name display area - floating above input */
#name-display {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#powered-by-text {
  font-size: 14px;
  color: #888;
  margin: 0;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#current-name {
  font-size: 3rem;
  font-weight: bold;
  color: #e27cb4;
  margin: 0;

  text-shadow:
    0 0 8px rgba(226, 124, 180, 0.6),
    0 0 18px rgba(226, 124, 180, 0.5),
    0 0 30px rgba(226, 124, 180, 0.35),
    0 0 45px rgba(226, 124, 180, 0.25);
}

/* Name input area - closer to other content */
#name-area {
  margin-top: 0rem;
  margin-bottom: 3rem; /* Extra gap at bottom */
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;

  background: rgba(0, 0, 0, 0.6);
  padding: 16px 20px;
  border-radius: 8px;
}

#name-area input {
  padding: 8px 12px;
  font-size: 14px;
  text-align: center;
  border: 2px solid #555;
  border-radius: 4px;
  background: #222;
  color: #fff;
  width: 200px;
}

#name-area input:focus {
  outline: none;
  border-color: #e27cb4;
}

#name-area button {
  padding: 8px 16px;
  cursor: pointer;
  background: #e27cb4;
  color: #111;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.2s;
}

#name-area button:hover {
  background: #ff90c9;
}

#name-area button:active {
  transform: translateY(2px);
}
