/* Krówka kontra Byk — style strony gry */
.kbg-section { padding: 28px 0 64px; }
.kbg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.kbg-flash { max-width: 1200px; margin: 0 auto 18px; padding: 12px 16px; border-radius: 12px; background: #E7F4E4; color: #22502A; font-weight: 600; }
.kbg-flash.is-err { background: #FBE3E1; color: #8A2621; }
.kbg-test { display: inline-block; margin-bottom: 14px; padding: 4px 10px; border-radius: 99px; background: #2C1810; color: #FBF6EF; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.kbg { background: #FFFFFF; border-radius: 22px; box-shadow: 0 10px 40px rgba(44, 24, 16, .08); padding: 14px; scroll-margin-top: 90px; }
.kbg-hud { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; }
.kbg-hud > div { display: flex; flex-direction: column; min-width: 64px; }
.kbg-hud span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8A551F; font-weight: 700; }
.kbg-hud strong { font-family: Fraunces, Georgia, serif; font-size: 22px; line-height: 1.1; color: #2C1810; font-variant-numeric: tabular-nums; }
.kbg-hud [data-kbg="lives"] { display: flex; gap: 4px; height: 26px; align-items: center; }
.kbg-life { display: inline-block; width: 18px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath fill='%23B4732E' d='M12 21.4 10.6 20C5.4 15.4 2 12.3 2 8.5 2 5.4 4.4 3 7.5 3c1.7 0 3.4.8 4.5 2.1C13.1 3.8 14.8 3 16.5 3 19.6 3 22 5.4 22 8.5c0 3.8-3.4 6.9-8.6 11.5L12 21.4z'/%3E%3C/svg%3E") center/contain no-repeat; }
.kbg-mute { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #EADBC8; background: #FBF6EF; cursor: pointer; display: grid; place-items: center; color: #2C1810; }
.kbg-mute svg { width: 20px; height: 20px; }
.kbg-mute .off { display: none; }
.kbg-mute.is-muted .on { display: none; }
.kbg-mute.is-muted .off { display: block; }

.kbg-stage { position: relative; display: flex; justify-content: center; background: #FBF6EF; border-radius: 16px; overflow: hidden; }
.kbg-stage canvas { display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.kbg-ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 22px; background: rgba(251, 246, 239, .94); backdrop-filter: blur(3px); overflow-y: auto; }
.kbg-ov[hidden] { display: none; }
.kbg-ov h2, .kbg-ov h3 { font-family: Fraunces, Georgia, serif; color: #2C1810; margin: 0 0 8px; line-height: 1.15; }
.kbg-ov h2 { font-size: clamp(24px, 4vw, 32px); }
.kbg-ov p { margin: 0 0 12px; color: #4A3428; max-width: 420px; }
.kbg-ov .btn { min-width: 180px; justify-content: center; }
.kbg-form { width: 100%; max-width: 380px; text-align: left; }
.kbg-form input[type=email] { width: 100%; padding: 13px 14px; border: 1px solid #DCC7AE; border-radius: 12px; font-size: 16px; background: #FFF; margin-bottom: 10px; box-sizing: border-box; }
.kbg-form label.kbg-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: #4A3428; margin-bottom: 8px; }
.kbg-form label.kbg-check input { margin-top: 2px; flex: 0 0 auto; width: 18px; height: 18px; accent-color: #B4732E; }
.kbg-form .btn { width: 100%; margin-top: 6px; }
.kbg-hp { position: absolute !important; left: -9999px !important; }
.kbg-msg { min-height: 1.2em; color: #8A2621; font-size: 14px; font-weight: 600; margin-top: 8px; text-align: center; }
.kbg-small { font-size: 12px !important; color: #7A6253 !important; }
.kbg-linkbtn { background: none; border: 0; padding: 0; color: #8A551F; text-decoration: underline; cursor: pointer; font: inherit; }
.kbg-weekbox { width: 100%; max-width: 360px; background: #FFF; border: 1px solid #EADBC8; border-radius: 14px; padding: 12px 14px; margin: 6px 0 14px; text-align: left; }
.kbg-weekbox b { font-variant-numeric: tabular-nums; }
.kbg-bar { height: 10px; background: #F4EADD; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.kbg-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #C89257, #B4732E); border-radius: 99px; transition: width .6s; }
.kbg-weekbox p { margin: 0; font-size: 13px; }
.kbg-verify { background: #FFF6DB; border: 1px solid #F0D488; border-radius: 12px; padding: 10px 12px; font-size: 13px !important; max-width: 360px; }
.kbg-final { font-family: Fraunces, Georgia, serif; font-size: 56px; line-height: 1; color: #B4732E; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }

.kbg-pad { display: none; margin: 10px auto 0; width: min(215px, 62vw, 30vh); aspect-ratio: 1; }
.kbg-pad svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.kbg-pad .kbg-w { fill: #2C1810; transition: fill .08s; }
.kbg-pad .kbg-a { fill: #FBF6EF; pointer-events: none; }
.kbg-pad .is-on .kbg-w { fill: #B4732E; }
@media (hover: none) and (pointer: coarse) { .kbg-pad { display: block; } .kbg-hint { display: none; } }
.kbg:not([data-state="play"]):not([data-state="pause"]) .kbg-pad { display: none; }
.kbg-hint { display: none; } }
.kbg-hint { text-align: center; font-size: 12px; color: #7A6253; margin: 10px 0 0; }

.kbg-side { display: flex; flex-direction: column; gap: 18px; }
.kbg-card { background: #FFF; border-radius: 18px; padding: 20px; box-shadow: 0 6px 24px rgba(44, 24, 16, .06); }
.kbg-card h2 { font-family: Fraunces, Georgia, serif; font-size: 22px; margin: 0 0 10px; color: #2C1810; }
.kbg-card ul.kbg-rules { margin: 0; padding: 0; list-style: none; }
.kbg-card ul.kbg-rules li { padding: 6px 0 6px 28px; position: relative; font-size: 14px; line-height: 1.45; color: #4A3428; }
.kbg-card ul.kbg-rules li::before { content: ''; position: absolute; left: 4px; top: 12px; width: 12px; height: 8px; border-radius: 3px; background: #F3D9A4; box-shadow: inset 0 0 0 1.5px #8A551F; }
.kbg-prizes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kbg-prize { background: #FBF6EF; border-radius: 14px; padding: 12px; text-align: center; }
.kbg-prize strong { display: block; font-family: Fraunces, Georgia, serif; font-size: 30px; color: #B4732E; line-height: 1.1; }
.kbg-prize span { font-size: 13px; color: #4A3428; }
.kbg-board { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.kbg-board li { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px dashed #EADBC8; font-size: 14px; }
.kbg-board li:last-child { border-bottom: 0; }
.kbg-board li:first-child:not(.kbg-empty) { font-weight: 700; }
.kbg-board li:first-child:not(.kbg-empty) .kbg-pos { color: #B8861B; }
.kbg-board .kbg-pos { width: 24px; color: #8A551F; font-weight: 700; }
.kbg-board .kbg-who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbg-board .kbg-pts { font-variant-numeric: tabular-nums; font-weight: 700; }
.kbg-board li.is-reached .kbg-pts::after { content: ' ✓'; color: #3E8A4B; }
.kbg-empty { color: #7A6253; font-size: 13px !important; }
.kbg-ends { font-size: 12px; color: #7A6253; margin: 10px 0 0; }

@media (max-width: 980px) {
	.kbg-layout { grid-template-columns: 1fr; }
	.kbg { padding: 10px; border-radius: 16px; }
}
@media (max-width: 480px) {
	.kbg-section { padding-top: 14px; }
	.kbg-hud strong { font-size: 19px; }
	.kbg-hud > div { min-width: 54px; }
	.kbg-ov { padding: 14px; }
	.kbg-ov h2 { font-size: 22px; }
	.kbg-final { font-size: 44px; }
}

/* Ekrany startu/końca w normalnym przepływie — rosną z treścią zamiast ucinać ją na małych telefonach */
.kbg-stage { min-height: var(--kbg-h, 0); }
.kbg[data-state="gate"] .kbg-stage canvas, .kbg[data-state="ready"] .kbg-stage canvas, .kbg[data-state="over"] .kbg-stage canvas { position: absolute; left: 50%; top: 0; transform: translateX(-50%); }
.kbg[data-state="gate"] .kbg-ov:not([hidden]), .kbg[data-state="ready"] .kbg-ov:not([hidden]), .kbg[data-state="over"] .kbg-ov:not([hidden]) { position: relative; inset: auto; width: 100%; min-height: var(--kbg-h, 0); overflow: visible; box-sizing: border-box; }
.kbg-form input[type=text] { width: 100%; padding: 13px 14px; border: 1px solid #DCC7AE; border-radius: 12px; font-size: 16px; background: #FFF; margin-bottom: 10px; box-sizing: border-box; }
.kbg-nameform { width: 100%; max-width: 360px; margin: 4px 0 12px; }
.kbg-nameform[hidden] { display: none; }
.kbg-nameform input { width: 100%; padding: 12px 14px; border: 1px solid #DCC7AE; border-radius: 12px; font-size: 16px; margin-bottom: 8px; box-sizing: border-box; }
.kbg-nameform .btn { width: 100%; }

/* Tryb pełnoekranowy w trakcie gry na telefonie: strona się nie przesuwa, przyciski zawsze widoczne */
html.kbg-lock, html.kbg-lock body { overflow: hidden !important; overscroll-behavior: none; }
.kbg.kbg-fs { position: fixed; inset: 0; z-index: 100000; border-radius: 0; margin: 0; padding: 8px 10px max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: center; background: #FFFFFF; touch-action: none; overflow: hidden; }
.kbg.kbg-fs .kbg-hud { padding-bottom: 6px; }
.kbg.kbg-fs .kbg-hint { display: none; }
.kbg-pausebtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #EADBC8; background: #FBF6EF; cursor: pointer; display: none; place-items: center; color: #2C1810; }
.kbg-pausebtn svg { width: 18px; height: 18px; }
.kbg[data-state="play"] .kbg-pausebtn { display: grid; }
.kbg-hud .kbg-mute { margin-left: auto; }
.kbg-ov .kbg-linkbtn.kbg-end { margin-top: 14px; }
