@import url("ui/raster/village-details/runtime-frames.css");

body.play-screen .village-question .vquestion-heading h2 {
  height: auto; min-height: calc(80 * var(--du)); background: none; border: 0 solid transparent; white-space: normal; overflow-wrap: anywhere;
  border-image: var(--village-detail-heading) var(--village-detail-heading-slices) fill / calc(34 * var(--du)) calc(92 * var(--du)) calc(19 * var(--du)) / calc(31 * var(--du)) calc(32 * var(--du)) calc(3 * var(--du)) stretch;
}
body.play-screen .village-question:has(#question-meaning:not([hidden])) .vquestion-bubble {
  position: relative; isolation: isolate; background: none; border-color: transparent;
}
body.play-screen .village-question:has(#question-meaning:not([hidden])) .vquestion-bubble::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 0 calc(-12 * var(--du));
  border: 0 solid transparent; filter: brightness(1.035) saturate(.75) hue-rotate(12deg);
  border-image: var(--village-detail-bubble) var(--village-detail-bubble-slices) fill / calc(18 * var(--du)) calc(26 * var(--du)) calc(50 * var(--du)) calc(30 * var(--du)) stretch;
}
body.play-screen .village-question .vquestion-answers :is([data-answer-state=idle],[data-answer-state=dim]) {
  border-image: var(--village-detail-answer) var(--village-detail-answer-slices) fill / calc(8 * var(--du)) calc(20 * var(--du)) calc(16 * var(--du)) stretch;
}
body.play-screen .village-question .vquestion-answers :is([data-answer-state=right],[data-answer-state=reveal]) {
  position: relative;
  border-image: var(--village-detail-answer-right) var(--village-detail-answer-right-slices) fill / calc(8 * var(--du)) calc(20 * var(--du)) calc(16 * var(--du)) stretch;
}
body.play-screen .village-question .vquestion-answers [data-answer-state=right] { padding-right: calc(64 * var(--du)); }
body.play-screen .village-question .vquestion-answers [data-answer-state=right]::after {
  position: absolute; right: calc(20 * var(--du)); top: 50%; translate: 0 -50%; font-size: calc(30 * var(--du)); line-height: 1;
}
body.play-screen #panel.village-question-panel .vquestion-answers button:not(:disabled),
body.play-screen #panel.village-question-panel #question-done { min-height: max(44px,calc(60 * var(--du))); }
body.play-screen #panel.village-question-panel:has(#question-meaning:not([hidden])):not(:has(.vquestion-feedback)) .vquestion-answers button { min-height: max(44px,calc(52 * var(--du))); }
body.play-screen .village-question #question-listen { min-width: 44px; min-height: 44px; }
body.play-screen .village-question #question-translate { position: relative; }
body.play-screen .village-question #question-translate::after { content: ""; position: absolute; inset: 0; min-width: 44px; min-height: 44px; pointer-events: auto; }
body.play-screen .village-question button { scroll-margin-block: 8px; }
body.play-screen #panel.village-question-panel > #panel-content { padding-bottom: 8px; }

@media (min-width: 1200px) and (min-height: 501px) {
  body.play-screen #panel.village-question-panel:not(:has(#question-meaning:not([hidden]))) .vquestion-answers button:not(:disabled) { min-height: max(44px,calc(68 * var(--du))); }
  body.play-screen .village-question:not(:has(#question-meaning:not([hidden]))) .vquestion-answers { gap: calc(6 * var(--du)); }
  body.play-screen .village-question:not(:has(#question-meaning:not([hidden]))) .vquestion-instruction { margin-bottom: calc(10 * var(--du)); }
  body.play-screen #panel.village-question-panel:has(#question-meaning:not([hidden])):not(:has(.vquestion-feedback)) .vquestion-answers button { min-height: max(44px,calc(60 * var(--du))); }
  body.play-screen .village-question:has(#question-meaning:not([hidden])):not(:has(.vquestion-feedback)) .vquestion-answers { gap: calc(4 * var(--du)); translate: 0 calc(-4 * var(--du)); }
  body.play-screen .village-question:has(#question-meaning:not([hidden])) .vquestion-heading h2 {
    font-family: Georgia,serif; font-size: calc(36 * var(--du));
    border-image-outset: calc(27 * var(--du)) calc(25 * var(--du)) calc(3 * var(--du));
  }
  body.play-screen .village-question:has(#question-meaning:not([hidden])) .vquestion-bubble { padding-block: calc(8 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-bubble { padding-block: calc(6 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-heading { height: calc(64 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-heading h2 {
    min-height: calc(64 * var(--du));
    border-image-width: calc(25 * var(--du)) calc(92 * var(--du)) calc(19 * var(--du));
    border-image-outset: calc(18 * var(--du)) calc(35 * var(--du)) calc(3 * var(--du));
  }
  /* Leave room for scroll padding when the result receives focus. */
  body.play-screen #panel.village-question-panel:has(.vquestion-feedback) { padding-bottom: calc(24 * var(--du)); }
  body.play-screen #panel.village-question-panel:has(#question-meaning:not([hidden])):not(:has(.vquestion-feedback)) { padding-top: calc(50 * var(--du)); }
}

@media (min-width: 1200px) and (min-height: 501px) {
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-greeting { translate: 0 calc(-6 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-greeting:has([data-villager-portrait=mira])::before { bottom: calc(-1 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-bubble { padding-block: calc(9 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-instruction { margin: calc(7 * var(--du)) 0 calc(3 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-answers { gap: calc(9 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-feedback { margin-top: calc(19 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-result-body { gap: calc(26 * var(--du)); padding-block: calc(4 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-result-body > div { border-left: calc(2 * var(--du)) solid #d3b4e3; padding-left: calc(20 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-feedback strong { font-size: calc(22 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-feedback p { margin-top: calc(2 * var(--du)); }
  body.play-screen .village-question:has(.vquestion-feedback) .vquestion-rewards { margin-top: calc(4 * var(--du)); font-size: calc(16 * var(--du)); }
  body.play-screen #panel.village-question-panel:has(.vquestion-feedback) #question-done { margin-top: calc(20 * var(--du)); min-height: max(44px,calc(64 * var(--du))); }
}

@media (min-width: 1100px) and (min-height: 501px) {
  body.play-screen .village-question #question-done { scroll-margin-block: 0; }
}

@media (max-width: 1199px), (max-height: 500px) {
  body.play-screen #panel.village-question-panel:has(#question-meaning) { --du: .8px; width: min(940px,calc(100vw - 16px)); height: auto; max-height: calc(100dvh - 24px); padding: 20px 16px 24px; transform: none; }
  body.play-screen #panel.village-question-panel::before { inset: 0; background: none; border: 0 solid transparent; border-image: var(--village-question-body) 14% fill / 36px stretch; }
  body.play-screen #panel.village-question-panel:has(#question-meaning) > #panel-content { width: auto; height: auto; max-height: calc(100dvh - 72px); margin: 0; padding: 0 0 8px; overflow: auto; }
  body.play-screen .village-question .vquestion-heading { position: static; width: calc(100% - 64px); height: auto; margin: 0 0 20px; }
  body.play-screen .village-question .vquestion-heading h2 { width: 100%; height: auto; min-height: 52px; padding: 6px 12px; font-family: inherit; font-size: 25px; border-image-width: 24px 58px 12px; border-image-outset: 12px 8px 2px; }
  body.play-screen #panel.village-question-panel .vquestion-feedback { margin-inline: 0; }
  body.play-screen #panel.village-question-panel > #close-panel { top: 14px; right: 14px; width: 48px; height: 48px; }
}

body.play-screen .village-question #question-translate { min-height: 44px; }
body.play-screen .village-question .vquestion-greeting:has([data-villager-portrait=mira]) { position: relative; }
body.play-screen .village-question .vquestion-greeting > [data-villager-portrait=mira] { opacity: 0; }
body.play-screen .village-question:has(.vquestion-feedback) .vquestion-greeting > canvas { transform: none; }
body.play-screen .village-question .vquestion-greeting:has([data-villager-portrait=mira])::before {
 content: ""; position: absolute; left: 0; bottom: calc(-20 * var(--du)); width: calc(90 * var(--du)); height: calc(129 * var(--du));
 background: url('/ui/raster/village-land-family-v2/mira-portrait.svg') center / contain no-repeat; pointer-events: none;
}
@media (min-width: 1200px) and (min-height: 501px) {
 body.play-screen #panel.village-question-panel:not(:has(#question-meaning:not([hidden])))::before, body.play-screen #panel.village-question-panel:has(.vquestion-feedback)::before { inset: 0; background: none; border: 0 solid transparent; border-image: url('/ui/raster/village-land-family-v2/question-panel.svg') 12% 20% 18% 20% fill / calc(34 * var(--du)) calc(130 * var(--du)) calc(90 * var(--du)) stretch; }
 body.play-screen .village-question .vquestion-answers button { font-weight: 800; }
 body.play-screen .village-question:not(:has(#question-meaning:not([hidden]))) .vquestion-bubble { padding-top: calc(14 * var(--du)); padding-bottom: calc(4 * var(--du)); }
}
@media (max-width: 1199px), (max-height: 500px) {
 body.play-screen .village-question .vquestion-greeting:has([data-villager-portrait=mira])::before { bottom: 0; width: 56px; height: 81px; }
}

@media (min-width: 1200px) and (min-height: 501px) {
 body.play-screen .village-question #question-translate { display: flex; align-items: flex-start; padding-top: calc(4 * var(--du)); box-sizing: border-box; }
}

@media (min-width: 701px) and (max-width: 1199px) and (min-height: 501px) {
  body.play-screen #panel.village-question-panel:has(#question-meaning) { width: min(680px,calc(100vw - 16px)); height: fit-content; }
  body.play-screen #panel:has(.village-directory) { width: min(680px,calc(100vw - 16px)); --village-paper-width: min(374px,calc(100vw - 16px)); }
  /* Keep the title clear of ornaments as the tablet paper widens. */
  body.play-screen #panel:has(.village-directory)::before { border-image-width: calc(var(--village-paper-width) * .228) calc(var(--village-paper-width) * .095) calc(var(--village-paper-width) * .1645); }
}
@media (min-width: 1200px) and (min-height: 501px) {
  body.play-screen .village-question #question-translate { font-size: max(15px,calc(20 * var(--du))); }
}

@media (min-width: 1200px) and (height < 501px) {
  body.play-screen #panel:has(.village-directory) { --du: .8px; width: min(680px,calc(100vw - 16px)); height: auto; max-height: calc(100dvh - 24px); padding: 60px 16px 20px; }
  body.play-screen #panel:has(.village-directory)::before { inset: 0; background: none; border: 0 solid transparent; border-image: var(--village-directory-body) 20.1% 9.5% 14.5% 9.5% fill / 85px 36px 62px stretch; }
  body.play-screen #panel:has(.village-directory) > #panel-content { height: auto; max-height: calc(100dvh - 104px); padding: 0; overflow: auto; }
  body.play-screen #panel:has(.village-directory) > #close-panel { top: 14px; right: 14px; width: 48px; height: 48px; }
  body.play-screen #panel .village-directory > .eyebrow { font-size: 11px; }
  body.play-screen #panel .village-directory > h2 { width: 100%; height: 70px; margin: 8px 0 12px; padding: 6px 24px; font-size: 27px; }
  body.play-screen #panel .village-directory > p { font-size: 15px; margin-bottom: 16px; }
  body.play-screen #panel .village-directory .villager-grid article { min-height: 0; padding: 12px; }
  body.play-screen #panel .village-directory .villager-grid article > div { height: 88px; }
  body.play-screen #panel .village-directory .villager-grid canvas { width: auto; height: 88px; max-width: 100%; transform: none; }
  body.play-screen #panel .village-directory .villager-grid h3 { margin: 8px 0 0; font-size: 22px; }
  body.play-screen #panel .village-directory .villager-grid p { margin: 4px 0 12px; font-size: 15px; }
  body.play-screen #panel .village-directory .villager-grid button { min-height: 44px; font-size: 16px; }
  body.play-screen #panel .village-directory .villager-grid button.quiet { min-height: 44px; margin-top: 8px; font-size: 16px; }
  body.play-screen #panel .village-directory > .villager-grid + p { margin: 14px 0 0; font-size: 14px; }
}
