@import url("./fonts.css");
:root {
  --ink: #594438;
  --muted: #866d5e;
  --paper: #fff9ef;
  --accent: #a65e46;
  --line: #e4cdb9;
  --ui: "Gowun Dodum", sans-serif;
  --story: "Gowun Batang", serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #ead9c7;
  color: var(--ink);
  font-family: var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  font-size: 15px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible {
  outline: 3px solid #ca9c68;
  outline-offset: 4px;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}
header {
  position: fixed;
  left: 38px;
  right: 38px;
  top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.logo {
  font-family: var(--story);
  font-size: 23px;
  line-height: 1.5;
  text-shadow: none;
  padding: 16px 22px;
  background: #fff7e9ed;
  border: 1px solid #fffaf3;
  border-radius: 18px;
  box-shadow: 0 8px 32px #65432b12;
}
.logo b {
  color: #a65e46;
  font-weight: 700;
}
.logo small {
  display: block;
  font: 12px var(--ui);
  letter-spacing: 0.7px;
  margin-top: 11px;
  color: #866b59;
}
.top-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.badge {
  font-size: 12px;
  background: #fff9f0f5;
  padding: 10px 15px;
  border-radius: 30px;
  color: #7e6858;
}
.top-right button,
.bottom button {
  pointer-events: auto;
  border: 1px solid #fff8;
  background: #fff8edee;
  border-radius: 30px;
  padding: 11px 17px;
  font-size: 12px;
  box-shadow: 0 3px 20px #6d3c2412;
}
.room-list { display: grid; gap: 10px; margin: 20px 0; }
.room-list button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid #dfc8af; border-radius: 12px; background: #fff9ef; color: #654c3c; text-align: left; }
.room-list button:hover:not(:disabled) { background: #f3e1cc; }
.room-list button:disabled { opacity: .55; cursor: not-allowed; }
.room-list small { white-space: nowrap; color: #92735e; }
.location {
  position: fixed;
  top: 205px;
  padding: 9px 14px;
  border-radius: 12px;
  background: #fff6e8dc;
  border: 1px solid #fff5e4;
  left: 39px;
  display: flex;
  gap: 13px;
  align-items: center;
  pointer-events: none;
}
.location > span {
  font-size: 30px;
  color: #a66f52;
}
.location div {
  font-family: var(--story);
  font-size: 15px;
}
.location small {
  display: block;
  font: 12px var(--ui);
  margin-top: 7px;
  color: #866b59;
}
.bottom {
  position: fixed;
  bottom: 24px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bottom > span {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  background: #fff6e9ed;
  padding: 12px 17px;
  border: 1px solid #fff8;
  border-radius: 30px;
}
kbd {
  display: inline-block;
  background: #f7e4d2;
  border: 1px solid #dfc1a7;
  border-bottom: 2px solid #d0ac8e;
  border-radius: 7px;
  padding: 2px 6px;
  font: 10px monospace;
  margin: 0 1px;
}
i {
  margin: 0 12px;
}
#hint {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #80543fef;
  color: #fff8ee;
  padding: 12px 23px;
  border-radius: 30px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 30px #6b3d2d25;
}
#worldLabel {
  position: fixed;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: #fff9f0f5;
  padding: 7px 12px;
  border-radius: 30px;
  font-size: 12px;
  white-space: nowrap;
}
#worldLabel small {
  background: #f4decc;
  padding: 3px 5px;
  border-radius: 7px;
  font-size: 8px;
  margin-left: 7px;
}
.greeting {
  position: fixed;
  right: 38px;
  bottom: 165px;
  z-index: 2;
}
.greeting > button, .greeting-choices {
  border: 1px solid #e3c4a4;
  background: #fff8eef5;
  border-radius: 22px;
  box-shadow: 0 5px 20px #6b3d2d25;
}
.greeting > button { padding: 10px 17px; color: #79513d; }
.greeting-choices {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 8px;
  width: 220px;
}
.greeting-choices[hidden], .greeting[hidden] { display: none; }
.greeting-choices button {
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 8px 3px;
  display: grid;
  justify-items: center;
  gap: 2px;
}
.greeting-choices button:hover, .greeting-choices button:focus-visible { background: #f8e6d2; }
.greeting-choices button:disabled { opacity: .5; }
.greeting-choices button span { font-size: 25px; line-height: 1.2; }
.greeting-choices button small { font-size: 11px; }
.emote-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border-radius: 50%;
  background: #fffaf2;
  border: 1px solid #e7c6a7;
  box-shadow: 0 4px 16px #6d402325;
  font-size: 26px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 700px) { .greeting { right: 15px; bottom: 145px; } }
.chat { position: fixed; left: 30px; bottom: 165px; z-index: 3; }
.chat[hidden], .chat-panel[hidden] { display: none; }
.chat > button, .chat-panel {
  border: 1px solid #e3c4a4;
  background: #fff9eff7;
  box-shadow: 0 5px 20px #6b3d2d25;
}
.chat > button { border-radius: 22px; padding: 10px 16px; color: #79513d; }
.chat-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(350px, calc(100vw - 30px));
  padding: 15px;
  border-radius: 20px;
}
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-heading button { border: 0; background: transparent; font-size: 22px; line-height: 1; }
.chat-note { color: #8a6d58; font-size: 11px; margin: 5px 0 8px; }
.chat-messages { height: 160px; overflow-y: auto; padding: 6px 2px; }
.chat-messages p { margin: 0 0 9px; font-size: 13px; overflow-wrap: anywhere; }
.chat-messages strong { display: block; color: #98745c; font-size: 11px; }
#chatForm { display: flex; gap: 7px; }
#chatForm input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid #e3c4a4; border-radius: 11px; background: #fffdf9; font-size: 13px; }
#chatForm button { border: 0; border-radius: 11px; padding: 8px 12px; color: white; background: #a65e46; }
#chatForm button:disabled { opacity: .5; }
.chat-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%);
  width: max-content; max-width: 200px; white-space: pre-wrap; overflow-wrap: anywhere;
  border: 1px solid #e3c4a4; border-radius: 15px 15px 15px 4px; padding: 9px 12px;
  color: #614733; background: #fffaf2; box-shadow: 0 4px 16px #6d402325; font-size: 13px;
}
@media (max-width: 700px) { .chat { left: 15px; bottom: 205px; } .chat-messages { height: 120px; } }
dialog {
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  border: 0;
  background: #63452f65;
  backdrop-filter: blur(6px);
  padding: 42px 20px;
  overflow: auto;
  color: var(--ink);
}
dialog::backdrop {
  background: #6f48352b;
}
.close {
  position: fixed;
  right: 35px;
  top: 25px;
  width: 42px;
  height: 42px;
  background: #fff5e7;
  border: 1px solid #e4c8ae;
  border-radius: 50%;
  font-size: 18px;
  z-index: 2;
}
.paper {
  max-width: 770px;
  min-height: calc(100dvh - 84px);
  margin: 0 auto;
  background: #fff9ef;
  background-image: linear-gradient(#ad795b0b 1px, transparent 1px);
  background-size: 100% 32px;
  border: 1px solid #e4cbb3;
  box-shadow: 0 20px 100px #57352238;
  padding: 45px 65px 55px;
  border-radius: 18px;
  position: relative;
}
.paper:before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid #c18d6240;
  pointer-events: none;
}
.paper-mark {
  font-size: 12px;
  letter-spacing: 1.7px;
  color: #986c50;
}
h1 {
  font-family: var(--story);
  font-size: 29px;
  font-weight: 700;
  line-height: 1.6;
  margin: 25px 0 20px;
}
p {
  font-size: 15px;
  line-height: 1.9;
}
.muted {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 26px;
}
.choice {
  padding: 25px 19px;
  text-align: left;
  border: 1px solid #e4cdb9;
  background: #fbecdc;
  border-radius: 12px;
}
.choice strong {
  display: block;
  font-family: var(--story);
  font-size: 20px;
}
.choice small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.primary {
  background: var(--accent);
  color: #fffaf0;
  border: 0;
  border-radius: 12px;
  padding: 13px 22px;
  margin-top: 20px;
}
.secondary {
  border: 1px solid #d9bda4;
  background: none;
  border-radius: 12px;
  padding: 11px 17px;
  margin: 12px 8px 0 0;
}
label {
  display: block;
  font-size: 14px;
  margin: 18px 0 8px;
}
input,
select,
textarea {
  width: 100%;
  background: #fffdf7;
  border: 1px solid #e1c9b3;
  border-radius: 7px;
  padding: 11px 12px;
}
textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.9;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.animals {
  display: flex;
  gap: 8px;
}
.animals button {
  flex: 1;
  padding: 13px 4px;
  background: #f9ecdd;
  border: 1px solid #e1c9b3;
  border-radius: 12px;
  font-size: 26px;
}
.animals button small {
  display: block;
  font-size: 12px;
}
.animals .selected {
  border-color: #ad7050;
  background: #f4d8c2;
}
.story {
  padding: 20px 0;
  border-top: 1px solid #e4cdb9;
}
.story h2 {
  font: 22px var(--story);
}
.meta {
  font-size: 12px;
  letter-spacing: 1px;
  color: #926c52;
}
.vote {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #fcf0e2;
  border: 1px solid #e4cab2;
  border-radius: 5px;
  margin: 8px 0;
}
.vote.selected {
  background: #f3d5bd;
}
#toast {
  position: fixed;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 24px;
  border-radius: 30px;
  background: #83543d;
  color: #fff8ef;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 10;
}
#toast.show {
  opacity: 1;
}
#touch {
  display: block;
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(27px, env(safe-area-inset-bottom));
  text-align: center;
  z-index: 3;
  user-select: none;
  -webkit-user-select: none;
}
#touch button {
  width: 48px;
  height: 46px;
  margin: 2px;
  border-radius: 12px;
  border: 1px solid #fff9;
  background: #fff8edee;
  box-shadow: 0 3px 12px #6d402320;
  touch-action: none;
}
#touch button:active {
  background: #edd2b8;
}
#touch #interact {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: 85px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #a65e46;
  color: white;
}
@media (max-width: 1100px) { .bottom > span { display: none; } }
@media (max-width: 700px) {
  header {
    left: 20px;
    right: 20px;
    top: 20px;
  }
  .logo {
    font-size: 19px;
    padding: 12px 14px;
  }
  .logo small {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .badge {
    display: none;
  }
  .location {
    left: 20px;
    top: 165px;
  }
  .location div {
    font-size: 12px;
  }
  .bottom {
    left: 15px;
    right: 15px;
    bottom: 15px;
  }
  .bottom > span {
    display: none;
  }
  #hint {
    bottom: min(265px, 40vh);
    font-size: 12px;
    padding: 10px 13px;
    max-width: 95vw;
    white-space: normal;
    text-align: center;
  }
  .bottom button {
    margin-left: auto;
  }
  .paper {
    padding: 34px 24px;
  }
  .paper-mark {
    font-size: 8px;
    letter-spacing: 0.7px;
  }
  h1 {
    font-size: 24px;
  }
  .choices {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 60px 12px 20px;
  }
  .close {
    right: 15px;
    top: 10px;
  }
}
.peer-label {
  position: fixed;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: #fff8efed;
  border: 1px solid #e7c6a7;
  padding: 7px 11px;
  border-radius: 25px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 3px 10px #633f281a;
}
.peer-label small {
  font-size: 12px;
  margin-left: 6px;
  background: #f4ddca;
  padding: 3px 5px;
  border-radius: 7px;
}
.story-button {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid #e4cdb9;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.letter-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#numberedOptions {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}
#numberedOptions label {
  margin: 0;
}
#notificationBanner {
  position: fixed;
  top: 100px;
  right: 32px;
  max-width: 420px;
  padding: 15px 20px;
  border: 1px solid #dfbea2;
  background: #fff6e9f5;
  color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 10px 30px #68452e20;
  text-align: left;
  font-size: 12px;
  z-index: 6;
}
#notificationBanner[hidden] {
  display: none;
}
button:disabled {
  cursor: default;
  opacity: 0.65;
}
.signin {
  display: inline-block;
  text-decoration: none;
}
.badge {
  max-width: 170px;
}
@media (max-width: 700px) {
  #notifications {
    font-size: 12px;
    padding: 9px;
  }
  .top-right {
    gap: 5px;
  }
  #notificationBanner {
    left: 15px;
    right: 15px;
    top: 120px;
    max-width: none;
  }
  #numberedOptions {
    grid-template-columns: 70px 1fr;
  }
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #bc815f;
  outline-offset: 2px;
  background: #fffdf8;
}
button {
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.primary:hover,
#touch #interact:hover {
  background: #8c4b38;
  box-shadow: 0 5px 15px #8c4b3825;
}
.choice:hover,
.vote:not(:disabled):hover {
  background: #f5dfc9;
  border-color: #bc8965;
}
.paper {
  background-image:
    radial-gradient(ellipse at 0% 0%, #fbe5ce80, transparent 60%),
    linear-gradient(#bc92600a 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 34px;
}
#worldLabel,
.peer-label {
  font-size: 12px;
  font-family: var(--ui);
  color: #614733;
  border: 1px solid #e7c6a7;
  box-shadow: 0 3px 12px #6d402320;
}
#worldLabel small,
.peer-label small {
  font-size: 10px;
  color: #865437;
}
@media (max-width: 700px) {
  header {
    left: 14px;
    right: 14px;
    top: 16px;
  }
  .top-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    max-width: 145px;
  }
  .top-right button {
    font-size: 12px;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 9px 12px;
  }
  .logo small {
    font-size: 10px;
    letter-spacing: 0;
  }
  .location {
    top: 175px;
    left: 15px;
    padding: 6px 10px;
  }
  .location div {
    font-size: 13px;
  }
  .location small {
    font-size: 10px;
  }
  #notificationBanner {
    top: 145px;
  }
  .paper {
    padding: 35px 26px;
  }
  #hint {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
}
#voteResults {
  margin: 32px 0 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.ratio-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ratio-heading h3 {
  font-family: var(--story);
  font-size: 21px;
  margin: 8px 0;
}
.ratio-live {
  font-size: 11px;
  color: #7c7054;
  background: #f4e9d5;
  border-radius: 20px;
  padding: 5px 10px;
}
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.ratio-card {
  padding: 18px;
  border: 1px solid #e5cdb8;
  border-radius: 14px;
  background: #fffaf2;
  min-width: 0;
}
.ratio-card h4 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 16px;
  color: #80543e;
  font-size: 16px;
}
.ratio-card h4 small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.ratio-overall {
  background: #f8ead9;
}
.ratio-option {
  margin: 13px 0;
}
.ratio-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.ratio-caption > span {
  overflow-wrap: anywhere;
}
.ratio-caption strong {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 400;
}
.ratio-caption small {
  color: var(--muted);
  font-size: 11px;
}
.ratio-track {
  height: 7px;
  background: #eee1d1;
  border-radius: 20px;
  overflow: hidden;
  margin-top: 6px;
}
.ratio-track > span {
  display: block;
  height: 100%;
  border-radius: 20px;
  transition: width 0.35s ease;
}
.ratio-empty {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.ratio-empty summary {
  cursor: pointer;
}
.ratio-empty p {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ratio-empty p span {
  padding: 4px 8px;
  border-radius: 7px;
  background: #f5ebdd;
  font-size: 11px;
}
.ratio-note {
  font-size: 11px;
}
@media (max-width: 700px) {
  .ratio-grid {
    grid-template-columns: 1fr;
  }
  .ratio-card {
    padding: 15px;
  }
  .ratio-caption {
    font-size: 12px;
  }
  .ratio-caption strong {
    font-size: 12px;
  }
  .ratio-caption > span {
    max-width: 65%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ratio-track > span {
    transition: none;
  }
}
#sheetNotice {
  position: sticky;
  top: 8px;
  z-index: 2;
  border: 1px solid #dbb999;
  background: #fff0dcef;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 12px;
  box-shadow: 0 4px 16px #80513512;
}
#sheetNotice[hidden] {
  display: none;
}
.response-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.report-wrap {
  position: relative;
  display: inline-flex;
}
.report-button {
  border: 1px solid #d4a38a;
  background: #fff9f1;
  color: #8b503c;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
}
.report-done {
  font-size: 11px;
  color: var(--muted);
}
.report-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 4;
  bottom: calc(100% + 8px);
  left: 0;
  width: min(260px, 70vw);
  padding: 10px 12px;
  border-radius: 9px;
  background: #704c3e;
  color: #fff9ef;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 5px 16px #553b2929;
  transition: opacity 0.15s;
  pointer-events: none;
}
.report-wrap:hover .report-tooltip,
.report-wrap:focus-within .report-tooltip {
  visibility: visible;
  opacity: 1;
}
#accountName[readonly],
#accountMbti:disabled {
  background: #f1e6d8;
  color: #765f52;
  cursor: default;
  opacity: 1;
}
