/* 人生すごろく。ワードウルフの見た目(wordwolf.css)に足す分。
   盤面は「紙のすごろく」: 生成り色の紙に、マスの種類ごとの色。コマは参加者ごとの色の丸 */
:root {
  --paper-2: #fff6df;    /* すごろくの紙 */
  --paper-3: #f3e6c4;
  --pay: #2fbf71;        /* 給料日 */
  --pay-bg: #dff7e9;
  --card-bg: #fff1a6;    /* ハプニング */
  --stop-bg: #ffe0ec;    /* 止まるマス */
  --gamble-bg: #ffd9c2;
}

/* 参加者の色(コマ・名前の印) */
.c0 { --pc: #ffe14d; } .c1 { --pc: #ff4f8b; } .c2 { --pc: #5ee0a8; } .c3 { --pc: #6cc4ff; }
.c4 { --pc: #ff9a3d; } .c5 { --pc: #c39bff; } .c6 { --pc: #ffffff; } .c7 { --pc: #a3e635; }

/* 上: みんなの財布 */
.purses { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 6px; margin: 0 -4px 0; scroll-snap-type: x proximity; }
.purse { flex: 0 0 auto; min-width: 118px; scroll-snap-align: start; background: var(--night-3); border-radius: 14px; padding: 5px 10px 5px; border: 3px solid transparent; position: relative; }
.purse.now { border-color: var(--pc); }
.purse.done { opacity: .7; }
.purse .pn { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: .92rem; white-space: nowrap; }
.purse .pn i { width: 12px; height: 12px; border-radius: 50%; background: var(--pc); flex: none; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.purse .pm { font-family: var(--display); font-size: 1.05rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.purse .pm.minus { color: var(--odd); }
.purse .pm small { font-family: inherit; font-size: .7rem; margin-left: 2px; }
.purse .ph { font-size: .78rem; font-weight: 700; color: #ffb3cd; line-height: 1.4; }
.purse .pj { font-size: .74rem; color: var(--sky); white-space: nowrap; line-height: 1.4; }
.purse .tag { position: absolute; top: -9px; right: 8px; font-size: .68rem; font-weight: 900; background: var(--pc); color: var(--ink); border-radius: 999px; padding: 0 8px; }

/* 盤面 */
.board-box { position: relative; height: clamp(210px, calc(100svh - 500px), 440px); overflow-y: auto; border-radius: 22px; background: var(--paper-2); color: var(--ink); padding: 10px 10px 16px; margin-top: 6px;
  background-image: radial-gradient(circle, rgba(20,26,79,.07) 1px, transparent 1.5px); background-size: 12px 12px; scroll-behavior: smooth; overscroll-behavior: contain; }
.stage-h { display: flex; align-items: baseline; gap: 8px; margin: 12px 4px 6px; font-family: var(--display); font-size: 1rem; color: var(--night); }
.stage-h:first-child { margin-top: 2px; }
.stage-h small { font-family: inherit; font-weight: 700; font-size: .78rem; color: #6b72a8; }
.lane-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.lane-h { text-align: center; font-weight: 900; font-size: .82rem; background: var(--paper-3); border-radius: 10px; padding: 3px 4px; margin-bottom: 4px; }
.road { display: grid; gap: 4px; }
.cell { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border-radius: 12px; background: #fff; border: 2px solid rgba(20,26,79,.1); font-size: .84rem; font-weight: 700; line-height: 1.3; position: relative; }
.cell .ic { width: 1.4em; text-align: center; flex: none; }
.cell .lb { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cell.t-pay { background: var(--pay-bg); border-color: #9be4bc; }
.cell.t-card { background: var(--card-bg); border-color: #f0d75a; }
.cell.t-gamble { background: var(--gamble-bg); border-color: #ffb48a; }
.cell.t-job, .cell.t-marry, .cell.t-house, .cell.t-fork, .cell.t-goal, .cell.t-start { background: var(--stop-bg); border-color: #ff9fc0; font-weight: 900; }
.cell.t-goal { background: var(--lemon); border-color: var(--lemon-2); }
.cell.hot { outline: 3px solid var(--night); outline-offset: 1px; }
.cell.flash { animation: flash .5s; }
@keyframes flash { 50% { transform: scale(1.04); } }
.toks { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; max-width: 50%; }
.tok { width: 20px; height: 20px; border-radius: 50%; background: var(--pc); box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 -3px 0 rgba(0,0,0,.15); font-size: .62rem; font-weight: 900; display: grid; place-items: center; color: var(--ink); flex: none; }
.tok.hop { animation: hop .22s ease-out; }
@keyframes hop { 40% { transform: translateY(-9px); } }
.lane-wrap .cell { font-size: .78rem; padding: 4px 6px; gap: 4px; }
.lane-wrap .toks { max-width: 44%; }
.lane-wrap .tok { width: 16px; height: 16px; font-size: .55rem; }

/* できごとカード */
.ev-card { margin-top: 10px; background: #fff; color: var(--ink); border-radius: 20px; padding: 10px 14px 12px; border-top: 7px solid var(--pc, var(--lemon)); min-height: 96px; }
.ev-card.pop { animation: pop .35s cubic-bezier(.3,1.5,.5,1); }
@keyframes pop { from { transform: translateY(10px) scale(.96); opacity: 0; } }
.ev-who { font-size: .82rem; font-weight: 900; color: #6b72a8; }
.ev-title { font-family: var(--display); font-size: clamp(1.25rem, 5.4vw, 1.6rem); line-height: 1.3; margin: 2px 0 4px; }
.ev-text { margin: 0; font-size: .95rem; }
.ev-note { margin: 4px 0 0; font-size: .85rem; color: #6b72a8; font-weight: 700; }
.deltas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.delta { font-weight: 900; font-size: .9rem; border-radius: 999px; padding: 2px 12px; background: var(--pay-bg); color: #137a45; }
.delta.minus { background: #ffe0ec; color: #b4134d; }
.delta.heart { background: #ffe3f0; color: #c2185b; }
.delta b { font-family: var(--display); font-weight: 400; }

/* サイコロ */
.dice-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.die { width: 64px; height: 64px; border-radius: 16px; background: #fff; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 10px; box-shadow: 0 6px 0 #b9bfe8; flex: none; }
.die i { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); place-self: center; visibility: hidden; }
.die i.on { visibility: visible; }
.die.one i.on { background: var(--odd); width: 15px; height: 15px; }
.die.rolling { animation: shake .12s infinite; }
.die.land { animation: land .35s cubic-bezier(.3,1.6,.5,1); }
.die.small { width: 34px; height: 34px; border-radius: 9px; padding: 5px; box-shadow: 0 3px 0 #b9bfe8; }
.die.small i { width: 6px; height: 6px; }
.die.small.one i.on { width: 8px; height: 8px; }
@keyframes shake { 0% { transform: rotate(-12deg) translateY(-4px); } 50% { transform: rotate(10deg) translateY(2px); } 100% { transform: rotate(-12deg) translateY(-4px); } }
@keyframes land { from { transform: scale(1.4) rotate(20deg); } }

/* 操作 */
.act { margin-top: 10px; }
.act > .panel { padding: 14px; }
.act h3 { margin: 0 0 8px; text-align: center; font-size: 1.05rem; }
.roll-btn { font-size: 1.4rem; min-height: 72px; }
.choices { display: grid; gap: 10px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice { font: inherit; text-align: left; border: 0; border-radius: 18px; background: #fff; color: var(--ink); padding: 12px 14px; cursor: pointer; box-shadow: 0 5px 0 #b9bfe8; display: grid; gap: 2px; }
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 #b9bfe8; }
.choice .ch-t { font-weight: 900; font-size: 1.08rem; display: flex; align-items: center; gap: 8px; }
.choice .ch-t .big { font-size: 1.5rem; }
.choice .ch-s { font-size: .84rem; color: #4a5190; font-weight: 700; }
.choice .ch-n { font-size: .8rem; color: #6b72a8; }
.choice.center { text-align: center; justify-items: center; }
.choice.go { background: var(--lemon); box-shadow: 0 5px 0 var(--lemon-2); }
.choice.risky { background: var(--odd); color: #fff; box-shadow: 0 5px 0 var(--odd-2); }
.choice.risky .ch-s, .choice.risky .ch-n { color: rgba(255,255,255,.85); }
.wait { text-align: center; padding: 10px; }
.wait .who { font-family: var(--display); font-size: 1.3rem; }
.turn-bar { height: 6px; border-radius: 999px; background: var(--night-2); overflow: hidden; margin-top: 10px; }
.turn-bar > div { height: 100%; background: var(--sky); transition: width .25s linear; }

/* スタンプ */
.reacts { display: flex; justify-content: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.reacts button { font-size: 1.4rem; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--night-3); cursor: pointer; }
.reacts button:active { transform: scale(.9); }
.float { position: fixed; bottom: 90px; z-index: 40; font-size: 2.2rem; pointer-events: none; animation: rise 2.2s ease-out forwards; text-align: center; }
.float small { display: block; font-size: .7rem; font-weight: 900; background: var(--pc); color: var(--ink); border-radius: 999px; padding: 0 8px; }
@keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { transform: translateY(-20px) scale(1.1); opacity: 1; } 100% { transform: translateY(-260px) scale(1); opacity: 0; } }

.log { margin-top: 14px; }
.log summary { cursor: pointer; font-weight: 700; color: var(--sky); }
.log ol { list-style: none; margin: 8px 0 0; padding: 0; font-size: .86rem; }
.log li { padding: 4px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.log li i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); margin-top: .5em; flex: none; }

/* 待合室: この端末で遊ぶ人 */
.local-add { display: flex; gap: 8px; margin-top: 8px; }
.local-add input { flex: 1; }
.badge.local { background: var(--sky); }

/* 結果 */
.podium { display: grid; gap: 10px; margin-top: 12px; }
.rank { background: #fff; color: var(--ink); border-radius: 20px; padding: 12px 16px; border-left: 10px solid var(--pc); }
.rank.r1 { background: var(--lemon); }
.rank-top { display: flex; align-items: baseline; gap: 10px; }
.rank-no { font-family: var(--display); font-size: 1.6rem; line-height: 1; }
.rank-name { font-weight: 900; font-size: 1.1rem; flex: 1; overflow-wrap: anywhere; }
.rank-pt { font-family: var(--display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.rank-pt small { font-family: inherit; font-size: .75rem; font-weight: 700; }
.rank-break { font-size: .8rem; color: #4a5190; font-weight: 700; }
.story-line { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.story-line span { font-size: .75rem; font-weight: 700; background: rgba(20,26,79,.08); border-radius: 999px; padding: 1px 9px; }
.story-line span + span::before { content: '→ '; color: #9aa0c8; }
.awards { display: grid; gap: 8px; margin-top: 8px; }
.award { display: flex; gap: 10px; align-items: center; background: var(--night-3); border-radius: 16px; padding: 10px 14px; }
.award b { font-size: 1.02rem; }
.award .an { font-weight: 900; color: var(--pc); }
.award .aw { font-size: .82rem; color: var(--sky); }

.title-jinsei { display: flex; align-items: center; gap: 12px; }
.title-dice { display: flex; gap: 6px; }

@media (max-width: 420px) {
  .lane-wrap .cell .lb { font-size: .72rem; }
  .choices.two { grid-template-columns: 1fr; }
}

/* 遊んでいるあいだは、上の帯を細く */
body.playing .site-head nav { display: none; }
body.playing .site-head .in { padding: 8px 20px; }
body.playing .wrap { padding-top: 4px; }
