/* Kata Rahasia: kotak tebakan di kiri, papan ketik di kanan */
.rt-wrap { flex: 1; min-height: 0; display: flex; padding: clamp(4px, 1vw, 12px); background: #14532d; }
.kr-stage { position: relative; flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; border: 3px solid #fff; background: linear-gradient(180deg, #f0fdf4, #fefce8); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.kr-left { display: flex; flex-direction: column; gap: 5px; padding: clamp(5px, 1vw, 10px); min-width: 0; min-height: 0; }
.rt-hud { display: flex; flex-wrap: wrap; gap: 5px; font-weight: 800; font-size: clamp(11px, 1.45vw, 16px); }
.rt-hud span { background: rgba(15,23,42,.78); color: #fff; border-radius: 999px; padding: 1px 10px; white-space: nowrap; }
.kr-gridbox { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.kr-grid { display: grid; gap: 4px; }
.kr-t { width: var(--ts, 40px); height: var(--ts, 40px); border: 3px solid #cbd5e1; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: calc(var(--ts, 40px) * .6); text-transform: uppercase; color: #0f172a; }
.kr-t.f { border-color: #64748b; animation: kr-pop .12s; }
.kr-t.ok { background: #16a34a; border-color: #16a34a; color: #fff; }
.kr-t.pr { background: #eab308; border-color: #eab308; color: #fff; }
.kr-t.no { background: #64748b; border-color: #64748b; color: #fff; }
.kr-t.rv { animation: kr-flip .45s; }
.kr-row.bad { animation: kr-shake .4s; }
@keyframes kr-pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes kr-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes kr-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.kr-row { display: contents; }
.kr-right { display: flex; flex-direction: column; justify-content: center; gap: clamp(4px, 1.2vh, 10px); padding: clamp(5px, 1vw, 10px); background: rgba(255,255,255,.7); border-left: 3px solid #fff; min-width: 0; min-height: 0; }
.rt-fb { margin: 0; min-height: 2.6em; text-align: center; font-weight: 800; font-size: clamp(12px, 1.6vw, 18px); line-height: 1.25; }
.rt-fb.ok { color: #15803d; } .rt-fb.bad { color: #dc2626; }
.kr-keys { display: flex; flex-direction: column; gap: clamp(3px, 1vh, 8px); }
.kr-kr { display: flex; gap: clamp(2px, .5vw, 6px); justify-content: center; }
.kr-k { flex: 1 1 0; max-width: 64px; min-height: clamp(32px, 8.5vh, 56px); border: 0; border-radius: 8px; background: #e2e8f0; color: #0f172a; font: inherit; font-weight: 900; font-size: clamp(13px, 2.2vw, 22px); text-transform: uppercase; cursor: pointer; box-shadow: 0 2px 0 rgba(15,23,42,.25); padding: 0; }
.kr-k.w { flex: 1.6 1 0; max-width: 96px; font-size: clamp(10px, 1.5vw, 15px); }
.kr-k.ok { background: #16a34a; color: #fff; } .kr-k.pr { background: #eab308; color: #fff; } .kr-k.no { background: #64748b; color: #fff; }
.rt-btn { min-height: clamp(34px, 6vh, 46px); padding: 0 16px; border: 0; border-radius: 999px; background: #16a34a; color: #fff; font: inherit; font-weight: 900; font-size: clamp(13px, 1.8vw, 20px); cursor: pointer; box-shadow: 0 3px 0 rgba(15,23,42,.3); }
.kr-done { position: absolute; inset: 0; background: rgba(20,83,45,.55); display: flex; align-items: center; justify-content: center; z-index: 5; }
.kr-done[hidden] { display: none; }
.kr-card { background: #fff; border-radius: 16px; padding: 14px 22px; text-align: center; max-width: 80%; }
.kr-card h2 { margin: 0 0 4px; } .kr-card p { margin: 0 0 10px; font-weight: 700; }
.kr-card .kr-ans { font-size: 1.6em; letter-spacing: .15em; text-transform: uppercase; font-weight: 900; color: #15803d; }
.rt-recap { text-align: left; max-height: 30vh; overflow-y: auto; font-size: clamp(11px, 1.4vw, 15px); font-weight: 600; margin: 4px 0 8px; }
@media (max-height: 520px) { .rt-wrap { padding: 3px 6px; } .kr-stage { border-width: 2px; border-radius: 12px; } .kr-grid { gap: 3px; } .kr-t { border-width: 2px; border-radius: 6px; } .rt-fb { min-height: 2.2em; } }
@media (max-width: 640px) and (orientation: portrait) { .kr-stage { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr); } .kr-right { border-left: 0; border-top: 3px solid #fff; } }
