/* One a Day — 壁に掛けた紙のカレンダーと、寄った窓（ux） */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: ui-rounded, "Hiragino Maru Gothic ProN", system-ui, -apple-system, "Noto Sans JP", sans-serif;
  color: #fdf6e6; display: flex; flex-direction: column; min-height: 100dvh; -webkit-tap-highlight-color: transparent;
  /* 暗い青緑の漆喰の壁。左上から光 */
  background-color: #17393d;
  background-image: radial-gradient(130% 90% at 12% 0%, rgba(150,205,195,.28), rgba(0,0,0,0) 55%), radial-gradient(150% 110% at 50% 40%, rgba(0,0,0,0) 45%, rgba(0,8,10,.5)), url(/assets/wall.svg);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.bar { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.lang button { padding: 0 10px; min-height: 44px; min-width: 44px; opacity: .6; font-size: 14px; }
.lang button + button { border-left: 1px solid rgba(253,246,230,.3); }
.lang button[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-decoration-color: #ffd66e; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.sound { width: 44px; height: 44px; display: grid; place-items: center; }
.sound .mute, .sound.off .waves { display: none; }
.sound.off { opacity: .6; }
.sound.off .mute { display: inline; }

/* ───── カレンダー ───── */
main { --head: 86px; flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 16px 8px; min-height: 0; }
.hang { --ah: max(452px, calc(100dvh - 88px - var(--head) - 14px)); --cw: min(calc(100vw - 32px), 420px, calc(var(--ah) * .66)); width: var(--cw); flex: none; }
.head { position: relative; height: var(--head); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding-bottom: 7px; }
.string { position: absolute; inset: 0; width: 100%; height: calc(100% + 7px); overflow: visible; }
.string path { stroke: #c9a56b; stroke-width: 2px; stroke-dasharray: 5 1.2; filter: drop-shadow(3px 4px 2px rgba(0,0,0,.45)); }
.nail { position: absolute; left: 50%; top: calc(17% - 7px); width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2cc, #b08a48 45%, #5a4320); box-shadow: 3px 5px 4px rgba(0,0,0,.5); }
.calendar { position: relative; width: 100%; height: min(var(--ah), calc(var(--cw) * 1.62)); display: flex; flex-direction: column; padding: 7px; border-radius: 6px;
  background: #f1e6ca url(/assets/paper.svg);
  /* 厚紙の断面と、2枚重ねの影 */
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.7), inset -1px -1px 0 rgba(120,96,56,.35), 1px 1px 0 #cdbb92, 2px 2px 0 #b7a37a, 3px 3px 0 #9d8a63, 4px 6px 7px rgba(0,0,0,.42), 12px 24px 38px rgba(0,0,0,.48); }
.calendar::before { content: ""; position: absolute; left: 13%; right: 13%; top: 2px; height: 4px; pointer-events: none;
  background: radial-gradient(circle 2px at 2px 2px, #4b3a22 98%, transparent) left / 100% 4px no-repeat, radial-gradient(circle 2px at calc(100% - 2px) 2px, #4b3a22 98%, transparent) right / 100% 4px no-repeat; }
.board { position: relative; flex: 1; min-height: 0; }
.board .cover { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 2px; box-shadow: 0 0 0 1px rgba(70,50,20,.35); }

/* ───── 窓 ───── */
.win { position: absolute; padding: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline-offset: 5px; }
.win::before { content: ""; position: absolute; inset: -3px; } /* 当たりを少し広げる */
.win.openable { filter: drop-shadow(1px 2px 2px rgba(0,0,0,.5)); }
/* 今日の窓: 少し浮いて、影が深く、灯りがにじみ、約3秒おきに光の筋が走る */
.win.today { z-index: 2; transform: translate(-1px, -2px); filter: drop-shadow(3px 6px 4px rgba(0,0,0,.62)) drop-shadow(0 0 7px rgba(255,214,120,.9)); }
.glint { position: absolute; inset: 0; overflow: hidden; pointer-events: none; display: none; }
.win.today .glint { display: block; }
.glint::after { content: ""; position: absolute; top: -40%; bottom: -40%; left: 0; width: 46%; transform: translateX(260%) rotate(24deg);
  background: linear-gradient(90deg, transparent, rgba(255,248,214,.75), transparent); animation: glint 3s ease-in-out infinite; }
@keyframes glint { 0% { transform: translateX(-140%) rotate(24deg); } 36%, 100% { transform: translateX(300%) rotate(24deg); } }
.win.opened { z-index: 1; }
/* 破れた窓の札: 奥の小物の手前に立てかけた、ひとことの書き出しの紙。上の端はちぎれ */
.mini-slip { position: absolute; left: 4%; right: 1%; top: 57%; bottom: 5%; filter: drop-shadow(0 1.5px 1.5px rgba(0,0,0,.65)); }
.mini-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 2px 1px 1px; overflow: hidden; background: #fbf2da url(/assets/paper.svg); background-blend-mode: multiply;
  clip-path: polygon(0 9%, 9% 3%, 17% 8%, 29% 1%, 40% 6%, 52% 2%, 61% 9%, 73% 3%, 84% 7%, 93% 0, 100% 6%, 99% 100%, 1% 98%); }
.mini-text { display: block; width: 100%; max-height: 2.4em; overflow: hidden; text-align: center; color: #33261a; font-weight: 700; line-height: 1.18;
  overflow-wrap: anywhere; line-break: strict; font-family: "Hiragino Maru Gothic ProN", ui-rounded, system-ui, "Noto Sans JP", sans-serif; }
/* まだの窓: 鍵のかかった戸を揺するように、がたがた（減衰） */
.win.shake { animation: shake .56s linear; z-index: 2; }
.win.shake-strong { animation: shake-strong .62s linear; z-index: 2; }
@keyframes shake { 8% { transform: translate(-3px, 0) rotate(-2.4deg); } 22% { transform: translate(3px, -1px) rotate(2.2deg); } 36% { transform: translate(-2.6px, 0) rotate(-1.8deg); } 50% { transform: translate(2px, 0) rotate(1.4deg); } 64% { transform: translate(-1.4px, 0) rotate(-.9deg); } 78% { transform: translate(.8px, 0) rotate(.5deg); } }
@keyframes shake-strong { 8% { transform: translate(-5px, 0) rotate(-4deg); } 22% { transform: translate(5px, -2px) rotate(3.6deg); } 36% { transform: translate(-4px, 0) rotate(-3deg); } 50% { transform: translate(3px, -1px) rotate(2.2deg); } 64% { transform: translate(-2px, 0) rotate(-1.4deg); } 78% { transform: translate(1px, 0) rotate(.7deg); } }

/* ───── 紙の札、見本の帯とスタンプ ───── */
.plate, .tape { position: relative; max-width: 100%; text-align: center; overflow-wrap: anywhere; color: #3a2e22; line-height: 1.35; }
.plate { background: #fffaf0 url(/assets/paper.svg); font-size: 14px; font-weight: 700; padding: 5px 16px; box-shadow: 1px 3px 6px rgba(0,0,0,.4); transform: rotate(-.8deg); max-height: 46px; overflow: hidden; }
.tape { background: rgba(236,214,150,.95); font-size: 13px; font-weight: 700; padding: 4px 22px; box-shadow: 0 2px 4px rgba(0,0,0,.3); transform: rotate(.8deg);
  clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 25%, 100% 50%, calc(100% - 4px) 75%, 100% 100%, 0 100%, 4px 75%, 0 50%, 4px 25%); }
.sample { position: absolute; inset: 0; z-index: 3; pointer-events: none; color: #3a2e22; }
.sample .tape-label { position: absolute; left: -8px; top: 12px; transform: rotate(-9deg); padding: 6px 20px; font-size: 18px; font-weight: 800; letter-spacing: .12em;
  background: repeating-linear-gradient(90deg, rgba(240,220,158,.96) 0 6px, rgba(233,211,145,.96) 6px 9px); box-shadow: 0 2px 5px rgba(0,0,0,.35);
  clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 25%, 100% 50%, calc(100% - 5px) 75%, 100% 100%, 0 100%, 5px 75%, 0 50%, 5px 25%); }
.sample .stamp { position: absolute; right: -10px; top: 2px; width: 126px; min-height: 52px; display: grid; place-items: center; padding: 5px 12px; text-align: center; line-height: 1.3; font-size: 12px; font-weight: 800;
  color: #a92e27; border: 2.5px solid #a92e27; outline: 1px solid #a92e27; outline-offset: -6px; border-radius: 50%; background: rgba(255,247,232,.95); transform: rotate(8deg); box-shadow: 0 2px 5px rgba(0,0,0,.35); text-wrap: balance; }
.sample .note { position: absolute; left: 6px; right: 6px; bottom: 5px; text-align: center; font-size: 11px; line-height: 1.35; padding: 3px 6px; background: #fff1ae; box-shadow: 1px 2px 4px rgba(0,0,0,.35); transform: rotate(-.6deg); text-wrap: balance; }

.link-error { position: fixed; left: 24px; right: 24px; top: 30%; z-index: 5; background: #fffaf0 url(/assets/paper.svg); color: #3a2e22; padding: 20px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 420px; margin: auto; line-height: 1.6; }
.link-error button { margin-top: 14px; min-height: 44px; padding: 0 18px; background: #b3372f; color: #fff; border-radius: 6px; }
.storage-off { font-size: 12px; margin-top: 10px; padding: 4px 12px; text-align: center; background: rgba(4,18,20,.55); border-radius: 999px; }
/* 下の帯の付箋。右下の感想のボタンと重ならない */
.sticky { position: relative; min-height: 40px; max-width: calc(100vw - 96px); padding: 4px 20px; line-height: 1.3; color: #3a2e22; font-weight: 700; font-size: 14px; transform: rotate(-1.5deg);
  background: linear-gradient(176deg, #ffec9e, #ffe07a); box-shadow: 1px 2px 2px rgba(0,0,0,.3), 3px 8px 10px -4px rgba(0,0,0,.45); }
.sticky::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: rgba(190,150,30,.16); }

/* ───── 寄った窓（ステージ）。後ろは深く沈める ───── */
html.stage-open, html.stage-open body { overflow: hidden; overscroll-behavior: none; }
html.stage-open .dafb-btn { visibility: hidden; }
.stage { position: fixed; inset: 0; z-index: 10; background-color: rgba(3,10,12,.975); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; outline: none;
  touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(75% 52% at 50% 42%, rgba(80,128,124,.22), transparent 70%); }
.stage-back { position: absolute; z-index: 3; left: 12px; top: calc(8px + env(safe-area-inset-top)); min-height: 44px; padding: 0 16px 0 22px; color: #3a2e22; font-size: 14px; font-weight: 700;
  background: #f6edd6 url(/assets/paper.svg); clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); }
.stage-window { position: relative; flex: none; margin-top: 8px; cursor: grab; }
.stage.touching .stage-window { cursor: grabbing; }
.stage.torn .stage-window { cursor: default; }
.stage-under { position: relative; z-index: 2; height: 150px; margin-top: 48px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 20px; text-align: center; }
.stage-guide { font-size: 16px; font-weight: 700; line-height: 1.5; text-wrap: balance; }
.stage-guide:empty, .stage-after:empty { display: none; }
/* 開いてすぐ読める明るさ: 薄い所から始めず、すぐに出しきる */
.stage-after { font-size: 15px; font-weight: 700; line-height: 1.5; color: #fff1bd; text-shadow: 0 1px 3px rgba(0,0,0,.8); animation: after-in .18s ease-out both; }
@keyframes after-in { from { opacity: .6; transform: translateY(4px); } }
.stage.reread .stage-under { animation: none; }
/* 長押しの代わりの操作。押せる小さな物に見せる。手本と点線より目立たせない */
.stage-hold { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 17px 0 13px; font-size: 12.5px; font-weight: 700; color: rgba(253,246,230,.8);
  border: 1.5px solid rgba(253,246,230,.34); border-radius: 12px; background: rgba(253,246,230,.07); box-shadow: 0 3px 0 rgba(253,246,230,.16); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stage-hold svg { flex: none; pointer-events: none; }
.stage-hold { position: relative; overflow: hidden; isolation: isolate; text-align: left; }
.hold-words { display: flex; flex-direction: column; line-height: 1.3; padding: 4px 0 5px; pointer-events: none; }
.hold-why { font-size: 11px; font-weight: 600; opacity: .85; }
/* 押している間は、破れた分だけ帯が進む（--done は切れた目の割合） */
.stage-hold::after { content: ""; position: absolute; z-index: -1; left: 0; top: 0; bottom: 0; width: var(--done, 0%); opacity: 0; pointer-events: none; background: rgba(255,206,92,.42); border-right: 3px solid #ffe27e; transition: width .08s linear; }
.stage-hold.pressing::after { opacity: 1; }
.stage-hold:active, .stage-hold.pressing { color: #fff8e4; background: rgba(255,224,140,.2); border-color: rgba(255,224,140,.75); box-shadow: 0 0 0 rgba(0,0,0,0); transform: translateY(3px); }
.stage-hold.nudge { animation: nudge .55s ease-in-out 1; }
@keyframes nudge { 16% { translate: -6px 0; } 34% { translate: 5px 0; } 52% { translate: -4px 0; } 70% { translate: 2.5px 0; } 86% { translate: -1px 0; } }
.stage-stuck { color: #ffe39a; }
/* 切れ目の先の光。弱い方は「ここまで破れた」の印、強い方は「ここから」の合図（脈を打つ） */
.tips { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.tip, .tip-arrow { position: absolute; width: 0; height: 0; }
.tip::before { content: ""; position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,252,230,.95) 0 14%, rgba(255,214,100,.8) 30%, rgba(255,204,80,0) 70%); }
.tip::after { content: ""; position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #ffdc72; opacity: 0; }
.tips[data-mode="weak"] .tip::after { animation: tip-ring 1.9s ease-out infinite; }
.tips[data-mode="strong"] .tip::before { left: -27px; top: -27px; width: 54px; height: 54px; animation: tip-beat .9s ease-in-out infinite; }
.tips[data-mode="strong"] .tip::after { left: -13px; top: -13px; width: 26px; height: 26px; border-width: 3px; box-shadow: 0 0 6px rgba(20,12,0,.55); animation: tip-ring-strong .9s ease-out infinite; }
.tip-arrow { transform: rotate(var(--a)); }
.tip-arrow i { position: absolute; left: 24px; top: -7px; width: 12px; height: 12px; border: solid #ffe27e; border-width: 3.5px 3.5px 0 0; transform: rotate(45deg) skew(6deg, 6deg); filter: drop-shadow(0 0 2px rgba(40,22,0,.9)); animation: tip-go .9s ease-in-out infinite; }
.tip-arrow i:nth-child(2) { left: 38px; animation-delay: .14s; }
.tip-arrow i:nth-child(3) { left: 52px; animation-delay: .28s; }
@keyframes tip-beat { 50% { transform: scale(.62); opacity: .75; } }
@keyframes tip-ring { 0% { transform: scale(.4); opacity: .85; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
@keyframes tip-ring-strong { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }
@keyframes tip-go { 0%, 100% { opacity: .35; } 45% { opacity: 1; } }
/* なぞっている間は邪魔をしない。ただし「ここから」を出している間は、指を置いていても見せる */
.stage.touching:not(.stuck) .tips { opacity: 0; }
.stage.stuck .hint svg, .stage.touching.stuck .hint svg { opacity: 1; }
.stage.stuck .hint-trail, .stage.touching.stuck .hint-trail { visibility: visible; }
.hint, .hint-trail { z-index: 3; }
@media (prefers-reduced-motion: reduce) {
  .stage-hold.nudge, .tip::before, .tips .tip::before, .tip-arrow i { animation: none; }
  .tips .tip::after { animation: none !important; opacity: .9; }
}
#stage-close { min-width: 140px; min-height: 44px; font-size: 15px; }

/* 窓の奥の札。字はここにだけ出る。小物の手前に立てた紙: 上の端はちぎれ、折り目が1本、少し傾く */
.slip { position: absolute; inset: 38% 6.5% 4% 8.5%; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #2e2315; isolation: isolate;
  rotate: var(--tilt, -.7deg); filter: drop-shadow(0 1px 0 #c9b88f) drop-shadow(2px 5px 6px rgba(0,0,0,.55)); }
.slip::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(177.6deg, transparent calc(50% - 5px), rgba(120,92,50,.07) calc(50% - 1px), rgba(112,84,44,.3) 50%, rgba(255,255,248,.95) calc(50% + 1.2px), rgba(255,255,248,0) calc(50% + 7px)),
    radial-gradient(120% 90% at 20% 8%, rgba(255,255,250,.75), rgba(255,255,250,0) 60%),
    linear-gradient(177.6deg, #fbf3dd 0 50%, #f1e6c9 50%, #f8efd7),
    #f8efd7;
  clip-path: polygon(0 7px, 5% 3px, 9% 6px, 15% 1px, 21% 5px, 26% 3px, 33% 8px, 39% 2px, 46% 5px, 52% 0, 58% 4px, 64% 2px, 71% 7px, 77% 3px, 83% 5px, 89% 0, 94% 4px, 100% 2px, 99.4% 100%, .6% calc(100% - 2px)); }
.slip::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: url(/assets/paper.svg); mix-blend-mode: multiply; opacity: .55;
  clip-path: polygon(0 7px, 5% 3px, 9% 6px, 15% 1px, 21% 5px, 26% 3px, 33% 8px, 39% 2px, 46% 5px, 52% 0, 58% 4px, 64% 2px, 71% 7px, 77% 3px, 83% 5px, 89% 0, 94% 4px, 100% 2px, 99.4% 100%, .6% calc(100% - 2px)); }
.slip.long { background: #f8efd7; }
.slip-hand { position: absolute; right: calc(6.5% + 11px); bottom: calc(4% + 7px); max-width: 74%; pointer-events: none; display: flex; align-items: center; gap: 4px; color: #8a2f27; font-size: 12px; font-weight: 700; line-height: 1.3; rotate: -2.5deg;
  font-family: "Klee", "Hannotate SC", "Bradley Hand", "Segoe Print", "Hiragino Maru Gothic ProN", ui-rounded, cursive; }
.slip-hand svg { flex: none; }
.slip-hand > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.slip.has-hand { padding-bottom: 30px; }
.slip p { width: 100%; white-space: pre-line; text-align: center; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; text-wrap: pretty; }
.slip p.short { line-height: 1.4; font-weight: 700; text-wrap: balance; word-break: auto-phrase; }
.slip.long { align-items: flex-start; overflow: auto; touch-action: pan-y; }
/* 開いた時の一拍: 少し奥にあった札が、ふたがよけた後に手前へ出て止まる（約0.22秒）。字は奥にある間から読める */
.slip.deep { transform: translateY(5px) scale(.93); }
.slip.arrive { animation: arrive .22s .18s cubic-bezier(.25,.7,.3,1) backwards; }
@keyframes arrive { 0% { transform: translateY(5px) scale(.93); } 70% { transform: translateY(-3px) scale(1.035); } 100% { transform: none; } }
.nb { white-space: nowrap; }
.slip p { text-shadow: 0 .5px 0 rgba(255,255,250,.9); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* 手本: 指の影と、点線の上の光の跡 */
.hint { position: absolute; left: 0; top: 0; width: 62px; height: 74px; margin: -11px 0 0 -16px; pointer-events: none; animation: trace 3.1s ease-in-out infinite; transition: opacity .2s; }
.hint svg { display: block; filter: drop-shadow(2px 5px 4px rgba(0,0,0,.5)); transition: opacity .2s; }
.hint .touch-ring { transform-origin: 20px 14px; animation: ring 3.1s ease-out infinite; }
.hint.weak svg { opacity: .55; }
.stage.touching .hint svg { opacity: .16; }
.hint-trail { position: absolute; height: 6px; border-radius: 3px; pointer-events: none; transform-origin: 0 50%; transform: rotate(var(--a)) scaleX(0); animation: trail 3.1s ease-in-out infinite;
  background: linear-gradient(90deg, rgba(255,222,120,.15), rgba(255,226,130,.85)); box-shadow: 0 0 10px 2px rgba(255,214,110,.55); }
.hint-trail.weak { opacity: .4; }
.stage.touching .hint-trail { visibility: hidden; }
@keyframes trace { 0% { transform: translate(var(--x0), var(--y0)) scale(1.18); opacity: 0; } 10% { transform: translate(var(--x0), var(--y0)); opacity: 1; } 56% { transform: translate(var(--x1), var(--y1)); opacity: 1; } 68%, 100% { transform: translate(var(--x1), var(--y1)) scale(1.1); opacity: 0; } }
@keyframes trail { 0%, 10% { transform: rotate(var(--a)) scaleX(0); opacity: 1; } 56% { transform: rotate(var(--a)) scaleX(1); opacity: 1; } 76%, 100% { transform: rotate(var(--a)) scaleX(1); opacity: 0; } }
@keyframes ring { 0%, 6% { transform: scale(1.7); opacity: 0; } 14% { transform: scale(1); opacity: 1; } }
/* 点線から外れた時だけ、点線が少し光る */
.offline { position: absolute; inset: -2px; pointer-events: none; border: 3px dashed #ffe18a; border-left: 0; filter: drop-shadow(0 0 5px #ffd25a); opacity: 0; transition: opacity .18s; }
.offline.on { opacity: .9; }

/* まだの窓のそばの札 */
.tag { position: fixed; transform: translateX(-50%) rotate(-1.2deg); z-index: 20; background: #fffaf0 url(/assets/paper.svg); color: #3a2e22; font-size: 14px; font-weight: 700; line-height: 1.5; padding: 10px 16px 9px; box-shadow: 0 2px 3px rgba(0,0,0,.35), 0 10px 18px rgba(0,0,0,.45); width: max-content; max-width: min(80vw, 300px); text-align: center; pointer-events: none; text-wrap: balance; animation: pop .22s ease-out; }
.tag::before { content: ""; position: absolute; left: 50%; top: -5px; width: 38px; height: 11px; margin-left: -19px; background: rgba(214,92,76,.82); transform: rotate(-2deg); }
@keyframes pop { from { opacity: 0; translate: 0 5px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (max-height: 700px) {
  main { --head: 68px; padding-bottom: 4px; }
  .sample .tape-label { top: 6px; font-size: 15px; padding: 4px 15px; }
  .sample .stamp { top: -1px; width: 118px; min-height: 42px; font-size: 11px; padding: 3px 10px; }
  .nail { top: 5px; }
  .stage-under { margin-top: 30px; height: 126px; }
}
@media (prefers-reduced-motion: reduce) {
  .glint { display: none !important; }
  .slip.arrive, .stage-after, .tag, .hint .touch-ring { animation: none; }
  .win.shake, .win.shake-strong { animation-name: shake-soft; }
  /* 手本は止めた絵にする: 起点に指、点線に光 */
  .hint { animation: none; transform: translate(var(--x0), var(--y0)); }
  .hint-trail { animation: none; transform: rotate(var(--a)); opacity: .7; }
}
@keyframes shake-soft { 25% { transform: translateX(-1px); } 75% { transform: translateX(1px); } }

/* 寄っている間、後ろの帯とスタンプと番号は見せない（字が重ならない） */
header.bar, main, footer.bar { transition: opacity .35s ease-out; }
html.stage-open header.bar, html.stage-open main, html.stage-open footer.bar { opacity: 0; transition: opacity .3s .15s ease-in; }
/* 今日の窓の灯り（ゆっくり明るくなる） */
.win.today::before { border-radius: 4px; box-shadow: 0 0 12px 4px rgba(255,212,104,.85); animation: halo 3s ease-in-out infinite; }
@keyframes halo { 50% { box-shadow: 0 0 6px 1px rgba(255,212,104,.45); } }
.slip { padding: 14px 15px 12px; }
.slip.has-hand { padding-bottom: 30px; }
.stage.wide .slip-hand { font-size: 15px; }
.slip p { line-break: strict; }
.slip p.short, .slip p.mid { word-break: auto-phrase; text-wrap: balance; }
.slip p.many { text-wrap: pretty; line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .win.today::before { animation: none; } header.bar, main, footer.bar { transition: none; } }
.hint svg { transform-origin: 16px 11px; }
.hint.above svg { transform: scaleY(-1); }
/* 長い名前の札と、12月より前の帯が両方出ても重ならない */
.plate { flex: none; max-height: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; padding-block: 4px; }
.tape { flex: none; }
.head:has(> .plate:not([hidden])) .string, .head:has(> .plate:not([hidden])) .nail { display: none; }
main:has(#plate:not([hidden])):has(#tape:not([hidden])) { --head: 90px; }
@media (max-height: 700px) { .plate { font-size: 12px; } .tape { font-size: 12px; padding-block: 2px; } main:has(#plate:not([hidden])):has(#tape:not([hidden])) { --head: 78px; } }
.plate { word-break: auto-phrase; text-wrap: balance; }
/* がたがたの間は、窓が紙から少し浮いて影が出る */
.win.shake { animation: shake .56s linear, knock .56s linear; }
.win.shake-strong { animation: shake-strong .62s linear, knock .62s linear; }
@keyframes knock { 0%, 100% { filter: drop-shadow(0 0 0 rgba(0,0,0,0)); } 8%, 36% { filter: drop-shadow(1px 5px 3px rgba(0,0,0,.65)); } 22% { filter: drop-shadow(-1px 3px 2px rgba(0,0,0,.55)); } 64% { filter: drop-shadow(1px 2px 2px rgba(0,0,0,.4)); } }
/* 厚紙の表面に、左上からの照り */
.board::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4; border-radius: 2px;
  background: linear-gradient(122deg, rgba(255,246,220,.11), rgba(255,246,220,0) 34%, rgba(0,4,24,0) 66%, rgba(0,4,24,.14)); box-shadow: inset 0 0 18px rgba(8,12,36,.22); }
@media (prefers-reduced-motion: reduce) { .win.shake, .win.shake-strong { animation: shake-soft .5s linear; } }
/* 下の一文は、窓が寄り終わってから出す（持ち上がる窓に重ねない） */
.stage-under { animation: rise .3s .42s ease-out both; }
@media (prefers-reduced-motion: reduce) { .stage-under { animation: none; } }
/* 日本語は語の途中で折らない。phrased は ui/phrase.js が <wbr> を挟んだ所（1まとまりが行より長い時だけ、中で折る） */
.phrased, .slip p.phrased { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
:lang(ja) :is(.tag, .tape, .plate, .sample .note, .stage-guide, .stage-after) { word-break: auto-phrase; line-break: strict; text-wrap: balance; }
:lang(ja) .stage-guide.phrased { word-break: keep-all; }
.sample .stamp { white-space: pre-line; }
/* 今日の窓の、光のほかのもう1つの印: 上の縁から垂れる赤いしおり（開け忘れた窓は、めくれた角だけ） */
.win.today::after { content: ""; position: absolute; z-index: 3; left: 4px; top: -6px; width: 11px; height: 23px; pointer-events: none;
  background: linear-gradient(90deg, #a62c25, #d8483b 45%, #b9352c); border-top: 2px solid #f0d9a0; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 73%, 0 100%); }
/* 点線から外れて引いた紙: 少したわみ、離すと弾んで戻る（動かすのは見た目だけ。切れ目は変わらない） */
.flap-canvas { transition: transform .5s cubic-bezier(.3,2.2,.5,1); }
.flap-canvas.strained { transition: transform .08s linear; }
@media (prefers-reduced-motion: reduce) { .flap-canvas, .flap-canvas.strained { transition: none; transform: none !important; } }
/* 「ここから」の間は、手本を短い周期で繰り返す（指が見えない時間を短くする） */
.stage.stuck .hint, .stage.stuck .hint-trail, .stage.stuck .hint .touch-ring { animation-duration: 2.2s; }
