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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: radial-gradient(ellipse at center, #10112a 0%, #05050d 70%);
  color: #cfd3ff;
  font-family: 'Press Start 2P', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

.wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
  width: 100%;
}

.screen {
  position: relative;
  width: min(600px, 100%, calc((100vh - 170px) * 600 / 660));
  aspect-ratio: 600 / 660;
  border: 3px solid #2a2d5c;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(77, 255, 122, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  background: #000;
}

/* Effet écran cathodique */
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.help {
  margin: 0;
  font-size: 10px;
  line-height: 2;
  text-align: center;
  color: #7c80b0;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #3a3e78;
  border-radius: 4px;
  background: #15173a;
  color: #e6e8ff;
  font-family: inherit;
  font-size: 9px;
}

/* Jauge de volume */
.volume {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, 100%);
  font-size: 10px;
  color: #7c80b0;
}

.volume button {
  width: 36px;
  height: 36px;
  flex: none;
  font-size: 16px;
  line-height: 1;
  background: #15173a;
  border: 2px solid #3a3e78;
  border-radius: 8px;
  cursor: pointer;
}

.volume button:hover {
  border-color: #4dff7a;
}

.volume input[type='range'] {
  --fill: 80%;
  flex: 1;
  min-width: 0;
  height: 10px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(to right, #4dff7a var(--fill), #15173a var(--fill));
  border: 2px solid #3a3e78;
  border-radius: 6px;
  cursor: pointer;
}

.volume input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 20px;
  background: #e6e8ff;
  border: 2px solid #4dff7a;
  border-radius: 3px;
}

.volume input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 18px;
  background: #e6e8ff;
  border: 2px solid #4dff7a;
  border-radius: 3px;
}

.volume input[type='range']:focus-visible {
  outline: 2px solid #4dff7a;
  outline-offset: 3px;
}

#volume-value {
  width: 5ch;
  text-align: right;
  color: #e6e8ff;
}

.touch {
  display: none;
  gap: 12px;
  width: min(600px, 100%);
}

.touch button {
  flex: 1;
  padding: 18px 0;
  font-family: inherit;
  font-size: 16px;
  color: #e6e8ff;
  background: #15173a;
  border: 2px solid #3a3e78;
  border-radius: 10px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.touch button:active {
  background: #262a60;
}

.touch .fire {
  flex: 1.4;
  color: #4dff7a;
  border-color: #2f8a4a;
}

@media (hover: none) and (pointer: coarse) {
  .touch {
    display: flex;
  }

  .help {
    display: none;
  }

  .screen {
    width: min(600px, 100%, calc((100vh - 200px) * 600 / 660));
  }
}
