/* =========================================================
   TODAY'S MEMBER COLOR — style
   詳細は DESIGN.md を参照
   ========================================================= */
:root {
  --paper: #ECE8E1;
  --ink: #1A1A1A;
  --ink-soft: rgba(26, 26, 26, .58);
  --line: rgba(26, 26, 26, .35);
  --c: #E60033;
  --c2: #FF8A3D;
  --dot: #E60033;

  --glow: #E60033;

  /* 参考サイトの組み合わせ：和文明朝＋ディスプレイセリフ＋Helvetica */
  --f-ja: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-ja-sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-serif: "Playfair Display", "Times New Roman", serif;
  --f-mono: "Helvetica Neue", Helvetica, Arial, var(--f-ja-sans);

  --pad-x: clamp(16px, 5.2vw, 92px);
  --side-x: clamp(12px, 1.4vw, 24px);  /* 両サイドの縦書きラベルの位置 */
  --pad-y: clamp(14px, 3vh, 32px);
  --orb: min(54vh, 30vw);
  --ease: cubic-bezier(.2, .7, .1, 1);

  /* 文字の滲み：芯はくっきり、まわりにインクがにじむ程度 */
  --bleed: 0 0 .6px rgba(26, 26, 26, .45), 0 0 7px rgba(26, 26, 26, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-ja);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  text-shadow: var(--bleed);
}
p, h1, dl, dd, ul { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.serif { font-family: var(--f-serif); font-weight: 400; font-style: italic; }
.small { font-size: 11px; }

/* ---------- 紙のノイズ ---------- */
.grain {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 50;
  opacity: .22; mix-blend-mode: multiply;
}

/* =========================================================
   LOADER
   ========================================================= */
.loader {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-content: center; justify-items: center;
  gap: 14px;
  background: var(--paper);
  transition: opacity .7s var(--ease), visibility .7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__orb {
  width: 132px; height: 132px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 6%, var(--lc, #E60033) 26%, transparent 64%),
    radial-gradient(circle at 30% 70%, var(--lc2, #FF8A3D) 0 10%, transparent 60%);
  filter: blur(6px);
  margin-bottom: 10px;
  transition: background .05s;
}
.loader__ring {
  position: absolute; top: 50%; left: 50%;
  width: 190px; height: 190px; margin: -150px 0 0 -95px;
  border: 1px solid var(--line); border-radius: 50%;
  border-top-color: var(--ink);
  animation: spin 1.1s linear infinite;
}
.loader__ja { position: relative; font-size: 14px; font-weight: 400; letter-spacing: .24em; }
/* 点が増えても文字の位置がずれないよう、右側に絶対配置 */
.loader__ja::after { content: ""; position: absolute; left: 100%; top: 0; animation: ellipsis 1.6s steps(1) infinite; }
.loader__mono {
  display: flex; gap: 18px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; color: var(--ink-soft);
}
.loader__hex { font-size: 11px; color: var(--ink-soft); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ellipsis {
  0% { content: ""; } 20% { content: "."; } 40% { content: ".."; } 60% { content: "..."; } 80% { content: "...."; }
}


/* 発表時のフラッシュ */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 45; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fff 0%, rgba(255,255,255,.85) 40%, transparent 75%);
  opacity: 0;
}
body.is-flash::after { animation: flash 1s var(--ease); }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* =========================================================
   STAGE (1画面)
   ========================================================= */
.stage {
  position: relative;
  height: 100vh; height: 100dvh;
  padding: var(--pad-y) var(--pad-x);
  padding-top: max(var(--pad-y), env(safe-area-inset-top));
  padding-bottom: max(var(--pad-y), env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(var(--orb) * 1.42) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "top top top"
    "reveal orb reading"
    "bottom bottom bottom";
  column-gap: clamp(12px, 2vw, 40px);
  overflow: hidden;
}

/* ---------- TOP ---------- */
.top {
  grid-area: top;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
}
.top__date { display: flex; align-items: center; gap: 10px; line-height: .8; }
.top__date .serif { font-size: clamp(38px, 5vw, 64px); }
.top__slash { width: 22px; height: 1px; background: var(--ink); transform: rotate(-60deg); }
.top__title { text-align: center; display: grid; justify-items: center; gap: 4px; }
.top__title .mono { font-size: clamp(12px, 1.1vw, 15px); letter-spacing: .12em; }
.dots-v {
  width: 3px; height: 22px; margin-top: 4px;
  background: radial-gradient(circle, var(--ink) 1.2px, transparent 1.6px) 0 0 / 3px 8px repeat-y;
}


/* ---------- REVEAL (左) ---------- */
.reveal {
  grid-area: reveal; align-self: center;
  display: grid; gap: clamp(8px, 1.4vh, 14px);
  min-width: 0;
}
.reveal__lead {
  font-size: clamp(14px, 1.3vw, 18px); font-weight: 300; letter-spacing: .3em;
  display: flex; align-items: center; gap: 12px;
}
.reveal__lead::after { content: ""; flex: 0 0 48px; height: 1px; background: var(--ink); }
.reveal { container-type: inline-size; }
.reveal__name {
  font-size: min(clamp(36px, 5.4vw, 92px), calc(100cqi / var(--seg, 4) * .98));
  font-weight: 600; line-height: 1.16; letter-spacing: .04em;
  word-break: keep-all;
}
.reveal__name .seg { display: inline-block; white-space: nowrap; }
.reveal__name .ch {
  display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(8px);
}
.is-revealed .reveal__name .ch {
  animation: ch-in .7s var(--ease) forwards;
  animation-delay: calc(.35s + var(--i) * .07s);
}
@keyframes ch-in { to { opacity: 1; transform: none; filter: none; } }
.reveal__en { font-size: clamp(22px, 2.3vw, 34px); font-weight: 700; font-style: italic; letter-spacing: -.01em; line-height: 1; }
.reveal__code { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.chip {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(26,26,26,.25);
}
.hex { font-size: clamp(17px, 1.5vw, 22px); font-weight: 400; letter-spacing: .08em; }
.coords { display: grid; gap: 4px; font-size: 11px; color: var(--ink-soft); margin-top: 6px; }
.coords > div:not(.coords__arrow) { display: flex; gap: 10px; }
.coords dt { width: 28px; }
.coords__arrow { padding-left: 2px; }

/* ---------- ORB (中央) ---------- */
.orb-area {
  grid-area: orb; position: relative;
  display: grid; place-items: center; min-height: 0;
}
.orb {
  position: relative;
  width: min(var(--orb), 100%); aspect-ratio: 1;
  max-height: 100%;
}
.orb__blob { position: absolute; border-radius: 50%; filter: blur(calc(var(--orb) * .07)); }
.orb__blob--a {
  inset: 10% 6% 4% 14%;
  background: radial-gradient(circle at 58% 52%, var(--c) 0 34%, color-mix(in srgb, var(--c) 60%, transparent) 55%, transparent 72%);
  animation: breathe 7s ease-in-out infinite;
}
.orb__blob--b {
  inset: 18% 30% 22% 4%;
  background: radial-gradient(circle at 45% 55%, var(--c2) 0 25%, transparent 68%);
  opacity: .85; mix-blend-mode: multiply;
  animation: drift 9s ease-in-out infinite;
}
.orb__blob--c {
  width: 26%; height: 26%; top: -4%; left: 12%;
  background: radial-gradient(circle, var(--c) 0 30%, var(--c2) 55%, transparent 72%);
  opacity: .9;
  animation: drift 11s ease-in-out infinite reverse;
}
.orb__dots { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: multiply; }
.orb__lines { position: absolute; inset: 0; overflow: visible; }
.ring { fill: none; stroke: var(--ink); vector-effect: non-scaling-stroke; }
.ring--solid { stroke-width: 1; opacity: .55; stroke-dasharray: 220 30 40 10; }
.ring--dotted { stroke-width: 1.4; stroke-dasharray: 0 5; stroke-linecap: round; opacity: .55; }
.ring-dot { fill: var(--ink); }
.ring-rot { transform-origin: 50px 50px; animation: spin 60s linear infinite; }
.axis { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .75; }
.axis-dot { fill: var(--ink); }
.orb__star {
  position: absolute; width: 18%; left: 50%; top: 56%; translate: -50% -50%;
  fill: #fff; filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 18px #fff);
  animation: twinkle 3.2s ease-in-out infinite;
}
.orb__glow {
  position: absolute; width: 30%; aspect-ratio: 1; left: 50%; top: 56%; translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95) 0 8%, rgba(255,255,255,.4) 30%, transparent 65%);
  mix-blend-mode: screen;
}
@keyframes breathe { 50% { transform: scale(1.04); } }
@keyframes drift { 50% { transform: translate(4%, -3%) scale(1.05); } }
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(.78) rotate(12deg); opacity: .85; }
}

/* 注釈（キーワード） */
.notes { position: absolute; inset: 0; pointer-events: none; }
.note {
  position: absolute; display: grid; gap: 2px;
  font-size: clamp(12px, 1.05vw, 14px); font-weight: 500; letter-spacing: .06em; white-space: nowrap;
  opacity: 0; transition: opacity .6s var(--ease);
}
.note small { font-family: var(--f-mono); font-size: 10px; font-weight: 400; color: var(--ink-soft); letter-spacing: .04em; }
.note--l { text-align: right; transform: translate(-100%, -50%); }
.note--r { transform: translate(0, -50%); }
.note-line { position: absolute; height: 1px; background: var(--ink); transform-origin: 0 50%; opacity: 0; transition: opacity .6s; }
.note-line::after {
  content: ""; position: absolute; right: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink);
}
.is-revealed .note, .is-revealed .note-line { opacity: 1; }

/* ---------- READING (右) ---------- */
.reading {
  grid-area: reading; align-self: center;
  display: grid; gap: clamp(14px, 3vh, 30px);
  min-width: 0; max-width: 380px; justify-self: end; width: 100%;
}
.role { font-size: clamp(20px, 1.9vw, 28px); font-weight: 600; letter-spacing: .06em; text-wrap: balance; }
.role::before { content: "〈"; color: var(--ink-soft); font-weight: 400; }
.role::after { content: "〉"; color: var(--ink-soft); font-weight: 400; }
.image { font-size: clamp(12px, 1vw, 14px); line-height: 2; letter-spacing: .04em; color: rgba(26,26,26,.78); text-wrap: pretty; }


.message {
  font-size: clamp(16px, 1.5vw, 21px); font-weight: 600; line-height: 1.75; letter-spacing: .04em;
  padding-left: 14px; border-left: 2px solid var(--c);
  text-wrap: pretty;
}
/* ---------- LUCKY ACTION（チケット） ---------- */
.ticket {
  position: relative; width: 100%; min-height: 62px;
  display: grid; grid-template-columns: 48px 1fr; align-items: stretch;
  border: 1px solid rgba(26,26,26,.5); border-radius: 10px;
  background: rgba(255,255,255,.3);
}
.ticket__stub {
  display: grid; place-items: center;
  background: var(--c); border-radius: 9px 0 0 9px;
  border-right: 1px dashed rgba(26,26,26,.45);
  box-shadow: inset 0 0 0 1px rgba(26,26,26,.08);
}
.ticket__stub svg { width: 18px; fill: var(--on-c, #fff); animation: twinkle 3.2s ease-in-out infinite; }
.ticket__body { display: grid; align-content: center; gap: 4px; padding: 10px 16px; min-width: 0; }
.ticket__label { font-size: 9.5px; letter-spacing: .14em; color: var(--ink-soft); }
.ticket__text { font-size: clamp(14px, 1.15vw, 16px); font-weight: 600; letter-spacing: .04em; line-height: 1.45; }

/* 右ブロックのフェードイン */
.reveal__en, .reveal__code, .coords, .reading .block, .reveal__lead {
  opacity: 0; transform: translateY(8px); filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter 1.1s var(--ease);
}
.is-revealed :is(.reveal__en, .reveal__code, .coords, .reading .block, .reveal__lead) { filter: none; }
.is-revealed .reveal__lead { opacity: 1; transform: none; transition-delay: .1s; }
.is-revealed .reveal__en { opacity: 1; transform: none; transition-delay: .9s; }
.is-revealed .reveal__code { opacity: 1; transform: none; transition-delay: 1.05s; }
.is-revealed .coords { opacity: 1; transform: none; transition-delay: 1.2s; }
.is-revealed .reading .block { opacity: 1; transform: none; }
.is-revealed .reading .block:nth-child(1) { transition-delay: 1.2s; }
.is-revealed .reading .block:nth-child(2) { transition-delay: 1.35s; }
.is-revealed .reading .block:nth-child(3) { transition-delay: 1.5s; }
.is-revealed .reading .block:nth-child(4) { transition-delay: 1.7s; }

/* ---------- BOTTOM ---------- */
.bottom {
  grid-area: bottom;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
}

.dots-h {
  width: 34px; height: 3px; margin-top: 6px;
  background: radial-gradient(circle, var(--ink) 1.1px, transparent 1.5px) 0 0 / 7px 3px repeat-x;
}
.bottom__actions { display: flex; gap: 10px; }
/* ガラスのボタン：細いフチ＋すりガラス。影は使わず、後ろの光が透けて見える */
.bottom__actions { position: relative; }
/* ボタンの後ろにあるペンライトの光（すりガラス越しに透ける） */
.bottom__actions::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -24px; top: 50%; width: 230px; height: 84px; transform: translateY(-50%);
  background:
    radial-gradient(closest-side at 38% 50%, var(--glow), transparent),
    radial-gradient(closest-side at 70% 55%, var(--c2), transparent);
  filter: blur(18px); opacity: .5;
  animation: haze 3.2s ease-in-out infinite;
}
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 24px; border-radius: 99px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255,255,255,.42), rgba(255,255,255,.12) 60%, rgba(255,255,255,.2));
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: inset 0 0 0 .5px rgba(26,26,26,.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  font-family: var(--f-ja-sans); font-size: 13px; font-weight: 400; letter-spacing: .12em; text-decoration: none;
  cursor: pointer; transition: transform .3s var(--ease), background .3s;
}
/* 左上の淡い映り込み */
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(165deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 42%);
}
.btn__label { position: relative; z-index: 2; }
.btn:hover { transform: translateY(-1px); background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.2) 60%, rgba(255,255,255,.3)); }
.btn:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* もう一回点灯する：ガラスの中でペンライトの光がふわっと灯る */
.btn--glow { padding-left: 20px; }
.btn--glow::before {
  content: ""; position: absolute; inset: -30% -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 60% at 28% 50%, var(--glow), transparent 75%),
    radial-gradient(42% 70% at 76% 56%, var(--c2), transparent 75%);
  filter: blur(10px);
  opacity: .5;
  animation: inner-light 3.2s ease-in-out infinite;
}
.btn--glow:hover::before, .btn--glow:hover .btn__led { animation-duration: 1.6s; }
.btn__led {
  position: relative; z-index: 2;
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px color-mix(in srgb, var(--glow) 80%, #fff);
  animation: led 3.2s ease-in-out infinite;
}
@keyframes inner-light {
  0%, 100% { opacity: .38; transform: scale(.94); }
  50% { opacity: .85; transform: scale(1.06); }
}
@keyframes haze {
  0%, 100% { opacity: .28; transform: translateY(-50%) scale(.92); }
  50% { opacity: .6; transform: translateY(-50%) scale(1.06); }
}
@keyframes led {
  0%, 100% { box-shadow: 0 0 4px 1px color-mix(in srgb, var(--glow) 70%, #fff); }
  50% { box-shadow: 0 0 10px 4px color-mix(in srgb, var(--glow) 85%, #fff); }
}

/* ---------- SIDE / DECO ---------- */
.side {
  position: absolute; top: 50%; font-size: 10px; letter-spacing: .16em; color: var(--ink-soft);
  writing-mode: vertical-rl; white-space: nowrap;
}
/* 縦書きは回転させず、日本語は正立・英字は上から下へ読む向きに */
.side--l { left: var(--side-x); transform: translateY(-50%); text-orientation: mixed; }
.side--r { right: var(--side-x); transform: translateY(-50%); }
.deco { position: absolute; pointer-events: none; transform: translate(-50%, -50%); }
.plus { width: 13px; height: 13px; }
.plus::before, .plus::after { content: ""; position: absolute; background: var(--ink); }
.plus::before { left: 6px; top: 0; width: 1px; height: 13px; }
.plus::after { top: 6px; left: 0; height: 1px; width: 13px; }
.lines {
  width: 80px; height: 15px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 5px);
  opacity: .7;
}
.grid-dots {
  width: 84px; height: 36px; opacity: .55;
  background: radial-gradient(circle, var(--ink) .9px, transparent 1.3px) 0 0 / 7px 7px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px) {
  :root { --orb: min(46vh, 30vw); }
  .deco { display: none; }
}

/* SP：縦積み */
@media (max-width: 760px) {
  :root { --orb: min(40vh, 78vw); --pad-x: 16px; --pad-y: 12px; }
  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top" "reveal" "orb" "reading" "bottom";
    row-gap: 8px;
  }
  .side, .deco { display: none; }
  .top { grid-template-columns: auto 1fr; align-items: center; }
  .top__no { display: none; }
  .top__title { justify-items: end; text-align: right; }
  .top__date .serif { font-size: 28px; }
  .top__title .mono { font-size: 11px; }
  .dots-v { display: none; }

  .reveal { gap: 2px; align-self: start; margin-top: 4px; }
  .reveal__lead { font-size: 12px; }
  .reveal__name { font-size: min(46px, calc(100cqi / var(--len, 4) * .98)); line-height: 1.15; white-space: nowrap; }
  .reveal__en { font-size: 18px; }
  .reveal__code { margin-top: 4px; gap: 8px; }
  .chip { width: 18px; height: 18px; }
  .hex { font-size: 15px; }
  .coords {
    position: absolute; right: 0; bottom: 2px; text-align: right; margin: 0; gap: 0; font-size: 9.5px;
  }
  .coords__arrow { display: none; }
  .coords > div:not(.coords__arrow) { justify-content: flex-end; gap: 6px; }
  .coords dt { width: auto; }
  .reveal { position: relative; }

  .orb { width: auto; height: min(var(--orb), 100%); }
  .notes { display: none; }

  .reading { max-width: none; gap: 10px; justify-self: stretch; }
  .reading .block:nth-child(1) { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .role { font-size: 17px; }
  .image { font-size: 11.5px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .message { font-size: 14.5px; line-height: 1.65; }
  .ticket { min-height: 52px; grid-template-columns: 40px 1fr; }
  .ticket__stub svg { width: 15px; }
  .ticket__body { padding: 8px 12px; gap: 2px; }
  .ticket__label { font-size: 8.5px; }
  .ticket__text { font-size: 13px; }

  .bottom { grid-template-columns: 1fr; justify-items: center; }
  .bottom__left, .bottom__right { display: none; }
  .bottom { padding-top: 6px; }
  .btn { height: 38px; font-size: 12px; padding: 0 16px; }
}

/* SP で高さが足りない端末 */
@media (max-width: 760px) and (max-height: 700px) {
  .reveal__en { display: none; }
  .image { -webkit-line-clamp: 2; }
}

/* 横長で高さが低い画面 */
@media (min-width: 761px) and (max-height: 640px) {
  .coords { display: none; }
  .image { font-size: 12px; line-height: 1.6; }
  .reading { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
