@font-face {
  font-family: "Press Start 2P";
  src: url("./fonts/PressStart2P-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Press Start 2P", ui-monospace, Menlo, Consolas, monospace;
  color: #f0e6d0;
}

#letterbox {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#stage {
  position: relative;
  line-height: 0;
}

#render {
  display: block;
  outline: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#hud {
  position: absolute;
  left: 0;
  top: 0;
  width: 640px;
  height: 360px;
  transform-origin: top left;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  image-rendering: pixelated;
  font-size: 8px;
  line-height: 1.6;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: 384px;
  height: 216px;
  min-width: 384px;
  min-height: 216px;
  max-width: 384px;
  box-sizing: border-box;
  padding: 42px 62px 44px;
  background: transparent url("./plaque.png") center / 384px 216px no-repeat;
  border: none;
  text-align: center;
  line-height: 1.45;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.panel.menu, .panel.lobby {
  justify-content: flex-start;
  padding-top: 46px;
  padding-bottom: 56px;
}
.panel h1 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  color: #f0e6d0;
  line-height: 1.4;
  text-shadow: 1px 1px 0 #3e2c20;
}
.panel p { margin: 4px 0 0; text-shadow: 1px 1px 0 #3e2c20; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li {
  position: relative;
  padding: 1px 0 1px 12px;
  color: #f0e6d0;
  text-align: left;
  text-shadow: 1px 1px 0 #3e2c20;
}
.panel li.on { color: #d4942c; }
.panel li .caret {
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  image-rendering: pixelated;
}
.panel .hint, .panel .ver { color: #96836d; font-size: 8px; text-shadow: 1px 1px 0 #3e2c20; }
.panel .ver { display: block; margin-top: 8px; }
.panel .big { font-size: 16px; color: #d4942c; }

#hud[data-screen="practice"],
#hud[data-screen="play"] {
  align-items: stretch;
  justify-content: stretch;
}

.playtop {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font-size: 8px;
  width: 100%;
  box-sizing: border-box;
  color: #f0e6d0;
}
.playtop .score { display: inline-flex; align-items: center; gap: 4px; }
.playtop .gemchip {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.playtop .timer.pulse { color: #c43c3c; }
.playscores {
  position: absolute;
  top: 22px;
  left: 8px;
  display: flex;
  gap: 8px;
  font-size: 8px;
  color: #f0e6d0;
}
.slot0 { color: #c43c3c; }
.slot1 { color: #3c9c54; }
.slot2 { color: #3c6cc4; }
.slot3 { color: #d4942c; }
.panel.lobby li { display: flex; justify-content: space-between; gap: 12px; }
.panel li.you { color: #d4942c; }
.panel li.ghost { opacity: 0.5; }
.panel li.bot { opacity: 0.85; }
.panel .ready {
  width: 8px;
  height: 8px;
  image-rendering: pixelated;
  vertical-align: -1px;
  margin-right: 4px;
}

#overlay {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  font: 12px/1.45 ui-monospace, Menlo, monospace;
  color: #f0e6d0;
  pointer-events: none;
  -webkit-font-smoothing: auto;
}
#overlay[data-open="0"] { visibility: hidden; }
#overlay button, #overlay select, #overlay input, #overlay .debug-launcher { pointer-events: auto; }
.debug-launcher { padding: 4px 8px; background: rgba(62,44,32,.92); cursor: pointer; }
.debug-launcher b { color: #d4942c; }
.debug-launcher em { color: #96836d; font-style: normal; }
.debug-panel {
  margin-top: 6px;
  width: 260px;
  pointer-events: auto;
  background: rgba(62,44,32,.96);
  border: 1px solid #f0e6d0;
  padding: 8px;
}
.debug-group { margin-bottom: 8px; }
.debug-group h3 { margin: 0 0 6px; font-size: 11px; color: #f0e6d0; text-transform: uppercase; }
.debug-field { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.debug-field span { color: #96836d; }
.debug-action { font: inherit; color: inherit; background: #3e2c20; border: 1px solid #f0e6d0; cursor: pointer; }
