/* ============================================================
   トカロン -Talk a Lot-（ぺげ No.08）
   全自動卓のような明るい緑のフェルト・象牙色の牌・赤と金
   ============================================================ */
:root {
  --felt: #1f9e3e;
  --felt-dark: #1f5c3a;
  --felt-deep: #17472c;
  --ivory: #fcf8ee;
  --tile: #fffdf8;
  /* 麻雀牌：手前の面の上に、白い厚みと背の色が見える（影を重ねて立体に見せる） */
  --tile-back: #e8961e;
  --tile-back-dark: #b0650d;
  --tile-back-light: #f8c46c;
  --tile-side: #fbfaf6;
  --tile-side-2: #ebe8df;
  --tile-edge: #d3cab6;
  --tile-face: linear-gradient(180deg, #e8e2d3 0%, #fffefa 13%, #fffdf8 74%, #ebe3cf 100%);
  --tile-layers: 0 -2px 0 0 var(--tile-edge), 0 -6px 0 -1px var(--tile-side-2), 0 -12px 0 -1px var(--tile-side), 0 -13px 0 -1px var(--tile-back-dark), 0 -19px 0 -2px var(--tile-back), 0 -21px 0 -3px var(--tile-back-light);
  --red: #d23a31;
  --red-dark: #9e231b;
  --gold: #dcae40;
  --gold-light: #f6d983;
  --ink: #2b2b2b;
  --sub: #6d6a62;
  --cream: #f8efd6;
  --shadow: 0 6px 16px rgba(0, 0, 0, .2);
  --shadow-s: 0 3px 8px rgba(0, 0, 0, .16);
  --round: 18px;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  --display: "Dela Gothic One", "M PLUS Rounded 1c", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: var(--felt);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
/* 全自動卓のフェルト（明るい緑。まわりだけ、ほんの少し暗く。iPhone でも動かないように固定の層） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 58%, rgba(0, 30, 10, .22) 100%),
    url("../img/felt.jpg?v=3") center / cover no-repeat, var(--felt);
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
.hidden { display: none !important; }

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 14px 110px;
}
.scr { display: none; animation: fadein .25s ease; }
.scr.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 文字 ---------- */
.on-felt { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.center { text-align: center; }
.title-s { font-size: 15px; font-weight: 800; margin: 0 0 8px; color: var(--felt-dark); }
.lead { font-size: 15px; line-height: 1.7; }
.note { font-size: 12.5px; color: var(--sub); line-height: 1.6; }
h2.head {
  font-size: 20px;
  font-weight: 800;
  margin: 6px 0 14px;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .38);
  line-height: 1.45;
}

/* ---------- カード ---------- */
.card {
  background: var(--ivory);
  border-radius: var(--round);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 14px;
  border: 2px solid rgba(220, 174, 64, .7);
}
.card.plain { border-color: transparent; }

/* ---------- ボタン ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 0;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, filter .15s ease, opacity .15s;
  margin: 10px 0 0;
}
.btn:active { transform: translateY(3px); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-red {
  color: #fff;
  background: linear-gradient(180deg, #ec5a4f, var(--red) 55%, var(--red-dark));
  border: 3px solid var(--gold);
  box-shadow: 0 5px 0 #7a1a14, 0 8px 16px rgba(0, 0, 0, .22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.btn-ivory {
  color: var(--felt-dark);
  background: var(--ivory);
  border: 3px solid var(--gold);
  box-shadow: 0 4px 0 #b4924a;
}
.btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(255, 255, 255, .6);
  min-height: 44px;
  font-size: 15px;
}
.btn-link {
  display: inline-block;
  background: none;
  border: 0;
  color: #fff;
  text-decoration: underline;
  font-size: 13.5px;
  padding: 8px 4px;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.card .btn-link { color: var(--sub); text-shadow: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- タイトル画面 ---------- */
.top-logo { width: 88%; margin: 6px auto 0; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3)); }
.catch {
  font-family: var(--display);
  font-size: 23px;
  text-align: center;
  color: #fff;
  margin: 8px 0 4px;
  letter-spacing: .02em;
  text-shadow: 0 3px 0 var(--red-dark), 0 4px 8px rgba(0, 0, 0, .35);
}
.catch-sub { text-align: center; color: var(--cream); font-size: 13.5px; font-weight: 700; margin: 0 0 12px; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.kv { border-radius: var(--round); border: 3px solid var(--gold); box-shadow: var(--shadow); width: 100%; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; }
.steps li { position: relative; padding: 0 0 10px 34px; font-size: 14px; line-height: 1.65; }
.steps li::before {
  counter-increment: st;
  content: counter(st);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps b { color: var(--red); }
.steps small { display: block; font-size: 11.5px; color: var(--sub); line-height: 1.5; margin-top: 2px; }
.premium-card { display: flex; gap: 12px; align-items: center; }
.premium-card img { width: 112px; border-radius: 12px; flex: none; }
.premium-card .txt { font-size: 13.5px; line-height: 1.6; }
.premium-card .price { color: var(--red); font-weight: 800; }
.footer { text-align: center; padding: 14px 0 0; }
.footer a { color: #fff; font-size: 13px; margin: 0 8px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.pege-mark { font-weight: 800; }

/* ---------- 入力 ---------- */
label.lb { display: block; font-size: 14px; font-weight: 800; margin: 12px 0 6px; color: var(--felt-dark); }
input.tx {
  width: 100%;
  font: inherit;
  font-size: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #dccfae;
  background: #fff;
  outline: none;
}
input.tx:focus { border-color: var(--gold); }
input.code {
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: .35em;
  text-align: center;
  padding-left: .35em;
  color: var(--red);
}
.icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
/* アイコンの絵は、まわりに髪などのための余白があるので、少し大きく表示する */
.icon-grid button {
  border: 3px solid transparent;
  border-radius: 16px;
  background: rgba(31, 158, 62, .08);
  padding: 0;
  cursor: pointer;
  overflow: visible;
}
.icon-grid button img { width: 100%; transform: scale(1.3); }
.icon-grid button.sel { border-color: var(--red); background: rgba(210, 58, 49, .1); }
.icon-grid button[disabled] { opacity: .25; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1;
  padding: 10px 6px;
  border-radius: 14px;
  border: 2px solid #dccfae;
  background: #fff;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--sub);
  cursor: pointer;
  line-height: 1.35;
}
.seg button small { display: block; font-size: 11.5px; font-weight: 500; }
.seg button.sel { border-color: var(--red); color: var(--red); background: #fff6f3; }

/* ---------- 待合室 ---------- */
.room-code {
  font-family: var(--display);
  font-size: 54px;
  letter-spacing: .25em;
  text-align: center;
  color: var(--red);
  margin: 2px 0 0;
  padding-left: .25em;
}
.players { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pchip { text-align: center; font-size: 13px; font-weight: 700; position: relative; }
.pchip img { width: 82%; margin: 6px auto 4px; transform: scale(1.25); }
.pchip .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip .host-tag {
  position: absolute; top: 0; left: 4px;
  background: var(--gold); color: #fff; font-size: 10.5px; padding: 1px 6px; border-radius: 99px;
}
.pchip.me .nm { color: var(--red); }

/* ---------- ゲームの上の帯（金のふちの、暗い点数表示） ---------- */
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 40, 14, .26);
  border: 2px solid rgba(220, 174, 64, .85);
  border-radius: 16px;
  padding: 6px 10px;
  color: var(--cream);
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.bar .kyoku { font-family: var(--display); font-size: 21px; color: var(--gold-light); white-space: nowrap; text-shadow: 0 2px 3px rgba(0, 0, 0, .35); }
.bar .oya { flex: 1; font-size: 12px; line-height: 1.3; overflow: hidden; color: var(--cream); }
.bar .oya b { font-size: 15px; color: #fff; }
.bar .mine { text-align: right; font-size: 11px; line-height: 1.2; white-space: nowrap; color: var(--cream); }
.bar .mine b { font-size: 16px; color: var(--gold-light); }

/* ---------- お題 ---------- */
.theme-title {
  background: var(--tile);
  border-radius: 16px;
  border: 3px solid var(--gold);
  padding: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--felt-dark);
  box-shadow: var(--shadow);
  margin: 0 0 12px;
  line-height: 1.4;
}
.theme-title small { display: block; font-size: 12px; color: var(--sub); font-weight: 700; margin-bottom: 2px; }
.field { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 10px; padding-top: 20px; }
.field button {
  min-height: 92px;
  border-radius: 12px;
  border: 0;
  background: var(--tile-face);
  box-shadow: var(--tile-layers), 0 8px 12px rgba(0, 0, 0, .26);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  padding: 10px 8px;
  line-height: 1.45;
  cursor: pointer;
}
.field button:active { transform: translateY(2px); }
.field button[disabled] { cursor: default; }
.field button[disabled]:active { transform: none; }

/* ---------- 卓（牌を置く場所。フェルトの上にそのまま並べる） ---------- */
.taku { margin: 4px 0 8px; }

/* ---------- 牌（待ちの言葉） ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 26px; }
.tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 0;
  background: var(--tile-face);
  box-shadow: var(--tile-layers), 0 8px 12px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  color: var(--ink);
  font-family: inherit;
}
.tile .w { font-weight: 800; line-height: 1.2; word-break: break-all; text-align: center; }
.tile .w.l1 { font-size: 26px; }
.tile .w.l2 { font-size: 21px; }
.tile .w.l3 { font-size: 16.5px; }
.tile .w.l4 { font-size: 13.5px; }
.tile .yaku { margin-top: 8px; font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 99px; color: #fff; }
.tile .pts { font-family: var(--display); font-size: 15px; margin-top: 3px; color: var(--red); }
.tile.t-s .yaku { background: #3b9a62; }
.tile.t-m .yaku { background: #2f76bd; }
.tile.t-l .yaku { background: linear-gradient(90deg, #c9921e, #edc24f); }
/* 選んだ牌は少し持ち上げて、牌全体（上の厚みも）を赤い枠でかこむ */
.tile.sel { transform: translateY(-8px); box-shadow: var(--tile-layers), 0 14px 18px rgba(0, 0, 0, .32); }
.tile.sel::after, .tile.hit::after {
  content: ""; position: absolute; left: -5px; right: -5px; top: -26px; bottom: -5px;
  border: 3px solid var(--red); border-radius: 16px; pointer-events: none;
}
.tile.hit::after { border-color: var(--gold-light); box-shadow: 0 0 22px rgba(246, 217, 131, .95); }
.tile.dim { opacity: .55; }
.tile .stamp {
  position: absolute;
  z-index: 2;
  top: -30px;
  right: -10px;
  background: var(--red);
  color: #fff;
  font-family: var(--display);
  font-size: 15px;
  padding: 3px 9px;
  border-radius: 10px;
  transform: rotate(10deg);
  border: 2px solid var(--gold);
}
.waiters { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-height: 30px; margin-top: 8px; }
.waiters img { width: 36px; transform: scale(1.2); }
.col { display: flex; flex-direction: column; }

/* ---------- 進み具合 ---------- */
.progress { text-align: center; color: #fff; font-weight: 800; font-size: 15px; margin: 10px 0; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.picked-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 6px 0; }
.picked-row img { width: 44px; transform: scale(1.2); transition: opacity .2s; }
.picked-row img.wait { opacity: .35; filter: grayscale(1); }

/* ---------- 60秒のタイマー ---------- */
.timer { position: relative; width: 150px; height: 150px; margin: 4px auto 10px; }
.timer::before {
  content: ""; position: absolute; inset: 12px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(0, 40, 14, .22), rgba(0, 40, 14, .32));
}
.timer svg { position: relative; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .bg { stroke: rgba(0, 0, 0, .25); }
.timer .fg { stroke: var(--gold-light); transition: stroke-dashoffset .2s linear; }
.timer.low .fg { stroke: #ff7a6b; }
.timer .num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  color: #fff; font-family: var(--display); font-size: 44px; line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}
.timer.low .num { color: #ff8a7d; }
.timer .num small { font-family: var(--font); font-size: 12px; font-weight: 700; margin-top: 4px; }

/* ---------- ロンのボタン ---------- */
.ron-wrap { display: flex; justify-content: center; margin: 14px 0 6px; }
.ron-btn {
  width: 188px;
  height: 188px;
  border-radius: 50%;
  border: 6px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #f37a6e, var(--red) 55%, var(--red-dark));
  color: #fff;
  font-family: var(--display);
  font-size: 62px;
  box-shadow: 0 9px 0 #7a1a14, 0 14px 26px rgba(0, 0, 0, .35);
  cursor: pointer;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .22);
  transition: transform .06s ease;
}
.ron-btn:active { transform: translateY(6px); box-shadow: 0 3px 0 #7a1a14, 0 8px 18px rgba(0, 0, 0, .35); }
.my-wait { display: flex; align-items: center; justify-content: center; gap: 12px; }
.my-wait .tile { width: 100px; cursor: default; margin-top: 22px; }
/* 小さい牌でも、4〜5文字の言葉が1行に入るように */
.my-wait .tile .w.l2 { font-size: 19px; }
.my-wait .tile .w.l3 { font-size: 15px; }
.my-wait .tile .w.l4 { font-size: 12.5px; }
.my-wait .lbl { font-size: 14px; line-height: 1.6; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.my-wait .lbl b { font-size: 18px; }

/* ---------- 点数表 ---------- */
.board { list-style: none; margin: 0; padding: 0; }
.board li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; border-bottom: 1px dashed #dccfae;
}
.board li:last-child { border-bottom: 0; }
.board img { width: 48px; flex: none; transform: scale(1.2); }
/* 名前は1行（長いときは…）。印（親・トップ・ラス・裏ドラ賞）は、入らなければ次の行へ */
.board .nm { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; row-gap: 3px; }
.board .nm-t { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 0; }
.board .nm .badge { flex: none; }
.board .sc { font-family: var(--display); font-size: 17px; color: var(--felt-dark); }
.board .rk { width: 26px; text-align: center; font-family: var(--display); font-size: 18px; color: var(--sub); flex: none; }
.board li.me .nm { color: var(--red); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 800; color: #fff;
  padding: 1px 7px; border-radius: 99px; margin-left: 4px; vertical-align: 2px;
}
.badge.oya { background: var(--red); }
.badge.top { background: linear-gradient(90deg, #c9921e, #edc24f); }
.badge.las { background: #8a8a8a; }
.badge.king { background: #2f8f5a; }
.board-toggle { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 20; width: auto; padding: 10px 22px; min-height: 0; font-size: 14px; }
.board-toggle:active { transform: translateX(-50%) translateY(2px); }

/* ---------- 下から出る点数表 ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 520px; margin: 0 auto;
  background: var(--ivory); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 26px rgba(0, 0, 0, .3);
  padding: 16px 16px 24px; max-height: 75vh; overflow: auto;
  transform: translateY(105%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s;
}
.sheet.open { transform: none; visibility: visible; transition: transform .25s ease; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 39; display: none; }
.sheet-bg.open { display: block; }

/* ---------- 投票 ---------- */
.vote-list { display: grid; gap: 10px; }
.vote-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--tile); border: 3px solid transparent; border-radius: 16px; padding: 8px 10px;
  box-shadow: var(--shadow); cursor: pointer; font-family: inherit; color: var(--ink);
}
.vote-item img { width: 62px; flex: none; transform: scale(1.2); }
.vote-item .nm { font-weight: 800; font-size: 16px; }
.vote-item .talks { font-size: 12px; color: var(--sub); line-height: 1.5; }
.vote-item.sel { border-color: var(--red); background: #fff6f3; }

/* ---------- 最後の結果 ---------- */
/* 裏ドラ賞（いちばん意外な一面が見えた人）：めくれた牌に、その人のアイコン */
.king-box { text-align: center; background: radial-gradient(circle at 50% 20%, #fffaf0, var(--ivory) 70%); }
.king-label { font-family: var(--display); font-size: 28px; color: var(--red); margin: 2px 0 0; }
.ura-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 32px 0 6px; }
.ura-tile {
  width: 104px; padding: 8px 6px 10px; border-radius: 14px;
  background: var(--tile-face);
  box-shadow: var(--tile-layers), 0 8px 14px rgba(0, 0, 0, .22), 0 0 28px rgba(237, 194, 79, .6);
}
.ura-tile img { width: 80%; margin: 6px auto 4px; transform: scale(1.2); }
.ura-tile b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ura-flip { display: flex; gap: 14px; justify-content: center; perspective: 800px; margin-bottom: 12px; padding-top: 22px; }
.ura3d { position: relative; width: 104px; height: 138px; transform-style: preserve-3d; animation: uraflip .9s ease-in-out both; }
.ura3d > div { position: absolute; inset: 0; border-radius: 14px; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
/* うら（背）：背の色の面。上に白い厚みが見える */
.ura-back {
  background: linear-gradient(180deg, var(--tile-back-light), var(--tile-back) 55%, var(--tile-back-dark));
  box-shadow: 0 -2px 0 0 var(--tile-back-dark), 0 -6px 0 -1px var(--tile-side-2), 0 -12px 0 -1px var(--tile-side), 0 -13px 0 -1px var(--tile-edge), 0 8px 18px rgba(0, 0, 0, .4);
}
.ura-front {
  transform: rotateY(180deg); display: flex; align-items: center; justify-content: center;
  background: var(--tile-face);
  box-shadow: var(--tile-layers), 0 0 30px rgba(246, 217, 131, .9);
}
.ura-front img { width: 82%; transform: scale(1.2); }
@keyframes uraflip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }

/* 麻雀の言葉の、小さな説明 */
.cap { font-size: 11.5px; line-height: 1.5; color: var(--sub); }
.on-felt.cap { color: var(--cream); }
.tip small { display: block; font-size: 11.5px; line-height: 1.55; margin-top: 4px; opacity: .92; }
.gold { color: var(--gold-light); }
/* 結果をシェア：1つのボタン → 下から出る画面で LINE・X・画像を保存 を選ぶ */
.btn-gold {
  color: #4a3206;
  background: linear-gradient(180deg, #f9df8c, #eabb4b 55%, #c9921e);
  border: 3px solid #fff3cf;
  box-shadow: 0 5px 0 #8a6312, 0 8px 16px rgba(0, 0, 0, .22);
}
.btn-line { background: #06c755; color: #fff; border: 0; }
.btn-x { background: #111; color: #fff; border: 0; }
#share-sheet .share-go.wait { opacity: .45; pointer-events: none; }
#share-sheet .note { text-align: center; margin: 12px 0 0; }
.sheet .btn-link { display: block; margin: 6px auto 0; color: var(--sub); text-shadow: none; }
.reco { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reco a {
  display: block; text-align: center; background: #fff; border: 2px solid rgba(220, 174, 64, .55); border-radius: 14px; padding: 10px 6px;
  color: var(--felt-dark); font-weight: 800; text-decoration: none; font-size: 14px;
}
.reco a small { display: block; font-weight: 500; color: var(--sub); font-size: 11.5px; }

/* ---------- 演出（ロン・流局・局の始まり・サイコロ） ---------- */
#fx {
  position: fixed; inset: 0; z-index: 60; display: none; overflow: hidden; isolation: isolate;
  align-items: center; justify-content: center; flex-direction: column;
  background: radial-gradient(circle at 50% 42%, rgba(24, 58, 38, .9), rgba(0, 0, 0, .94));
  text-align: center; padding: 20px;
}
#fx.show { display: flex; animation: fadein .15s ease; }
.fx-big {
  font-family: var(--display);
  font-size: 92px;
  line-height: 1.05;
  background: linear-gradient(180deg, #fffbe6, var(--gold-light) 45%, #d39a22);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 var(--red-dark)) drop-shadow(0 8px 14px rgba(0, 0, 0, .45));
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1);
}
.fx-big.long { font-size: 64px; }
.fx-mid { font-family: var(--display); font-size: 34px; color: #fff; margin-top: 10px; animation: pop .5s .25s both; text-shadow: 0 3px 0 var(--red-dark); }
.fx-sub { color: var(--cream); font-size: 17px; font-weight: 800; margin-top: 12px; animation: fadein .3s .45s both; line-height: 1.6; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.fx-sub b { color: #fff; }
/* 倍満：金色の文字 */
.fx-baiman .fx-mid { color: var(--gold-light); font-size: 42px; text-shadow: 0 3px 0 var(--red-dark), 0 0 18px rgba(246, 217, 131, .8); }
/* 役満：赤い背景に、回る金の光・ゆれる大きな文字・金の粉 */
#fx.fx-yakuman { background: radial-gradient(circle at 50% 42%, rgba(160, 30, 18, .95), rgba(24, 0, 0, .97)); }
.fx-yakuman .rays {
  position: absolute; left: 50%; top: 42%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(246, 217, 131, .28) 0deg 7deg, rgba(246, 217, 131, 0) 7deg 18deg);
  animation: spin 9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fx-pre { font-family: var(--display); font-size: 36px; color: #fff; text-shadow: 0 3px 0 var(--red-dark); animation: pop .4s both; }
.fx-big.yakuman { font-size: 132px; animation: pop .55s .15s cubic-bezier(.2, 1.6, .4, 1) both, shake .5s .8s both; }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translate(-7px, 3px) rotate(-2deg); }
  40% { transform: translate(7px, -3px) rotate(2deg); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(4px, -2px); }
}
.fx-yakuman .fx-mid { color: var(--gold-light); font-size: 54px; text-shadow: 0 4px 0 var(--red-dark), 0 0 22px rgba(246, 217, 131, .9); }
.fx-sub small { font-size: 14px; color: var(--cream); }
.spark {
  position: absolute; top: -24px; width: 10px; height: 10px; border-radius: 2px; z-index: -1;
  background: var(--gold-light); box-shadow: 0 0 8px rgba(246, 217, 131, .9);
  animation: fall 2s linear infinite;
}
@keyframes fall { from { transform: translateY(0) rotate(0); opacity: 1; } to { transform: translateY(110vh) rotate(540deg); opacity: .25; } }
.fx-ryu .fx-big { background: linear-gradient(180deg, #f4fbf6, #b9dcc6); -webkit-background-clip: text; background-clip: text; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.fx-flash { position: fixed; inset: 0; background: #fff; z-index: 61; pointer-events: none; animation: flash .5s ease forwards; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

.dice-row { display: flex; gap: 18px; justify-content: center; margin: 6px 0 16px; }
.die {
  width: 84px; height: 84px; border-radius: 18px;
  background: linear-gradient(145deg, #fff, #e9e9ef);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .08), 0 8px 18px rgba(0, 0, 0, .4);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: 12px; gap: 2px;
}
.die.roll { animation: roll .9s ease-out; }
@keyframes roll {
  0% { transform: translateY(-120px) rotate(-200deg); }
  60% { transform: translateY(8px) rotate(20deg); }
  100% { transform: none; }
}
.die i { width: 15px; height: 15px; border-radius: 50%; background: #222; align-self: center; justify-self: center; visibility: hidden; }
.die i.on { visibility: visible; }
.die.one i.on { background: var(--red); width: 22px; height: 22px; }

/* ---------- 確認ダイアログ ---------- */
#modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); padding: 20px; }
#modal.show { display: flex; }
#modal .box { background: var(--ivory); border-radius: 20px; padding: 20px; max-width: 380px; width: 100%; box-shadow: var(--shadow); border: 3px solid var(--gold); }
#modal .msg { font-size: 16px; line-height: 1.7; font-weight: 700; text-align: center; white-space: pre-line; }

/* ---------- プレミアム（ログイン・購入） ---------- */
#premium {
  position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .5); padding: 16px; overflow-y: auto;
}
#premium.show { display: flex; }
#premium .box {
  background: var(--ivory); border-radius: 20px; padding: 18px 18px 12px; max-width: 400px; width: 100%;
  box-shadow: var(--shadow); border: 3px solid var(--gold); margin: auto;
}
.premium-kv { width: 100%; border-radius: 12px; border: 2px solid rgba(220, 174, 64, .7); }
.premium-title { font-family: var(--display); font-size: 22px; color: var(--felt-dark); text-align: center; margin: 12px 0 8px; }
.premium-list { list-style: none; margin: 0; padding: 0; }
.premium-list li { font-size: 13px; line-height: 1.6; color: var(--sub); padding: 8px 0 8px 22px; position: relative; border-bottom: 1px dashed #dccfae; }
.premium-list li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.premium-list li b { display: block; font-size: 15px; color: var(--ink); }
.premium-price { font-family: var(--display); font-size: 30px; color: var(--red); text-align: center; margin: 10px 0 2px; }
.premium-price small { font-family: var(--font); font-size: 13px; font-weight: 700; color: var(--sub); margin-left: 4px; }
.premium-warn { background: #fff3d6; border-radius: 12px; padding: 8px 10px; font-size: 12.5px; line-height: 1.6; color: #7a5a12; font-weight: 700; }
.premium-owned { text-align: center; font-weight: 800; color: var(--felt-dark); line-height: 1.7; margin: 10px 0 0; }
.premium-foot { display: flex; justify-content: center; gap: 18px; margin-top: 6px; }
#premium .btn-link { color: var(--sub); text-shadow: none; }
#premium .note { margin: 8px 0 0; }

/* ---------- 規約などのリンク ---------- */
.legal { text-align: center; margin: 14px 0 0; line-height: 2; }
.legal a { color: var(--cream); font-size: 11.5px; margin: 0 6px; text-decoration: underline; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); font-weight: 500; }

/* ---------- シェアの画像 ---------- */
.share-preview { width: 100%; border-radius: 12px; border: 2px solid rgba(220, 174, 64, .6); margin: 0 0 10px; }

/* ---------- お知らせ ---------- */
/* 出ていないときは、画面の上に少しも見えないようにする */
#toast {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -200%);
  background: rgba(20, 20, 20, .85); color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 99px; z-index: 90;
  opacity: 0; visibility: hidden; transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s;
  max-width: 92vw; text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .25s ease, opacity .25s ease; }

.wait-msg { text-align: center; color: #fff; font-weight: 800; font-size: 15px; margin: 18px 0 4px; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.tip {
  background: rgba(0, 40, 14, .28);
  border-radius: 14px;
  color: #fffbea;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.65;
  margin: 12px 0 0;
}
.tip b { color: var(--gold-light); }
.small-actions { text-align: center; margin-top: 4px; }

@media (max-width: 360px) {
  .catch { font-size: 20px; }
  .tile .w.l1 { font-size: 22px; }
  .tile .w.l2 { font-size: 18px; }
  .tile .w.l3 { font-size: 14px; }
  .tile .w.l4 { font-size: 12px; }
  .ron-btn { width: 170px; height: 170px; font-size: 56px; }
  .fx-big { font-size: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-yakuman .rays, .spark { animation: none; }
  .ura3d { animation: none; transform: rotateY(180deg); }
  .fx-big.yakuman { animation: pop .3s both; }
}
