#festival-dialog {
  position: fixed;
  inset: 50dvh auto auto 50vw;
  transform: translate(-50%, -50%);
  margin: 0;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: clamp(14px, 4vw, 24px);
  color: #53576c;
  background: #fff8e8;
  border: 1px solid #e6ddc9;
  border-radius: 18px;
  box-shadow: 0 12px 48px #162c4955;
  font-family: Kanit, sans-serif;
  text-align: center;
}
#festival-dialog::backdrop { background: #182c45aa; }
#festival-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#festival-dialog h2 { margin: 0; font-size: clamp(20px, 5vw, 25px); }
#festival-dialog p { margin: 10px 0 16px; line-height: 1.5; }
#festival-dialog button {
  min-height: 44px;
  border: 1px solid #e6ddc9;
  border-radius: 12px;
  padding: 7px 8px;
  background: #fffcf3;
  color: #53576c;
  font: inherit;
  cursor: pointer;
}
#festival-dialog button:focus-visible { outline: 2px solid #296c68; outline-offset: 2px; }
#festival-dialog .festival-close { min-width: 44px; font-size: 22px; line-height: 1; }
#festival-dialog .festival-action { padding-inline: 16px; background: #b9ddb9; color: #29473d; border-color: #99c6ae; }
#festival-dialog .festival-action:disabled { opacity: .55; cursor: default; }
#festival-dialog .festival-designs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
#festival-dialog .festival-designs button { display: grid; justify-items: center; align-content: center; line-height: 1.2; }
#festival-dialog button[aria-pressed=true] { border-color: #40a49d; background: #e3f4e8; box-shadow: inset 0 0 0 1px #40a49d; }
#festival-dialog img { object-fit: contain; }
#festival-dialog .festival-designs img { width: min(100%, 80px); height: clamp(42px, 16vw, 80px); margin-bottom: 6px; }
#festival-dialog .festival-preview { width: 92px; height: 92px; }
#festival-dialog.festival-fair { width: min(510px, calc(100vw - 24px)); }
.fair-stats { margin-bottom: 6px; font-weight: 600; color: #2d7069; font-variant-numeric: tabular-nums; }
.fair-board {
  position: relative;
  height: clamp(156px, 36dvh, 280px);
  overflow: hidden;
  border: 1px solid #9db8b4;
  border-radius: 14px;
  background: linear-gradient(#c9e2da, #e9ead5 69%, #d9bba0 70%, #ddc7af);
  touch-action: manipulation;
  user-select: none;
}
.fair-board[data-game=balloons] { background: linear-gradient(#dcd0ec, #f3d8d9 69%, #d9bba0 70%, #ddc7af); }
.fair-message { position: absolute; inset: 0; display: grid; place-content: center; }
.fair-result:not(:empty) { margin-top: 8px; font-weight: 600; }
#festival-dialog .fair-target, #festival-dialog .fair-balloon {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  width: 62px;
  height: 62px;
}
#festival-dialog .fair-target {
  border-radius: 50%;
  border: 2px solid #72493e;
  box-shadow: 0 3px 3px #80574444;
  background: radial-gradient(circle, #aa4458 0 23%, #f0c16c 24% 59%, #fff8e8 60% 100%);
}
#festival-dialog .fair-balloon { border: 0; background: none; }
.fair-balloon img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
@media (orientation: landscape) and (max-height: 470px) {
  #festival-dialog { padding: 10px 14px; }
  #festival-dialog p { margin: 4px 0 8px; }
  #festival-dialog .festival-designs img, #festival-dialog .festival-preview { height: 44px; }
  #festival-dialog.festival-fair .fair-board { height: 144px; }
}
/* owner 2026-11-18: festival quest list in Mali's / the table's / the dock's window */
#festival-dialog .festival-quest { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #fff7e6; border: 1px solid #ecd6a8; color: #5a4630; font-size: 13px; }
#festival-dialog .festival-quest ul { list-style: none; margin: 6px 0; padding: 0; }
#festival-dialog .festival-quest li { margin: 4px 0; line-height: 1.4; }
#festival-dialog .festival-quest li.done { color: #8a9a7a; }
#festival-dialog .festival-quest small { color: #8a7458; }
#festival-dialog .festival-quest .note { margin: 6px 0 0; font-size: 12px; color: #7a6040; }

/* owner 2026-11-18: richer fair games (Client/js/festival-fair.js) */
.fair-hint { font-size: 12.5px; line-height: 1.45; color: #5a4a3a; }
.fair-message small { display: block; margin-top: 6px; color: #6a7a78; text-align: center; }
.fair-board { cursor: crosshair; }
#festival-dialog .fair-target { position: absolute; transform: translate(-50%, -50%); pointer-events: none; display: grid; place-items: center; font-size: 22px; }
#festival-dialog .fair-target.gold { border-color: #a07a1a; background: radial-gradient(circle, #fff6b0 0 30%, #f2c230 31% 70%, #c89418 71%); box-shadow: 0 0 10px #ffd84a; }
#festival-dialog .fair-target.lotus { border-color: #b46a8a; background: #ffe3ee; }
#festival-dialog .fair-target.clock { border-color: #3f8f86; background: #e3f6f2; }
#festival-dialog .fair-balloon { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
#festival-dialog .fair-balloon b { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: 18px; }
#festival-dialog .fair-balloon.gold img { filter: sepia(1) saturate(4) hue-rotate(-12deg) brightness(1.1); }
#festival-dialog .fair-balloon.bomb img { filter: grayscale(1) brightness(.55); }
.fair-dart { position: absolute; transform: translate(-50%, -50%); font-size: 16px; pointer-events: none; }
.fair-float { position: absolute; transform: translate(-50%, -100%); font-weight: 700; font-size: 13px; color: #2d7069; pointer-events: none; text-shadow: 0 1px 0 #fff; animation: fair-up .7s ease-out forwards; white-space: nowrap; }
.fair-float.good { color: #c27a00; font-size: 15px; } .fair-float.bad { color: #c0394a; } .fair-float.shot { color: #9a6a4a; font-size: 12px; }
@keyframes fair-up { to { transform: translate(-50%, -160%); opacity: 0; } }
