@import url('https://fonts.googleapis.com/css2?family=Jokerman&display=swap');

body{
  margin:0;
  background:#000;
  overflow:hidden;
  font-family: 'Courier New', monospace;
  color:#fff;
}

canvas{
  display:block;
  background: #1a1a1a;
}

#perspective-wrapper {
  perspective: 1200px;
}

/* Default 3D view for gameplay */
#game {
  transform: rotateX(50deg);
  box-shadow: 0 35px 35px -15px rgba(0,0,0,0.7);
  transition: transform 0.4s ease-in-out;
}

/* Class for the flat 2D editor view */
#game.editor-layout-view {
  transform: none;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

#toolbar{
  position:absolute;
  left:12px;
  top:12px;
  background:#000;
  padding:12px;
  border-radius:0;
  color:white;
  display:none;
  border:2px solid #fff;
}

button{
  display:block;
  margin:4px 0;
  width:100%;
  border:2px solid #fff;
  background:#000;
  color:#fff;
  font-weight:bold;
  padding:6px;
  cursor:pointer;
  border-radius:0;
  font-family:'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing:0.3px;
}

#menu-title, .logo-text-center {
  font-family: 'Jokerman', 'Courier New', monospace;
  animation: float-title 1.3s ease-in-out infinite alternate;
  color: #fff;
  font-size: 2.2rem;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

@keyframes float-title {
  from { transform: translateY(-4px); }
  to { transform: translateY(4px); }
}

button:hover{
  background:#fff;
  color:#000;
}

button.active{
  background:#fff;
  color:#000;
  border-color:#fff;
  text-shadow:none;
}

#properties {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #000;
  padding: 10px;
  border-radius: 0;
  color: #fff;
  width: 180px;
  text-align: left;
  border: 2px solid #fff;
  display: none;
}

.menu-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 600;
  opacity: 1;
}

.menu-card {
  width: min(90vw, 620px);
  max-width: 640px;
  padding: 22px;
  border-radius: 0;
  border: 2px solid #fff;
  background: #000;
  box-shadow: none;
  text-align: center;
  color: #fff;
}


.logo-row { margin-bottom: 4px; }
.logo-text-center { font-family: 'Courier New', monospace; color: #fff; font-size: 2rem; letter-spacing: 1px; }

.flash-btn { background:#000; border:2px solid #fff; color:#fff; font-weight:700; text-transform:uppercase; letter-spacing:0.6px; border-radius:0; }

.menu-subtitle {
  margin: 8px 0 16px;
  color: #a0d6ff;
  font-size: 0.8rem;
}

.menu-buttons {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.menu-buttons button {
  background:#000;
  color:#fff;
  border:2px solid #fff;
  border-radius:0;
  padding:10px;
  cursor:pointer;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.4px;
  box-shadow:none;
}

.menu-buttons button:hover {
  background:#fff;
  color:#000;
}

.menu-window {
  position: fixed;
  left: 50%;
  top: 14%;
  transform: translateX(-50%);
  width: min(96vw, 460px);
  background: #000;
  border: 2px solid #fff;
  border-radius: 0;
  color: #fff;
  z-index: 700;
  box-shadow: none;
  font-family: 'Courier New', monospace;
}

.menu-window.hide { display: none; }
.menu-window-titlebar {
  display: flex;
  justify-content: space-between;
  background: #111;
  border-bottom: 1px solid #fff;
  padding: 8px 10px;
  border-radius: 0;
}
.menu-window-titlebar span { font-weight: 700; font-family: 'Courier New', monospace; }
.menu-window-titlebar button {
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 0;
  cursor: pointer;
}
.menu-window-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}
.menu-window-body label { font-size: 0.9rem; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.menu-window-body input[type=range] { width: 100%; }
.menu-window-body input[type=checkbox] { margin-right: 6px; }

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  background: #000;
  z-index: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
}

#menu {
  z-index: 900;
}

#menu-config-window {
  z-index: 1100;
}

#menu-config-close {
  cursor: pointer;
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  border-radius: 0;
}

.menu-window .menu-window-body input {
  background: #000;
  color: #fff;
  border: 1px solid #fff;
}

#menu.pixel-leave {
  animation: pixelFade 0.4s ease forwards;
}

@keyframes pixelFade {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 0.8; transform: translateY(-2px) scale(0.98); filter: contrast(220%) saturate(0.1); }
  100% { opacity: 0; transform: translateY(-6px) scale(0.96); filter: blur(1px) contrast(250%); }
}

#overlay.hidden { display: none; }

#properties h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #fff;
  padding-bottom: 5px;
  color: #fff;
}

#properties label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: #ccc;
}

#properties input {
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid #fff;
  background: #000;
  color: white;
  padding: 4px;
}

.overlay-hidden {
  display: none;
}

.menu-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  background: rgba(0,0,0,0.85);
}

.menu-card {
  width: min(90vw, 380px);
  padding: 20px;
  background: #000;
  border: 2px solid #fff;
  text-align: center;
  color: #fff;
  border-radius: 0;
}

.menu-card h1 {
  font-size: 2rem;
  margin: 0 0 10px;
  color: #fff;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

.menu-card p {
  margin: 0 0 14px;
  color: #fff;
  font-size: 0.9rem;
}

.menu-card button {
  margin: 6px auto;
  width: 100%;
  max-width: 220px;
  border: 2px solid #fff;
  background: #000;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 0;
  cursor: pointer;
  box-shadow: none;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
}

.menu-card button:hover {
  background: #fff;
  color: #000;
}

#score-board {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 2px;
  padding: 10px;
  background: #000;
  border: 2px solid #fff;
  border-radius: 0;
  z-index: 50;
}

#score-board img {
  width: 30px;
  height: 45px;
  image-rendering: pixelated;
}

.shake-ui {
  animation: shake 0.1s infinite;
}

@keyframes shake {
  0% { transform: translateY(-50%) translate(1px, 1px) rotate(0deg); }
  10% { transform: translateY(-50%) translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translateY(-50%) translate(-3px, 0px) rotate(1deg); }
  30% { transform: translateY(-50%) translate(3px, 2px) rotate(0deg); }
  40% { transform: translateY(-50%) translate(1px, -1px) rotate(1deg); }
  50% { transform: translateY(-50%) translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translateY(-50%) translate(-3px, 1px) rotate(0deg); }
  70% { transform: translateY(-50%) translate(3px, 1px) rotate(-1deg); }
  80% { transform: translateY(-50%) translate(-1px, -1px) rotate(1deg); }
  90% { transform: translateY(-50%) translate(1px, 2px) rotate(0deg); }
  100% { transform: translateY(-50%) translate(1px, -2px) rotate(-1deg); }
}

.drop-zone {
  border: 2px solid #fff;
  border-radius: 0;
  padding: 20px;
  text-align: center;
  color: #fff;
  margin-bottom: 10px;
  font-size: 12px;
  background: #000;
  cursor: pointer;
}

.drop-zone.drag-over {
  border-color: #fff;
  background: #333;
}
