/* Ringkönig: bright, chunky, toy-box look over the 3D ring. */
.rk { position: absolute; inset: 0; overflow: hidden; background: #8fd3ff; font-family: 'Nunito', system-ui, sans-serif; color: #1a1030; user-select: none; -webkit-user-select: none; touch-action: none; }
.rk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rk kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 7px; background: #fff; border: 2px solid #1a1030; border-bottom-width: 4px; font: 800 12px 'Nunito', sans-serif; color: #1a1030; text-align: center; line-height: 1.3; }

/* HUD */
.rk-hud { position: absolute; inset: 10px 10px auto 10px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; pointer-events: none; z-index: 3; }
.rk-hud[hidden] { display: none; }
.rk-side { display: flex; flex-direction: column; gap: 5px; }
.rk-side.op { align-items: flex-end; }
.rk-name { font: 400 20px 'Lilita One', sans-serif; color: #fff; -webkit-text-stroke: 5px #1a1030; paint-order: stroke fill; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rk-bar { position: relative; width: min(340px, 100%); height: 20px; border-radius: 999px; background: #3b2f5c; border: 3px solid #1a1030; overflow: hidden; box-shadow: 0 3px 0 #1a1030; }
.rk-bar.sta { height: 12px; width: min(280px, 85%); }
.rk-bar b { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#7ef08a, #2fbf4a); border-radius: 999px; transition: width .12s; }
.rk-bar.hp.low b { background: linear-gradient(#ff9a8a, #e8343e); animation: rk-pulse .5s infinite alternate; }
.rk-bar.sta b { background: linear-gradient(#ffe37a, #ffb800); }
.rk-bar.sta.low b { background: linear-gradient(#ffb37a, #ff7a00); }
.rk-bar i { position: absolute; right: 0; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #1a1030 0 5px, #4b3d72 5px 10px); }
.op .rk-bar b { left: auto; right: 0; }
.op .rk-bar i { right: auto; left: 0; }
.rk-kd { font-weight: 900; font-size: 13px; color: #fff; text-shadow: 0 2px 0 #1a1030; }
.rk-mid { text-align: center; background: #fff; border: 3px solid #1a1030; border-radius: 16px; padding: 4px 14px 6px; box-shadow: 0 4px 0 #1a1030; }
.rk-round { font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #e8343e; }
.rk-clock { font: 400 28px 'Lilita One', sans-serif; line-height: 1; }
.rk-pausebtn { pointer-events: auto; position: absolute; left: 50%; transform: translateX(-50%); top: 70px; width: 40px; height: 40px; border-radius: 12px; border: 3px solid #1a1030; background: #fff; font: 900 15px 'Nunito', sans-serif; cursor: pointer; box-shadow: 0 3px 0 #1a1030; }
@keyframes rk-pulse { to { filter: brightness(1.4); } }

.rk-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 0, 40, 0) 40%, rgba(255, 0, 40, .75) 100%); z-index: 2; }
.rk-call { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) scale(.6); opacity: 0; transition: transform .18s cubic-bezier(.3, 1.8, .5, 1), opacity .15s; font: 400 clamp(40px, 8vw, 84px) 'Lilita One', sans-serif; color: #ffd23f; -webkit-text-stroke: 10px #1a1030; paint-order: stroke fill; text-align: center; pointer-events: none; z-index: 4; white-space: nowrap; line-height: 1.05; }
.rk-call small { display: block; font: 900 clamp(14px, 2.2vw, 20px) 'Nunito', sans-serif; -webkit-text-stroke: 0; color: #fff; text-shadow: 0 2px 0 #1a1030, 0 0 8px #1a1030; margin-top: 6px; white-space: normal; }
.rk-call.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.rk-call.intro { font-size: clamp(28px, 5vw, 54px); color: #fff; }
.rk-call.bad { color: #ff6b6b; }
.rk-call.good { color: #7ef08a; }
.rk-call.count { font-size: clamp(70px, 14vw, 150px); color: #fff; }
.rk-call.big { font-size: clamp(70px, 15vw, 170px); }
.rk-call.round { color: #fff; }

.rk-tell { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: opacity .08s, transform .08s; background: #fff; border: 3px solid #1a1030; border-radius: 16px; padding: 8px 14px; font-weight: 800; font-size: 15px; box-shadow: 0 4px 0 #1a1030; pointer-events: none; z-index: 3; max-width: calc(100% - 32px); text-align: center; }
.rk-tell b { color: #e8343e; font-size: 17px; margin-right: 6px; }
.rk-tell.show { opacity: 1; transform: translateX(-50%); }
.rk-tell.left { left: 26%; } .rk-tell.right { left: 74%; }
.rk-tell.left::before, .rk-tell.right::after { content: ''; position: absolute; top: 50%; width: 0; height: 0; border: 14px solid transparent; transform: translateY(-50%); }
.rk-tell.left::before { right: 100%; border-right-color: #1a1030; }
.rk-tell.right::after { left: 100%; border-left-color: #1a1030; }
.rk-chance { position: absolute; top: 40%; left: 50%; transform: translateX(-50%); font: 400 26px 'Lilita One', sans-serif; color: #7ef08a; -webkit-text-stroke: 6px #1a1030; paint-order: stroke fill; opacity: 0; transition: opacity .1s; pointer-events: none; z-index: 3; }
.rk-chance.show { opacity: 1; animation: rk-bounce .3s infinite alternate; }
@keyframes rk-bounce { to { transform: translateX(-50%) translateY(-6px); } }
.rk-pops { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.rk-pop { position: absolute; transform: translate(-50%, -50%); font: 400 26px 'Lilita One', sans-serif; color: #ffd23f; -webkit-text-stroke: 6px #1a1030; paint-order: stroke fill; animation: rk-rise .9s ease-out forwards; white-space: nowrap; }
.rk-pop.counter { color: #ff5d5d; font-size: 34px; }
.rk-pop.def { color: #7ad7ff; }
@keyframes rk-rise { 0% { transform: translate(-50%, -30%) scale(.5); opacity: 0; } 15% { transform: translate(-50%, -60%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -160%) scale(1); opacity: 0; } }

/* Touch controls */
.rk-touch { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); pointer-events: none; z-index: 3; }
.rk-touch[hidden] { display: none; }
.rk-pad { display: grid; gap: 6px; pointer-events: auto; }
.rk-pad.left { grid-template-columns: repeat(3, 58px); }
.rk-pad.right { grid-template-columns: repeat(2, 66px); }
.rk-pad button { height: 50px; border-radius: 14px; border: 3px solid #1a1030; background: rgba(255, 255, 255, .85); font: 900 11px/1.05 'Nunito', sans-serif; color: #1a1030; box-shadow: 0 3px 0 #1a1030; touch-action: none; }
.rk-pad button.on { transform: translateY(3px); box-shadow: none; background: #ffd23f; }
.rk-pad .str { background: rgba(255, 210, 63, .9); }
.rk-pad .hook { background: rgba(255, 140, 140, .9); }
.rk-pad .up { background: rgba(140, 210, 255, .9); }
.rk-pad .body { grid-column: span 2; height: 38px; }
.rk-pad .body.on { background: #7ef08a; transform: none; box-shadow: 0 3px 0 #1a1030; }

/* Panels */
.rk-panel { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; z-index: 5; overflow: auto; }
.rk-panel.show { display: flex; }
.rk-panel.menu { justify-content: flex-start; padding-left: max(16px, 5vw); }
.rk-panel.side { justify-content: flex-end; align-items: center; pointer-events: none; }
.rk-panel.side .rk-card { pointer-events: auto; }
.rk-card { width: min(560px, 100%); max-height: 100%; overflow: auto; background: #fff; border: 4px solid #1a1030; border-radius: 26px; padding: 22px 24px; box-shadow: 0 8px 0 #1a1030, 0 20px 40px rgba(26, 16, 48, .3); margin: auto 0; }
.rk-card h1 { margin: 0; font: 400 clamp(46px, 7vw, 68px)/1 'Lilita One', sans-serif; color: #ffd23f; -webkit-text-stroke: 8px #1a1030; paint-order: stroke fill; letter-spacing: .01em; }
.rk-card h1 span { color: #e8343e; }
.rk-card h2 { margin: 0 0 4px; font: 400 32px/1.1 'Lilita One', sans-serif; }
.rk-card h4 { margin: 12px 0 6px; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #6b5a99; }
.rk-sub { margin: 8px 0 14px; font-weight: 700; color: #4b3d72; line-height: 1.4; }
.rk-go, .rk-btn, .rk-chip { font: 900 16px 'Nunito', sans-serif; border: 3px solid #1a1030; border-radius: 16px; cursor: pointer; box-shadow: 0 4px 0 #1a1030; transition: transform .08s, box-shadow .08s; color: #1a1030; }
.rk-go { display: block; width: 100%; padding: 14px; font-size: 20px; background: linear-gradient(#ff6a6a, #e8343e); color: #fff; text-shadow: 0 2px 0 #8a1020; }
.rk-go kbd { margin-left: 6px; font-size: 11px; vertical-align: middle; text-shadow: none; }
.rk-btn { padding: 9px 14px; background: #fff; }
.rk-chip { padding: 6px 12px; background: #fff; font-size: 14px; }
.rk-chip.on { background: #ffd23f; }
.rk-go:hover, .rk-btn:hover, .rk-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #1a1030; }
.rk-go:active, .rk-btn:active, .rk-chip:active { transform: translateY(3px); box-shadow: 0 1px 0 #1a1030; }
.rk-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.rk-row.small { font-weight: 800; font-size: 14px; margin-top: 10px; }
.rk-row .rk-go { flex: 1 1 200px; width: auto; }
.rk-next { margin-top: 10px; padding: 10px 14px; border-radius: 16px; background: #fff6d6; border: 3px dashed #e3b600; }
.rk-next small { display: block; font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #a07f00; }
.rk-next b { font: 400 22px 'Lilita One', sans-serif; }
.rk-next em { display: block; font-style: normal; font-weight: 700; color: #6b5a99; font-size: 14px; }
.rk-how { margin-top: 12px; border: 3px solid #1a1030; border-radius: 16px; padding: 8px 14px; background: #f3f0ff; }
.rk-how summary { cursor: pointer; font-weight: 900; }
.rk-how ul { margin: 8px 0 4px; padding-left: 20px; font-weight: 700; line-height: 1.45; font-size: 14px; }
.rk-how li { margin: 4px 0; }
.rk-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 16px; margin: 6px 0; }
.rk-help h4 { margin: 6px 0 4px; }
.rk-help p { margin: 3px 0; font-weight: 700; font-size: 13px; }
.rk-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rk-check input { width: 18px; height: 18px; accent-color: #e8343e; }
.rk-ladder ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.rk-ladder button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 9px 12px; border: 3px solid #1a1030; border-radius: 16px; background: #fff; cursor: pointer; font: inherit; color: inherit; box-shadow: 0 3px 0 #1a1030; }
.rk-ladder button:hover:not(:disabled) { background: #fff6d6; }
.rk-ladder button:disabled { opacity: .45; cursor: not-allowed; }
.rk-ladder b { display: block; font-size: 16px; }
.rk-ladder em { display: block; font-style: normal; font-size: 13px; font-weight: 700; color: #6b5a99; }
.rk-ladder .done button { background: #e6ffe9; }
.rk-ladder .now button { border-color: #e8343e; }
.rk-step { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #ffd23f; border: 3px solid #1a1030; font-weight: 900; }
.rk-belt { margin-left: auto; font-size: 24px; }
.rk-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-sw { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #1a1030; cursor: pointer; box-shadow: 0 3px 0 #1a1030; }
.rk-sw.on { outline: 4px solid #ffd23f; outline-offset: 2px; }
.rk-look { width: min(440px, 100%); }
.rk-panel.menu .rk-look { margin-left: 0; }
.rk-stats { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-weight: 800; }
.rk-stats td, .rk-stats th { padding: 5px 6px; border-bottom: 2px dashed #e0d9f5; }
.rk-stats td { text-align: center; width: 30%; font-size: 17px; }
.rk-stats th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #6b5a99; }
.rk-stats thead td { font-size: 13px; color: #e8343e; }
.rk-coach { background: #fff6d6; border: 3px solid #1a1030; border-radius: 16px; padding: 10px 14px; font-weight: 700; }
.rk-coach ul { margin: 6px 0 0; padding-left: 18px; }
.rk-break { width: min(420px, 100%); }
.rk-result { text-align: center; }
.rk-result .rk-trophy { font-size: 64px; line-height: 1; }
.rk-result.won h2 { color: #16a34a; }
.rk-result.lost h2 { color: #e8343e; }
.rk-cards { display: flex; justify-content: center; gap: 10px; margin: 8px 0; }
.rk-cards div { background: #f3f0ff; border: 3px solid #1a1030; border-radius: 12px; padding: 6px 12px; }
.rk-cards small { display: block; font-size: 11px; font-weight: 900; color: #6b5a99; }
.rk-cards b { font: 400 22px 'Lilita One', sans-serif; }
.rk-news { background: #e6ffe9; border: 3px solid #16a34a; border-radius: 14px; padding: 8px; font-weight: 800; }
.rk-score small { display: block; font-weight: 900; font-size: 11px; text-transform: uppercase; color: #6b5a99; letter-spacing: .08em; }
.rk-score b { font: 400 34px 'Lilita One', sans-serif; color: #e8343e; }

@media (max-width: 640px) {
	.rk-hud { inset: 6px 6px auto 6px; gap: 6px; }
	.rk-name { font-size: 14px; -webkit-text-stroke-width: 4px; }
	.rk-bar { height: 14px; }
	.rk-bar.sta { height: 9px; }
	.rk-clock { font-size: 20px; }
	.rk-mid { padding: 2px 8px 4px; }
	.rk-tell { bottom: 200px; font-size: 13px; }
	.rk-tell.left { left: 40%; } .rk-tell.right { left: 60%; }
	.rk-panel.menu { padding-left: 16px; justify-content: center; }
	.rk-card { padding: 16px; border-radius: 20px; }
	.rk-pausebtn { top: 52px; width: 34px; height: 34px; }
}
