/* LYX Coin — 上の残高ボタン（main.js の .coinbtn）と、コインの画面（screens/coin.js）
   コインは CSS で描く金貨。色は app.css の :root（--accent が金） */
:root {
  --gold: #ffd23f;
  --gold2: #f5a623;
  --gold3: #8a5a00;
  --silver: #cfd6ea;
  --bronze: #e09a5b;
}

/* ---- 小さい金貨（どこでも使う） ---- */
i.lyx { position: relative; display: inline-block; flex: none; width: 1.15em; height: 1.15em; border-radius: 50%; vertical-align: -.2em;
  background: radial-gradient(circle at 34% 30%, #fff6c8 0 12%, var(--gold) 34%, var(--gold2) 72%, var(--gold3) 100%);
  box-shadow: inset 0 0 0 .1em rgba(138, 90, 0, .55), 0 .06em 0 #000; }
i.lyx::after { content: "L"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); font-style: normal; font-size: .62em; line-height: 1; color: var(--gold3); }

/* ---- 上の残高ボタン ---- */
.coinbtn { position: relative; flex: 0 1 auto; min-width: 0; max-width: 34vw; display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 10px 4px 6px;
  border: 2px solid #000; border-radius: 999px; background: linear-gradient(180deg, #2b2410, #17130a); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 #000, inset 0 0 0 1px rgba(255, 210, 63, .35); }
.coinbtn[hidden] { display: none; } /* ルーキーズは隠す。inline-flex が hidden に勝つので強める（2026-10-12） */
.coinbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000, inset 0 0 0 1px rgba(255, 210, 63, .35); }
.coinbtn i.lyx { font-size: 22px; }
.coinbtn .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--gold); }
.coinbtn small { flex: none; font-size: 10px; font-weight: 800; color: var(--sub); letter-spacing: .04em; }
/* もらったとき「+10 LYX」が浮かんで消える（1.6秒。main.js が 1600ms で消す） */
.coinpop { position: absolute; left: 50%; top: 100%; z-index: 10; pointer-events: none; white-space: nowrap; font-weight: 800; font-size: 14px; color: var(--gold);
  text-shadow: 0 2px 0 #000, 0 0 10px rgba(255, 210, 63, .6); transform: translate(-50%, 4px); opacity: 0; animation: coinpop 1.6s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes coinpop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
  30% { transform: translate(-50%, -4px) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -26px) scale(1); }
}
@media (max-width: 360px) {
  .topbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .coinbtn { padding: 3px 8px 3px 4px; gap: 4px; }
  .coinbtn small { display: none; }
  .coinbtn .n { font-size: 13px; }
  .coinbtn i.lyx { font-size: 20px; }
}

/* ---- 画面 ---- */
/* .btn や display を決めた部品でも hidden を効かせる（もっと前を見る・公開鍵の全部） */
.coin-scr [hidden] { display: none !important; }
.coin-scr { background: radial-gradient(ellipse 70% 40% at 20% 0%, rgba(255, 210, 63, .08), transparent 70%); }
.coin-wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 12px 16px 28px; flex: none; }
.coin-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.coin-top h2 { flex: 1; min-width: 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-top .coin-rules { flex: none; }
.coin-back { flex: none; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg2); color: var(--ink); font-weight: 800; cursor: pointer; }
.coin-back:hover { border-color: var(--r5); }
@media (max-width: 420px) {
  .coin-top { flex-wrap: wrap; }
  .coin-top h2 { order: 3; flex-basis: 100%; font-size: 20px; }
  .coin-top .coin-rules { margin-left: auto; }
}
.coin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; }
.coin-col { min-width: 0; }
.coin-col > .sec:first-child { margin-top: 0; }
@media (min-width: 960px) { .coin-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .coin-col:last-child > .sec:first-child { margin-top: 0; } }

/* 大きい金貨 */
.coin-big { position: relative; flex: none; width: 84px; height: 84px; border-radius: 50%; border: 3px solid #000;
  background: radial-gradient(circle at 32% 28%, #fff8d6 0 10%, var(--gold) 34%, var(--gold2) 70%, var(--gold3) 100%);
  box-shadow: 0 5px 0 #000, 0 0 28px rgba(255, 210, 63, .35), inset 0 -6px 10px rgba(138, 90, 0, .45); }
.coin-big i { position: absolute; inset: 9px; border-radius: 50%; border: 3px solid rgba(138, 90, 0, .55); display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, .35), transparent 60%); }
.coin-big i::after { content: "L"; font-family: var(--head); font-style: normal; font-size: 34px; line-height: 1; color: var(--gold3); text-shadow: 0 1px 0 rgba(255, 248, 214, .8); }
.coin-big::after { content: ""; position: absolute; top: 12%; left: 18%; width: 22%; height: 12%; border-radius: 50%; background: rgba(255, 255, 255, .6); transform: rotate(-30deg); filter: blur(1px); }
.coin-big.sm { width: 52px; height: 52px; border-width: 2px; box-shadow: 0 3px 0 #000, inset 0 -4px 6px rgba(138, 90, 0, .45); }
.coin-big.sm i { inset: 6px; border-width: 2px; }
.coin-big.sm i::after { font-size: 20px; }
.coin-big.spin { animation: coinspin 1s linear infinite; }
@keyframes coinspin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

/* 残高 */
.coin-hero { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 16px; border-radius: 18px; border: 2px solid #000;
  background: linear-gradient(160deg, #241d3f, var(--panel) 55%); box-shadow: 0 5px 0 #000, inset 0 0 0 1px rgba(255, 210, 63, .25); overflow: hidden; }
.coin-hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--rainbow); opacity: .8; }
.coin-hero-t { min-width: 0; flex: 1; }
.coin-cap { display: block; font-size: 13px; font-weight: 800; color: var(--sub); }
.coin-balrow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.coin-bal { font-family: var(--head); font-weight: 400; font-size: clamp(32px, 9vw, 52px); line-height: 1.1; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 #000; overflow-wrap: anywhere; min-width: 0; }
.coin-balrow .sym { font-family: var(--head); font-size: 18px; color: var(--sub); }
.coin-rookie { margin: 6px 0 2px; padding: 8px 10px; border-radius: 10px; background: rgba(76, 201, 255, .12); border: 1px solid rgba(76, 201, 255, .45); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5; }
.coin-tasks.off .coin-task { opacity: .6; }
.coin-tasks.off .coin-task em { color: var(--dim); }
.coin-sub { font-size: 12px; color: var(--sub); margin-top: 2px; }
.coin-status { margin-top: 8px; }
.coin-status .chip { white-space: normal; text-align: left; }
.coin-hero.got { animation: herogot 1.1s ease-out; }
.coin-hero.got .coin-big { animation: coinhop .8s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes herogot { 0% { box-shadow: 0 5px 0 #000, 0 0 0 0 rgba(255, 210, 63, .7); } 40% { box-shadow: 0 5px 0 #000, 0 0 0 10px rgba(255, 210, 63, .25); } 100% { box-shadow: 0 5px 0 #000, 0 0 0 18px rgba(255, 210, 63, 0); } }
@keyframes coinhop { 0% { transform: translateY(0) rotateY(0); } 40% { transform: translateY(-14px) rotateY(180deg); } 100% { transform: translateY(0) rotateY(360deg); } }
@media (max-width: 380px) {
  .coin-hero { gap: 12px; padding: 16px 12px; }
  .coin-hero > .coin-big { width: 64px; height: 64px; }
  .coin-hero > .coin-big i { inset: 7px; }
  .coin-hero > .coin-big i::after { font-size: 26px; }
}

/* 今日もらえる LYX */
.coin-progress .row { justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; }
.coin-pbar { height: 8px; border-radius: 4px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 10px; }
.coin-pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); border-radius: 4px; transition: width .5s ease; }
.coin-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 8px; }
.coin-h4 { font-size: 13px; color: var(--sub); margin: 14px 0 6px; font-weight: 800; }
.coin-task, .coin-hrow, .coin-rrow, .coin-tx { display: grid; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left; color: var(--ink); cursor: pointer;
  border: 2px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 8px 12px; min-height: 52px; }
.coin-task { grid-template-columns: 26px minmax(0, 1fr) auto; }
.coin-task:hover:not([disabled]), .coin-hrow:hover:not([disabled]), .coin-rrow:hover:not([disabled]), .coin-tx:hover:not([disabled]) { border-color: var(--r5); }
.coin-task[disabled], .coin-hrow[disabled], .coin-rrow[disabled], .coin-tx[disabled] { cursor: default; }
.coin-task .t, .coin-hrow .t, .coin-rrow .t, .coin-tx .t { min-width: 0; }
.coin-task .t b, .coin-hrow .t b, .coin-rrow .t b, .coin-tx .t b { display: block; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; line-height: 1.35; }
.coin-task .t small, .coin-hrow .t small, .coin-rrow .t small, .coin-tx .t small { display: block; font-size: 12px; color: var(--sub); overflow-wrap: anywhere; line-height: 1.4; }
.coin-task em, .coin-hrow em, .coin-rrow em, .coin-tx em { font-style: normal; font-weight: 800; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.coin-task i.ck { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--dim); display: grid; place-items: center; font-style: normal; font-size: 14px; font-weight: 800; }
.coin-task.part { border-color: rgba(255, 210, 63, .5); }
.coin-task.part i.ck { border-color: var(--gold); }
.coin-task.done { background: transparent; border-style: dashed; }
.coin-task.done i.ck { background: var(--ok); border-color: #000; color: #032318; }
.coin-task.done em { color: var(--dim); }
.coin-task.done .t b { color: var(--sub); }

/* もらった LYX */
.coin-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.coin-hrow { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 48px; }
.coin-hrow i.lyx { font-size: 22px; }
.coin-hrow code { font-family: ui-monospace, monospace; font-size: 11px; color: var(--dim); }
.coin-hrow .wait { color: var(--gold); font-weight: 800; }
.coin-hist .empty, .coin-rank .empty { padding: 20px 12px; }

/* チェーン */
.coin-chainhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.coin-chaininfo { display: flex; flex-direction: column; min-width: 0; }
.coin-chaininfo b { font-family: var(--head); font-weight: 400; font-size: 18px; }
.coin-chaininfo .tiny { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.coin-verify { flex: 0 1 auto; }
.coin-verify i.lyx { font-size: 20px; }
.coin-chain { display: grid; gap: 14px; }
.blk { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "no hx sum" "sm sm sm"; align-items: center; gap: 2px 10px;
  width: 100%; text-align: left; color: var(--ink); cursor: pointer; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); box-shadow: 0 3px 0 #04061a; }
/* ブロックとブロックのあいだの「くさり」 */
.blk + .blk::before { content: ""; position: absolute; left: 22px; top: -16px; width: 6px; height: 16px; border-radius: 3px; pointer-events: none;
  background: repeating-linear-gradient(180deg, var(--gold2) 0 5px, transparent 5px 8px); }
button.blk:hover { border-color: var(--r5); }
.blk .no { grid-area: no; font-family: var(--head); color: var(--gold); font-size: 15px; }
.blk .hx { grid-area: hx; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; font-size: 12px; color: var(--sub); }
.blk .sum { grid-area: sum; font-weight: 800; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.blk small { grid-area: sm; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
.blk.pend { cursor: default; background: transparent; border-style: dashed; border-color: rgba(255, 210, 63, .55); box-shadow: none; }
.blk.pend .hx { color: var(--gold); font-family: var(--body); font-weight: 800; animation: pendblink 1.4s ease-in-out infinite; }
@keyframes pendblink { 50% { opacity: .45; } }
.blk.gen { border-color: rgba(255, 210, 63, .45); }
.blk.gen::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 2px; background: var(--rainbow); border-radius: 2px; opacity: .8; }
.blk.new { animation: blkin .9s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes blkin { 0% { transform: translateY(-10px); opacity: 0; box-shadow: 0 0 0 0 rgba(255, 210, 63, .8); } 60% { opacity: 1; box-shadow: 0 0 0 6px rgba(255, 210, 63, .3); } 100% { transform: none; box-shadow: 0 3px 0 #04061a; } }
.coin-chain .empty { padding: 20px 12px; }
.coin-more { margin-top: 12px; }

/* ランキング */
.coin-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.coin-rrow { grid-template-columns: 28px 36px minmax(0, 1fr) auto; min-height: 52px; padding: 6px 12px; }
.coin-rrow .rn { font-family: var(--head); text-align: center; color: var(--dim); font-size: 15px; }
.coin-rrow img.face { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); }
.coin-rank .top1 .rn { color: var(--gold); font-size: 18px; }
.coin-rank .top2 .rn { color: var(--silver); font-size: 17px; }
.coin-rank .top3 .rn { color: var(--bronze); font-size: 16px; }
.coin-rank .top1 img.face { border-color: var(--gold); }
.coin-rank .me .coin-rrow { border-color: var(--gold); background: linear-gradient(90deg, rgba(255, 210, 63, .12), var(--bg2) 60%); }
.coin-rankme { margin: 8px 2px 0; }
.coin-rankme:empty { display: none; }

/* 説明 */
.coin-note { margin-top: 20px; padding: 16px; border-radius: 16px; border: 2px dashed rgba(255, 210, 63, .45); background: rgba(18, 26, 63, .7); }
.coin-note h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 10px; }
.coin-note h3 i.lyx { font-size: 22px; }
.coin-note p { margin: 8px 0 0; overflow-wrap: anywhere; }
.coin-law { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg2); border-left: 4px solid var(--gold); font-weight: 800; font-size: 14px; line-height: 1.6; }
.coin-scr .linkbtn { background: none; border: 0; padding: 4px 2px; min-height: 0; color: var(--r5); font-size: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.coin-pub code { font-family: ui-monospace, monospace; }
.coin-pub code.secret { display: block; margin-top: 6px; font-size: 11px; color: var(--sub); }

/* ---- ブロックの中身（モーダル） ---- */
.coin-blockm { min-width: 0; }
.coin-bm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding-right: 36px; }
.coin-bm-head > div:last-child { min-width: 0; }
.coin-bm-head h2 { font-size: 20px; }
.coin-blockm > .chip { margin-bottom: 10px; white-space: normal; }
.coin-kvs { display: grid; gap: 8px; }
.coin-kvs .kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; font-size: 14px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.coin-kvs .kv > span:first-child { font-size: 12px; font-weight: 800; color: var(--sub); }
.coin-kvs .kv code { font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.5; word-break: break-all; color: var(--ink); user-select: all; }
.coin-kvs .kv b { font-size: 16px; font-variant-numeric: tabular-nums; }
.coin-kvs .kv .btn, .coin-kvs .kv .tiny { justify-self: start; margin-top: 4px; }
.coin-h3 { font-size: 15px; margin: 16px 0 8px; }
.coin-txs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.coin-tx { grid-template-columns: 36px minmax(0, 1fr) auto; min-height: 48px; padding: 6px 12px; }
.coin-tx img.face { width: 36px; height: 36px; border-radius: 50%; }
.coin-bm-nav { margin-top: 14px; }

/* ---- 検証（モーダル） ---- */
.coin-vm { min-width: 0; }
.vhead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-right: 36px; perspective: 400px; }
.vhead > div:last-child { min-width: 0; }
.vhead h2 { font-size: 19px; }
.vsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: vs; }
.vstep { display: grid; grid-template-columns: 30px minmax(0, 1fr) 28px; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); opacity: .55; transition: opacity .2s, border-color .2s, background .2s; }
.vstep .t b { display: block; font-size: 14px; }
.vstep .t small { display: block; font-size: 12px; color: var(--sub); line-height: 1.4; }
.vstep i.st { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); counter-increment: vs; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; color: var(--sub); }
.vstep i.st::after { content: counter(vs); }
.vstep em.res { font-style: normal; font-weight: 800; font-size: 20px; text-align: center; }
.vstep.run { opacity: 1; border-color: var(--gold); }
.vstep.run i.st { border-color: var(--gold) var(--gold) transparent transparent; animation: stspin .7s linear infinite; }
.vstep.run i.st::after { content: ""; }
@keyframes stspin { to { transform: rotate(360deg); } }
.vstep.ok { opacity: 1; border-color: rgba(46, 230, 166, .6); }
.vstep.ok i.st { background: var(--ok); border-color: #000; color: #032318; }
.vstep.ok em.res { color: var(--ok); animation: respop .35s cubic-bezier(.2, .9, .3, 1.4); }
.vstep.ng { opacity: 1; border-color: var(--hot); background: rgba(255, 77, 109, .12); }
.vstep.ng i.st { background: var(--hot); border-color: #000; color: #fff; }
.vstep.ng em.res { color: var(--hot); animation: respop .35s cubic-bezier(.2, .9, .3, 1.4); }
.vstep.skip { opacity: .4; }
.vstep.skip em.res { color: var(--dim); }
@keyframes respop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
.vresult { margin-top: 14px; }
.vresult:empty { display: none; }
.vresult > p { margin: 10px 0 0; overflow-wrap: anywhere; }
.vbig { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid #000; display: grid; place-items: center; font-size: 40px; font-weight: 800; box-shadow: 0 4px 0 #000; animation: respop .5s cubic-bezier(.2, .9, .3, 1.4); }
.coin-vm.is-ok .vbig { background: var(--ok); color: #032318; box-shadow: 0 4px 0 #000, 0 0 30px rgba(46, 230, 166, .45); }
.coin-vm.is-ng .vbig { background: var(--hot); color: #fff; }
.coin-vm.is-ok .vhead h2 { color: var(--ok); }
.coin-vm.is-ng .vhead h2 { color: var(--hot); }

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
  .coinpop { animation-duration: 1.6s; animation-name: coinfade; }
  @keyframes coinfade { 0% { opacity: 0; } 15%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
  .coin-big.spin, .coin-hero.got, .coin-hero.got .coin-big, .blk.new, .blk.pend .hx, .vstep.run i.st, .vbig, .vstep em.res { animation: none !important; }
  .coin-pbar i, .vstep { transition: none; }
}
