/* Fairness pop-up on the game page (5b). Sizes follow Stake's (research/fairness/stake-fair.json): a dim layer over the
   game frame, a 500 px card, 16 px padding, 3 equal 44 px tabs, 44 px fields, 14 px labels. Colours are our tokens. */
.fm-layer { position: fixed; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box;
  background: rgba(7, 24, 36, .85); animation: fm-in 250ms linear both; }
.fm-layer.fm-docked { z-index: 1500; }
@keyframes fm-in { from { opacity: 0; } to { opacity: 1; } }
.fm-card { width: 500px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; background: var(--bg);
  border-radius: var(--radius); box-shadow: var(--lift); overflow: hidden; color: var(--text-2); }
.fm-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; min-height: 60px; box-sizing: border-box; }
.fm-title { display: flex; align-items: center; gap: 12px; }
.fm-title svg { width: 16px; height: 16px; fill: none; stroke: var(--label); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.fm-title h3 { margin: 0; font-size: 18px; font-weight: 700; line-height: 28px; color: var(--text); }
.fm-x { width: 20px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--label); display: grid; place-items: center; }
.fm-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fm-x:hover { color: var(--text); }
.fm-main { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 16px 16px; }
.fm-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px; margin-bottom: 16px; background: var(--surface-2); border-radius: 9999px; }
.fm-tabs button { height: 44px; border: 0; border-radius: 9999px; background: none; color: var(--text); font: 600 16px var(--font); cursor: pointer; }
.fm-tabs button:hover { background: var(--surface-3); }
.fm-tabs button.is-on { background: var(--surface-3); }
.fm-body { display: flex; flex-direction: column; gap: 16px; }
.fm-field { display: flex; flex-direction: column; gap: 4px; }
.fm-label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--label); }
.fm-req { color: var(--lose); }
.fm-row { display: flex; }
.fm-val, .fm-in { flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px 12px; font: 600 16px/24px var(--font); color: var(--text-2);
  background: var(--surface-2); border: 2px solid var(--surface-3); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.fm-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-val.is-tall { white-space: normal; min-height: 68px; }
.fm-in:focus { outline: none; border-color: var(--surface-4); }
select.fm-in { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--label) 50%), linear-gradient(135deg, var(--label) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.fm-row > :first-child:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.fm-copy, .fm-step, .fm-btn { flex: none; border: 0; cursor: pointer; background: var(--surface-3); color: var(--text); font: 600 16px var(--font); }
.fm-copy { width: 52px; display: grid; place-items: center; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.fm-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.fm-copy.is-done { color: var(--win); }
.fm-step { width: 60px; }
.fm-step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.fm-btn { width: 118px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.fm-copy:hover, .fm-step:hover, .fm-btn:hover { background: var(--surface-4); }
.fm-btn:disabled { opacity: .4; cursor: default; }
.fm-box { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: var(--surface); border-radius: var(--radius); }
.fm-box h3, .fm-text h3 { margin: 0; font-size: 18px; line-height: 28px; font-weight: 700; color: var(--text); }
.fm-text { display: flex; flex-direction: column; gap: 8px; }
.fm-text p { margin: 0; font-size: 16px; line-height: 24px; color: var(--label); }
.fm-text pre { margin: 0 0 8px; padding: 16px; background: var(--surface-2); border-radius: var(--radius-sm); font: 400 14px/20px ui-monospace, monospace; white-space: pre-wrap; color: var(--text-2); }
.fm-link { color: var(--text); font-weight: 600; text-decoration: none; }
.fm-link:hover { text-decoration: underline; }
.fm-text .fm-link, .fm-center { align-self: center; }
.fm-note { margin: 0; color: var(--label); font-size: 14px; }
.fm-note.err:empty { display: none; }
.fm-result { min-height: 219px; display: grid; place-items: center; padding: 16px; box-sizing: border-box; border: 2px dashed var(--surface-3); border-radius: var(--radius); color: var(--label); text-align: center; }
.fm-lines { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.fm-lines div { display: flex; flex-direction: column; gap: 2px; }
.fm-lines span { font-size: 14px; color: var(--label); }
.fm-lines b { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.fm-hash { font-size: 13px; }
@media (max-width: 600px) { .fm-layer { padding: 0; z-index: 90; }
  .fm-card { width: 100%; height: 100%; border-radius: 0; } }
.fm-body.is-verify { gap: 19px; }               /* Stake's Verify fields sit 87 px apart (68 + 19) */
.fm-body.is-verify .fm-result { min-height: 216px; }
