.tea-reward-claim { --reward-accent:#f5cb72; position:fixed; z-index:16; inset:auto auto auto 50%; top:calc(var(--view-top,0px) + var(--view-height,100dvh) * .39); width:min(710px,calc(100vw - 36px)); max-height:calc(var(--view-height,100dvh) * .68); transform:translate(-50%,-42%); padding:22px; border:1px solid #f6d59880; border-radius:23px; background:radial-gradient(ellipse at 23% 43%,#5a401b,#20160f 63%); color:#fff4d9; box-shadow:0 18px 66px #000b,0 0 40px #d4984630; }
.tea-reward-claim:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr) minmax(190px,1fr); align-items:center; gap:22px; }
.tea-reward-claim[data-docked=true]:not([hidden]) { inset:calc(var(--view-top) + var(--view-height) * .27) max(10px,env(safe-area-inset-right)) auto auto; width:clamp(84px,12vw,154px); transform:none; padding:5px; display:block; border-radius:12px; z-index:17; }
.tea-reward-claim[data-docked=true] .tea-reward-content { gap:3px; }
.tea-reward-claim[data-docked=true] .tea-reward-content h2 { font:700 clamp(10px,1.3vw,14px)/1.22 sans-serif; }
.tea-reward-claim[data-docked=true] :is(.tea-reward-art,.tea-reward-giver,.tea-reward-instruction,.tea-reward-open) { display:none; }
.tea-reward-claim[data-docked=true] .tea-reward-link { width:100%; margin:0; }
.tea-page:has(#teaQuiz:not([hidden])) .tea-reward-claim[data-docked=true] { top:auto; bottom:calc(var(--keyboard-gap) + var(--footer-height) + 10px); }
.tea-reward-claim[data-giver=nene],.tea-reward-claim[data-giver=yodo] { --reward-accent:#fac0ce; background:radial-gradient(ellipse at 24% 38%,#674354,#25151c 68%); }
.tea-reward-claim[data-giver=ieyasu] { --reward-accent:#d7eab2; background:radial-gradient(ellipse at 24% 38%,#424b27,#151d18 68%); }
.tea-reward-close { position:absolute; z-index:3; top:9px; right:11px; padding:0; width:36px; height:36px; border:1px solid #f4e5c55e; border-radius:50%; background:#120f0d; color:#fff0cc; font:28px/1 sans-serif; }
.tea-reward-art { position:relative; min-width:0; isolation:isolate; --offer-start:-66px; }
.tea-reward-claim[data-side=right] .tea-reward-art { --offer-start:66px; }
.tea-reward-art img { display:block; width:100%; height:auto; position:relative; z-index:1; filter:drop-shadow(0 12px 15px #120d087d); }
.tea-reward-art span { position:absolute; inset:13%; border-radius:50%; background:radial-gradient(ellipse,var(--reward-accent),transparent 66%); opacity:.28; filter:blur(10px); }
.tea-reward-content { display:grid; justify-items:center; gap:7px; position:relative; z-index:2; text-align:center; }
.tea-reward-giver,.tea-reward-instruction { margin:0; }
.tea-reward-giver { font-size:clamp(11px,2vw,15px); color:var(--reward-accent); }
.tea-reward-content h2 { margin:0; color:#fff3d7; font:700 clamp(24px,5vw,34px)/1.24 "Yu Mincho",serif; }
.tea-reward-instruction { font-size:clamp(11px,2vw,15px); line-height:1.55; }
.tea-reward-link { display:block; width:clamp(142px,26vh,228px); aspect-ratio:1; margin:3px 0; border-radius:6px; background:white; overflow:hidden; }
.tea-reward-link img { display:block; width:100%; height:100%; image-rendering:pixelated; }
.tea-reward-open { color:#fff0c1; font-size:12px; text-underline-offset:3px; }
.tea-reward-button { color:#ffe6a7; border-color:#edc477a0; }
.tea-reward-sparks { position:absolute; left:26%; top:45%; z-index:0; pointer-events:none; }
.tea-reward-sparks i { position:absolute; width:8px; height:10px; background:var(--reward-accent); border-radius:1px; opacity:0; animation:tea-claim-spark 1.6s ease-out var(--delay) both; }
.tea-reward-claim[data-celebrate=true] .tea-reward-art img { animation:tea-claim-offer 5s ease both; }
.tea-reward-claim[data-celebrate=true] .tea-reward-art span { animation:tea-claim-glow 1.4s ease-out both; }
@keyframes tea-claim-offer { 0% { opacity:0; transform:translateX(var(--offer-start)) rotate(-14deg) scale(.64); } 14% { opacity:1; transform:translateY(-7%) rotate(5deg) scale(1.12); } 80% { opacity:1; transform:translateY(-3%) scale(1.22); } 100% { opacity:0; transform:translateY(-5%) scale(1.5); } }
@keyframes tea-claim-glow { 0%,100% { opacity:.28; transform:scale(.8); } 43% { opacity:.65; transform:scale(1.27); } }
@keyframes tea-claim-spark { 0% { opacity:0; } 17%,38% { opacity:.9; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(var(--turn)); } }

.tea-celebration-layer { position:absolute; inset:0; z-index:7; overflow:hidden; pointer-events:none; }
.tea-party-text { display:block; position:absolute; top:25%; left:50%; width:max-content; max-width:92%; transform:translateX(-50%); padding:6px 16px; border-radius:999px; background:#261708dc; color:#fff3bc; box-shadow:0 0 28px #eaab4270; font:700 clamp(26px,6vw,56px)/1.15 "Yu Mincho",serif; text-align:center; animation:tea-party-word 7.2s ease both; }
.tea-celebration-layer i { position:absolute; left:var(--x); top:-20px; width:clamp(5px,1vw,12px); height:9px; background:var(--tone); animation:tea-party-paper var(--time) linear var(--delay) both; }
@keyframes tea-party-word { 0% { opacity:0; transform:translate(-50%,7px) scale(.8); } 10%,82% { opacity:1; transform:translateX(-50%); } 100% { opacity:.35; } }
@keyframes tea-party-paper { 0% { transform:translate(0,-12px) rotate(0); } 75% { opacity:.86; } 100% { opacity:0; transform:translate(var(--drift),94vh) rotate(560deg); } }

.tea-photo { position:fixed; z-index:15; inset:0; pointer-events:none; color:#fff4c4; text-align:center; }
.tea-photo-frame { position:absolute; inset:7vh 7vw; border:2px solid #f7d88b; box-shadow:inset 0 0 0 6px #3b241164,0 0 30px #0005; border-radius:20px; }
.tea-photo-caption { display:contents; text-shadow:0 3px 13px #000; }
.tea-photo-count,.tea-photo-hint,.tea-photo-caption:has(.tea-photo-copy:not([hidden])) { position:absolute; left:50%; transform:translateX(-50%); width:max-content; max-width:78vw; }
.tea-photo-count { top:18%; font:700 clamp(36px,9vw,92px) "Yu Mincho",serif; }
.tea-photo-caption:has(.tea-photo-copy:not([hidden])) { bottom:9%; display:grid; justify-items:center; gap:clamp(2px,.6vh,6px); }
.tea-photo-caption:has(.tea-photo-copy:not([hidden])) :is(.tea-photo-count,.tea-photo-hint) { position:static; max-width:100%; transform:none; }
.tea-photo-caption:has(.tea-photo-copy:not([hidden])) .tea-photo-count { order:1; font-size:clamp(12px,2vw,18px); }
.tea-photo-copy { padding:9px clamp(13px,3vw,34px); border:1px solid #f7d88b9c; border-radius:12px; background:#21150ee8; }
.tea-photo-name { display:block; overflow-wrap:anywhere; font:700 clamp(24px,min(4.4vw,6vh),48px)/1.16 "Yu Mincho",serif; }
.tea-photo-subtitle,.tea-photo-date { display:block; }
.tea-photo-subtitle { margin:.3em 0; color:#fff1ce; font:600 clamp(13px,1.8vw,22px)/1.3 "Yu Mincho",serif; }
.tea-photo-date { margin-top:.4em; color:#ead29d; font-size:clamp(11px,1.4vw,16px); font-variant-numeric:tabular-nums; }
.tea-photo-copy p { margin:3px 0 0; color:#ffdc8f; font:700 clamp(15px,min(2.5vw,4.3vh),24px)/1.25 "Yu Mincho",serif; }
.tea-photo-hint { bottom:15%; padding:7px 14px; border-radius:25px; background:#1b120deb; font-size:clamp(11px,2.5vw,15px); }
.tea-photo-caption:has(.tea-photo-copy:not([hidden])) .tea-photo-hint { order:2; padding:2px 10px; }
.tea-photo-mode .tea-dialogue,.tea-photo-mode .tea-top,.tea-photo-mode .tea-bottom,.tea-photo-mode .tea-stage-caption,.tea-photo-mode .tea-person-label,.tea-photo-mode .tea-visitor-voice,.tea-photo-mode .tea-reward-claim:not([data-docked=true]) { visibility:hidden; }
.tea-photo-held #resetBtn { position:fixed; top:calc(var(--view-top) + max(12px,env(safe-area-inset-top))); right:max(16px,env(safe-area-inset-right)); visibility:visible; }
.tea-replay-qr { display:none; }
:is(.tea-photo-held.tea-photo-ready .tea-replay-qr,.tea-demo.tea-photo-all.tea-photo-ready .tea-replay-qr-demo):not([hidden]) { position:fixed; z-index:19; bottom:calc(var(--keyboard-gap) + 6vh); left:clamp(9px,2.7vw,40px); display:grid; justify-items:center; gap:5px; width:min(clamp(115px,17vw,245px),32vh); padding:7px; border:1px solid #e9c880aa; border-radius:9px; background:#21150ef2; color:#fff4d7; text-align:center; font-size:clamp(10px,1.45vw,15px); line-height:1.2; text-decoration:none; }
.tea-replay-qr img { display:block; width:100%; height:auto; aspect-ratio:1; background:#fff; }
.tea-photo-mode .tea-heading { top:calc(var(--view-top) + 9vh); left:10vw; right:10vw; text-align:center; }
.tea-photo-mode #visitorLabel,.tea-photo-mode .tea-party-text { visibility:hidden; }
.tea-photo-pose { position:absolute; z-index:3; left:50%; bottom:11%; width:min(84vw,1080px); height:70%; transform:translateX(-50%); pointer-events:none; }
.tea-photo-pose img { display:block; width:100%; height:100%; object-fit:contain; object-position:center bottom; filter:drop-shadow(0 12px 17px #110a0788); animation:tea-pose-in .42s ease-out both; }
.tea-photo-all-title { display:none; }
.tea-photo-all .tea-photo-all-title { display:block; position:absolute; top:8%; inset-inline:11%; margin:0; font:700 clamp(16px,3vw,29px)/1.2 "Yu Mincho",serif; text-shadow:0 2px 10px #000; }
.tea-photo-all .tea-heading { visibility:hidden; }
.tea-photo-all .tea-photo-pose:not([hidden]) { inset:0; width:100%; height:100%; transform:none; overflow:hidden; }
.tea-photo-member { position:absolute; left:var(--pose-x); top:var(--pose-y,10%); width:0; height:0; }
.tea-photo-member img { position:absolute; width:clamp(620px,min(82vw,139vh),1420px); max-width:none; height:auto; object-fit:initial; transform:translateX(calc(-1 * var(--face-x))); clip-path:inset(0 var(--right-cut,47%) 0 var(--left-cut,0%)); }
.tea-photo-member[data-person=hideyoshi] { --pose-x:19%; --face-x:31.5%; }
.tea-photo-member[data-person=nene] { --pose-x:40%; --face-x:70.5%; --pose-y:8%; --left-cut:53%; --right-cut:0%; z-index:1; }
.tea-photo-member[data-person=ieyasu] { --pose-x:61%; --face-x:29%; --pose-y:14%; }
.tea-photo-member[data-person=yodo] { --pose-x:81%; --face-x:73.2%; --pose-y:9%; --left-cut:53%; --right-cut:0%; z-index:1; }
.tea-photo-mode .tea-reward-claim[data-docked=true] { top:calc(var(--view-top) + var(--view-height) * .17); }
.tea-photo-held.tea-photo-ready .tea-reward-claim[data-docked=true] { inset:auto clamp(9px,2.7vw,40px) calc(var(--keyboard-gap) + 6vh) auto; width:min(clamp(115px,17vw,245px),32vh); padding:7px; }
.tea-photo-all.tea-photo-held .tea-photo-caption:has(.tea-photo-copy:not([hidden])) { max-width:53vw; }
.tea-page[data-line=arrival] .tea-cast { animation:tea-host-entry .72s ease-out both; }
@keyframes tea-host-entry { from { transform:translateX(8vw); opacity:.25; } }
.tea-photo-ready .tea-cast { visibility:hidden; }
@keyframes tea-pose-in { from { opacity:0; transform:translateY(12px) scale(.97); } }
@media(max-width:640px) {
  .tea-photo-pose { width:95vw; bottom:23%; }
  .tea-photo-mode .tea-heading { top:calc(var(--view-top) + 13vh); }
}
@media(max-width:640px) and (min-height:550px) {
  .tea-photo-member img { width:clamp(355px,min(134vw,72vh),660px); mask-image:linear-gradient(#000 72%,#000d 86%,transparent 100%); }
  .tea-photo-member[data-person=hideyoshi] { --pose-x:26%; --pose-y:5%; }
  .tea-photo-member[data-person=nene] { --pose-x:74%; --pose-y:3%; z-index:0; }
  .tea-photo-member[data-person=ieyasu] { --pose-x:27%; --pose-y:30%; z-index:1; }
  .tea-photo-member[data-person=yodo] { --pose-x:74%; --pose-y:28%; }
  :is(.tea-photo-all.tea-photo-held,.tea-demo.tea-photo-all) .tea-photo-caption:has(.tea-photo-copy:not([hidden])) { bottom:calc(min(27vw,151px) + 10vh); max-width:92vw; }
  :is(.tea-photo-held.tea-photo-ready .tea-replay-qr,.tea-demo.tea-photo-all.tea-photo-ready .tea-replay-qr-demo):not([hidden]),.tea-photo-held.tea-photo-ready .tea-reward-claim[data-docked=true] { bottom:calc(var(--keyboard-gap) + 3vh); width:clamp(102px,31vw,151px); }
}
@media(max-height:560px) {
  .tea-photo-copy { padding-block:4px; }
  .tea-photo-caption:has(.tea-photo-copy:not([hidden])) .tea-photo-hint { display:none; }
}

.tea-question-area:has(.tea-quiz:not([hidden])) { position:fixed; z-index:14; top:calc(var(--view-top) + clamp(66px,var(--view-height) * .25,205px)); left:50%; width:min(590px,calc(100vw - 32px)); transform:translateX(-50%); display:grid; gap:9px; pointer-events:none; }
.tea-quiz { padding:15px 20px; border:1px solid #e9c88085; border-radius:16px; background:#261a10f7; color:#fff4d7; text-align:center; box-shadow:0 9px 38px #0009; }
.tea-quiz h2,.tea-quiz p { margin:0; }
.tea-quiz h2 { font:700 clamp(18px,3.5vw,27px)/1.35 "Yu Mincho",serif; }
.tea-quiz ol { list-style:none; display:flex; flex-wrap:wrap; justify-content:center; gap:8px; padding:0; margin:12px 0; }
.tea-quiz li { padding:4px 10px; border:1px solid #e9c88040; border-radius:20px; background:#ffcb5e18; font-size:clamp(13px,2.4vw,17px); }
.tea-quiz p { color:#ffda89; font-size:13px; }
.tea-quiz:not([hidden]) + .tea-visitor-voice { position:relative; top:auto; left:auto; width:100%; max-width:none; padding:6px 12px; transform:none; border-radius:13px; animation:tea-quiz-voice-in .2s ease-out both; }
.tea-quiz:not([hidden]) + .tea-visitor-voice .tea-visitor-transcript { margin:2px 0 0; font-size:clamp(16px,3.5vw,24px); max-height:2.56em; -webkit-line-clamp:2; }
@keyframes tea-quiz-voice-in { from { opacity:0; transform:translateY(3px); } }
@media(max-height:560px) {
  .tea-question-area:has(.tea-quiz:not([hidden])) { top:calc(var(--view-top) + clamp(40px,var(--view-height) * .22,96px)); gap:5px; }
  .tea-quiz { padding:8px 12px; }
  .tea-quiz ol { margin:6px 0; gap:4px; }
  .tea-quiz li { padding:2px 8px; }
}

.tea-keepsake-page { margin:0; background:#241911; color:#fff3d2; font-family:"Yu Gothic",Meiryo,sans-serif; }
.tea-keepsake { max-width:430px; margin:auto; padding:22px 17px 32px; text-align:center; }
.tea-keepsake-event,.tea-keepsake-giver { margin:5px 0 10px; color:#ebcc8d; font-size:14px; }
.tea-keepsake h1 { margin:0 0 8px; font:700 clamp(29px,8vw,42px)/1.2 "Yu Mincho",serif; }
.tea-keepsake-card { display:block; width:100%; height:auto; margin:15px 0; border-radius:12px; }
.tea-keepsake-save { display:inline-block; padding:12px 21px; border:1px solid #f0cb83; border-radius:26px; background:#e1b665; color:#1c140b; font-weight:700; text-decoration:none; }

@media(max-width:640px) {
  .tea-reward-claim { gap:7px; padding:11px 14px; top:calc(var(--view-top) + var(--view-height) * .37); }
  .tea-reward-claim:not([hidden]) { grid-template-columns:minmax(0,.72fr) minmax(156px,1fr); }
  .tea-reward-content { gap:4px; }
  .tea-reward-content h2 { font-size:21px; }
  .tea-reward-instruction { font-size:10px; }
  .tea-reward-close { width:27px; height:27px; font-size:21px; top:4px; right:4px; }
}
@media(prefers-reduced-motion:reduce) { .tea-reward-sparks,.tea-celebration-layer i { display:none; } }
