@import url('./wq-components.css');

*{box-sizing:border-box}body{margin:0;background:var(--wq-navy-deep);color:var(--wq-action-ink);font-family:var(--font-body)}.screen{position:relative;isolation:isolate;max-width:480px;min-height:100vh;min-height:100dvh;margin:auto;padding:calc(env(safe-area-inset-top,0px) + 28px) 26px calc(env(safe-area-inset-bottom,0px) + 22px);display:flex;flex-direction:column;background:var(--wq-paper)}.screen:before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:url('assets/worldmap-ink.png') center 28%/170% auto no-repeat;opacity:.12}.brand{text-align:center}.brand .eyebrow{font-size:10px;letter-spacing:.18em;color:#87691a;margin:0 0 12px}.brand p:last-child{font-family:var(--font-heading);font-weight:900;font-size:24px;line-height:1.55;margin:0}.brand span{display:block;font-size:13px;letter-spacing:.2em}.rule{width:38px;height:2px;background:var(--wq-gold);margin:22px auto}.entry{margin:auto 0;padding:22px 0}.entry h1{text-align:center;font-family:var(--font-heading);font-size:23px;margin:0 0 12px;font-weight:900}.intro{font-size:13px;line-height:1.9;text-align:center;margin:0 0 24px}.fields{background:#fffaf0eb;border:1px solid #d8c8a7;border-radius:18px;padding:23px 20px;box-shadow:0 10px 30px #16273f08}label{display:block;font-size:13px;font-weight:700;margin-bottom:10px}input{width:100%;height:58px;border:1.5px solid #b6a787;border-radius:9px;background:#fffefa;color:var(--wq-action-ink);font-family:var(--font-body);font-size:22px;text-align:center;padding:10px;letter-spacing:.08em;min-width:0}input::placeholder{font-size:15px;color:#89877e;letter-spacing:.03em}input:focus-visible{outline:3px solid var(--wq-gold);outline-offset:3px}.hint{font-size:11px;line-height:1.8;margin:10px 0 21px;color:#68604e}.wq-button{width:100%;height:54px;gap:10px}.wq-button:disabled{cursor:default}.wq-button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2}.help{font-size:11px;line-height:1.9;text-align:center;margin:22px 0 0;color:#655f51}footer{text-align:center;font-size:10px;line-height:1.8;color:#716958;padding-top:18px}footer p{margin:0 0 7px}.simon{display:none}.b{background:linear-gradient(180deg,var(--wq-navy),var(--wq-navy-deep));color:var(--wq-cream);padding-left:30px;padding-right:30px}.b:before{background-image:url('assets/worldmap-white.png');opacity:.09;background-position:center 32%}.b:after{content:"";position:absolute;inset:12px;border:1px solid #c9a22770;border-radius:22px;pointer-events:none;z-index:-1}.b .eyebrow{color:var(--wq-gold-soft)}.b .fields{color:var(--wq-action-ink);background:var(--wq-paper);border:0;box-shadow:0 14px 34px #0003}.b .help,.b footer{color:#d7cdb9}.b .rule{margin:26px auto}.c{padding-left:22px;padding-right:22px}.c:before{opacity:.22;background-size:220%;background-position:center 10%}.c .brand p:last-child{font-size:21px}.c .rule{display:none}.c .entry{position:relative;margin:10px 0 auto;padding:0}.c .simon{display:block;width:130px;height:150px;object-fit:contain;margin:0 auto -16px;position:relative;z-index:1;filter:drop-shadow(0 8px 8px #16273f18)}.c .letter{padding:38px 24px 36px;background:url('assets/letter-parchment.png') center/100% 100% no-repeat;filter:drop-shadow(0 8px 16px #49381718)}.c .fields{background:none;border:0;padding:0;box-shadow:none}.c .entry h1{font-size:22px}.c .intro{font-size:12px;margin-bottom:20px}.c .help{margin-top:15px}.c footer{padding-top:12px}@media(max-width:360px){.screen{padding-left:20px;padding-right:20px}.brand p:last-child{font-size:22px}.fields{padding:20px 16px}.c .letter{padding-left:20px;padding-right:20px}}@media(max-height:700px){.screen{padding-top:22px}.rule{margin:16px auto}.entry{padding:12px 0}.c .simon{height:110px;width:100px}.c .letter{padding-top:30px;padding-bottom:30px}}
/* Match the destination list's approved heritage artwork and font roles. */
.a::before{position:fixed;width:min(100%,480px);margin-inline:auto;background:url('assets/ui/background-heritage-stamps-v01.png') center top/cover no-repeat;mix-blend-mode:multiply;opacity:.35}
.a .brand .eyebrow{font-family:var(--font-display);font-weight:700}
.a label{font-family:var(--font-heading)}
.a .fields{background:#fffaf0}
/* A: selected Noto Sans JP / Noto Sans JP / Poppins font combination. */
.a {
  --font-heading: 'Noto Sans JP', sans-serif;
  --font-body: 'Noto Sans JP', sans-serif;
  --font-display: 'Poppins', sans-serif;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 24px calc(env(safe-area-inset-bottom, 0px) + 20px);
  font-family: var(--font-body);
}
.a .brand > p:not(.eyebrow) { margin: 0; font-family: var(--font-heading); font-size: clamp(24px, 6.5vw, 28px); font-weight: 700; line-height: 1.55; }
.a .brand span { font-size: 16px; letter-spacing: .12em; margin-bottom: 4px; }
.a .brand .eyebrow { font-size: 11px; margin-bottom: 14px; }
.a .rule { margin: 20px auto 0; }
.a .entry { margin: 30px 0 auto; padding: 0; }
.a .entry h1 { font-size: 21px; font-weight: 700; line-height: 1.5; margin-bottom: 12px; }
.a .intro { font-size: 13px; line-height: 1.85; margin-bottom: 22px; }
.a .fields { padding: 20px 18px; border-radius: 12px; }
.a label { font-size: 13px; margin-bottom: 8px; }
.a input { font-family: var(--font-body); font-size: 18px; height: 52px; letter-spacing: .04em; }
.a input::placeholder { font-size: 14px; }
.a .hint { font-size: 11px; margin: 9px 0 18px; }
.a .wq-button { font-family: var(--font-heading); font-size: 15px; font-weight: 700; height: 50px; gap: 8px; }
.a .help { font-size: 12px; margin-top: 20px; }
.a footer { font-size: 10px; padding-top: 24px; }
@media (max-width: 360px) { .a { padding-left: 20px; padding-right: 20px; } .a .fields { padding: 18px 16px; } }

.a .partner-logos { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px auto 0; padding: 12px; width: fit-content; max-width: 100%; border-radius: 10px; background: rgba(255, 250, 240, .95); }
.a .partner-logos img { display: block; object-fit: contain; max-width: 43%; width: auto; }
.a .partner-logos .tws-logo { height: 28px; }
.a .partner-logos .sekaken-logo { height: 22px; }
.a .partner-logos > span { width: 1px; height: 24px; background: rgba(19, 34, 56, .2); flex: none; }

/* Adopted entry header: the same navy and cream as the destination list. */
.a { padding-top: 0; --entry-side: 24px; }
.a .brand { margin: 0 calc(-1 * var(--entry-side)); padding: calc(env(safe-area-inset-top, 0px) + 22px) 24px 24px; background: var(--wq-navy); color: var(--wq-cream); }
.a .brand .eyebrow { color: var(--wq-gold); }
/* 協働ロゴは入力画面の下部へ戻す（10/18 本人見直し）。 */
.a footer .partner-logos { margin: 0 auto; padding: 6px 12px; gap: 12px; }
/* タイトル画像を保ち、ヘッダーの背景を共通の紺色に戻す（10/19 本人指示）。 */
.a .brand:has(.wq-title-logo) { background: var(--wq-navy); color: var(--wq-cream); }
.a .brand .wq-title-logo { display: block; width: min(100%, 348px); height: auto; margin: 0 auto; object-fit: contain; filter: drop-shadow(1px 0 0 var(--wq-cream)) drop-shadow(-1px 0 0 var(--wq-cream)) drop-shadow(0 1px 0 var(--wq-cream)) drop-shadow(0 -1px 0 var(--wq-cream)); }
.a .rule { display: none; }
@media (max-width: 360px) { .a { --entry-side: 20px; } }
/* Keep the complete entry visible on short portrait viewports, including Safari bars.
   2026-11-14: 700px → 820px so Plus/Pro Max (Safari about 739-766px high) and tall Android phones get the same compact spacing
   as the standard iPhone instead of being shrunk by invite-adventure-v1.js. The three max-height blocks of the entry page move together. */
@media (max-height: 820px) {
  .a { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .a .brand { padding: calc(env(safe-area-inset-top, 0px) + 10px) 20px 12px; }
  .a .brand .eyebrow { font-size: 10px; margin-bottom: 5px; }
  .a .brand > p:not(.eyebrow) { font-size: 24px; line-height: 1.3; }
  .a .brand span { font-size: 13px; margin-bottom: 2px; }
  .a .entry { margin-top: 12px; }
  .a .entry h1 { font-size: 20px; line-height: 1.3; margin-bottom: 6px; }
  .a .intro { font-size: 12px; line-height: 1.5; margin-bottom: 12px; }
  .a .fields { padding: 12px 14px; }
  .a label { font-size: 12px; line-height: 1.4; margin-bottom: 6px; }
  .a input { height: 44px; font-size: 16px; padding: 8px; }
  .a .hint { font-size: 10px; line-height: 1.5; margin: 6px 0 10px; }
  .a .wq-button { height: 44px; font-size: 14px; }
  .a .help { font-size: 11px; line-height: 1.5; margin-top: 10px; }
  .a footer { padding-top: 10px; font-size: 9px; line-height: 1.4; }
  .a footer p { margin-bottom: 4px; }
  .a .partner-logos { margin-top: 6px; padding: 7px 10px; gap: 12px; }
  .a .partner-logos .tws-logo { height: 23px; }
  .a .partner-logos .sekaken-logo { height: 18px; }
  .a .partner-logos > span { height: 20px; }
}
@media (max-height: 480px) {
  .a .brand { padding-top: calc(env(safe-area-inset-top, 0px) + 6px); padding-bottom: 8px; }
  .a .brand > p:not(.eyebrow) { font-size: 22px; }
  .a .entry { margin-top: 8px; }
  .a .intro { margin-bottom: 8px; }
  .a .help { margin-top: 6px; }
  .a footer { padding-top: 6px; }
}

/* Invalid codes are identified by both the field outline and explanatory text. */
.a input[aria-invalid="true"] { border: 2px solid #b42318; background: #fff5f4; }
.a input[aria-invalid="true"]:focus-visible { outline-color: #b42318; }
.a input[aria-invalid="true"] + .hint { color: #b42318; font-weight: 700; }

/* 冒険の暗号（2026-10-18）：「謎を解く」、10ケタのマス、謎の地図、暗号が通ったときのシモン。動きは invite-adventure-v1.js。 */
.a .intro span { display: inline-block; }
/* 暗号入力前のリードは短い画面でも読みやすい大きさを保つ（10/18 本人指示）。 */
.a:has(#inviteForm) .intro { font-size: 18px; }
@media (min-width: 768px) { .a:has(#inviteForm) .intro { font-size: 20px; } }
/* 「謎を解く」は通常のボタンサイズ（10/18 本人見直し）。黄色と、入力完了まで灰色の「冒険をはじめる」は維持。 */
.a { --wq-riddle-gap: 50px; }
.a .wq-riddle-open { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; margin: 0 0 var(--wq-riddle-gap); padding: 0 22px; border: 0; border-radius: 999px; background: var(--wq-button-fill); color: var(--wq-action-ink); font-family: var(--font-heading); font-size: 15px; font-weight: 700; letter-spacing: .08em; cursor: pointer; box-shadow: var(--wq-button-shadow); -webkit-tap-highlight-color: transparent; }
/* 謎を解くボタンと暗号入力の間に、ボタン1個分の空白と薄い線を置く。 */
.a .wq-riddle-open:not([hidden]) + .wq-code-entry { position: relative; }
.a .wq-riddle-open:not([hidden]) + .wq-code-entry::before { content: ""; position: absolute; top: calc(var(--wq-riddle-gap) * -.5); left: 0; right: 0; border-top: 1px solid rgba(118, 85, 66, .22); pointer-events: none; }
.a .wq-riddle-open svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.a .wq-riddle-open svg path { fill: currentColor; stroke: none; }
.a .wq-riddle-open:active { transform: translateY(2px); }
.a .fields:has(.wq-code-cells.is-ready:not([data-filled="10"])) button[type="submit"]:not(:disabled) { background: #d9d3c5; color: #776f60; box-shadow: none; }
/* まちがい・失敗の案内は赤字（invite-adventure-v1.js が data-tone を付ける）。 */
#inviteStatus[data-tone="error"] { color: #b42318; font-weight: 700; }
/* 初回のお知らせの右上の×（「次へ」と同じく閉じる）。 */
.wq-invite-spot__xform { margin: 0; }
.wq-invite-spot__x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid rgba(34, 48, 74, .2); border-radius: 50%; background: #fffaf0; color: #22304a; cursor: pointer; }
.wq-invite-spot__x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wq-invite-spot__x:focus-visible { outline: 3px solid var(--wq-gold); outline-offset: 2px; }
.a .wq-riddle-open:focus-visible { outline: 3px solid var(--wq-gold); outline-offset: 3px; }
.a .wq-riddle-open[hidden] { display: none; }
.a .hint span { display: inline-block; }

/* 準備ができたら（is-ready）、本物の入力欄は透明にしてマスの上に重ねる（数字はマスに写す）。
   スクリプトが読めないときはマスを出さず、ふつうの入力欄のまま使う。 */
.a .wq-code-cells.is-ready { position: relative; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; border-radius: 9px; }
.a .wq-code-cells:not(.is-ready) .wq-code-cell { display: none; }
.a .wq-code-cells.is-ready input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent; font-size: 16px; letter-spacing: 0; text-align: left; cursor: text; }
.a .wq-code-cells.is-ready input::selection { background: transparent; }
/* 画面全体を縮めたとき（invite-adventure-v1.js が --wq-fit を置く）も、見えない入力欄の文字は画面上で16pxを保つ（iPhoneの入力時の拡大を防ぐ）。 */
.a .wq-code-cells.is-ready input { font-size: calc(16px / var(--wq-fit, 1)); }
.a .wq-code-cells.is-ready input:focus-visible { outline: none; }
.a .wq-code-cells.is-ready.is-focused { outline: 3px solid rgba(201, 162, 39, .55); outline-offset: 4px; }
.a .wq-code-cell { height: 46px; display: flex; align-items: center; justify-content: center; border: 1.5px solid #8f7f5c; border-radius: 7px; background: #fffefa; color: var(--wq-navy); font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1; transition: background-color .15s, border-color .15s, color .15s; }
.a .wq-code-cell.is-filled { border-color: var(--wq-navy); background: var(--wq-navy); color: #fff7e6; }
.a .wq-code-cells.is-focused .wq-code-cell.is-next { border: 2px solid var(--wq-gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .25); }
.a .wq-code-cells.is-focused .wq-code-cell.is-next::after { content: ""; width: 2px; height: 22px; background: var(--wq-navy); animation: wqCodeCaret 1s steps(1) infinite; }
.a .wq-code-cells.is-disabled .wq-code-cell { opacity: .55; }
@keyframes wqCodeCaret { 50% { opacity: 0; } }
@media (max-width: 360px) { .a .wq-code-cells { gap: 3px; } .a .wq-code-cell { height: 40px; font-size: 18px; border-radius: 6px; } }
@media (max-height: 820px) {
  .a { --wq-riddle-gap: 44px; }
  .a .wq-riddle-open { height: 44px; font-size: 14px; }
  .a .wq-code-cell { height: 40px; font-size: 19px; }
}

/* 短いiPhone SEでも、キーボードを閉じた入力画面を1画面に収める。拡大・エラー時のスクロールは妨げない。 */
.a:has(#inviteForm) .letter > .hint { text-align: center; margin: 0 0 12px; font-size: 11px; line-height: 1.6; }
/* ボタンは fieldset（display:contents）の中にあるので子孫の指定にする（「>」だとマスとボタンの間が0になっていた。2026-11-14）。 */
.a:has(#inviteForm) .fields .wq-button { margin-top: 14px; }
/* 2026-11-14：見出し・案内文が1行ずつ増えたので余白だけを詰め、SE（375×548）で3行のエラー文が出ても「ご利用前の確認」と下のロゴまで収める。 */
@media (max-height: 820px) {
  .a:has(#inviteForm) { --wq-riddle-gap: 10px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 3px); }
  .a:has(#inviteForm) .brand { padding-top: calc(env(safe-area-inset-top, 0px) + 6px); padding-bottom: 6px; }
  .a:has(#inviteForm) .wq-title-logo { width: auto; max-width: 100%; max-height: 64px; }
  .a:has(#inviteForm) .entry { margin-top: 6px; }
  .a:has(#inviteForm) .entry h1 { margin-bottom: 4px; }
  .a:has(#inviteForm) .intro { line-height: 1.45; margin-bottom: 4px; }
  .a:has(#inviteForm) .letter > .hint { line-height: 1.5; margin-bottom: 6px; }
  .a:has(#inviteForm) .fields { padding-top: 8px; padding-bottom: 8px; }
  .a:has(#inviteForm) label { margin-bottom: 4px; }
  .a:has(#inviteForm) .wq-code-cell { height: 44px; }
  .a:has(#inviteForm) .fields .wq-button { margin-top: 8px; }
  .a:has(#inviteForm) #inviteStatus { margin-top: 6px; line-height: 1.45; }
  .a:has(#inviteForm) .wq-entry-checks-link { margin-top: 2px; padding: 5px 10px; }
  .a:has(#inviteForm) footer { padding-top: 2px; }
  .a:has(#inviteForm) footer .partner-logos { padding: 4px 10px; }
  /* 2026-11-14 本人「4でええやん」：高さに余裕がある画面（標準のiPhone・Pro Max など）は、空きを下にためずに、
     タイトルの画像と各部の間へ高さに応じて配る。SE（548px）では上の値と同じ。文字・ボタン・入力欄の大きさは変えない。
     dvh が使えないブラウザは上の固定値のまま（var() に入れる値が無効にならないよう @supports で囲む）。 */
  @supports (height: 100dvh) {
    .a:has(#inviteForm) { --wq-riddle-gap: clamp(10px, calc((100dvh - 548px) * .22), 36px); }
    .a:has(#inviteForm) .brand { padding-top: calc(env(safe-area-inset-top, 0px) + clamp(6px, calc((100dvh - 548px) * .1), 18px)); padding-bottom: clamp(6px, calc((100dvh - 548px) * .1), 18px); }
    .a:has(#inviteForm) .wq-title-logo { max-height: clamp(64px, calc(64px + (100dvh - 548px) * .3), 110px); }
    .a:has(#inviteForm) .entry { margin-top: clamp(6px, calc((100dvh - 548px) * .12), 28px); }
    .a:has(#inviteForm) .entry h1 { margin-bottom: clamp(4px, calc((100dvh - 548px) * .05), 10px); }
    .a:has(#inviteForm) .intro { margin-bottom: clamp(4px, calc((100dvh - 548px) * .06), 12px); }
    .a:has(#inviteForm) .letter > .hint { margin-bottom: clamp(6px, calc((100dvh - 548px) * .08), 16px); }
    .a:has(#inviteForm) .wq-entry-checks-link { margin-top: clamp(2px, calc((100dvh - 548px) * .06), 12px); }
  }
}
@media (max-height: 480px) {
  .a:has(#inviteForm) { --wq-riddle-gap: 10px; }
  .a:has(#inviteForm) .brand { padding-top: calc(env(safe-area-inset-top, 0px) + 6px); padding-bottom: 6px; }
  .a:has(#inviteForm) .wq-title-logo { max-height: 56px; }
  .a:has(#inviteForm) .entry { margin-top: 6px; }
  .a:has(#inviteForm) .intro { line-height: 1.4; }
  .a:has(#inviteForm) .fields { padding: 8px 12px; }
  .a:has(#inviteForm) footer { padding-top: 2px; }
}
/* 謎の地図：全画面。縦持ちは「回転」で横長の地図を大きく、横持ちは画面いっぱいに出す。 */
.wq-riddle { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0c1526; color: #f2e6cf; overflow: hidden; font-family: 'Noto Sans JP', sans-serif; }
.wq-riddle[open] { display: flex; flex-direction: column; }
.wq-riddle::backdrop { background: #0c1526; }
.wq-riddle__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 8px 20px; }
.wq-riddle__bar h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .1em; outline: none; }
/* 開いている間は、後ろのページを動かさない。 */
html:has(.wq-riddle[open]), html:has(.wq-riddle[open]) body { overflow: hidden; }
.wq-riddle__close { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid rgba(242, 230, 207, .35); border-radius: 50%; background: rgba(12, 21, 38, .6); color: inherit; cursor: pointer; }
.wq-riddle__close svg, .wq-riddle__rotate svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wq-riddle__stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: zoom-in; }
.wq-riddle[data-zoomed] .wq-riddle__stage { cursor: grab; }
.wq-riddle__frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transform-origin: center; }
/* 読み込み中は羊皮紙色の枠と「読み込んでいます」を先に出す。 */
.wq-riddle__frame.is-loading { border-radius: 4px; background: #e9d9b6; }
.wq-riddle__frame.is-loading::after { content: "地図を読み込んでいます…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6b5a39; font-size: 13px; font-weight: 700; }
.wq-riddle__frame.is-loading img { visibility: hidden; }
.wq-riddle__frame img { position: absolute; left: 50%; top: 50%; display: block; max-width: none; border-radius: 4px; box-shadow: 0 12px 34px rgba(0, 0, 0, .55); pointer-events: none; user-select: none; -webkit-user-drag: none; }
.wq-riddle__tools { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 16px); }
.wq-riddle__hint { margin: 0; font-size: 12px; line-height: 1.6; text-align: center; color: rgba(242, 230, 207, .72); }
.wq-riddle__hint span { display: inline-block; }
.wq-riddle[data-zoomed] .wq-riddle__hint { visibility: hidden; }
/* 回転中：見出しの帯を外して地図に高さを回す（閉じるのは下の2つのボタン）。地図の上が画面の右に来るので、
   ヒントは「左に倒して」に替える（invite-adventure-v1.js）。 */
.wq-riddle[data-rotated] .wq-riddle__bar { display: none; }
.wq-riddle[data-rotated] .wq-riddle__tools { padding-top: 8px; }
.wq-riddle[data-rotated] .wq-riddle__hint { color: var(--wq-gold-soft, #e8cd85); font-weight: 700; }
.wq-riddle__row { display: flex; gap: 10px; }
.wq-riddle__rotate { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 96px; height: 50px; padding: 0 16px; border: 1px solid rgba(242, 230, 207, .45); border-radius: 999px; background: none; color: #f2e6cf; font: 700 14px 'Noto Sans JP', sans-serif; cursor: pointer; }
.wq-riddle__rotate[aria-pressed="true"] { border-color: var(--wq-gold); color: var(--wq-gold-soft); }
.wq-riddle .wq-riddle__back { flex: 1; height: 50px; font-size: 15px; }
.wq-riddle button:focus-visible { outline: 3px solid var(--wq-gold); outline-offset: 3px; }
/* 横持ち：見出しと「暗号を入力する」は地図の上に重ねて、地図を画面いっぱいにする。回転は要らない。 */
@media (orientation: landscape) {
  .wq-riddle__bar { position: absolute; top: 0; right: 0; z-index: 2; padding: calc(env(safe-area-inset-top, 0px) + 8px) calc(env(safe-area-inset-right, 0px) + 10px) 0 0; }
  .wq-riddle__bar h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wq-riddle__tools { position: absolute; right: calc(env(safe-area-inset-right, 0px) + 10px); bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 2; padding: 0; }
  .wq-riddle__hint, .wq-riddle__rotate { display: none; }
  .wq-riddle .wq-riddle__back { flex: none; width: auto; height: 42px; padding: 0 20px; font-size: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
}

/* 暗号が通ったとき：マスが金色になり、シモンが一言（約2秒で次の画面へ）。 */
.wq-code-solved .a .wq-code-cell.is-filled { border-color: var(--wq-gold); background: var(--wq-gold); color: var(--wq-navy); animation: wqCodeSolved .5s cubic-bezier(.2, .8, .2, 1) both; }
.wq-code-solved .a .wq-code-cell:nth-child(n+3) { animation-delay: .04s; } .wq-code-solved .a .wq-code-cell:nth-child(n+5) { animation-delay: .08s; }
.wq-code-solved .a .wq-code-cell:nth-child(n+7) { animation-delay: .12s; } .wq-code-solved .a .wq-code-cell:nth-child(n+9) { animation-delay: .16s; }
@keyframes wqCodeSolved { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); } }
.wq-solved { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 18px); background: linear-gradient(180deg, rgba(12, 21, 38, .08) 0%, rgba(12, 21, 38, .62) 100%); font-family: 'Noto Sans JP', sans-serif; animation: wqSolvedFade .3s ease-out both; }
.wq-solved[hidden] { display: none; }
.wq-solved__inner { display: flex; align-items: flex-end; width: min(100%, 440px); }
.wq-solved__bubble { position: relative; flex: 1; margin: 0 -8px 72px 0; padding: 14px 16px 15px; border: 1px solid rgba(201, 162, 39, .45); border-radius: 18px 18px 6px 18px; background: var(--wq-navy, #16273f); color: #fff7e6; font-size: 18px; font-weight: 700; line-height: 1.6; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); animation: wqSolvedBubble .45s .2s cubic-bezier(.2, .8, .2, 1) both; }
.wq-solved__bubble > span:not(.wq-solved__name) { display: inline-block; }
.wq-solved__name { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: .14em; color: var(--wq-gold-soft, #e8cd85); }
.wq-solved__simon { flex: none; width: 128px; height: auto; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .3)); animation: wqSolvedSimon .55s .05s cubic-bezier(.2, .9, .25, 1.2) both; }
@keyframes wqSolvedFade { from { opacity: 0; } }
@keyframes wqSolvedBubble { from { opacity: 0; transform: translateY(12px) scale(.94); } }
@keyframes wqSolvedSimon { from { opacity: 0; transform: translateY(40px); } }
@media (prefers-reduced-motion: reduce) { .wq-solved, .wq-solved__bubble, .wq-solved__simon, .wq-code-solved .a .wq-code-cell.is-filled, .a .wq-code-cells.is-focused .wq-code-cell.is-next::after { animation: none; } }

/* QR arrival: read before entering the code; the confirmation stays within reach. */
.wq-entry-checks{width:min(420px,calc(100vw - 28px));max-height:calc(100dvh - 28px);padding:0;border:1px solid #d7c8a8;border-radius:22px;background:#fffaf0;color:#22304a;box-shadow:0 22px 70px #0005;text-align:left;overflow:hidden}.wq-entry-checks[open]{display:flex;flex-direction:column}.wq-entry-checks::backdrop{background:#101c32cc}.wq-entry-checks__head{flex:none;padding:14px 18px;background:#f5cd57;border-bottom:1px solid #d8b544}.wq-entry-checks h2{margin:0;font-size:20px;line-height:1.4;color:#1c2b45}.wq-entry-checks h2:focus{outline:none}.wq-entry-checks__body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 22px 10px}.wq-entry-checks section{padding:17px 0;border-bottom:1px solid #ded6c5}.wq-entry-checks section:last-child{border:0}.wq-entry-checks h3{margin:0 0 10px;font-size:15px;line-height:1.55}.wq-entry-checks p{font-size:12px;line-height:1.85;margin:8px 0 0;overflow-wrap:anywhere}.wq-entry-checks__browsers{display:grid;grid-template-columns:1fr 1fr;border:1px solid #ded6c5;border-radius:12px;background:#fff;overflow:hidden}.wq-entry-checks__browsers>div{display:flex;flex-direction:column;gap:5px;padding:12px 6px;text-align:center}.wq-entry-checks__browsers>div+div{border-left:1px solid #ded6c5}.wq-entry-checks__browsers span{font-size:11px}.wq-entry-checks__browser-icon{display:block;align-self:center;object-fit:contain;margin:2px 0}.wq-entry-checks__browsers strong{font-size:23px;line-height:1.3}.wq-entry-checks__browsers small{font-size:10px;color:#5e6777}.wq-entry-checks details{margin-top:12px;border:1px solid #d7c8a8;border-radius:10px;background:#fff}.wq-entry-checks summary{cursor:pointer;font-size:12px;font-weight:700;line-height:1.7;padding:11px 12px}.wq-entry-checks__settings{padding:0 12px 13px}.wq-entry-checks h4{font-size:12px;margin:12px 0 0}.wq-entry-checks .wq-entry-checks__note{border-left:3px solid #d3a72e;padding-left:10px;color:#655c45}.wq-entry-checks__foot{flex:none;padding:12px 20px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid #ded6c5;background:#fffaf0}.wq-entry-checks__foot .wq-button{height:48px;font-size:14px}.wq-entry-checks-link{display:block;margin:14px auto 0;padding:7px 10px;border:0;background:none;color:#e9d49a;text-decoration:underline;text-underline-offset:3px;font:inherit;font-size:11px;cursor:pointer}.wq-entry-checks-link:focus-visible{outline:2px solid #f5cd57;outline-offset:2px}

/* Use the approved heritage background; the labels remain text beside the brand marks. */
.wq-entry-checks{background-image:linear-gradient(rgba(255,250,240,.76),rgba(255,250,240,.85)),url('assets/ui/background-heritage-stamps-v01.png');background-position:center top;background-size:cover;background-repeat:no-repeat}.wq-entry-checks__head{background:#f5cd57e6}.wq-entry-checks__foot{background:#fffaf0ed}.wq-entry-checks__apps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:14px 0 12px}.wq-entry-checks__apps>div{display:flex;flex-direction:column;align-items:center;gap:8px;padding:10px 2px;border:1px solid #ded6c5;border-radius:10px;background:#fff}.wq-entry-checks__apps svg{display:block;width:34px;height:34px}.wq-entry-checks__apps span{font-size:9px;line-height:1.4;font-weight:700}
