html {
  -ms-touch-action: none;
}

body,
canvas,
div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

html,
body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;
  cursor: default;
  color: #ddd;
  background: #050505;
  text-align: center;
  font-family: Helvetica, Verdana, Arial, "Microsoft YaHei", sans-serif;
}

#GameDiv {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  margin: 0;
  overflow: hidden;
}

#GameCanvas {
  width: 100%;
  height: 100%;
  background: #000;
  touch-action: none;
}

#status {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 20;
  box-sizing: border-box;
  width: min(420px, calc(100vw - 32px));
  padding: 16px 20px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 218, 120, 0.42);
  border-radius: 10px;
  background: rgba(20, 15, 10, 0.9);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.46);
  color: #ffe7ba;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  white-space: pre-wrap;
}

#status[hidden] {
  display: none;
}

#activationGate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(5, 5, 5, 0.96);
}

.activation-card {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 32px));
  padding: 30px;
  border: 1px solid rgba(255, 218, 120, 0.4);
  border-radius: 8px;
  background: #17130e;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.58);
  text-align: left;
}

.activation-kicker {
  margin-bottom: 10px;
  color: #c49a4c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

.activation-title {
  color: #ffe3a3;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.activation-subtitle {
  margin: 10px 0 24px;
  color: #d8c39a;
  font-size: 14px;
  text-align: center;
}

#activationForm {
  display: grid;
  gap: 10px;
}

.activation-label {
  color: #e7d1a1;
  font-size: 13px;
  font-weight: 700;
}

#activationCode,
#activationSubmit {
  box-sizing: border-box;
  width: 100%;
  border-radius: 6px;
  font: inherit;
}

#activationCode {
  height: 48px;
  border: 1px solid rgba(255, 218, 120, 0.38);
  padding: 0 14px;
  background: #0b0a08;
  color: #fff4d6;
  font-size: 15px;
  letter-spacing: 0.04em;
  outline: 0;
  text-transform: uppercase;
}

#activationCode::placeholder {
  color: #8f8062;
  letter-spacing: 0.02em;
}

#activationCode:focus {
  border-color: #ffd36f;
  box-shadow: 0 0 0 3px rgba(255, 211, 111, 0.16);
}

#activationSubmit {
  height: 48px;
  margin-top: 6px;
  border: 1px solid #d5a951;
  background: #80561b;
  color: #fff2c8;
  cursor: pointer;
  font-weight: 700;
}

#activationSubmit:hover:not(:disabled),
#activationSubmit:focus-visible:not(:disabled) {
  background: #956722;
}

#activationSubmit:disabled {
  cursor: default;
  opacity: 0.62;
}

.activation-message {
  min-height: 20px;
  margin-top: 12px;
  color: #ffcf86;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.activation-device-note {
  margin-top: 18px;
  color: #958565;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 480px) {
  #status {
    width: min(360px, calc(100vw - 28px));
    padding: 14px 16px;
    font-size: 13px;
  }

  .activation-card {
    padding: 24px 20px;
  }

  .activation-title {
    font-size: 26px;
  }
}
