/*
 * Socratus app pages (css/app.css): /mine, /stake, /history and /history/round/:id, on top of css/base.css.
 * orbio's light look in the Socratus skin: porcelain glass cards, gold leaf for selection and the primary action,
 * Minoan red for live and the Bonanza, Geist Mono numbers, DM Sans text. The mine app sits on the Knossos palace,
 * washed with cream so the UI reads; stake and history carry the same painting as a soft band at the top.
 * The ring (js/app/ring.js) is drawn here too: porcelain wedges, a gilt rim that fills as the round runs, a
 * porcelain plate with the read-out, gold for your tiles and a gold glow on the winner.
 */

/* ------------------------------------------------------------------ frame */
body.app { background: var(--paper); }
.app main { position: relative; z-index: 1; }
.app .hdr .wrap { max-width: calc(1152px + 2 * var(--gutter)); }
[data-page="mine"] .hdr .wrap { max-width: calc(var(--mine-w) + 2 * var(--gutter)); }
:root { --mine-w: 1392px; }
.js-ico { display: inline-flex; }

/* The washed painting: fixed behind the mine app, a band at the top of stake and history. */
.app-bg { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; background: var(--paper); }
.app-bg img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 40%; filter: saturate(.72) contrast(.86) blur(1.5px); transform: scale(1.04); }
.app-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(58% 62% at 50% 52%, rgba(250, 247, 241, .58) 0%, rgba(250, 247, 241, .76) 58%, rgba(250, 247, 241, .9) 100%),
    linear-gradient(180deg, rgba(250, 247, 241, .72) 0%, rgba(250, 247, 241, .3) 34%, rgba(250, 247, 241, .52) 72%, rgba(250, 247, 241, .9) 100%);
}
.app-bg::before {
  content: ''; position: absolute; inset: 0; z-index: 1; opacity: .3; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.app-bg.is-band { position: absolute; inset: auto 0 auto 0; top: var(--banner-h); height: 620px; }
.app-bg.is-band::after {
  background:
    linear-gradient(90deg, rgba(250, 247, 241, .94) 0%, rgba(250, 247, 241, .86) 45%, rgba(250, 247, 241, .7) 100%),
    linear-gradient(180deg, rgba(250, 247, 241, 0) 40%, var(--paper) 100%);
}

/* ------------------------------------------------------------------ shared bits */
.info-btn { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--ink-3); transition: color .2s, background .2s; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--ink); background: rgba(235, 228, 214, .8); }
.tip { padding: 10px 12px; border-radius: var(--r-md); background: var(--gold-wash); border: 1px solid rgba(201, 149, 28, .25); font-size: 12.5px; line-height: 1.55; color: var(--gold-ink); }
.toggle { display: inline-flex; align-items: center; padding: 4px; margin-right: -4px; border-radius: 999px; }
.field .field-eth { width: 22px; height: 22px; flex: none; margin-right: 4px; }
.field .tok { width: 26px; height: 26px; flex: none; margin-right: 2px; border-radius: 50%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(74, 52, 25, .2)); }
.field input:disabled { cursor: not-allowed; color: var(--ink-3); }
.field.is-off { background: rgba(235, 228, 214, .35); }
.pos { color: var(--gold-ink); font-weight: 600; }
.mark-sm { width: 16px; height: 16px; border-radius: 50%; object-fit: contain; }
.kv-v { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------------ mine layout */
.mine {
  display: grid; grid-template-columns: 392px minmax(0, 1fr) 316px; grid-template-areas: 'left board right';
  gap: 20px; align-items: start; max-width: calc(var(--mine-w) + 2 * var(--gutter)); margin: 0 auto;
  padding: 6px var(--gutter) 72px;
}
.mine-left { grid-area: left; padding: 18px 20px 20px; }
.mine-board { grid-area: board; position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; }
.mine-right { grid-area: right; overflow: hidden; }
.mine .card { background: rgba(255, 253, 249, .78); }

/* left: stats, tabs, form */
.m-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.m-stats > div { min-width: 0; padding: 10px 12px 11px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 253, 249, .6); }
.m-stats dt { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.m-stats dd { margin: 4px 0 0; font-size: 17px; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-tabs { margin-top: 18px; }
.pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 16px; }
#auto-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.m-label { display: grid; gap: 3px; min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.m-count, .m-min { font: 400 11.5px/1.2 var(--mono); letter-spacing: -.01em; color: var(--ink-3); }
.chips { display: flex; gap: 4px; flex: none; }
.chips .chip { height: 30px; padding: 0 9px; }
.chip-x { width: 30px; padding: 0 !important; color: var(--ink-3); }
.m-field { height: 68px; padding: 0 16px; }
.m-field input { font-size: 28px; }
.m-help { min-height: 19px; margin-top: -4px; }
.m-cta { margin-top: 2px; }
.m-apr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.m-apr dt { font-size: 12px; color: var(--ink-3); }
.m-apr dd { margin: 0; }
.m-apr .mono { margin-top: 4px; font-size: 16px; font-weight: 500; letter-spacing: -.02em; }
.m-note { margin-top: 3px; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }

/* auto */
.a-lines { display: grid; }
.a-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line-soft); }
.a-lines .tip { margin: 8px 0; }
.a-line-total { border-bottom: 0; }
.a-k { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.a-v { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 500; }
.a-line-total .a-v { font-size: 16px; }
.stepper { display: inline-flex; align-items: stretch; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: rgba(255, 253, 249, .75); overflow: hidden; }
.step-btn { width: 34px; display: grid; place-items: center; color: var(--ink-2); transition: background .2s; }
.step-btn:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.step-btn:disabled { color: var(--ink-4); }
.stepper input { width: 58px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; text-align: center; font-size: 14px; font-weight: 500; outline: none; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper:focus-within { border-color: rgba(60, 44, 20, .45); box-shadow: 0 0 0 3px rgba(242, 198, 76, .2); }
.a-quiet { text-align: center; }
.aa { padding: 14px 16px 8px; border-radius: var(--r-lg); border: 1px solid rgba(201, 149, 28, .3); background: linear-gradient(180deg, rgba(251, 240, 207, .85), rgba(255, 253, 249, .7)); }
.aa-dl { margin-top: 8px; }
.aa-dl > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; border-bottom: 1px solid rgba(201, 149, 28, .16); font-size: 13.5px; }
.aa-dl > div:last-child { border-bottom: 0; }
.aa-dl dt { color: var(--ink-2); }
.aa-dl dd { margin: 0; font-weight: 500; text-align: right; }
.aa-stop { height: 44px; font-size: 14px; border-radius: var(--r-md); }
#auto-active { display: grid; gap: 12px; }

/* ------------------------------------------------------------------ the board */
.bz {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 22px;
  width: 100%; max-width: 640px; padding: 12px 18px; border-radius: var(--r-lg);
  border: 1px solid rgba(180, 67, 47, .24); background: linear-gradient(100deg, rgba(246, 224, 217, .9) 0%, rgba(255, 253, 249, .8) 62%);
  box-shadow: var(--shadow-sm); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.bz-head { display: flex; align-items: center; gap: 4px; }
.bz-title { display: inline-flex; align-items: center; gap: 8px; font: 600 14.5px/1.2 var(--sans); letter-spacing: -.01em; color: var(--red); }
.bz-info { color: rgba(180, 67, 47, .7); }
.bz-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-left: 20px; border-left: 1px solid rgba(180, 67, 47, .18); }
.bz-grid > div { min-width: 0; }
.bz-grid dt { font-size: 11.5px; color: var(--ink-3); }
.bz-grid dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bz-grid a { text-decoration: underline; text-decoration-color: rgba(180, 67, 47, .4); text-underline-offset: 3px; }
.bz-grid a:hover { color: var(--red); }
.bz-pot dd { font-weight: 600; color: var(--ink); }
.bz-note { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid rgba(180, 67, 47, .16); font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }

.ring-wrap {
  position: relative; width: min(100%, 620px, max(360px, calc(100vh - var(--banner-h) - var(--hdr-h) - 124px)));
  aspect-ratio: 1;
}
.ring { position: relative; width: 100%; height: 100%; overflow: visible; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.ring-plate { fill: rgba(255, 253, 249, .9); stroke: rgba(60, 44, 20, .1); stroke-width: 1; }
.ring-plate-g { filter: drop-shadow(0 8px 20px rgba(74, 52, 25, .1)); }
.ring-inlay { fill: none; stroke: rgba(201, 149, 28, .45); stroke-width: 1.2; stroke-dasharray: .1 6.4; stroke-linecap: round; }
.ring-track { fill: none; stroke: rgba(60, 44, 20, .065); stroke-width: 4; }
.ring-rim { fill: none; stroke: var(--gold-2); stroke-width: 4; stroke-linecap: round; opacity: 0; transition: stroke-dashoffset .3s linear, opacity .4s, stroke .4s; }
.ring.has-progress .ring-rim { opacity: 1; }
.ring.is-closing .ring-rim, .ring.is-settling .ring-rim { stroke: var(--red); animation: rim-breathe 1.4s ease-in-out infinite; }
.ring.has-winner .ring-rim { stroke: var(--gold-2); animation: none; }
@keyframes rim-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.ring-tiles { filter: drop-shadow(0 8px 18px rgba(74, 52, 25, .1)); }
.tile { outline: none; }
.tile-shape {
  fill: #f4efe5;
  fill: color-mix(in srgb, #efd37f calc(var(--heat, 0) * 72%), #f4efe5);
  stroke: rgba(60, 44, 20, .22); stroke-width: 1; stroke-linejoin: round;
  transition: fill .25s var(--ease), stroke .25s, stroke-width .25s, opacity .45s;
}
.tile.has-eth .tile-shape { stroke: rgba(111, 76, 12, calc(.22 + var(--heat, 0) * .2)); }
.tile-num { font: 500 14px var(--mono); fill: var(--ink-3); letter-spacing: -.02em; pointer-events: none; transition: fill .2s; }
.tile.has-eth .tile-num { fill: var(--ink-2); }
.tile-dot { fill: var(--ink); opacity: 0; pointer-events: none; transition: opacity .2s; }
.tile.is-mine .tile-dot { opacity: .85; }
.ring.is-interactive .tile { cursor: pointer; }
.ring.is-interactive .tile:hover .tile-shape { fill: #fffdf9; fill: color-mix(in srgb, #efd37f calc(var(--heat, 0) * 60%), #fffdf9); stroke: rgba(60, 44, 20, .42); }
.ring.is-interactive .tile:hover .tile-num { fill: var(--ink); }
.tile.is-selected .tile-shape, .ring.is-interactive .tile.is-selected:hover .tile-shape { fill: var(--gold); stroke: var(--gold-3); stroke-width: 1.6; }
.ring.is-interactive .tile.is-selected:hover .tile-shape { fill: #f5cf63; }
.tile.is-selected .tile-num { fill: #1b1408; font-weight: 600; }
.tile:focus-visible .tile-shape { stroke: var(--ink); stroke-width: 2.2; }
.ring.is-closing .tile-shape, .ring.is-settling .tile-shape { animation: tile-breathe 1.6s ease-in-out infinite; }
@keyframes tile-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .74; } }
.ring.has-winner .tile:not(.is-winner) .tile-shape { opacity: .36; }
.ring.has-winner .tile.is-selected:not(.is-winner) .tile-shape { fill: var(--gold-wash-2); stroke: rgba(201, 149, 28, .4); }
.ring.has-winner .tile.is-mine:not(.is-winner) .tile-dot { opacity: .35; }
.tile.is-winner .tile-shape { fill: var(--gold); stroke: var(--gold-ink); stroke-width: 2.2; animation: win-glow 1.1s ease-in-out infinite alternate; }
.tile.is-winner .tile-num { fill: #1b1408; font-weight: 700; }
@keyframes win-glow {
  from { filter: drop-shadow(0 0 6px rgba(242, 198, 76, .85)) drop-shadow(0 0 14px rgba(230, 181, 50, .35)); }
  to { filter: drop-shadow(0 0 14px rgba(242, 198, 76, 1)) drop-shadow(0 0 30px rgba(230, 181, 50, .65)); }
}

.ring-center { pointer-events: none; }
.ring-center .rc-values { pointer-events: auto; outline: none; }
.rc-top { font: 500 12px var(--mono); letter-spacing: .18em; fill: var(--ink-3); }
.rc-big { font: 500 54px var(--mono); letter-spacing: -.02em; fill: var(--ink); font-variant-numeric: tabular-nums; }
.rc-sub { font: 500 10.5px var(--mono); letter-spacing: .2em; fill: var(--ink-3); }
.ring.is-closing .rc-sub, .ring.is-settling .rc-sub { fill: var(--red); }
.ring.has-winner .rc-big { fill: var(--gold-ink); }
.ring.has-winner .rc-sub { fill: var(--gold-ink); }
.ring.is-bonanza .rc-sub { fill: var(--red); }
.rc-rule { stroke: rgba(60, 44, 20, .16); stroke-width: 1; }
.rc-val { font: 500 16px var(--mono); fill: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.rc-cap { font-size: 11.5px; fill: var(--ink-3); letter-spacing: .04em; }
.rc-glyph { color: #5a6378; }
.rc-eth, .rc-usd { transition: opacity .15s; }
.rc-usd { opacity: 0; }
.rc-values:not(.no-usd):hover .rc-eth, .rc-values:not(.no-usd):focus .rc-eth { opacity: 0; }
.rc-values:not(.no-usd):hover .rc-usd, .rc-values:not(.no-usd):focus .rc-usd { opacity: 1; }
.ring.no-values .rc-rule, .ring.no-values .rc-values { display: none; }
.ring.no-values .rc-big { letter-spacing: .02em; }
/* The small static rings (round detail) draw at about half size: keep the big line and its note, set to read. */
.ring.is-compact .rc-top, .ring.is-compact .rc-rule, .ring.is-compact .rc-values { display: none; }
.ring.is-compact .ring-center { transform: translateY(24px); }
.ring.is-compact .rc-big { font-size: 66px; }
.ring.is-compact .rc-sub { font-size: 21px; letter-spacing: .12em; }
.ring.is-compact .tile-num { font-size: 21px; }
.ring.is-compact .ring-tiles { filter: none; }

.settle-now {
  position: absolute; z-index: 2; left: 50%; top: 71%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font: 500 12.5px/1 var(--sans); white-space: nowrap; box-shadow: var(--shadow-md);
  transition: background .2s, opacity .2s;
}
.settle-now::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #e0806c; animation: pulse-red 2s var(--ease) infinite; }
.settle-now:hover:not(:disabled) { background: #2a251d; }
.settle-now:disabled { opacity: .6; }

/* ------------------------------------------------------------------ my rounds */
.mr-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 14px; border-bottom: 1px solid var(--line); }
.mr-sub { margin-top: 1px; padding-left: 16px; font-size: 12px; color: var(--ink-3); }
.mr-count { display: inline-flex; align-items: center; gap: 5px; padding-top: 3px; font-size: 12.5px; color: var(--ink-2); }
.mr-body { display: grid; gap: 14px; padding: 16px 20px 20px; }
.mr-empty { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.mr-connect { justify-self: start; }
.rw { display: grid; gap: 12px; padding: 14px 14px 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: rgba(255, 253, 249, .7); }
.rw-h { font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.rw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rw-txt { min-width: 0; }
.rw-k { font-size: 12px; color: var(--ink-3); }
.rw-v { margin-top: 2px; font-size: 17px; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-v small { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.rw-btn { min-width: 78px; height: 32px; flex: none; }
.rw-btn-gold { background: var(--gold); border-color: var(--gold-2); color: #1b1408; box-shadow: 0 6px 16px -10px rgba(201, 149, 28, .8); }
.rw-btn-gold:hover:not(:disabled) { background: #f5cd5c; border-color: var(--gold-2); }
.rw-btn-gold:disabled { background: var(--paper-2); border-color: var(--line); color: var(--ink-3); box-shadow: none; opacity: 1; }
.rw-sub { margin-top: -6px; font-size: 11.5px; line-height: 1.5; color: var(--gold-ink); }
.rw-note { padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.mr-list { display: grid; }
.mr-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 8px; margin: 0 -8px; border-bottom: 1px solid var(--line-soft); border-radius: var(--r-sm); transition: background .2s; }
.mr-list li:last-child .mr-item { border-bottom: 0; }
.mr-item:hover { background: rgba(251, 240, 207, .45); }
.mr-id { font-size: 13.5px; font-weight: 600; }
.mr-res { justify-self: end; display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 999px; font: 500 11px/1 var(--mono); color: var(--ink-3); background: var(--paper-2); border: 1px solid var(--line); white-space: nowrap; }
.mr-res.is-won { color: var(--gold-ink); background: var(--gold-wash); border-color: rgba(201, 149, 28, .35); }
.mr-res.is-live { color: var(--red); background: var(--red-wash); border-color: rgba(180, 67, 47, .22); }
.mr-res.is-live::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--red); animation: pulse-red 2s var(--ease) infinite; }
.mr-tiles { min-width: 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-amt { justify-self: end; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.mr-amt .mono { color: var(--ink-2); }
.mr-more { font-size: 12.5px; color: var(--ink-3); }

/* ------------------------------------------------------------------ stake */
.sk-in { display: grid; grid-template-columns: minmax(0, 1fr) 432px; gap: 48px; align-items: start; padding-top: 56px; }
.sk-title { margin-top: 14px; font: 700 58px/1.03 var(--sans); letter-spacing: -.035em; text-wrap: balance; }
.sk-sub { margin-top: 22px; max-width: 470px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.sk-stats { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 40px; }
.sk-stats dd { margin: 0; }
.sk-stats .big { font-size: 33px; font-weight: 500; letter-spacing: -.04em; }
.sk-stats .unit { margin-left: 6px; font-size: 18px; color: var(--ink-3); }
.sk-stats .cap { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.sk-soon { display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid rgba(201, 149, 28, .3); background: rgba(251, 240, 207, .75); font-size: 13.5px; color: var(--gold-ink); }
.sk-card { padding: 22px 24px 24px; border-radius: var(--r-2xl); background: rgba(255, 253, 249, .8); }
.sk-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 18px; }
.sk-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.sk-kv .kv-v { font: 500 14px var(--mono); color: var(--ink); }
.sk-amt-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.sk-avail { display: inline-flex; align-items: center; gap: 8px; font: 400 12px var(--mono); color: var(--ink-3); }
.sk-max { height: 24px; padding: 0 8px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); background: rgba(255, 253, 249, .7); font: 500 11.5px var(--mono); color: var(--ink-2); }
.sk-max:hover:not(:disabled) { background: var(--white); color: var(--ink); }
.sk-max:disabled { opacity: .5; }
.sk-field .post { white-space: nowrap; }
.sk-pos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.sk-pos > div { min-width: 0; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 253, 249, .6); }
.sk-pos dt { font-size: 12px; color: var(--ink-3); }
.sk-pos dd { margin: 4px 0 0; font-size: 15px; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-claim { height: 44px; border-radius: var(--r-md); font-size: 14px; }
.sk-sum { padding-top: 40px; padding-bottom: 96px; }
.sk-sum-card { overflow: hidden; background: rgba(255, 253, 249, .8); }
.sk-sum-card .tip { margin: 14px 20px 0; }
.sk-sum-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sk-sum-dl > div { min-width: 0; padding: 16px 20px 18px; border-right: 1px solid var(--line); }
.sk-sum-dl > div:last-child { border-right: 0; }
.sk-sum-dl dt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.sk-sum-dl dd { margin: 6px 0 0; font-size: 20px; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-sum-dl .sk-s { margin-top: 3px; font-size: 11.5px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
.sk-apr-body { display: grid; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--ink-2); }

/* ------------------------------------------------------------------ history */
.hist { padding-top: 56px; padding-bottom: 96px; }
.hist-title { margin-top: 14px; }
.hist-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.hs { min-width: 0; padding: 16px 18px 18px; border-radius: var(--r-lg); background: rgba(255, 253, 249, .78); }
.hs dt { font-size: 12.5px; color: var(--ink-3); }
.hs dd { margin: 0; }
.hs-v { margin-top: 6px !important; font: 500 22px/1.2 var(--mono); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-v.has-usd { cursor: help; }
.hs-v .usd { display: none; }
.hs-v.has-usd:hover .amt, .hs-v.has-usd:focus .amt { display: none; }
.hs-v.has-usd:hover .usd, .hs-v.has-usd:focus .usd { display: inline; }
.hs-s { margin-top: 3px !important; font-size: 11.5px; color: var(--ink-3); }
.hist-main { margin-top: 24px; overflow: hidden; background: rgba(255, 253, 249, .82); }
.hist-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 20px 0; border-bottom: 1px solid var(--line-strong); }
.hist-tabs { border-bottom: 0; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.hist-tabs::-webkit-scrollbar { display: none; }
.hist-tabs .tab { font-size: 14.5px; white-space: nowrap; }
.hist-tabs.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.hist-tools { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; flex: none; }
.hf { display: inline-flex; align-items: center; gap: 8px; }
.hf-l { font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.select { position: relative; display: inline-flex; align-items: center; }
.select select { appearance: none; -webkit-appearance: none; height: 32px; padding: 0 30px 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: rgba(255, 253, 249, .85); font: 500 13px/1 var(--sans); color: var(--ink); cursor: pointer; }
.select select:hover { background: var(--white); }
.select .ico { position: absolute; right: 9px; pointer-events: none; color: var(--ink-3); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th { height: 40px; padding: 0 14px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); background: rgba(244, 239, 230, .5); }
.tbl td { height: 52px; padding: 0 14px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl td.r, .tbl td.mono, .tbl .t-num { font-family: var(--mono); font-size: 13px; letter-spacing: -.01em; }
.tbl tbody tr:not(.tbl-empty):not(.no-link) { cursor: pointer; }
.tbl tbody tr:not(.tbl-empty):not(.no-link):hover td { background: rgba(251, 240, 207, .4); }
.t-round a { font: 600 13.5px var(--mono); }
.t-round a:hover { text-decoration: underline; text-decoration-color: var(--gold-2); text-underline-offset: 3px; }
.t-tile { font-family: var(--mono); font-size: 13px; }
.t-state { font-size: 13px; color: var(--ink-2); }
.t-state.is-live { color: var(--red); font-weight: 500; }
.t-state.is-live::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--red); vertical-align: 1px; animation: pulse-red 2s var(--ease) infinite; }
.t-state.is-bonanza { color: var(--red); font-weight: 600; }
.t-state.is-redrawn::after { content: ' · redrawn'; color: var(--ink-3); font-weight: 400; }
.t-coin { color: var(--gold-ink); }
.tbl a.tx { color: var(--blue); text-decoration: underline; text-decoration-color: rgba(43, 95, 158, .35); text-underline-offset: 3px; }
.tbl-empty td { height: 88px; text-align: center; white-space: normal; color: var(--ink-3); font-size: 13.5px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-top: 1px solid var(--line); font: 400 12.5px var(--mono); color: var(--ink-3); }
.col-round { width: 12%; } .col-state { width: 14%; } .col-tile { width: 12%; } .col-dep { width: 16%; }
.col-win { width: 10%; } .col-set { width: 11%; } .col-bz { width: 12%; } .col-coin { width: 13%; }

.rd-wrap { padding: 20px 22px 24px; }
.rd-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.rd-back:hover { color: var(--ink); }
.rd-title { margin-top: 10px; font: 700 32px/1.1 var(--sans); letter-spacing: -.03em; }
.rd { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px; align-items: center; margin-top: 22px; }
.rd-ring { width: 100%; max-width: 300px; aspect-ratio: 1; }
.rd-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rd-fact { min-width: 0; padding: 10px 12px 11px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 253, 249, .65); }
.rd-fact dt { font-size: 11.5px; color: var(--ink-3); }
.rd-fact dd { margin: 4px 0 0; font: 500 14px/1.3 var(--mono); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-fact.is-wide { grid-column: 1 / -1; }
.rd-fact.is-wide dd { white-space: normal; font-family: var(--sans); }
.rd-miners { margin-top: 28px; }
.rd-h { margin-bottom: 10px; font: 600 15px/1.4 var(--sans); }
.rd-miners .tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255, 253, 249, .6); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1279.98px) {
  .mine {
    grid-template-columns: minmax(330px, 380px) minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: 'left board' 'right board'; max-width: 1180px;
  }
  .mine-board { position: sticky; top: 12px; }
}
@media (max-width: 1100px) {
  .sk-in { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; }
  .sk-title { font-size: 48px; }
}
@media (max-width: 960px) {
  .sk-in { grid-template-columns: 1fr; padding-top: 36px; }
  .sk-card { max-width: 520px; }
  .rd { grid-template-columns: 1fr; }
  .rd-ring { margin: 0 auto; max-width: 280px; }
  .hist-bar { flex-direction: column; align-items: stretch; }
  .hist-tools { justify-content: flex-end; padding-bottom: 12px; }
}
@media (max-width: 860px) {
  .mine { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: 'board' 'left' 'right'; gap: 16px; padding-top: 4px; padding-bottom: 40px; }
  .mine-board { position: static; }
  .ring-wrap { width: min(100%, 560px); }
  .mine-left { padding: 16px 16px 18px; }
  .mr-h, .mr-body { padding-left: 16px; padding-right: 16px; }
  .sk-sum-dl { grid-template-columns: 1fr; }
  .sk-sum-dl > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .sk-sum-dl > div:last-child { border-bottom: 0; }
  .hist { padding-top: 36px; padding-bottom: 64px; }
  .hist-stats { grid-template-columns: 1fr; gap: 8px; }
  .hs { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 14px 16px; }
  .hs .hs-v { grid-row: 1 / 3; grid-column: 2; margin-top: 0 !important; font-size: 18px; text-align: right; }
  .hs .hs-s { margin-top: 0 !important; }
  .app-bg.is-band { height: 520px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .ring:not(.is-compact) .tile-num { font-size: 19px; }
  .ring:not(.is-compact) .tile-dot { r: 5px; }
  .ring:not(.is-compact) .rc-top { font-size: 17px; letter-spacing: .14em; }
  .ring:not(.is-compact) .rc-big { font-size: 68px; }
  .ring:not(.is-compact) .rc-sub { font-size: 14.5px; letter-spacing: .14em; }
  .ring:not(.is-compact) .rc-val { font-size: 22px; }
  .ring:not(.is-compact) .rc-cap { font-size: 16px; }
  .ring-tiles { filter: none; }
  .settle-now { top: 73%; height: 30px; padding: 0 12px; font-size: 12px; }
  .bz { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 14px 12px; }
  .bz-head { justify-content: space-between; }
  .bz-grid { padding-left: 0; border-left: 0; gap: 10px; }
  .bz-grid dd { font-size: 13px; }
  .m-stats > div { padding: 9px 10px 10px; }
  .m-stats dd { font-size: 16px; }
  .chips .chip { padding: 0 8px; }
  .m-field input { font-size: 26px; }
  .sk-title { font-size: 40px; }
  .sk-card { padding: 18px 18px 20px; }
  .hist-bar { padding: 14px 14px 0; gap: 12px; }
  .hist-tools { justify-content: flex-start; gap: 8px; }
  .hist-tools .btn { margin-left: auto; width: 34px; padding: 0; }
  .hf-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .h-refresh-t { display: none; }
  .sk-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
  .sk-stats .big { font-size: 30px; }
  .tbl { table-layout: auto; }
  .tbl th { padding: 0 8px; font-size: 9.5px; letter-spacing: .06em; }
  .tbl td { height: 48px; padding: 0 8px; font-size: 12.5px; }
  .tbl td.r, .tbl td.mono, .t-tile, .t-round a { font-size: 12px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 14px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 14px; }
  #h-table col { width: auto; }
  #h-table[data-view="rounds"] th:nth-child(n+5), #h-table[data-view="rounds"] td:nth-child(n+5) { display: none; }
  #h-table[data-view="mine"] th:nth-child(3), #h-table[data-view="mine"] td:nth-child(3), #h-table[data-view="mine"] th:nth-child(5), #h-table[data-view="mine"] td:nth-child(5) { display: none; }
  #h-table[data-view="claims"] th:nth-child(3), #h-table[data-view="claims"] td:nth-child(3) { display: none; }
  #h-table[data-view="burns"] th:nth-child(3), #h-table[data-view="burns"] td:nth-child(3) { display: none; }
  .tbl-empty td { display: table-cell !important; padding: 0 16px !important; }
  #rd-table th:nth-child(2), #rd-table td:nth-child(2) { display: none; }
  .rd-wrap { padding: 16px 14px 18px; }
  .rd-title { font-size: 26px; }
  .rd-facts { grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (max-width: 380px) {
  .chips { gap: 3px; }
  .chips .chip { padding: 0 6px; font-size: 11.5px; }
  .chip-x { width: 28px; }
  .m-stats { gap: 6px; }
  .m-stats dt { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile.is-winner .tile-shape { animation: none; filter: drop-shadow(0 0 10px rgba(242, 198, 76, .9)); }
}
