@font-face {
  font-family: "Px437 IBM VGA 8x16";
  src: url("./fonts/Web437_IBM_VGA_8x16.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: #05070d;
  color: #f4f7ff;
  font-family: "Px437 IBM VGA 8x16", monospace;
  --text: #f4f7ff;
  --cyan: #20e860;
  --green: #20e860;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(24, 184, 141, 0.14), transparent 38%),
    linear-gradient(180deg, #07101a 0%, #05070d 56%, #030406 100%);
}

canvas {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  image-rendering: auto;
}

.hint {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: min(94vw, 860px);
  color: rgba(244, 247, 255, 0.68);
  font-size: 12px;
  letter-spacing: 0;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.86);
}

.lightning-modal {
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 50%, transparent 50%),
    radial-gradient(circle at 50% 42%, rgba(32, 232, 96, 0.18), transparent 42%),
    radial-gradient(circle at 58% 54%, rgba(32, 232, 96, 0.12), transparent 44%),
    rgba(3, 5, 8, 0.9);
  background-size: 100% 4px, auto, auto, auto;
  backdrop-filter: blur(2px);
  font-family: "Px437 IBM VGA 8x16", monospace;
  overflow: hidden;
}

.lightning-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--lightning-modal-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.92;
  filter: saturate(0.9) brightness(0.62);
}

.lightning-modal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 50%, transparent 50%),
    radial-gradient(circle at 50% 48%, rgba(1, 5, 9, 0.44), rgba(1, 5, 9, 0.9) 72%),
    rgba(0, 0, 0, 0.28);
  background-size: 100% 4px, auto, auto;
}

.lightning-modal.hidden {
  display: none;
}

.lightning-modal--lobby {
  background:
    radial-gradient(circle at 50% 42%, rgba(32, 232, 96, 0.08), transparent 42%),
    rgba(3, 5, 8, 0.42);
  backdrop-filter: none;
}

.lightning-modal__panel {
  position: relative;
  z-index: 2;
  width: 360px;
  box-sizing: border-box;
  padding: 18px 18px 16px;
  color: var(--text);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(32, 232, 96, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(7, 13, 27, 0.98), rgba(4, 6, 14, 0.99)),
    #071018;
  border: 2px solid rgba(32, 232, 96, 0.82);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 56px rgba(0, 0, 0, 0.72),
    0 0 32px rgba(32, 232, 96, 0.28);
}

.lightning-modal--lobby .lightning-modal__panel {
  width: 284px;
  padding: 16px 16px 14px;
  background:
    linear-gradient(180deg, rgba(3, 7, 15, 0.72), rgba(1, 3, 8, 0.8)),
    #03070f;
  border-width: 1px;
  border-color: rgba(32, 232, 96, 0.66);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 14px 32px rgba(0, 0, 0, 0.34),
    0 0 14px rgba(32, 232, 96, 0.14);
}

.lightning-modal__qr {
  display: inline-block;
  padding: 10px;
  background: #fbfdff;
  border: 2px solid var(--green);
  border-radius: 8px;
  box-shadow:
    0 0 0 4px #fbfdff,
    0 0 22px rgba(32, 232, 96, 0.44),
    0 0 48px rgba(32, 232, 96, 0.22);
}

.lightning-modal__qr img,
.lightning-modal__qr canvas {
  display: block;
}

#lightning-status {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.28;
  white-space: pre-line;
  color: var(--green);
  text-shadow: 0 0 12px rgba(32, 232, 96, 0.36);
}

#lightning-timer {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(244, 247, 255, 0.62);
}

.lightning-modal__cancel {
  margin-top: 16px;
  padding: 9px 16px;
  color: var(--text);
  font: 13px "Px437 IBM VGA 8x16", monospace;
  background: linear-gradient(180deg, rgba(32, 232, 96, 0.26), rgba(32, 232, 96, 0.12));
  border: 1px solid rgba(32, 232, 96, 0.66);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 16px rgba(32, 232, 96, 0.18);
}

@media (max-height: 520px) {
  .hint {
    display: none;
  }
}
