/* Kriegswerk — the casino's walk-in (casino-ui.js, casino-scene.js): the venue full-window over the game, opened by Trade →
   Gaming's "Go in". z-index 45 like the furniture shops: over the game, under the game's own modals (50), the minigames and
   toasts (60) and the tooltip (70). Green baize and brass on the shops' dark base; the Soviet and British touches are one rule
   each at the end. */

.kw-csw { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; background: #0b0d0a; color: var(--kw-text); font-family: var(--kw-font); animation: kw-fade .15s ease; }
.kw-csw-top { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; background: linear-gradient(#1f2a1f, #151b14); border-bottom: 1px solid #b08a3a; }
.kw-csw-top > img { image-rendering: pixelated; flex: 0 0 auto; }
.kw-csw-top h3 { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; flex-direction: column; font-family: var(--kw-stencil); font-weight: 400; font-size: 20px; letter-spacing: .03em; color: #f0d890; line-height: 1.1; }
.kw-csw-top h3 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-csw-top h3 small { font-family: var(--kw-font); font-size: 13px; letter-spacing: 0; color: var(--kw-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-csw-night { font-weight: 400; color: var(--kw-gelb2); }
.kw-csw-night.is-raid { color: #ff9a80; }
.kw-csw-clock { font-variant-numeric: tabular-nums; }
.kw-csw-modes { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.kw-csw-modes .kw-chip[aria-pressed="true"] { color: #141a12; background: var(--kw-gelb); border-color: var(--kw-gelb2); }
.kw-csw-have { flex: 0 0 auto; min-width: 110px; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
.kw-csw-secs { flex: 0 0 auto; padding: 4px 12px 6px; background: #121710; border-bottom: 1px solid #070906; }
.kw-csw-strip { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.kw-csw-strip::-webkit-scrollbar { display: none; }
.kw-csw-sec { flex: 0 0 auto; white-space: nowrap; font-size: 13px; padding: 2px 8px; }
.kw-csw-sec i { margin-right: 4px; }
.kw-csw-sec.is-room { border-color: #8a6a28; }
.kw-csw-sec[aria-current="true"] { border-color: var(--kw-gelb); color: var(--kw-gelb2); }
.kw-csw-mini { position: relative; height: 4px; margin-top: 4px; background: #232b20; border-radius: 2px; }
.kw-csw-mini i { position: absolute; top: 0; bottom: 0; left: 0; width: 10%; background: var(--kw-gelb); border-radius: 2px; }
.kw-csw-main { position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.kw-csw-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #0e100c; }
.kw-csw-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; touch-action: none; cursor: default; }
.kw-csw.is-cursor .kw-csw-stage canvas { cursor: grab; }
.kw-csw-hint { position: absolute; left: 10px; bottom: 8px; max-width: calc(100% - 20px); padding: 3px 8px; font-size: 12px; color: var(--kw-dim); background: rgba(11, 13, 10, .72); border-radius: 2px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the card over the view */
.kw-csw-pop { position: absolute; left: 12px; top: 12px; width: min(360px, calc(100% - 24px)); max-height: calc(100% - 52px); overflow-y: auto; padding: 10px; background: #18201a; border: 1px solid #6a7a50; border-radius: 3px; box-shadow: 0 10px 24px rgba(0, 0, 0, .6); }
.kw-csw-pop[hidden] { display: none; }
.kw-csw-pop.is-table { border-color: #b08a3a; background: linear-gradient(#1c3020, #18201a 45%); }
.kw-csw-pop p { margin: 6px 0; line-height: 1.3; }
.kw-csw-ph { display: flex; gap: 8px; align-items: flex-start; }
.kw-csw-ph > img { image-rendering: pixelated; background: #12301c; border: 1px solid #070906; flex: 0 0 auto; }
.kw-csw-ph > div { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kw-csw-ph > div b { font-size: 16px; color: #f0d890; line-height: 1.15; }
.kw-csw-ph > div small { color: var(--kw-dim); }
.kw-csw-ph .kw-icon-btn { flex: 0 0 auto; }
.kw-csw-dim { color: var(--kw-dim); }
.kw-csw-warn { color: #ffb0a0; }
.kw-csw-warn small { display: flex; align-items: flex-start; gap: 6px; }
.kw-csw-warn small > :first-child { flex: none; margin-top: 1px; }
.kw-csw-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0 4px; }
.kw-csw-chips > span { font-size: 12px; color: var(--kw-dim); margin-right: 2px; }
.kw-csw-chip { min-width: 46px; height: 30px; padding: 0 8px; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; color: #f4ecd0; background: radial-gradient(circle at 50% 40%, #3a5a3c, #1f3322); border: 2px dashed #c8b070; border-radius: 15px; cursor: pointer; }
.kw-csw-chip[aria-pressed="true"] { color: #1a1408; background: radial-gradient(circle at 50% 40%, #f4d878, #c89a30); border-style: solid; border-color: #fff0b0; }
.kw-csw-chip:disabled { opacity: .4; cursor: not-allowed; }
.kw-csw-hold { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 4px; padding: 6px 10px; background: #f4ecd0; color: #1c1810; border-radius: 2px; }
.kw-csw-hold > span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #5a4e30; }
.kw-csw-hold > b { font-size: 16px; font-variant-numeric: tabular-nums; }
.kw-csw-hold .kw-cash { color: inherit; }
.kw-csw-hold > small { color: #5a4e30; }
.kw-csw-why { min-height: 18px; margin: 4px 0; font-size: 12px; line-height: 1.3; color: var(--kw-dim); }
.kw-csw-why.is-bad { color: var(--kw-rot2); }
.kw-csw-drinks { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.kw-csw-drink { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; font: inherit; color: var(--kw-text); text-align: left; background: #222a20; border: 1px solid #070906; border-radius: 2px; cursor: pointer; }
.kw-csw-drink:hover:not(:disabled) { border-color: #b08a3a; }
.kw-csw-drink:disabled { opacity: .5; cursor: not-allowed; }
.kw-csw-drink > i { color: var(--kw-gelb2); }
.kw-csw-drink span { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.kw-csw-drink small { color: var(--kw-dim); font-size: 12px; }
.kw-csw-drink em { font-style: normal; font-size: 11px; color: var(--kw-gelb2); }
.kw-csw-drink.is-on { border-color: var(--kw-gelb); }
.kw-csw-bar { height: 6px; margin: 6px 0 2px; background: #232b20; border-radius: 3px; overflow: hidden; }
.kw-csw-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a28, var(--kw-gelb)); }
.kw-csw .is-down, .kw-csw-ask .is-down { color: #ff8a70; }
.kw-csw .is-up, .kw-csw-ask .is-up { color: #8ad07a; }

/* the evening (the aside; a bottom sheet on phones) */
.kw-csw-side { min-height: 0; display: flex; flex-direction: column; background: #151b14; border-left: 1px solid #070906; }
.kw-csw-bbar { display: none; }
.kw-csw-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.kw-csw-box { padding: 8px 10px; background: #1b231a; border: 1px solid #070906; border-radius: 3px; display: flex; flex-direction: column; gap: 4px; }
.kw-csw-box small { font-size: 12px; line-height: 1.3; }
.kw-csw-bh { font-family: var(--kw-stencil); font-size: 15px; letter-spacing: .03em; color: #f0d890; }
.kw-csw-bh i { margin-right: 4px; color: var(--kw-gelb2); }
.kw-csw-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.kw-csw-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-csw-row.is-off { opacity: .55; }
.kw-csw-row.is-drink, .kw-csw-row.is-cool { grid-template-columns: 18px minmax(0, 1fr) auto; color: var(--kw-gelb2); }
.kw-csw-nightp { margin: 4px 0 0; padding: 4px 8px; font-size: 12px; line-height: 1.3; background: #2a2414; border-left: 3px solid var(--kw-gelb); }
.kw-csw-nightp.is-raid { border-left-color: #c84a30; }
.kw-csw-limrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.kw-csw-limrow > span { flex: 0 0 100px; font-size: 12px; color: var(--kw-dim); }
.kw-csw-lim { font-size: 12px; padding: 1px 7px; }
.kw-csw-lim[aria-pressed="true"] { color: #141a12; background: var(--kw-gelb); border-color: var(--kw-gelb2); }
.kw-csw-comps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.kw-csw-comps i { color: var(--kw-gelb2); margin-right: 4px; }
.kw-csw-led { display: flex; flex-direction: column; gap: 2px; }
.kw-csw-lr { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; font-size: 12px; font-variant-numeric: tabular-nums; }
.kw-csw-lr > small { color: var(--kw-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-csw-lr > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-csw-safe { margin: 0; padding: 6px 8px; font-size: 12px; line-height: 1.35; color: var(--kw-dim); border-top: 1px dashed #3a4a34; }
.kw-csw-safe i { color: #c87a70; margin-right: 4px; }
.kw-csw-ask .kw-csw-dim { color: var(--kw-dim); }
.kw-csw-check { display: flex; align-items: center; gap: 6px; margin: 8px 0; font-size: 13px; cursor: pointer; }

/* phones: the evening is a bottom sheet — a bar with tonight's result and the rounds left; a tap opens it */
@media (max-width: 760px) {
    .kw-csw-top { gap: 6px; padding: 6px 8px; flex-wrap: wrap; }
    .kw-csw-top h3 { font-size: 17px; flex-basis: calc(100% - 80px); order: 0; }
    .kw-csw-top .kw-icon-btn { order: 1; }
    .kw-csw-modes { order: 2; }
    .kw-csw-have { order: 3; flex: 1 1 auto; }
    .kw-csw-secs { padding: 4px 8px 6px; }
    .kw-csw-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 48px; }
    .kw-csw-side { position: relative; border-left: 0; border-top: 1px solid #070906; overflow: visible; }
    .kw-csw-bbar { display: flex; align-items: center; gap: 6px; width: 100%; height: 48px; padding: 0 12px; color: var(--kw-text); font: inherit; font-size: 15px; background: #151b14; border: 0; cursor: pointer; }
    .kw-csw-bbar small { color: var(--kw-dim); font-size: 12px; margin-left: auto; }
    .kw-csw-chev { transition: transform .15s; }
    .kw-csw-body { display: none; }
    .kw-csw.has-sheet .kw-csw-side { position: absolute; left: 0; right: 0; bottom: 0; height: min(70vh, 540px); z-index: 2; box-shadow: 0 -10px 24px rgba(0, 0, 0, .6); display: flex; }
    .kw-csw.has-sheet .kw-csw-body { display: flex; }
    .kw-csw.has-sheet .kw-csw-chev { transform: rotate(180deg); }
    .kw-csw-pop { left: 8px; top: 8px; width: calc(100% - 16px); max-height: calc(100% - 16px); }
    .kw-csw-hint { display: none; }
    .kw-csw-limrow > span { flex-basis: 100%; }
}

/* the factions: one rule each under the bar (subtle, like the rest of their looks) */
body.kw-fac-su .kw-csw-top { border-bottom: 2px solid var(--kw-su-red, #a8281e); }
body.kw-fac-uk .kw-csw-top { border-bottom: 2px solid var(--kw-uk-rule, #24346a); }
