body {
  margin: 0;
  padding: 0;
  background-color: #0b0b1a;
  color: #fff;
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}
#game-container {
  position: relative;
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.2);
  border: 4px solid #333;
  background-color: #050510;
}
canvas {
  display: block;
  image-rendering: pixelated;
  background: linear-gradient(to bottom, #050510 0%, #111128 100%);
  cursor: none;
  touch-action: none;
}
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.overlay-screen {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  background: rgba(5, 5, 16, 0.95);
  padding: 20px;
  pointer-events: auto;
  border: 2px solid #5d275d;
  border-radius: 8px;
  width: 80%;
  max-width: 280px;
  max-height: 85%;
  overflow-y: auto;
}
.overlay-screen::-webkit-scrollbar {
  width: 8px;
}
.overlay-screen::-webkit-scrollbar-track {
  background: #111;
}
.overlay-screen::-webkit-scrollbar-thumb {
  background: #8a3a8a;
  border-radius: 4px;
}

/* Custom scrollbar for EULA text box */
#eulaContent::-webkit-scrollbar {
  width: 6px;
}
#eulaContent::-webkit-scrollbar-track {
  background: #000;
}
#eulaContent::-webkit-scrollbar-thumb {
  background: #ff00ff;
  border-radius: 3px;
}

.overlay-screen > h2 {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #050510;
  margin-top: 0 !important;
  padding-bottom: 5px;
  box-shadow:
    0 -20px 0 20px #050510,
    0 10px 20px 10px #050510;
}

.pixel-title {
  font-size: 20px;
  color: #ff00ff;
  text-shadow: 3px 3px 0px #3e1a5f;
  margin-bottom: 5px;
  line-height: 1.4;
  cursor: pointer;
}
.subtitle {
  font-size: 10px;
  color: #00ffff;
  margin-top: 0;
  margin-bottom: 20px;
}
.menu-text {
  font-size: 9px;
  line-height: 1.8;
  margin-bottom: 15px;
  color: #e0e0e0;
}

.boss-warning {
  display: none;
  position: absolute;
  top: 35%;
  color: #ff4444;
  font-size: 14px;
  text-shadow: 2px 2px 0px #000;
  animation: blink 0.4s infinite alternate;
}
@keyframes blink {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

button {
  background-color: #3e1a5f;
  color: white;
  border: 2px solid #8a3a8a;
  padding: 12px;
  font-size: 10px;
  cursor: pointer;
  margin-top: 10px;
  font-family: inherit;
  width: 100%;
  text-transform: uppercase;
  transition: all 0.2s;
  flex-shrink: 0;
}
button:hover:not(:disabled) {
  background-color: #6a31a1;
  transform: scale(1.02);
}
button:active:not(:disabled) {
  background-color: #ff00ff;
}
button:disabled {
  background-color: #222 !important;
  border-color: #444 !important;
  color: #666 !important;
  cursor: not-allowed;
  transform: none;
}

.sticky-back-btn {
  position: sticky;
  bottom: 0;
  z-index: 100;
  margin-top: 15px;
  margin-bottom: 0;
  box-shadow:
    0 20px 0 20px #050510,
    0 -10px 20px 10px #050510;
}

/* Main Menu Hierarchy */
.play-btn {
  font-size: 14px;
  padding: 16px;
  background-color: #008b8b;
  border: 3px solid #00ffff;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
  animation: pulse-glow 2s infinite alternate;
}
.play-btn:hover:not(:disabled) {
  background-color: #00ffff;
  color: #000;
  text-shadow: none;
}
@keyframes pulse-glow {
  from {
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
  }
  to {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.7);
  }
}

.split-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}
.half-btn {
  margin-top: 10px;
  padding: 10px;
  flex: 1;
}

.icon-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  width: 100%;
  margin-top: 20px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  padding: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #181425;
  border: 2px solid #5d275d;
  border-radius: 4px;
  margin-top: 0;
}
.icon-btn:hover:not(:disabled) {
  border-color: #00ffff;
  background-color: #2d134d;
}

label {
  font-size: 10px;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 10px 0;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  cursor: pointer;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  background: #111;
  color: #fff;
  border: 2px solid #8a3a8a;
  padding: 10px;
  font-family: inherit;
  font-size: 10px;
  width: 90%;
  text-align: center;
  margin-bottom: 10px;
  box-sizing: border-box;
}
input[type="text"],
input[type="email"] {
  text-transform: uppercase;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #00ffff;
}

.stats-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #3e1a5f;
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 4px;
  width: 90%;
}
.shard-display {
  color: #cc66ff;
  font-size: 12px;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 10px;
}
.new-record {
  display: none;
  color: #39ff14;
  font-size: 10px;
  margin-top: -5px;
  margin-bottom: 10px;
  animation: blink 0.3s infinite alternate;
}
button.special {
  background-color: #8b0000;
  border-color: #ff4444;
}
button.special:hover:not(:disabled) {
  background-color: #cc0000;
}
button.shop-btn {
  background-color: #4a0e4e;
  border-color: #cc66ff;
  color: #ffd700;
}

/* Split Layout for Shop */
#shopScreen {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  width: 95%;
  max-width: 480px;
  padding: 15px;
  overflow: hidden;
}
#shopLeftPanel {
  width: 65%;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#shopLeftPanel::-webkit-scrollbar {
  width: 6px;
}
#shopLeftPanel::-webkit-scrollbar-track {
  background: #111;
}
#shopLeftPanel::-webkit-scrollbar-thumb {
  background: #8a3a8a;
  border-radius: 3px;
}

#shopRightPanel {
  width: 32%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 10px;
}

/* Responsive Shop Layout for Mobile */
@media (max-width: 480px) {
  #shopScreen {
    flex-direction: column;
    overflow-y: auto;
  }
  #shopLeftPanel {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
  #shopRightPanel {
    width: 100%;
    position: relative;
    top: 0;
    margin-top: 0;
    margin-bottom: 15px;
    order: -1;
  }
}

/* Item Cards */
.shop-item {
  background: linear-gradient(135deg, #1a0a2a 0%, #2d134d 100%);
  border: 2px solid #8a3a8a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.shop-item:hover {
  transform: translateY(-2px);
  border-color: #00ffff;
}
.shop-item h3 {
  margin: 0 0 5px 0;
  font-size: 10px;
  color: #00ffff;
  text-shadow: 1px 1px 0 #000;
}
.shop-item p {
  margin: 0 0 10px 0;
  font-size: 8px;
  color: #ccc;
  line-height: 1.4;
}
.shop-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.shop-item button {
  width: auto;
  padding: 8px 12px;
  margin: 0;
  font-size: 8px;
}

/* Dialogue Box */
.dialogue-box {
  background: rgba(0, 0, 0, 0.85);
  border: 2px dashed #00ffff;
  border-radius: 8px;
  padding: 12px;
  font-size: 8px;
  color: #fff;
  margin-bottom: 15px;
  line-height: 1.6;
  min-height: 60px;
  cursor: pointer;
  text-align: left;
}
.dialogue-box span {
  color: #ffd700;
  font-size: 6px;
  display: block;
  margin-top: 8px;
  text-align: right;
  animation: blink 1s infinite alternate;
}

#pauseBtn {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 32px;
  color: #fff;
  z-index: 100;
  pointer-events: auto;
  text-shadow: 2px 2px 0 #000;
  transition: transform 0.2s;
}
#pauseBtn:hover {
  transform: scale(1.2);
}

/* Bug Report Button */
#bug-report-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: auto;
  padding: 10px 15px;
  background-color: #1a0a2a;
  color: #ff00ff;
  border: 2px solid #8a3a8a;
  font-size: 8px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
  cursor: pointer;
}
#bug-report-btn:hover {
  background-color: #2d134d;
  border-color: #ff00ff;
  transform: scale(1.05);
}
