/* ==========================================================================
   ARKA ODA: the back-room gambling den (js/kumar.js).
   Inverted ink panel like the story scenes; the table is ink with paper
   cross-hatching; dice and cards are paper. Riso red only for the main
   action, danger and stamps. 0 radius, no shadows.
   ========================================================================== */
#modal-root .modal.ko { align-items: stretch !important; justify-content: center; background: var(--ink) !important; z-index: 120; }
.ko-wrap { position: relative; width: 100%; max-width: 540px; height: 100%; display: flex; flex-direction: column; background: var(--ink); color: var(--paper); overflow: hidden; transform: translateY(24px); transition: transform .35s cubic-bezier(.2,.9,.3,1); }
.modal.ko.in .ko-wrap { transform: none; }
.ko-wrap::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(236,234,227,.085) 1px, transparent 1.5px); background-size: 7px 7px;
  -webkit-mask-image: radial-gradient(130% 60% at 50% 0%, #000 0%, transparent 72%); mask-image: radial-gradient(130% 60% at 50% 0%, #000 0%, transparent 72%); }
.ko-wrap > * { position: relative; z-index: 1; }
.ko-wrap .ic { width: 18px; height: 18px; }
.ko button { cursor: pointer; border-radius: 0; }
.ko button:disabled { cursor: not-allowed; }

/* smoke: dotted drifting trails, printed rather than blurred */
.ko-smoke { position: absolute !important; left: 0; top: 0; width: 100%; height: 300px; pointer-events: none; z-index: 0 !important; fill: none; stroke: var(--paper); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 9; opacity: .16; animation: koSmoke 18s ease-in-out infinite alternate; }
.ko-smoke .s2 { stroke-dasharray: 1 12; opacity: .8; }
.ko-smoke .s3 { stroke-dasharray: 1 14; opacity: .6; }
@keyframes koSmoke { from { transform: translateX(-14px); } to { transform: translateX(14px); } }

/* ---------- header + status bar ---------- */
.ko-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: calc(12px + var(--safe-t)) 16px 10px; border-bottom: 4px double var(--paper); }
.ko-top .kicker { color: var(--ink-3); font-size: 10px; }
.ko-title { font-family: var(--f-display); font-weight: 400; font-size: 42px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; margin-top: 4px; }
.ko-x { flex: none; width: 44px; height: 44px; border: 2px solid var(--paper); background: transparent; display: grid; place-items: center; padding: 0; }
.ko-x:active:not(:disabled) { background: var(--paper); color: var(--ink); }
.ko-x:disabled { opacity: .3; }
.ko-bar { display: grid; grid-template-columns: 1.15fr 1fr 1fr; border-bottom: 1px solid var(--ink-2); }
.ko-bar > div { padding: 7px 12px 8px; border-right: 1px solid var(--ink-2); min-width: 0; }
.ko-bar > div:last-child { border-right: 0; }
.ko-bar small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.ko-bar b { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ko-bar b.neg { color: #ff8c73; }
.ko-pips { display: flex; gap: 4px; margin-top: 5px; }
.ko-pips i { width: 11px; height: 11px; border: 1.5px solid var(--paper); }
.ko-pips i.on { background: var(--paper); }
.ko-main { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 16px calc(24px + var(--safe-b)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* ---------- lobby ---------- */
.ko-lamp { position: relative; height: 104px; margin: -12px -16px -6px; overflow: hidden; pointer-events: none; }
.ko-lamp .cord { position: absolute; left: 50%; top: 0; width: 2px; height: 26px; margin-left: -1px; background: var(--paper-3); }
.ko-lamp .shade { position: absolute; left: 50%; top: 26px; width: 58px; height: 20px; margin-left: -29px; background: var(--paper); clip-path: polygon(28% 0, 72% 0, 100% 100%, 0 100%); }
.ko-lamp .cone { position: absolute; left: 50%; top: 46px; width: 420px; height: 120px; margin-left: -210px;
  clip-path: polygon(43% 0, 57% 0, 100% 100%, 0 100%);
  background-image: radial-gradient(var(--paper) 1.3px, transparent 1.7px); background-size: 6px 6px;
  -webkit-mask-image: linear-gradient(#000 0%, rgba(0,0,0,.35) 45%, transparent 100%); mask-image: linear-gradient(#000 0%, rgba(0,0,0,.35) 45%, transparent 100%); opacity: .55; }
.ko-dek { font-family: var(--f-serif); font-style: italic; font-size: 17px; line-height: 1.45; color: var(--paper-3); margin: 0 0 12px; }
.ko-lim { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; border-top: 2px solid var(--paper); border-bottom: 1px solid var(--ink-2); padding: 7px 0; margin-bottom: 8px; }
.ko-lim span { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.ko-lim b { font-family: var(--f-mono); font-weight: 500; font-size: 17px; text-align: right; }
.ko-lim small { grid-column: 1 / 3; font-size: 11.5px; color: var(--ink-3); text-align: right; }
.ko-notes { margin-bottom: 12px; }
.ko-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: var(--paper-3); padding: 7px 0; margin: 0; border-bottom: 1px dotted var(--ink-2); }
.ko-note .ic, .ko-warn .ic { flex: none; margin-top: 1px; }
.ko-warn { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--red); border-left-width: 6px; padding: 10px 12px; margin: 0 0 10px; font-size: 13.5px; line-height: 1.4; }
.ko-warn .ic { color: #ff8c73; }
.ko-games { display: grid; gap: 10px; }
.ko-game { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 12px; border: 2px solid var(--paper); background: transparent; color: var(--paper); min-height: 96px; transition: background .12s, color .12s; }
.ko-game:active:not(:disabled) { background: var(--paper); color: var(--ink); }
.ko-game:active:not(:disabled) .txt span, .ko-game:active:not(:disabled) .txt i { color: var(--ink-2); }
.ko-game:disabled { opacity: .35; }
.ko-game .art { width: 64px; height: 64px; display: grid; place-items: center; border-right: 1px solid var(--ink-2); padding-right: 6px; }
.ko-game .txt { display: grid; gap: 2px; min-width: 0; }
.ko-game .txt b { font-family: var(--f-display); font-weight: 400; font-size: 27px; line-height: 1.05; letter-spacing: .02em; text-transform: uppercase; }
.ko-game .txt span { font-family: var(--f-serif); font-style: italic; font-size: 15px; line-height: 1.3; color: var(--paper-3); }
.ko-game .txt i { font-style: normal; font-family: var(--f-mono); font-size: 11px; line-height: 1.35; color: var(--paper-3); border-top: 1px dotted var(--ink-2); padding-top: 5px; margin-top: 4px; }
.ko-game .txt em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 1.5px solid currentColor; padding: 3px 6px; justify-self: start; margin-top: 4px; }
.art-dice { display: flex; gap: 4px; }
.art-dice .ko-die:first-child { transform: rotate(-12deg); }
.art-dice .ko-die:last-child { transform: rotate(9deg) translateY(6px); }
.art-cards { position: relative; width: 58px; height: 56px; }
.art-cards .kc { position: absolute; top: 2px; }
.art-cards .kc:first-child { left: 2px; transform: rotate(-10deg); }
.art-cards .kc:last-child { left: 20px; transform: rotate(8deg); }
.art-horse { width: 58px; line-height: 0; }
.art-horse svg { width: 100%; }
.art-horse .hb { fill: var(--paper); }
.art-horse .hl { fill: none; stroke: var(--paper); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.art-horse .he, .ko-horse .he { fill: var(--ink); }
.art-slip { display: grid; grid-template-columns: repeat(3, 16px); gap: 3px; background: var(--paper); color: var(--ink); padding: 10px 6px; outline: 1px solid var(--ink); outline-offset: -3px; transform: rotate(-4deg); }
.art-slip b { font-family: var(--f-display); font-weight: 400; font-size: 16px; text-align: center; border: 1.5px solid var(--ink); line-height: 1.25; }
.art-slip b:nth-child(2) { background: var(--ink); color: var(--paper); }
.ko-leave { width: 100%; margin-top: 14px; }

/* ---------- generic buttons ---------- */
.ko-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; padding: 8px 12px; border: 2px solid var(--paper); background: transparent; color: var(--paper); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; transition: background .12s, color .12s; }
.ko-btn.ko-leave { flex-direction: row; gap: 8px; }
.ko-btn small { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: 0; text-transform: none; opacity: .85; }
.ko-btn.inv { background: var(--paper); color: var(--ink); }
.ko-btn:active:not(:disabled) { background: var(--paper); color: var(--ink); }
.ko-btn.inv:active:not(:disabled) { background: transparent; color: var(--paper); }
.ko-btn:disabled { opacity: .3; }
.ko-go { display: block; width: 100%; min-height: 58px; border: 0; background: var(--red); color: var(--paper); font-family: var(--f-display); font-weight: 400; font-size: 23px; letter-spacing: .05em; text-transform: uppercase; padding: 8px 12px; transition: transform .08s; }
.ko-go:active:not(:disabled) { transform: translateY(2px); }
.ko-go:disabled { background: transparent; color: var(--ink-3); border: 2px dashed var(--ink-2); }

/* ---------- game screen ---------- */
.ko-gh { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ko-gh h3 { font-family: var(--f-display); font-weight: 400; font-size: 34px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.ko-back { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 8px; border: 2px solid var(--paper); background: transparent; color: var(--paper); font-weight: 700; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.ko-back .ic { transform: scaleX(-1); }
.ko-back:active:not(:disabled) { background: var(--paper); color: var(--ink); }
.ko-back:disabled { opacity: .3; }
.ko-rules { list-style: none; margin: 0 0 10px; padding: 0; font-family: var(--f-serif); font-size: 14.5px; line-height: 1.38; color: var(--paper-3); }
.ko-rules li { position: relative; padding-left: 14px; margin-bottom: 3px; }
.ko-rules li::before { content: ''; position: absolute; left: 0; top: .66em; width: 7px; height: 2px; background: var(--paper-3); }

/* the table: ink "baize" engraved with paper cross-hatching, double rail */
.ko-felt { position: relative; overflow: hidden; border: 6px double var(--paper); padding: 12px 12px 10px; background-color: var(--ink);
  background-image: repeating-linear-gradient(45deg, rgba(236,234,227,.075) 0 1px, transparent 1px 6px), repeating-linear-gradient(-45deg, rgba(236,234,227,.045) 0 1px, transparent 1px 6px); }
.felt-lbl { display: block; font-family: var(--f-ui); font-weight: 700; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--paper-3); }
.felt-lbl b { font-family: var(--f-mono); font-weight: 500; letter-spacing: 0; color: var(--paper); font-size: 13px; }
.felt-print { text-align: center; font-family: var(--f-display); font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); border-top: 1px solid var(--ink-2); border-bottom: 1px solid var(--ink-2); padding: 5px 0; margin: 8px 0; background: var(--ink); }
.ko-res { min-height: 8px; margin: 8px 0 2px; }
.ko-line { font-family: var(--f-serif); font-size: 16px; line-height: 1.4; margin: 0 0 4px; }
.ko-wait { font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); text-align: center; padding: 18px 0; margin: 0; animation: koBlink 1.2s steps(2) infinite; }
@keyframes koBlink { 50% { opacity: .45; } }
.ko-over { border-top: 2px solid var(--paper); padding-top: 12px; margin-top: 10px; display: grid; gap: 10px; }
.ko-over p { font-family: var(--f-serif); font-style: italic; font-size: 16px; color: var(--paper-3); margin: 0; }
.ko-over .ko-btn { width: 100%; }
.ko .chip { background: transparent; color: var(--paper); border-color: var(--paper); }
.ko .chip.down { color: #ff8c73; border-color: #ff8c73; }
.ko .chip.stampchip { color: #ff8c73; border-color: var(--red); background: transparent; }

/* stamps */
.ko-stamp { position: absolute; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -50%) rotate(-7deg); pointer-events: none; white-space: nowrap;
  font-family: var(--f-display); font-size: 44px; line-height: 1; letter-spacing: .06em; text-transform: uppercase; padding: 6px 16px 4px; border: 5px solid currentColor; color: var(--paper); background: rgba(21,20,18,.8);
  animation: koStamp .38s cubic-bezier(.2,1.5,.4,1) both; }
.ko-stamp::after { content: ''; position: absolute; inset: 3px; border: 1.5px solid currentColor; }
.ko-stamp.lose { color: var(--red); transform: translate(-50%, -50%) rotate(5deg); animation-name: koStampL; }
.ko-stamp.push { color: var(--paper-3); }
.ko-stamp.played { color: var(--red); background: rgba(236,234,227,.72); font-size: 30px; left: auto; right: 10px; top: auto; bottom: 46px; transform: rotate(-8deg); animation: koStampP .38s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes koStamp { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(2.3); } 60% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(.94); } 100% { transform: translate(-50%, -50%) rotate(-7deg) scale(1); } }
@keyframes koStampL { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(5deg) scale(2.3); } 60% { opacity: 1; transform: translate(-50%, -50%) rotate(5deg) scale(.94); } 100% { transform: translate(-50%, -50%) rotate(5deg) scale(1); } }
@keyframes koStampP { 0% { opacity: 0; transform: rotate(-8deg) scale(2.2); } 100% { opacity: 1; transform: rotate(-8deg) scale(1); } }
.ko-raid { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; text-align: center; gap: 8px; padding: 16px; background: var(--red); color: var(--paper); animation: koSiren .5s steps(2) 3; }
.ko-raid b { font-family: var(--f-display); font-weight: 400; font-size: 58px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; }
.ko-raid p { font-family: var(--f-serif); font-size: 16px; line-height: 1.4; margin: 0; max-width: 300px; }
@keyframes koSiren { 50% { background: var(--ink); } }

/* ---------- dice ---------- */
.ko-die { position: relative; display: inline-grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 58px; height: 58px; padding: 7px; gap: 1px; background: var(--paper); flex: none; }
.ko-die::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(21,20,18,.28); pointer-events: none; }
.ko-die i { display: block; width: 11px; height: 11px; margin: auto; background: var(--ink); border-radius: 50%; opacity: 0; }
.ko-die[data-v="1"] i:nth-child(5),
.ko-die[data-v="2"] i:nth-child(3), .ko-die[data-v="2"] i:nth-child(7),
.ko-die[data-v="3"] i:nth-child(3), .ko-die[data-v="3"] i:nth-child(5), .ko-die[data-v="3"] i:nth-child(7),
.ko-die[data-v="4"] i:nth-child(1), .ko-die[data-v="4"] i:nth-child(3), .ko-die[data-v="4"] i:nth-child(7), .ko-die[data-v="4"] i:nth-child(9),
.ko-die[data-v="5"] i:nth-child(1), .ko-die[data-v="5"] i:nth-child(3), .ko-die[data-v="5"] i:nth-child(5), .ko-die[data-v="5"] i:nth-child(7), .ko-die[data-v="5"] i:nth-child(9),
.ko-die[data-v="6"] i:nth-child(1), .ko-die[data-v="6"] i:nth-child(3), .ko-die[data-v="6"] i:nth-child(4), .ko-die[data-v="6"] i:nth-child(6), .ko-die[data-v="6"] i:nth-child(7), .ko-die[data-v="6"] i:nth-child(9) { opacity: 1; }
.ko-die[data-v="1"] i:nth-child(5) { width: 14px; height: 14px; }
.ko-die.sm { width: 28px; height: 28px; padding: 3px; }
.ko-die.sm::after { inset: 2px; }
.ko-die.sm i { width: 5px; height: 5px; }
.ko-die.sm[data-v="1"] i:nth-child(5) { width: 6px; height: 6px; }
.ko-die.idle { opacity: .32; }
.ko-die.roll { animation: koTumble .15s linear infinite; }
.ko-dice .ko-die:nth-child(2).roll { animation-duration: .19s; animation-direction: reverse; }
.ko-die.land { animation: koLand .34s cubic-bezier(.2,1.6,.4,1); }
@keyframes koTumble { 0% { transform: rotate(0) translateY(0); } 33% { transform: rotate(14deg) translateY(-7px); } 66% { transform: rotate(-9deg) translateY(-3px); } 100% { transform: rotate(0) translateY(0); } }
@keyframes koLand { 0% { transform: scale(1.22) rotate(7deg); } 100% { transform: none; } }
.bb-row { display: grid; grid-template-columns: 52px 1fr 60px; align-items: center; gap: 8px; min-height: 76px; }
.bb-row .ko-dice { display: flex; gap: 14px; justify-content: center; }
.bb-sum { font-family: var(--f-display); font-weight: 400; font-size: 42px; line-height: 1; text-align: right; }
.bb-msg { text-align: center; font-family: var(--f-mono); font-size: 12.5px; color: var(--paper-3); min-height: 18px; margin-top: 4px; }

/* ---------- cards ---------- */
.kc { position: relative; display: inline-block; flex: none; width: 66px; height: 94px; background: var(--paper); color: var(--ink); outline: 1px solid var(--ink); outline-offset: -5px; vertical-align: top; }
.kc b { position: absolute; left: 8px; top: 7px; font-family: var(--f-display); font-weight: 400; font-size: 23px; line-height: 1; letter-spacing: -.02em; }
.kc .rb { display: none; }
.kc svg { position: absolute; fill: currentColor; }
.kc .s1 { left: 9px; top: 33px; width: 13px; height: 13px; }
.kc .s2 { left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-36%, -38%); }
.kc.red { color: var(--red); }
.kc.back { background-color: var(--ink); outline: 2px solid var(--paper); outline-offset: -5px; border: 2px solid var(--paper);
  background-image: repeating-linear-gradient(45deg, rgba(236,234,227,.55) 0 1px, transparent 1px 5px), repeating-linear-gradient(-45deg, rgba(236,234,227,.55) 0 1px, transparent 1px 5px); }
.kc.sm { width: 34px; height: 48px; outline-offset: -3px; }
.kc.sm b { left: 4px; top: 3px; font-size: 12px; }
.kc.sm .rb { display: none; }
.kc.sm .s1 { display: none; }
.kc.sm .s2 { width: 17px; height: 17px; transform: translate(-45%, -35%); }
.kc.deal { animation: koDeal .3s cubic-bezier(.2,.9,.3,1) both; }
.kc.flip { animation: koFlip .32s cubic-bezier(.3,.7,.4,1) both; }
@keyframes koDeal { from { opacity: 0; transform: translate(110px, -70px) rotate(14deg); } to { opacity: 1; transform: none; } }
@keyframes koFlip { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bj-row { display: grid; gap: 6px; min-height: 120px; }
.ko-hand { display: flex; min-height: 94px; padding-left: 2px; }
.ko-hand .kc + .kc { margin-left: -20px; }
.ko-hand:empty::before { content: ''; width: 66px; height: 94px; border: 2px dashed var(--ink-2); }
.bj-now { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12.5px; color: var(--paper-3); border-top: 2px solid var(--paper); padding-top: 10px; margin-top: 10px; }
.bj-now b { font-family: var(--f-mono); font-weight: 500; color: var(--paper); font-size: 14px; }
.bj-acts { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; margin-top: 10px; }
.bj-acts .ko-btn { min-height: 60px; font-size: 14px; }
.bj-tip { font-family: var(--f-serif); font-style: italic; font-size: 14px; color: var(--ink-3); margin: 8px 0 0; }

/* ---------- horse race ---------- */
.at-com { font-family: var(--f-mono); font-size: 13px; min-height: 20px; margin-bottom: 6px; color: var(--paper); border-bottom: 1px solid var(--ink-2); padding-bottom: 6px; }
.ko-lanes { display: grid; }
.ko-lane { display: grid; grid-template-columns: 30px 1fr auto 44px; grid-template-rows: 20px 32px; align-items: center; column-gap: 8px; width: 100%; padding: 4px 6px 3px 0; min-height: 56px; border: 0; border-bottom: 1px dashed var(--ink-2); background: transparent; color: var(--paper); text-align: left; transition: background .12s, color .12s; }
.ko-lane:disabled { cursor: default; }
.ln-no { grid-row: 1 / 3; align-self: stretch; display: grid; place-items: center; font-family: var(--f-display); font-size: 20px; border-right: 2px solid currentColor; }
.ln-n { font-weight: 700; font-size: 12px; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-o { font-family: var(--f-mono); font-size: 14px; }
.ln-p { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); text-align: right; }
.ln-track { grid-column: 2 / 5; position: relative; height: 32px; border-bottom: 1px solid var(--ink-2); }
.ln-track::after { content: ''; position: absolute; right: 0; top: 2px; bottom: 0; width: 8px; background: repeating-conic-gradient(var(--paper) 0 25%, var(--ink) 0 50%) 0 0 / 4px 4px; }
.ko-horse { position: absolute; left: 0; bottom: 1px; width: 50px; height: 31px; line-height: 0; will-change: transform; z-index: 1; }
.ko-horse svg { width: 100%; height: 100%; overflow: visible; }
.ko-horse .hb { fill: var(--paper); }
.ko-horse .hl { fill: none; stroke: var(--paper); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.ko-lane.on { background: var(--paper); color: var(--ink); }
.ko-lane.on .ln-p { color: var(--ink-2); }
.ko-lane.on .ln-track { border-bottom-color: var(--ink-3); }
.ko-lane.on .ln-track::after { background: repeating-conic-gradient(var(--ink) 0 25%, var(--paper) 0 50%) 0 0 / 4px 4px; }
.ko-lane.on .ko-horse .hb { fill: var(--ink); }
.ko-lane.on .ko-horse .hl { stroke: var(--ink); }
.ko-lane.on .ko-horse .he { fill: var(--paper); }
.ko-felt.racing .ko-lane:not(.fin) .ko-horse svg { animation: koGallop .24s ease-in-out infinite alternate; }
.ko-felt.racing .ko-lane:nth-child(2n):not(.fin) .ko-horse svg { animation-duration: .21s; }
@keyframes koGallop { from { transform: translateY(0) rotate(0); } to { transform: translateY(-3px) rotate(-4deg); } }
.ko-lane.fin .ln-p { font-family: var(--f-display); font-size: 16px; color: inherit; }
.ko-lane.win .ln-p { color: var(--paper); background: var(--ink); outline: 2px solid var(--paper); text-align: center; }
.ko-lane.on.win .ln-p { color: var(--paper); background: var(--ink); outline-color: var(--ink); }
.ko-lane.win:not(.on) { background-image: repeating-linear-gradient(45deg, rgba(236,234,227,.16) 0 2px, transparent 2px 6px); }
.ko-stamp.inline { position: relative; left: auto; top: auto; display: inline-block; margin: 4px 0 10px 4px; font-size: 36px; transform: rotate(-4deg); animation: koStampI .38s cubic-bezier(.2,1.5,.4,1) both; }
.ko-stamp.inline.lose { transform: rotate(3deg); animation-name: koStampIL; }
@keyframes koStampI { 0% { opacity: 0; transform: rotate(-4deg) scale(2.2); } 100% { opacity: 1; transform: rotate(-4deg) scale(1); } }
@keyframes koStampIL { 0% { opacity: 0; transform: rotate(3deg) scale(2.2); } 100% { opacity: 1; transform: rotate(3deg) scale(1); } }

/* ---------- iddaa coupon ---------- */
.felt-iddaa { padding: 14px 12px 18px; }
.kupon { position: relative; background: var(--paper); color: var(--ink); padding: 12px 12px 14px; outline: 1px solid var(--ink); outline-offset: -5px; transform: rotate(-.6deg); }
.kupon::after { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 7px;
  background: linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 10px 7px repeat-x, linear-gradient(-135deg, var(--paper) 50%, transparent 50%) 0 0 / 10px 7px repeat-x; }
.kp-h { display: flex; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid var(--ink); padding: 2px 4px 6px; }
.kp-m { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; text-align: center; font-family: var(--f-display); font-size: 22px; line-height: 1.05; margin: 12px 0 4px; }
.kp-m b { font-weight: 400; overflow-wrap: anywhere; }
.kp-m i { font-style: normal; color: var(--ink-3); }
.kp-sub { text-align: center; font-family: var(--f-serif); font-style: italic; font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.kp-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kp-picks button { display: grid; justify-items: center; align-content: start; gap: 3px; min-height: 104px; padding: 8px 4px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); transition: background .12s, color .12s; }
.kp-picks small { font-family: var(--f-display); font-size: 20px; line-height: 1; }
.kp-picks b { font-family: var(--f-mono); font-weight: 500; font-size: 20px; line-height: 1.1; }
.kp-picks em { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; text-align: center; overflow-wrap: anywhere; }
.kp-picks i { font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); }
.kp-picks button.on { background: var(--ink); color: var(--paper); }
.kp-picks button.on i { color: var(--paper-3); }
.kp-picks button:disabled:not(.on) { opacity: .4; }
.kp-bet { font-family: var(--f-mono); font-size: 12.5px; text-align: center; margin-top: 10px; border-top: 1px dashed var(--ink-3); padding-top: 8px; }

/* ---------- stake panel ---------- */
.stk { border-top: 2px solid var(--paper); padding-top: 10px; margin-top: 10px; }
.stk-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.stk-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.stk-amt { font-family: var(--f-mono); font-weight: 500; font-size: 32px; line-height: 1.1; }
.stk-range { --pct: 50%; display: block; width: 100%; height: 44px; margin: 2px 0 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: pan-y; cursor: pointer; }
.stk-range:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.stk-range::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, var(--paper) var(--pct), var(--ink-2) var(--pct)); }
.stk-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; margin-top: -13px; border: 0; background: var(--paper);
  background-image: linear-gradient(90deg, transparent 9px, var(--ink) 9px 11px, transparent 11px 14px, var(--ink) 14px 16px, transparent 16px 19px, var(--ink) 19px 21px, transparent 21px); background-size: 100% 12px; background-position: center; background-repeat: no-repeat; }
.stk-range::-moz-range-track { height: 4px; background: var(--ink-2); }
.stk-range::-moz-range-progress { height: 4px; background: var(--paper); }
.stk-range::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 0; background: var(--paper); }
.stk-range:disabled { opacity: .35; }
.stk-scale { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin: -4px 0 8px; }
.stk-chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.stk-chips button { min-height: 44px; padding: 0 2px; border: 1.5px solid var(--paper); background: transparent; color: var(--paper); font-family: var(--f-mono); font-size: 12px; font-weight: 500; text-transform: uppercase; transition: background .12s, color .12s; }
.stk-chips button.on { background: var(--paper); color: var(--ink); }
.stk-chips button:disabled { opacity: .28; }
.stk-odds { margin: 10px 0; padding: 10px 12px 8px; border: 1px solid var(--ink-2); border-top: 3px solid var(--paper); }
.stk-odds .stk-pr { display: block; font-family: var(--f-display); font-weight: 400; font-size: 21px; line-height: 1.15; letter-spacing: .02em; text-transform: uppercase; margin-bottom: 6px; }
.stk-odds .stk-ln { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: baseline; padding: 5px 0; border-bottom: 1px dotted var(--ink-2); font-size: 13px; }
.stk-odds .stk-ln span { color: var(--paper-3); }
.stk-odds .stk-ln b { font-family: var(--f-mono); font-weight: 500; font-size: 14.5px; text-align: right; }
.stk-odds .stk-ln small { grid-column: 1 / 3; text-align: right; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.stk-odds .stk-note { font-family: var(--f-serif); font-style: italic; font-size: 13.5px; line-height: 1.4; color: var(--paper-3); margin: 8px 0 0; }
.stk-warn { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 7px 10px; border-left: 5px solid var(--red); background: rgba(226,59,30,.12); font-size: 13px; line-height: 1.35; }
.stk-warn .ic { color: #ff8c73; flex: none; }

/* ---------- end of night ---------- */
.ko-end { text-align: center; padding-top: 16px; }
.ko-end > .kicker { color: var(--ink-3); }
.ko-end-net { display: block; font-family: var(--f-display); font-weight: 400; font-size: 66px; line-height: 1.05; letter-spacing: .01em; margin: 6px 0 14px; }
.ko-end-net.neg { color: var(--red); }
.ko-rows { text-align: left; border-top: 2px solid var(--paper); margin-bottom: 10px; }
.ko-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dotted var(--ink-2); font-size: 13.5px; }
.ko-rows span { color: var(--paper-3); }
.ko-rows b { font-family: var(--f-mono); font-weight: 500; }
.ko-end .chips { justify-content: center; }
.ko-marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 16px 0 4px; }
.ko-mark { border: 3px solid var(--red); color: #ff8c73; padding: 8px 12px; max-width: 240px; text-align: left; animation: koPop .38s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes koPop { 0% { opacity: 0; scale: 2; } 100% { opacity: 1; scale: 1; } }
.ko-mark.r0 { transform: rotate(-3deg); } .ko-mark.r1 { transform: rotate(2deg); }
.ko-mark b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 22px; letter-spacing: .06em; line-height: 1; color: var(--red); }
.ko-mark small { display: block; font-size: 11.5px; line-height: 1.3; margin-top: 5px; color: var(--paper-3); }
.ko-flav { font-family: var(--f-serif); font-style: italic; font-size: 18px; line-height: 1.45; color: var(--paper-3); margin: 16px 0 18px; }

@media (max-width: 360px) {
  .ko-title { font-size: 34px; }
  .ko-bar b { font-size: 13.5px; }
  .stk-chips { grid-template-columns: repeat(3, 1fr); }
  .kp-m { font-size: 18px; }
  .ko-die { width: 50px; height: 50px; padding: 6px; }
  .ko-die i { width: 9px; height: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .ko-smoke, .ko-wait, .ko-die.roll, .ko-felt.racing .ko-horse svg { animation: none !important; }
  .ko-wrap { transition: none; }
}
