#naiwaCaptcha {
  width: min(440px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid #c9c9c9;
  border-radius: 3px;
  background: #fff;
  color: #242424;
  box-shadow: 0 4px 24px #0005;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  container-type: normal;
  overflow: auto;
  overscroll-behavior: contain;
}

#naiwaCaptcha::backdrop { background: #0006; }
#naiwaCaptcha *, #naiwaCaptcha *::before, #naiwaCaptcha *::after { box-sizing: border-box; }
#naiwaCaptcha button { font-family: inherit; border-radius: 2px; letter-spacing: 0; font-style: normal; }
#naiwaCaptcha button:focus-visible { outline: 3px solid #f2b600; outline-offset: -3px; }
#naiwaCaptcha .captcha-card { padding: 7px; }
#naiwaCaptcha .captcha-header { padding: 15px 17px 17px; background: #427fdf; color: #fff; }
#naiwaCaptcha .captcha-header h2 { margin: 0; color: #fff; font-size: 23px; font-weight: 700; line-height: 1.35; }
#naiwaCaptcha .captcha-header p { margin: 6px 0 0; color: #fff; font-size: 13px; }
#naiwaCaptcha .captcha-scene { position: relative; width: 100%; overflow: hidden; background: #dedede; isolation: isolate; }
#naiwaCaptcha .captcha-card > .captcha-scene { margin-top: 7px; }
#naiwaCaptcha .captcha-photo { display: block; width: 100%; height: 100%; max-width: none; object-fit: fill; }
#naiwaCaptcha .captcha-sprite { position: absolute; display: block; overflow: hidden; pointer-events: none; }
#naiwaCaptcha .captcha-sprite-image { position: absolute; width: 150.9434%; height: 100.4885%; left: -22.0126%; top: -.4885%; max-width: none; }
#naiwaCaptcha .captcha-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); z-index: 2; }
#naiwaCaptcha .captcha-tile { display: block; position: relative; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 1px solid #fffffff0; border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; }
#naiwaCaptcha .captcha-tile:disabled { cursor: wait; opacity: 1; }
#naiwaCaptcha .captcha-tile.is-selected { background: #2d7cdf28; box-shadow: inset 0 0 0 5px #2d7cdf; }
#naiwaCaptcha .captcha-tile.is-selected::after { content: "✓"; position: absolute; left: 5px; top: 5px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #2d7cdf; color: #fff; font-size: 19px; font-weight: bold; }
#naiwaCaptcha .captcha-tile.is-answer { background: #20af3b16; box-shadow: inset 0 0 0 4px #20a442; }
#naiwaCaptcha .captcha-tile.is-wrong { background: #dc2f3828; box-shadow: inset 0 0 0 3px #dc2f38; }
#naiwaCaptcha .captcha-selected-count, #naiwaCaptcha .captcha-countdown { min-height: 22px; margin: 9px 8px; color: #626262; font-size: 13px; text-align: center; }
#naiwaCaptcha .captcha-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 4px 5px; border-top: 1px solid #ddd; }
#naiwaCaptcha .captcha-back, #naiwaCaptcha .captcha-submit, #naiwaCaptcha .captcha-retry { min-height: 40px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
#naiwaCaptcha .captcha-back { border: 1px solid #d3d3d3; background: #fff; color: #656565; }
#naiwaCaptcha .captcha-submit { min-width: 100px; border: 1px solid #3475d2; background: #427fdf; color: #fff; }
#naiwaCaptcha .captcha-submit:disabled { opacity: .5; cursor: wait; }
#naiwaCaptcha .captcha-retry { min-height: 30px; padding: 4px 8px; border: 1px solid #c5c5c5; background: #fff; color: #2768c4; }
#naiwaCaptcha .captcha-answer-copy { margin: 11px 8px; color: #a62a26; font-size: 14px; font-weight: 600; }
#naiwaCaptcha .captcha-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 9px; margin: 12px 0 0; }
#naiwaCaptcha .captcha-detail { min-width: 0; margin: 0; }
#naiwaCaptcha .captcha-zoom { position: relative; aspect-ratio: 1; overflow: hidden; border: 2px solid #e6b81b; background: #ddd; }
#naiwaCaptcha .captcha-zoom-ring { position: absolute; z-index: 2; width: 46%; height: 46%; border: 2px solid #ff2c2c; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 1px #fff9; }
#naiwaCaptcha .captcha-detail figcaption { margin-top: 4px; color: #565656; font-size: 12px; text-align: center; }
#naiwaCaptcha .captcha-overview { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
#naiwaCaptcha .captcha-overview > .captcha-scene { width: 132px; flex: 0 0 132px; }
#naiwaCaptcha .captcha-overview > p { max-width: 100px; margin: 0; color: #626262; font-size: 12px; }
#naiwaCaptcha .captcha-empty { margin: 22px; }

#naiwaCaptcha .cookie-board {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 420 / 260;
  background: #fae9ac url("captcha/cookie-counter.png") center / 100% 100% no-repeat;
  user-select: none;
}
#naiwaCaptcha .cookie-board::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 40%;
  background: white url("captcha/cookie-user.jpg") 46% 45% / 185% auto no-repeat;
  border-right: 2px solid #312d35; pointer-events: none;
}
#naiwaCaptcha .cookie-head {
  position: absolute;
  left: 10.5%; top: 13.5%; width: 12%; height: 15%;
  padding: 0; border: 0; border-radius: 38%; background: transparent;
}
#naiwaCaptcha .cookie-head.is-hungry { outline: 3px dashed #bd4130; outline-offset: 2px; }
#naiwaCaptcha .cookie-user-label {
  position: absolute; left: 11%; top: 73%; padding: 2px 10px;
  border: 2px solid #312d35; background: #fff6d6; color: #312d35;
  box-shadow: 2px 2px #312d35; font-size: 16px; transform: rotate(-6deg);
}
#naiwaCaptcha .cookie-food {
  position: absolute; display: grid; place-items: center;
  width: 13%; height: 19%; border: 0; padding: 0;
  background: transparent; box-shadow: none; color: #322817;
  font: clamp(26px, 8vw, 40px)/1 "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  filter: drop-shadow(1px 2px 1px #374c424d); cursor: grab; touch-action: none;
}
#naiwaCaptcha .cookie-food.in-hand {
  z-index: 2; cursor: grabbing; filter: drop-shadow(3px 5px 2px #47392255);
}
#naiwaCaptcha .cookie-status {
  margin: 10px 6px; min-height: 1.5em;
  color: #4c392f; font-size: 14px; font-weight: bold; text-align: center;
}
#naiwaCaptcha .cookie-status:empty { display: none; }
#naiwaCaptcha .cookie-confirm {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px; background: #30251670;
}
#naiwaCaptcha .cookie-confirm p {
  width: min(100%, 330px); margin: 0; padding: 18px 12px;
  background: #fff9df; border: 2px solid #312d35; box-shadow: 3px 3px #312d35;
  color: #302516; font-size: 17px; font-weight: bold; text-align: center;
}
#naiwaCaptcha .cookie-confirm button { margin-top: 10px; }

#naiwaCaptcha .captcha-sentence { font-size: 16px; line-height: 1.65; }
#naiwaCaptcha .captcha-sentence-question { margin: 18px 10px 12px; color: #242424; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
#naiwaCaptcha .captcha-sentence-hint { margin: -4px 10px 16px; color: #626262; font-size: 14px; }
#naiwaCaptcha .captcha-sentence-form { margin: 0; }
#naiwaCaptcha .captcha-sentence-label { display: block; margin: 14px 10px 7px; color: #424242; font-size: 14px; font-weight: 600; }
#naiwaCaptcha .captcha-sentence-input { display: block; width: calc(100% - 20px); min-height: 136px; margin: 0 10px; padding: 11px 12px; border: 1px solid #b5b5b5; border-radius: 2px; background: #fff; color: #242424; font: inherit; line-height: 1.65; resize: vertical; }
#naiwaCaptcha .captcha-sentence-input::placeholder { color: #777; opacity: 1; }
#naiwaCaptcha .captcha-sentence-input:focus { outline: 2px solid #427fdf; outline-offset: 1px; border-color: #427fdf; }
#naiwaCaptcha .captcha-sentence-error { min-height: 23px; margin: 7px 10px 12px; color: #b52b2b; font-size: 14px; }
#naiwaCaptcha .captcha-sentence-result { margin: 16px 10px; padding: 10px 12px; border-left: 4px solid; font-weight: 700; }
#naiwaCaptcha .captcha-sentence-result.is-correct { border-color: #21883d; background: #edf8ef; color: #1d7134; }
#naiwaCaptcha .captcha-sentence-result.is-incorrect { border-color: #c33b35; background: #fff0ef; color: #a52c28; }
#naiwaCaptcha .captcha-sentence-submitted, #naiwaCaptcha .captcha-sentence-reference { margin: 14px 10px; }
#naiwaCaptcha .captcha-sentence-submitted h3, #naiwaCaptcha .captcha-sentence-reference h3 { margin: 0 0 5px; color: #626262; font-size: 14px; font-weight: 600; }
#naiwaCaptcha .captcha-sentence-reference h3 { color: #2868c4; }
#naiwaCaptcha .captcha-sentence-quote { margin: 0; padding: 10px 12px; border: 1px solid #e0e0e0; background: #fafafa; color: #242424; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
#naiwaCaptcha .captcha-sentence-reference .captcha-sentence-quote { border-color: #d4e1f5; background: #f4f8fe; }
#naiwaCaptcha .captcha-sentence .captcha-actions { margin-top: 16px; }

@media (max-width: 420px) {
  #naiwaCaptcha .captcha-header { padding: 12px; }
  #naiwaCaptcha .captcha-header h2 { font-size: 20px; }
  #naiwaCaptcha .captcha-tile.is-selected::after { width: 21px; height: 21px; left: 3px; top: 3px; font-size: 16px; }
}
