/* 健三 · claim room */
body.claim { min-height: 100svh; }
.backdrop { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(700px 500px at var(--mx) var(--my), rgba(216, 50, 31, .08), transparent 70%),
  linear-gradient(180deg, rgba(11, 10, 9, .55), rgba(11, 10, 9, .92) 70%, var(--ink)),
  url(/media/ink.webp) center top / cover no-repeat; }

.room { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); align-items: center; max-width: 1240px; margin: 0 auto;
  padding: 110px clamp(16px, 5vw, 60px) 40px; min-height: 100svh; }

/* ------------------------------------------------------------ stage: envelope + seal ring */
.stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; max-width: 560px; width: 100%; margin: 0 auto; --charge: 0; }
.glow { position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 140, 60, calc(.08 + var(--charge) * .5)), rgba(216, 50, 31, calc(var(--charge) * .25)) 55%, transparent 75%);
  filter: blur(20px); transition: background 1s; animation: glowp 4s ease-in-out infinite; }
@keyframes glowp { 50% { transform: scale(1.06); } }
.env { position: relative; width: 66%; aspect-ratio: 1; animation: hover 6s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-12px) rotate(1deg); } }
.env img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 40px 50px rgba(0, 0, 0, .75)); transition: opacity .8s, transform .8s var(--ease); }
.env .env-open { opacity: 0; transform: scale(.9); }
/* the idle loop video sits on top of the poster image and fades in once it really plays (black edges hidden by screen blend + mask) */
.env-vid { position: absolute; inset: -20%; width: 140%; height: 140%; object-fit: cover; opacity: 0; transition: opacity .6s; mix-blend-mode: screen; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 98%); mask-image: radial-gradient(closest-side, #000 70%, transparent 100%); }
.env.vid-on .env-vid { opacity: 1; }
.env.vid-on .env-closed { opacity: 0; }
.stage.opened .env .env-vid { opacity: 0; }
.stage.opened .env .env-closed { opacity: 0; transform: scale(1.08); }
.stage.opened .env .env-open { opacity: 1; transform: none; }
.env.shake { animation: shake .6s cubic-bezier(.36, .07, .19, .97) 2; }
@keyframes shake { 10%, 90% { transform: translateX(-2px) rotate(-1deg); } 20%, 80% { transform: translateX(4px) rotate(2deg); } 30%, 50%, 70% { transform: translateX(-7px) rotate(-3deg); } 40%, 60% { transform: translateX(7px) rotate(3deg); } }
.env.zap { animation: zap .5s var(--ease); }
@keyframes zap { 40% { transform: scale(1.05) rotate(-2deg); filter: brightness(1.3); } }

.ring { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.ring li { --a: 0deg; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; display: grid; place-items: center;
  transform: rotate(var(--a)) translateY(calc(var(--r, 250px) * -1)) rotate(calc(var(--a) * -1)) rotate(-6deg);
  border: 2px solid rgba(216, 50, 31, .55); border-radius: 6px; color: rgba(216, 50, 31, .75); background: rgba(11, 10, 9, .6);
  font: 400 26px/1 var(--brush); transition: background .35s, color .35s, border-color .35s, box-shadow .35s; }
.ring li:nth-child(1) { --a: -90deg; } .ring li:nth-child(2) { --a: -60deg; } .ring li:nth-child(3) { --a: -30deg; } .ring li:nth-child(4) { --a: 0deg; }
.ring li:nth-child(5) { --a: 30deg; } .ring li:nth-child(6) { --a: 60deg; } .ring li:nth-child(7) { --a: 90deg; }
.ring li.done { background: var(--cinnabar); color: #fff1e4; border-color: var(--cinnabar); box-shadow: 0 0 22px rgba(216, 50, 31, .6); }
.ring li.now { border-color: var(--gold); color: var(--gold-hi); box-shadow: 0 0 0 4px rgba(217, 178, 106, .15); animation: nowp 1.6s ease-in-out infinite; }
@keyframes nowp { 50% { box-shadow: 0 0 0 9px rgba(217, 178, 106, 0); } }
.ring li.stamp { animation: stampSeal .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes stampSeal { 0% { transform: rotate(var(--a)) translateY(calc(var(--r, 250px) * -1)) rotate(calc(var(--a) * -1)) scale(2.4) rotate(-20deg); opacity: 0; }
  100% { transform: rotate(var(--a)) translateY(calc(var(--r, 250px) * -1)) rotate(calc(var(--a) * -1)) rotate(-6deg); opacity: 1; } }
.prog { position: absolute; bottom: 4%; left: 0; right: 0; margin: 0; text-align: center; font-size: 14px; letter-spacing: .14em; color: var(--muted); }
.prog b { color: var(--gold-hi); font-family: var(--mono); font-weight: 500; }

/* ------------------------------------------------------------ desk: the paper slip */
.desk { position: relative; }
.vline { position: absolute; left: -54px; top: 10px; writing-mode: vertical-rl; font-size: 30px; letter-spacing: .3em; color: rgba(216, 50, 31, .55); }
.slip { position: relative; padding: clamp(24px, 3.4vw, 40px); background: linear-gradient(180deg, rgba(26, 23, 20, .94), rgba(16, 14, 12, .96));
  border: 1px solid var(--line-2); border-radius: 3px; box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .04); }
.slip::before, .slip::after { content: ""; position: absolute; left: 14px; right: 14px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .5; }
.slip::before { top: 8px; } .slip::after { bottom: 8px; }
.slip-card { min-height: 290px; }
.slip-card.out { animation: slipOut .34s var(--ease) forwards; }
.slip-card.in { animation: slipIn .55s var(--ease) both; }
@keyframes slipOut { to { opacity: 0; transform: translateX(-24px); filter: blur(4px); } }
@keyframes slipIn { from { opacity: 0; transform: translateX(28px); filter: blur(4px); } }
.sc-top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.sc-top .seal { width: 58px; height: 58px; font-size: 34px; }
.sc-k { margin: 0; font-size: 14px; letter-spacing: .24em; color: var(--gold); }
html[data-lang="en"] .sc-k { font: 600 12px/1.3 var(--mono); letter-spacing: .28em; }
.sc-title { margin: 0 0 10px; font: 600 clamp(26px, 2.6vw, 34px)/1.3 var(--sc); color: var(--paper); }
html[data-lang="en"] .sc-title { font: 500 clamp(30px, 3vw, 40px)/1.15 var(--serif); }
.sc-desc { margin: 0 0 26px; color: var(--paper-2); font-size: 16px; }
.sc-act { display: flex; gap: 10px; flex-wrap: wrap; }
.sc-act > .btn { min-width: 220px; }
.sc-act > .btn.big { width: 100%; min-height: 64px; font-size: 20px; }
.field { display: flex; align-items: stretch; width: 100%; border: 1px solid var(--line-2); border-radius: 4px; background: #0d0b0a; overflow: hidden; transition: border-color .25s, box-shadow .25s; }
.field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(217, 178, 106, .12); }
.field .pre { display: grid; place-items: center; padding: 0 0 0 16px; color: var(--muted); font: 500 18px/1 var(--mono); }
.field input { flex: 1; min-width: 0; padding: 16px 14px; border: 0; background: transparent; color: var(--paper); font: 500 18px/1.2 var(--mono); outline: none; }
.field input::placeholder { color: #5a5348; }
.field .btn { border-radius: 0; min-height: 0; padding: 0 22px; }
.field.bad { animation: no .4s; border-color: var(--cinnabar); }
@keyframes no { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.net { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font: 500 12px/1 var(--mono); letter-spacing: .14em; color: var(--muted); }
.net i { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); }
.sc-err { min-height: 22px; margin-top: 12px; color: var(--cinnabar-hi); font-size: 15px; }
.btn.pending { pointer-events: none; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { margin: 16px 0 0; font-size: 13px; color: var(--muted); }

.broken { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px dashed rgba(217, 178, 106, .2); }
.broken:empty { display: none; }
.broken li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 6px; border: 1px solid rgba(216, 50, 31, .35); border-radius: 3px; font-size: 13px; color: var(--paper-2); }
.broken li i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; background: var(--cinnabar); color: #fff; font: 400 14px/1 var(--brush); font-style: normal; }
.broken li.last { animation: pop .5s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.7); } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ------------------------------------------------------------ board */
.board { animation: slipIn .6s var(--ease); }
.bd-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.bd-head .seal { width: 54px; height: 54px; font-size: 30px; }
.bd-k { margin: 0; font-size: 14px; letter-spacing: .24em; color: var(--gold); }
.bd-who { margin: 4px 0 0; font-size: 17px; }
.tl { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 22px; padding: 0; }
.tl li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.tl li::before { content: ""; position: absolute; top: 13px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: var(--line); }
.tl li:first-child::before { display: none; }
.tl li i { width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--line-2); transform: rotate(-6deg); transition: .4s; }
.tl li.on { color: var(--paper); }
.tl li.on i { background: var(--cinnabar); border-color: var(--cinnabar); box-shadow: 0 0 16px rgba(216, 50, 31, .5); }
.tl li.on::before { background: var(--cinnabar); }
.tl li.now i { border-color: var(--gold); animation: nowp 1.6s infinite; }
.bd-status { margin: 0 0 18px; padding: 16px 18px; border-left: 3px solid var(--gold); background: rgba(217, 178, 106, .06); color: var(--paper); font-size: 16px; line-height: 1.75; }
.bd-status[data-s="sent"] { border-color: var(--jade); background: rgba(111, 191, 142, .07); }
.bd-status[data-s="blocked"], .bd-status[data-s="failed"] { border-color: var(--cinnabar); background: rgba(216, 50, 31, .07); }
.bd-status a { color: var(--gold-hi); }
.xchk { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 20px; }
.xchk > span { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.xchk > span i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--cinnabar); }
.xchk > span.y i { background: var(--jade); border-color: var(--jade); box-shadow: inset 0 0 0 3px #10241a; }
.xchk .btn { margin-left: auto; }
.bd-act { display: flex; gap: 10px; flex-wrap: wrap; }
.linkish { margin-top: 18px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--paper-2); }

/* ------------------------------------------------------------ the reveal */
.reveal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 40%, rgba(90, 20, 10, .92), rgba(8, 6, 5, .97) 70%);
  overflow-y: auto; animation: fadeIn .4s; }
.reveal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.rv-flash { position: fixed; inset: 0; background: #fff3d6; opacity: 0; pointer-events: none; animation: flash .9s .1s ease-out; }
@keyframes flash { 10% { opacity: .85; } 100% { opacity: 0; } }
.rv-in { position: relative; text-align: center; max-width: 560px; }
.rv-k { margin: 0; font-size: clamp(54px, 10vw, 92px); line-height: 1; color: var(--gold-hi); text-shadow: 0 0 40px rgba(243, 217, 160, .5); animation: rvk .9s .2s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes rvk { from { opacity: 0; transform: scale(1.8); filter: blur(10px); } }
.rv-env { width: min(300px, 64vw); height: auto; margin: 0 auto -10px; animation: rvEnv 1s .35s var(--ease) both; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .7)); }
@keyframes rvEnv { from { opacity: 0; transform: translateY(40px) scale(.8) rotate(-6deg); } }
.rv-l { margin: 8px 0 0; color: var(--paper-2); letter-spacing: .2em; font-size: 15px; }
.rv-amt { margin: 4px 0 10px; font: 500 clamp(42px, 8vw, 68px)/1.1 var(--mono); color: #fff; }
.rv-amt span { color: var(--cinnabar-hi); }
.rv-amt em { font-style: normal; }
.rv-p { margin: 0 auto 24px; max-width: 440px; color: var(--paper-2); font-size: 15px; }
.rv-act { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ wall */
.wallbox { max-width: 1240px; margin: 30px auto 0; padding: 0 clamp(16px, 5vw, 60px) 80px; }
.wb-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.wb-head h2 { margin: 0; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.wb-head h2 .brush { font-size: clamp(44px, 6vw, 70px); line-height: 1; }
.wb-head h2 small { font-size: 16px; color: var(--muted); font-weight: 400; }
.wb-stats { display: flex; gap: 10px; }
.wb-stats div { min-width: 110px; padding: 12px 16px; border: 1px solid var(--line); background: rgba(19, 17, 16, .8); border-radius: 3px; }
.wb-stats b { display: block; font: 500 24px/1.1 var(--mono); color: var(--gold-hi); }
.wb-stats span { font-size: 13px; color: var(--muted); }
.wl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.wl li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(19, 17, 16, .85); border: 1px solid var(--line); border-radius: 3px; min-width: 0; }
.wl li.new { animation: pop .6s var(--ease); border-color: rgba(217, 178, 106, .45); }
.wl li.empty { grid-column: 1 / -1; justify-content: center; padding: 30px; color: var(--muted); }
.wl-av { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--avc, #3a2a20); color: #1a1208; font: 700 16px/1 var(--mono); overflow: hidden; }
.wl-av img { width: 100%; height: 100%; object-fit: cover; }
.wl-who { min-width: 0; flex: 1; }
.wl-who a { display: block; text-decoration: none; color: var(--paper); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-who small { color: var(--muted); font-size: 12px; }
.wl-tag { flex: none; font-size: 12px; padding: 4px 9px; border-radius: 2px; border: 1px solid var(--line-2); color: var(--gold); text-decoration: none; white-space: nowrap; }
.wl-tag.sent { color: var(--jade); border-color: rgba(111, 191, 142, .4); }
.wl-tag.need { color: var(--cinnabar-hi); border-color: rgba(216, 50, 31, .45); }
.center { display: flex; justify-content: center; margin-top: 20px; }

/* golden rays behind the envelope: one composited rotation, brighter as seals break */
.rays { position: absolute; inset: -4%; border-radius: 50%; pointer-events: none; opacity: calc(.25 + var(--charge) * .75);
  background: repeating-conic-gradient(from 0deg, rgba(243, 217, 160, .16) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 18%, transparent 72%); mask-image: radial-gradient(closest-side, #000 18%, transparent 72%);
  animation: spin 60s linear infinite; transition: opacity 1s; will-change: transform; }
@keyframes spin { to { transform: rotate(360deg); } }
/* progress arc through the seven seals */
.arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.arc path { fill: none; stroke-width: .7; stroke-linecap: round; }
.arc-bg { stroke: rgba(216, 50, 31, .22); stroke-dasharray: 1 1.6; }
.arc-fg { stroke: var(--cinnabar); stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .7s var(--ease); filter: drop-shadow(0 0 1.2px rgba(255, 74, 46, .9)); }
/* ink splash when a seal is stamped */
.ring li.stamp::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--cinnabar-hi); animation: splash .7s ease-out forwards; }
@keyframes splash { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
/* all seven broken: the envelope begs to be opened */
.stage.ready .env { animation: hover 6s ease-in-out infinite, beg 2.4s ease-in-out infinite; }
@keyframes beg { 0%, 70%, 100% { rotate: 0deg; } 74% { rotate: -4deg; } 78% { rotate: 4deg; } 82% { rotate: -3deg; } 86% { rotate: 2deg; } }
.stage.ready .glow { animation: glowp 1.6s ease-in-out infinite; }
.btn.big[data-go] { animation: goPulse 1.8s ease-in-out infinite; }
@keyframes goPulse { 50% { box-shadow: inset 0 0 0 1px rgba(255, 220, 170, .5), 0 0 0 10px rgba(216, 50, 31, 0), 0 0 44px rgba(216, 50, 31, .75); } }
/* reveal: opening video, falls back to the still */
.rv-media { position: relative; width: min(340px, 72vw); aspect-ratio: 1; margin: 0 auto -10px; }
.rv-media .rv-env { position: absolute; inset: 0; width: 100%; margin: 0; }
.rv-vid { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; opacity: 0; mix-blend-mode: screen; transition: opacity .25s;
  -webkit-mask-image: radial-gradient(closest-side, #000 64%, transparent 98%); mask-image: radial-gradient(closest-side, #000 64%, transparent 98%); }
.rv-media.vid .rv-vid { opacity: 1; }
.rv-media.vid .rv-env { opacity: 0; animation: none; }
.rv-amt b { display: inline-block; min-width: 4ch; }

@media (max-width: 920px) {
  .room { grid-template-columns: 1fr; padding-top: 86px; gap: 6px; min-height: 0; }
  .stage { max-width: 380px; }
  .ring li { width: 38px; height: 38px; margin: -19px; font-size: 21px; }
  .vline { display: none; }
  .slip-card { min-height: 0; }
}
@media (max-width: 560px) {
  .room { padding-top: 74px; }
  .stage { max-width: 290px; margin-bottom: -18px; }
  .ring li { width: 34px; height: 34px; margin: -17px; font-size: 19px; border-width: 1.5px; }
  .slip { padding: 22px 18px; }
  .sc-top { margin-bottom: 12px; }
  .sc-top .seal { width: 46px; height: 46px; font-size: 27px; }
  .sc-desc { margin-bottom: 18px; font-size: 15px; }
  .sc-act > .btn { min-width: 0; flex: 1 1 100%; }
  .field .btn { padding: 0 14px; font-size: 15px; }
  .field input { font-size: 16px; padding: 15px 10px; }
  .wb-stats { width: 100%; }
  .wb-stats div { flex: 1; min-width: 0; padding: 10px 12px; }
  .wb-stats b { font-size: 20px; }
  .xchk .btn { margin-left: 0; }
}
/* each new seal card: its seal stamps in */
.slip-card.in .sc-top .seal { animation: cardSeal .55s .12s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes cardSeal { from { transform: scale(2.2) rotate(-24deg); opacity: 0; } to { transform: rotate(-4deg); opacity: 1; } }
.slip-card.in .sc-title { animation: inkIn .7s .18s var(--ease) both; }
@keyframes inkIn { from { opacity: 0; filter: blur(6px); transform: translateY(8px); } }
