* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #120e1a;
  color: #fff4e8;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 2px solid #f2ce94;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
header {
  position: fixed;
  left: 28px;
  right: 28px;
  top: 25px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}
.pill {
  background: #17131b9c;
  border: 1px solid #ffffff26;
  border-radius: 32px;
  backdrop-filter: blur(15px);
  padding: 12px 19px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  font-size: 12px;
}
.brand > span {
  font-family: serif;
  font-size: 23px;
  color: #e6c48e;
}
.brand b {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 2px;
}
.brand i {
  font-style: normal;
  font-size: 11px;
  color: #cebdc9;
  padding-left: 12px;
  border-left: 1px solid #ffffff30;
}
.top-actions {
  display: flex;
  gap: 9px;
}
.welcome {
  position: fixed;
  left: 7%;
  top: 30%;
  max-width: 440px;
  text-shadow: 0 3px 18px #000;
  background: linear-gradient(90deg, #150f1899, transparent);
  padding: 25px;
  border-radius: 10px;
}
.welcome > span {
  color: #dec7a5;
  font-size: 12px;
  letter-spacing: 4px;
}
.welcome h1 {
  font-family: serif;
  font-size: 40px;
  letter-spacing: 3px;
  font-weight: 400;
  line-height: 1.5;
}
.welcome p {
  font-size: 13px;
  color: #e3d4dd;
  margin-bottom: 30px;
}
.welcome button {
  background: #efd0a0;
  color: #332130;
  border-radius: 30px;
  padding: 15px 35px;
  text-shadow: none;
}
.welcome small {
  display: block;
  color: #c6b8c4;
  font-size: 10px;
  margin-top: 20px;
}
#actions {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 7px 15px;
  background: #1c1527a8;
  backdrop-filter: blur(20px);
  border: 1px solid #ffffff3b;
  border-radius: 46px;
  box-shadow: 0 8px 30px #0003;
}
#actions button {
  font-size: 11px;
  min-width: 68px;
  padding: 7px 13px;
  border-radius: 25px;
  display: grid;
  gap: 7px;
  justify-items: center;
  color: #e7dce6;
  white-space: nowrap;
}
#actions button:hover,
#actions button.active {
  background: #e8cb9b25;
  color: #ffe1a3;
}
#actions span {
  font-size: 25px;
  line-height: 1;
}
#location {
  position: fixed;
  left: 30px;
  bottom: 35px;
  pointer-events: none;
}
#location > span {
  font-size: 14px;
  letter-spacing: 2px;
}
#location small {
  display: block;
  font-size: 10px;
  color: #c5b9c8;
  margin-top: 9px;
  max-width: 180px;
  line-height: 1.8;
}
#status {
  position: fixed;
  right: 28px;
  bottom: 36px;
  font-size: 11px;
  max-width: 220px;
  line-height: 1.8;
  color: #dbccdf;
  text-align: right;
  pointer-events: none;
}
#context {
  position: fixed;
  left: 50%;
  bottom: 142px;
  transform: translateX(-50%);
  background: #f1d3a5;
  color: #332031;
  border-radius: 25px;
  padding: 12px 25px;
  font-size: 12px;
  box-shadow: 0 0 30px #0005;
}
#speech {
  position: fixed;
  top: 110px;
  right: 30px;
  width: 300px;
  max-width: 80vw;
  background: #251b2cdb;
  backdrop-filter: blur(18px);
  border: 1px solid #b99b7a88;
  border-radius: 14px 14px 3px 14px;
  padding: 20px 25px;
  box-shadow: 0 12px 50px #0003;
}
#speech b {
  font-size: 13px;
  color: #f0c995;
}
#speech p {
  font-size: 13px;
  line-height: 1.9;
  color: #eee0ed;
  margin-bottom: 0;
}
#speech-close {
  position: absolute;
  right: 8px;
  top: 5px;
  font-size: 18px;
  color: #c4b3c4;
}
#loading {
  position: fixed;
  inset: 0;
  background: #17111e;
  z-index: 20;
  display: grid;
  place-content: center;
  text-align: center;
  transition: opacity 0.5s;
}
#loading > span {
  font-size: 70px;
  color: #efd0a0;
  font-family: serif;
}
#loading h1 {
  font-family: serif;
  font-weight: 400;
  letter-spacing: 7px;
  font-size: 26px;
}
#loading p {
  font-size: 12px;
  color: #c6b1c4;
  letter-spacing: 4px;
}
dialog {
  width: 440px;
  max-width: 90vw;
  border: 1px solid #b29773;
  border-radius: 16px;
  background: #241a2b;
  color: #f3e5d8;
  padding: 30px;
}
dialog::backdrop {
  background: #0a0612aa;
  backdrop-filter: blur(9px);
}
#close-modal {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 24px;
}
dialog h2 {
  font-family: serif;
  font-weight: 400;
  letter-spacing: 2px;
}
dialog p {
  line-height: 1.9;
  font-size: 13px;
  color: #d2bdce;
}
.primary,
.upload {
  display: block;
  background: #e8c99b;
  color: #322035;
  border-radius: 6px;
  padding: 13px;
  width: 100%;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}
.upload input {
  display: none;
}
.secondary {
  border: 1px solid #886d83;
  border-radius: 6px;
  padding: 11px;
  width: 100%;
  margin-top: 10px;
  color: #dac4d6;
}
.chat-input {
  background: #160f1b;
  color: white;
  border: 1px solid #806378;
  border-radius: 5px;
  width: 100%;
  padding: 13px;
  margin-top: 10px;
}
.reply {
  font-size: 12px;
  color: #f1d3a5;
  line-height: 1.8;
}
#move-pad {
  display: none;
  position: fixed;
  bottom: 130px;
  left: 20px;
  width: 118px;
  height: 105px;
  grid-template-columns: repeat(3, 36px);
  gap: 4px;
}
#move-pad button {
  background: #21172a88;
  backdrop-filter: blur(8px);
  border: 1px solid #ffffff30;
  border-radius: 12px;
  font-size: 20px;
  touch-action: none;
}
#move-pad button:first-child {
  grid-column: 2;
}
#move-pad button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}
#move-pad button:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}
#move-pad button:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}
#game-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  text-align: center;
  background: linear-gradient(#0c081b99, transparent 40%, #0c081b99);
}
.game-title {
  position: absolute;
  top: 17%;
  width: 100%;
  padding: 0 20px;
}
.game-title > span {
  font-size: 11px;
  letter-spacing: 3px;
  color: #d2b58e;
}
.game-title h2 {
  font-family: serif;
  font-weight: 400;
  font-size: 33px;
  letter-spacing: 4px;
}
.game-title p {
  font-size: 12px;
  color: #d5c6db;
}
#roll {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  background: #e9c891;
  color: #35253a;
  padding: 14px 50px;
  border-radius: 30px;
  pointer-events: auto;
}
#leave-game {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #ddd0e0;
  pointer-events: auto;
}
#dice-result {
  position: absolute;
  bottom: 32%;
  width: 100%;
  font-size: 18px;
  color: #ffdda5;
  text-shadow: 0 2px 8px #000;
  padding: 0 20px;
}
.unavailable {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 40px;
  background: #17111e;
  text-align: center;
  z-index: 30;
}
.unavailable p {
  font-size: 14px;
  line-height: 2;
  color: #d7bdd1;
}
#reticle {
  position: fixed;
  width: 12px;
  height: 12px;
  border: 1px solid #e5cc9a99;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  pointer-events: none;
  display: none;
}
@media (max-width: 900px) {
  #location {
    bottom: 120px;
    left: 20px;
  }
  #location small {
    display: none;
  }
  #status {
    bottom: 120px;
    font-size: 10px;
    right: 20px;
    max-width: 170px;
  }
  #actions {
    bottom: 24px;
    padding: 7px 9px;
    gap: 0;
  }
  #actions button {
    min-width: 53px;
    padding: 7px 10px;
  }
  header {
    left: 16px;
    right: 16px;
    top: 16px;
  }
  .brand {
    padding: 9px 14px;
    gap: 7px;
  }
  .brand i {
    display: none;
  }
  .top-actions .pill {
    padding: 10px 12px;
    font-size: 10px;
  }
  .welcome {
    left: 5%;
    right: 5%;
    top: 27%;
    padding: 20px;
  }
  .welcome h1 {
    font-size: 32px;
  }
  #speech {
    right: 16px;
    top: 86px;
    width: 270px;
  }
  #camera {
    display: none;
  }
}
@media (pointer: coarse) {
  #move-pad {
    display: grid;
  }
  #location {
    bottom: 255px;
  }
  #status {
    max-width: 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.pill {
  white-space: nowrap;
}
.mood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}
.mood-grid button {
  border: 1px solid #866576;
  background: #372436;
  border-radius: 12px;
  text-align: left;
  padding: 16px 13px;
}
.mood-grid button:hover {
  background: #503347;
}
.mood-grid span {
  display: block;
  font-size: 27px;
  margin-bottom: 12px;
  color: #eccb93;
}
.mood-grid b {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.mood-grid small {
  display: block;
  font-size: 10px;
  color: #ceb9c9;
  margin-top: 8px;
  line-height: 1.6;
}
.mood-footnote {
  font-size: 10px !important;
  color: #b8a5b7 !important;
}
@media (max-width: 600px) {
  header {
    left: 12px;
    right: 12px;
    gap: 10px;
  }
  .brand b {
    font-size: 12px;
    letter-spacing: 0;
  }
  .brand {
    padding: 9px 10px;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions .pill {
    padding: 10px 8px;
    font-size: 10px;
  }
  #actions {
    width: calc(100% - 24px);
    padding: 7px 4px;
    gap: 0;
    bottom: 20px;
  }
  #actions button {
    min-width: 0;
    flex: 1;
    padding: 7px 2px;
    font-size: 10px;
  }
  #actions span {
    font-size: 23px;
  }
  #context {
    bottom: 132px;
    max-width: 85vw;
    white-space: nowrap;
  }
}
