@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
  --game-width: 390px;
  --game-height: 720px;
  --game-scale: 1;
  --app-height: 100vh;
  --white: #fff;
  --brown-red: #9f3f3d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  display: grid;
  place-items: center;
  height: var(--app-height);
  min-height: var(--app-height);
  background: #151515;
  color: var(--white);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body.is-scaled {
  place-items: start center;
}

body.is-ko .game-shell {
  font-family: "Pretendard", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

body.is-ko .game-shell :where(p, h1, h2, span, strong, button, label, select) {
  letter-spacing: -0.03em;
}

button,
select {
  font: inherit;
}

.game-shell {
  position: relative;
  width: var(--game-width);
  height: var(--game-height);
  overflow: hidden;
  background: #050505;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: scale(var(--game-scale));
  transform-origin: top center;
  contain: layout paint size;
  direction: ltr;
}

.screen {
  position: absolute;
  inset: 0;
  display: block;
  visibility: hidden;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.screen.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.screen-loading {
  display: grid;
  place-items: center;
  background: #050505;
}

.screen-loading p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.screen-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.screen-start::before,
.screen-start::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.screen-start::before {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.47), rgba(0, 0, 0, 0.05) 34%, rgba(0, 0, 0, 0.08) 58%, rgba(0, 0, 0, 0.88));
}

.screen-start::after {
  background: rgba(255, 255, 255, 0.03);
}

.screen-start.is-leaving {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.start-copy {
  position: absolute;
  z-index: 1;
  top: 27px;
  left: 22px;
  right: 22px;
  text-align: center;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.65);
}

.event-label {
  margin: 0 0 24px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 span {
  display: block;
  margin-bottom: 3px;
  font-size: 24px;
  font-weight: 300;
}

h1 strong {
  display: block;
  font-size: 43px;
  font-weight: 900;
}

.start-controls {
  position: absolute;
  z-index: 1;
  left: 60px;
  right: 60px;
  bottom: 77px;
  display: grid;
  gap: 17px;
  justify-items: center;
}

.start-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  background: #55b6b4;
  color: var(--white);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 4px 0 rgba(19, 95, 94, 0.7);
  cursor: pointer;
}

.start-button:active {
  transform: translateY(2px);
  box-shadow: none;
}

.start-button:disabled {
  cursor: default;
}

.language-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  width: 182px;
  color: var(--white);
  font-size: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.language-row select {
  width: 120px;
  height: 29px;
  border: 0;
  border-radius: 0;
  padding: 0 10px;
  background: #f4f4f4;
  color: #222;
  font-size: 12px;
}

.legal-note {
  position: absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  bottom: 17px;
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
  white-space: pre-line;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}

body.is-rtl .start-copy,
body.is-rtl .legal-note,
body.is-rtl .language-row {
  direction: rtl;
}

body.is-rtl h1 span {
  font-size: 21px;
}

body.is-rtl h1 strong {
  font-size: 39px;
}

.scene-character {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.scene-character.is-hidden {
  display: none;
}

.dialogue-card {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  height: 250px;
  margin: 0;
  padding: 41px 20px 34px;
  text-align: center;
  cursor: pointer;
}

.dialogue-bg {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.scene-id {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.speaker-name {
  margin: 0 auto 23px;
  padding-bottom: 17px;
  max-width: 350px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  color: var(--white);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.speaker-name.is-empty {
  height: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
  overflow: hidden;
}

.dialogue-text {
  margin: 0 auto;
  max-width: 350px;
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  word-break: keep-all;
  white-space: pre-line;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.68);
}

body.is-rtl .speaker-name,
body.is-rtl .dialogue-text {
  direction: rtl;
}

body.is-rtl .dialogue-text {
  font-size: 15px;
  line-height: 1.5;
}

body.is-jp .dialogue-text {
  font-size: 15px;
  line-height: 1.48;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: strict;
}

.dialogue-emphasis {
  color: #ff4b4b;
  font-weight: 900;
}

.next-button {
  position: absolute;
  right: 38px;
  bottom: 31px;
  width: 31px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.next-button img {
  width: 15px;
  height: 13px;
  object-fit: contain;
}

.next-button:focus {
  outline: none;
}

.next-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.sound-button {
  position: absolute;
  z-index: 20;
  top: 14px;
  right: 11px;
  width: 32px;
  height: 32px;
  display: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.sound-button.is-visible {
  display: block;
}

.sound-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.screen-title {
  background: #000;
  cursor: pointer;
}

.screen-title.is-active {
  z-index: 10;
}

.title-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.screen-title.is-visible .title-image {
  opacity: 1;
  transition: opacity 1.2s ease;
}

.screen-title.is-leaving .title-image {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.title-next-cue {
  position: absolute;
  z-index: 1;
  right: 38px;
  bottom: 31px;
  width: 15px;
  height: 13px;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
}

.screen-title.is-cue-visible .title-next-cue {
  opacity: 1;
  transition: opacity 0.28s ease;
}

.screen-title.is-leaving .title-next-cue {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.quiz-dim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42) 57%, rgba(0, 0, 0, 0.84));
}

.screen-quiz {
  opacity: 1;
}

.screen-quiz.is-leaving {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.quiz-layout-image {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.quiz-board,
.quiz-memo {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 8px;
  color: #171717;
  text-align: center;
  word-break: keep-all;
  white-space: pre-line;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.quiz-board,
.quiz-memo,
.quiz-id {
  display: none;
}

.quiz-board {
  top: 41px;
  left: 20px;
  width: 350px;
  height: 224px;
  padding: 8px 26px 7px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.quiz-id {
  position: absolute;
  top: 11px;
  right: 15px;
  margin: 0;
  color: rgba(20, 20, 20, 0.35);
  font-size: 10px;
}

.quiz-section-title {
  margin: 0 auto 6px;
  padding-bottom: 5px;
  max-width: 234px;
  border-bottom: 1px solid #171717;
  color: #111;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.quiz-record,
.quiz-memo-text {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.quiz-record {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.22;
}

.quiz-strong {
  font-weight: 900;
}

.quiz-board.is-long .quiz-record {
  font-size: 13px;
  line-height: 1.18;
}

.quiz-board.is-extra-long .quiz-record {
  font-size: 12.5px;
  line-height: 1.13;
}

.quiz-board.is-ultra-long .quiz-record {
  font-size: 12px;
  line-height: 1.08;
}

.quiz-memo {
  top: 280px;
  left: 20px;
  width: 350px;
  height: 126px;
  padding: 7px 24px 6px;
  background: #fff6c7;
  box-shadow: 0 6px 13px rgba(0, 0, 0, 0.28);
}

.quiz-memo.is-hidden {
  display: none;
}

.quiz-memo .quiz-section-title {
  margin-bottom: 4px;
  padding-bottom: 4px;
}

.quiz-memo-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.16;
}

.quiz-answer-area {
  position: absolute;
  z-index: 2;
  left: 32px;
  right: 32px;
  bottom: 82px;
}

.quiz-prompt {
  margin: 0;
  color: var(--white);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  word-break: keep-all;
  white-space: pre-line;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.78);
}

.quiz-prompt.is-long {
  font-size: 16px;
}

.quiz-choices {
  display: grid;
  margin: 18px 22px 0;
  gap: 7px;
}

.quiz-choices.has-five {
  gap: 6px;
}

body.is-rtl .quiz-board,
body.is-rtl .quiz-memo,
body.is-rtl .quiz-prompt,
body.is-rtl .choice-button {
  direction: rtl;
}

body.is-rtl .quiz-record,
body.is-rtl .quiz-memo-text {
  text-align: right;
  word-break: normal;
  overflow-wrap: anywhere;
}

body.is-rtl .quiz-section-title {
  font-size: 18px;
}

body.is-rtl .quiz-prompt {
  font-size: 16px;
  line-height: 1.28;
}

body.is-rtl .quiz-prompt.is-long {
  font-size: 15px;
}

body.is-rtl .choice-button {
  min-height: 34px;
  font-size: 14px;
  line-height: 1.18;
}

#quiz-screen[data-quiz-id="Quiz02"] .quiz-board {
  top: 40px;
  height: 300px;
  padding: 7px 22px 6px;
}

#quiz-screen[data-quiz-id="Quiz02"] .quiz-section-title {
  margin-bottom: 4px;
  padding-bottom: 4px;
  font-size: 19px;
}

#quiz-screen[data-quiz-id="Quiz02"] .quiz-record {
  font-size: 13px;
  line-height: 1.12;
}

#quiz-screen[data-quiz-id="Quiz02"] .quiz-board.is-long .quiz-record {
  font-size: 12.4px;
  line-height: 1.08;
}

#quiz-screen[data-quiz-id="Quiz02"] .quiz-memo {
  top: 348px;
  height: 62px;
  padding: 5px 22px 4px;
}

#quiz-screen[data-quiz-id="Quiz02"] .quiz-memo .quiz-section-title {
  margin-bottom: 5px;
  padding-bottom: 5px;
  font-size: 18px;
}

#quiz-screen[data-quiz-id="Quiz02"] .quiz-memo-text {
  font-size: 13px;
  line-height: 1.12;
}

#quiz-screen[data-quiz-id="Quiz02"] .quiz-answer-area,
#quiz-screen[data-quiz-id="Quiz03"] .quiz-answer-area {
  bottom: 88px;
}

#quiz-screen[data-quiz-id="Quiz03"] .quiz-board {
  top: 46px;
  height: 206px;
  padding: 7px 24px 6px;
}

#quiz-screen[data-quiz-id="Quiz03"] .quiz-section-title {
  margin-bottom: 4px;
  padding-bottom: 4px;
  font-size: 19px;
}

#quiz-screen[data-quiz-id="Quiz03"] .quiz-record {
  font-size: 13px;
  line-height: 1.16;
}

#quiz-screen[data-quiz-id="Quiz03"] .quiz-memo {
  top: 266px;
  height: 112px;
  padding: 6px 24px 5px;
}

#quiz-screen[data-quiz-id="Quiz03"] .quiz-memo .quiz-section-title {
  margin-bottom: 6px;
  padding-bottom: 6px;
  font-size: 18px;
}

#quiz-screen[data-quiz-id="Quiz03"] .quiz-memo-text {
  font-size: 13px;
  line-height: 1.14;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-board {
  top: 12px;
  height: 312px;
  padding: 8px 22px 8px;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-section-title {
  margin-bottom: 4px;
  padding-bottom: 4px;
  font-size: 18px;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-record {
  font-size: 13px;
  line-height: 1.08;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-board.is-long .quiz-record {
  font-size: 12.2px;
  line-height: 1.04;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-memo {
  top: 334px;
  height: 58px;
  padding: 6px 24px 5px;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-memo .quiz-section-title {
  margin-bottom: 3px;
  padding-bottom: 3px;
  font-size: 17px;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-memo-text {
  font-size: 13px;
  line-height: 1.08;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-answer-area {
  bottom: 46px;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-prompt {
  font-size: 16px;
  line-height: 1.22;
}

#quiz-screen[data-quiz-id="Quiz04"] .quiz-choices {
  margin-top: 14px;
  gap: 6px;
}

#quiz-screen[data-quiz-id="Quiz04"] .choice-button {
  min-height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 14px;
}

#quiz-screen[data-quiz-id="Quiz05"] .quiz-board {
  top: 46px;
  height: 238px;
  padding: 7px 24px 6px;
}

#quiz-screen[data-quiz-id="Quiz05"] .quiz-section-title {
  margin-bottom: 4px;
  padding-bottom: 4px;
  font-size: 18px;
}

#quiz-screen[data-quiz-id="Quiz05"] .quiz-record {
  font-size: 13px;
  line-height: 1.16;
}

#quiz-screen[data-quiz-id="Quiz05"] .quiz-memo {
  top: 298px;
  height: 66px;
  padding: 5px 24px 5px;
}

#quiz-screen[data-quiz-id="Quiz05"] .quiz-memo .quiz-section-title {
  margin-bottom: 3px;
  padding-bottom: 3px;
  font-size: 17px;
}

#quiz-screen[data-quiz-id="Quiz05"] .quiz-memo-text {
  font-size: 13px;
  line-height: 1.1;
}

#quiz-screen[data-quiz-id="Quiz05"] .quiz-answer-area {
  bottom: 82px;
}

.choice-button {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  background: #a83b3b;
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.has-five .choice-button {
  min-height: 33px;
  font-size: 14px;
}

.choice-button.is-selected {
  background: #d2b45b;
  color: #211811;
}

.choice-button:focus {
  outline: none;
}

.screen-result {
  overflow-y: auto;
  overflow-x: hidden;
  background: #000;
  -webkit-overflow-scrolling: touch;
}

.result-page {
  position: relative;
  min-height: 1490px;
  padding: 28px 0 54px;
  background: #000;
  text-align: center;
}

.result-logo {
  display: block;
  width: 90px;
  height: 60px;
  margin: 0 auto 9px;
  object-fit: contain;
}

.result-score-panel {
  position: relative;
  width: 350px;
  height: 215px;
  margin: 0 auto 30px;
}

.result-board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.result-percent-line {
  position: absolute;
  z-index: 1;
  top: 57px;
  left: 10px;
  right: 0;
  margin: 0;
  color: #111;
  line-height: 1;
  text-align: center;
  direction: ltr;
  unicode-bidi: isolate;
}

.result-percent-line strong {
  display: inline-block;
  min-width: 96px;
  font-size: 44px;
  font-weight: 900;
  line-height: 0.9;
}

body.is-rtl .result-percent-line {
  left: 18px;
  right: 0;
}

body.is-rtl .result-comment,
body.is-rtl .result-copy,
body.is-rtl .result-section h2,
body.is-rtl .result-button,
body.is-rtl .share-feedback {
  direction: rtl;
}

.result-comment {
  position: absolute;
  z-index: 1;
  left: 122px;
  right: 24px;
  top: 142px;
  height: 48px;
  margin: 0;
  padding: 0 12px;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.32;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: keep-all;
}

.result-actions {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 39px;
}

.result-button {
  width: 196px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #287f7a;
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.share-feedback {
  min-height: 16px;
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.result-divider {
  width: 72px;
  height: 1px;
  margin: 0 auto 39px;
  background: rgba(255, 255, 255, 0.9);
}

.result-section {
  color: var(--white);
  text-align: center;
}

.result-kicker,
.result-subtitle {
  margin: 0;
  font-weight: 800;
  line-height: 1.35;
}

.result-kicker {
  font-size: 15px;
}

.result-subtitle {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 500;
}

.result-section h2 {
  margin: 12px 0 18px;
  font-size: 21px;
  line-height: 1.15;
}

.meet-inspector-image {
  display: block;
  width: 220px;
  height: 152px;
  margin: 0 auto 28px;
  object-fit: contain;
}

.result-copy {
  margin: 0 auto 15px;
  max-width: 306px;
  color: rgba(255, 255, 255, 0.93);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.65;
  word-break: keep-all;
}

.result-link-button {
  margin-top: 15px;
}

.result-inspector-section {
  margin-bottom: 48px;
}

.result-game-section h2 {
  margin: 12px auto 24px;
  max-width: 330px;
  font-size: 24px;
}

.mafia-illust-image {
  display: block;
  width: 390px;
  height: 160px;
  margin: 0 auto 30px;
  object-fit: cover;
}
