/* Koki Cilik: Restoran Takaran dan Gizi */
.kk { --kk: #c2410c; --kk-soft: #ffedd5; --kk-ink: #7c2d12; }
.kk-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: clamp(8px, 1.6vw, 18px); overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #fff7ed, #fff 55%); -webkit-overflow-scrolling: touch; }
.kk-view { display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 14px); min-width: 0; }
.kk-view[hidden] { display: none; }
.kk-hud { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.kk-hud:empty { display: none; }
.kk-chip { background: #fff; border: 3px solid var(--c); color: var(--ink); border-radius: 999px; padding: 2px 14px; font-weight: 800; font-size: clamp(13px, 1.6vw, 19px); display: inline-flex; gap: 6px; align-items: baseline; }
.kk-chip b { font-size: 1.2em; font-variant-numeric: tabular-nums; }
.kk-chip i { font-style: normal; }
.kk-chip.on { background: var(--c); color: #fff; }
.kk-bank { background: #fef3c7; border: 3px solid #f59e0b; color: #78350f; border-radius: 999px; padding: 2px 14px; font-weight: 800; font-size: clamp(13px, 1.6vw, 19px); display: inline-flex; gap: 6px; align-items: center; }
.kk-bank svg { width: 20px; height: 20px; }
.kk-qn { font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.5vw, 17px); margin-left: 6px; }
.kk h2 { margin: 0; font-size: clamp(18px, 2.4vw, 26px); }
.kk h3 { margin: 0 0 6px; font-size: clamp(16px, 1.9vw, 20px); }
.kk-names { display: grid; gap: 6px; }
.kk-names input { font: 700 16px var(--font); padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; min-width: 0; width: 100%; box-sizing: border-box; text-align: center; }
.kk-names input[hidden] { display: none; }
#game-opts[hidden] { display: none; }
.kk-tip { margin: 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 14px; }
.kk-turn { text-align: center; font-weight: 800; font-size: clamp(14px, 1.7vw, 18px); color: var(--c); }

/* gambar */
.kk-pic { display: inline-block; width: var(--ps, 56px); height: var(--ps, 56px); flex: none; line-height: 0; }
.kk-pic svg { width: 100%; height: 100%; display: block; }
.kk-ph { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--h, #94a3b8); color: #fff; font: 800 calc(var(--ps, 56px) * .5)/1 var(--font); }

/* adegan restoran */
.kk-scene { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px clamp(8px, 2vw, 20px); align-items: center; background: linear-gradient(180deg, #fde68a 0 62%, #b45309 62% 66%, #d97706 66%); border: 4px solid #92400e; border-radius: 24px; padding: 10px clamp(8px, 2vw, 18px) 10px; overflow: hidden; }
.kk-scene .bg { position: absolute; inset: 0; opacity: .22; pointer-events: none; }
.kk-scene .bg svg { width: 100%; height: 100%; display: block; }
.kk-cust { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 1; }
.kk-cust > .kk-pic { --ps: clamp(84px, 17vh, 150px); }
.kk-cust .nm { font-weight: 800; font-size: 14px; color: #fff; background: #92400e; border-radius: 999px; padding: 0 10px; }
.kk-starsbar { display: flex; gap: 2px; }
.kk-cust .kk-starsbar .kk-pic { --ps: 24px; }
.kk-cust .kk-starsbar .kk-pic.off { opacity: .35; filter: grayscale(1); }
.kk-bubble { position: relative; z-index: 1; background: #fff; border: 3px solid #1f2937; border-radius: 20px; padding: 8px 14px; color: var(--ink); font-weight: 700; font-size: clamp(14px, 1.7vw, 19px); line-height: 1.45; }
.kk-bubble::before { content: ''; position: absolute; left: -11px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-right-color: #1f2937; border-left: 0; }
.kk-bubble b { color: var(--kk); }
.kk-bubble .req { display: block; font-size: .8em; color: var(--muted); margin-top: 2px; }
@media (max-width: 480px) { .kk-scene { grid-template-columns: 1fr; justify-items: center; } .kk-bubble::before { left: 50%; top: -11px; margin: 0 0 0 -9px; border: 9px solid transparent; border-bottom-color: #1f2937; border-top: 0; } .kk-cust { flex-direction: row; gap: 10px; } .kk-cust > .kk-pic { --ps: 72px; } }

.kk-card { background: #fff; border: 3px solid var(--kk-soft); border-radius: 20px; padding: 8px 12px 12px; min-width: 0; }
.kk-card > h3 { color: var(--kk-ink); }
.kk-card.recipe { border-color: #fdba74; background: #fffaf3; }
.kk-ing { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.kk-ing li { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 2px solid #fed7aa; border-radius: 999px; padding: 2px 12px 2px 4px; font-weight: 700; font-size: clamp(13px, 1.5vw, 16px); color: var(--ink); }
.kk-ing .kk-pic { --ps: 34px; }

/* takaran */
.kk-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 8px; }
.kk-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; background: #fff; border: 3px solid var(--kk-soft); border-radius: 18px; padding: 6px 10px; }
.kk-row.good { border-color: var(--ok); background: #f0fdf4; }
.kk-row.bad { border-color: var(--bad); background: #fff1f2; }
.kk-row .kk-pic { --ps: 52px; }
.kk-row .nm { font-weight: 800; color: var(--ink); font-size: clamp(14px, 1.6vw, 17px); line-height: 1.2; }
.kk-row .nm small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.kk-step { grid-column: 1 / -1; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 6px; align-items: center; }
.kk-sb { width: 48px; height: 48px; min-width: 44px; min-height: 44px; border-radius: 14px; border: 3px solid var(--kk); background: #fff; color: var(--kk); font: 800 28px/1 var(--font); cursor: pointer; padding: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(194,65,12,.3); }
.kk-sb:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.kk-sb:disabled { opacity: .4; cursor: not-allowed; }
.kk-val { text-align: center; font-weight: 800; font-size: clamp(18px, 2.4vw, 26px); color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; background: #f8fafc; border-radius: 12px; border: 2px solid var(--line); padding: 4px 4px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; box-sizing: border-box; }
.kk-val small { font-size: .6em; color: var(--muted); font-weight: 700; }
.kk-vis { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-height: 30px; }
.kk-vis .tool { width: 34px; height: 34px; flex: none; }
.kk-vis .tool svg { width: 100%; height: 100%; display: block; }
.kk-meter { position: relative; flex: 1; height: 14px; border-radius: 999px; background: #e2e8f0; overflow: hidden; border: 2px solid #94a3b8; box-sizing: border-box; }
.kk-meter i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--f, 0%); background: var(--mc, #f59e0b); transition: width .2s; }
.kk-meter.ml i { background: #38bdf8; }
.kk-meter.g i { background: #f59e0b; }
.kk-cup { position: relative; width: 26px; height: 40px; border: 3px solid #475569; border-top: 0; border-radius: 0 0 8px 8px; background: #f1f5f9; overflow: hidden; flex: none; }
.kk-cup i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--f, 0%); background: #38bdf8; transition: height .2s; }
.kk-dots { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; min-height: 28px; flex: 1; }
.kk-dots .kk-pic { --ps: 26px; }
.kk-dots .more { font-weight: 800; font-size: 13px; color: var(--muted); }
.kk-scale { transform-origin: 50% 80%; transition: transform .25s; }
.kk-vis .tool.scale svg { transform: rotate(var(--r, 0deg)); transform-origin: 50% 70%; transition: transform .25s; }
.kk-ans { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--bad); }
.kk-ans.ok { color: var(--ok); }

/* porsi / pilihan */
.kk-prompt { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 22px); background: #fff; border: 4px solid var(--kk); border-radius: 24px; padding: 8px 14px; min-height: 80px; flex-wrap: wrap; }
.kk-prompt .kk-pic { --ps: clamp(80px, 22vh, 140px); }
.kk-qtext { margin: 0; flex: 1 1 220px; text-align: center; font-weight: 800; color: var(--ink); font-size: clamp(17px, 2.3vw, 26px); line-height: 1.35; overflow-wrap: anywhere; }
.kk-qtext small { display: block; font-size: .55em; color: var(--kk); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
.kk-opts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.2vw, 14px); }
@media (max-width: 480px) { .kk-opts:not(.pic) { grid-template-columns: 1fr; } }
.kk-opt { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: clamp(56px, 9vh, 88px); padding: 6px 12px 6px 30px; border-radius: 18px; border: 4px solid var(--kk-soft); background: #fff; color: var(--ink); font: 800 clamp(15px, 2vw, 24px)/1.25 var(--font); cursor: pointer; text-align: center; overflow-wrap: anywhere; }
.kk-opt kbd { position: absolute; top: 3px; left: 8px; font: 800 12px var(--font); color: var(--muted); }
.kk-opt:hover:not(:disabled) { border-color: var(--kk); }
.kk-opt:disabled { cursor: default; }
.kk-opt.good { background: #bbf7d0; border-color: var(--ok); }
.kk-opt.bad { background: #fecdd3; border-color: var(--bad); }
.kk-stock { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.kk-stock .it { display: flex; flex-direction: column; align-items: center; gap: 0; background: #fff; border: 3px solid #fed7aa; border-radius: 16px; padding: 4px 10px; font-weight: 800; font-size: clamp(13px, 1.5vw, 16px); color: var(--ink); text-align: center; }
.kk-stock .it .kk-pic { --ps: 48px; }
.kk-stock .it small { font-weight: 700; color: var(--muted); }

/* piring */
.kk-pl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 639px) { .kk-pl { grid-template-columns: 1fr; } }
.kk-plate { position: relative; width: clamp(210px, 46vh, 360px); aspect-ratio: 1; margin: 0 auto; }
.kk-plate .base { position: absolute; inset: 0; }
.kk-plate .base svg { width: 100%; height: 100%; display: block; }
.kk-slot { position: absolute; width: 38%; height: 38%; border-radius: 50%; border: 3px dashed #475569; background: rgba(255,255,255,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; cursor: pointer; color: var(--ink); font: 800 11px/1.1 var(--font); touch-action: manipulation; min-width: 44px; min-height: 44px; }
.kk-slot .kk-pic { --ps: 56%; width: 56%; height: 56%; }
.kk-slot .lb { display: block; text-transform: uppercase; letter-spacing: .03em; font-size: 10px; }
.kk-slot.fill { border-style: solid; border-color: var(--kk); background: rgba(255,255,255,.85); }
.kk-slot.want { border-style: solid; border-color: #ca8a04; background: #fef9c3; box-shadow: 0 0 0 4px rgba(250,204,21,.6); }
.kk-slot.hot { border-style: solid; border-color: var(--kk); background: #ecfdf5; }
.kk-slot.good { border-color: var(--ok); background: #bbf7d0; }
.kk-slot.bad { border-color: var(--bad); background: #fecdd3; animation: kk-shake .35s; }
.kk-slot:disabled { cursor: default; }
.kk-slot.no { display: none; }
.kk-need { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; color: var(--ink); font-size: clamp(14px, 1.5vw, 16px); line-height: 1.45; }
.kk-need b { color: var(--kk); }
.kk-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kk-tray { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 8px; border: 2px dashed var(--line); border-radius: 16px; background: #fff; min-height: 56px; }
.kk-tc { display: flex; flex-direction: column; align-items: center; gap: 2px; width: clamp(78px, 13vw, 100px); min-height: 66px; padding: 4px 4px 6px; border-radius: 14px; border: 3px solid var(--kk); background: #fff; color: var(--ink); font: 800 12px/1.2 var(--font); cursor: grab; touch-action: none; box-shadow: 0 4px 0 rgba(194,65,12,.25); overflow-wrap: anywhere; text-align: center; }
.kk-tc .kk-pic { --ps: 44px; }
.kk-tc.sel { background: #fef9c3; border-color: #ca8a04; box-shadow: 0 0 0 4px rgba(250,204,21,.6); }
.kk-tc.placed { display: none; }
.kk-tc:disabled { cursor: default; }
.kk-ghost { position: fixed; z-index: 99; pointer-events: none; transform: translate(-50%, -60%); opacity: .92; margin: 0; }
@keyframes kk-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* umpan balik dan tombol */
.kk-fb { min-height: 1.4em; text-align: center; font-weight: 800; color: var(--muted); font-size: clamp(14px, 1.7vw, 19px); line-height: 1.4; }
.kk-fb.ok b.r { color: var(--ok); } .kk-fb.bad b.r { color: var(--bad); }
.kk-fb p { margin: 4px 0 0; font-weight: 700; color: var(--ink); text-align: left; background: #f8fafc; border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; font-size: clamp(14px, 1.5vw, 16px); }
.kk-fb ol { margin: 4px 0 0; padding-left: 22px; text-align: left; color: var(--ink); font-size: clamp(13px, 1.5vw, 16px); font-weight: 700; background: #f8fafc; border: 2px solid var(--line); border-radius: 14px; padding-top: 8px; padding-bottom: 8px; }
.kk-next { align-self: center; margin-top: 0; min-height: 52px; padding: 0 34px; font-size: clamp(18px, 2vw, 24px); }
.kk-next[hidden] { display: none; }
.kk-act { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; align-items: center; }
.kk-mini-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 3px solid var(--line); background: #fff; font: 800 15px var(--font); color: var(--ink); cursor: pointer; }
.kk-mini-btn:hover:not(:disabled) { border-color: var(--kk); background: var(--kk-soft); }
.kk-mini-btn:disabled { opacity: .45; cursor: not-allowed; }
.kk-check { margin-top: 0; min-height: 52px; padding: 0 28px; font-size: 20px; }
.kk-check:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }

/* belajar */
.kk-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.kk-tab { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 3px solid var(--line); background: #fff; color: var(--ink); font: 800 clamp(14px, 1.6vw, 17px) var(--font); cursor: pointer; }
.kk-tab[aria-pressed="true"] { background: var(--kk); border-color: var(--kk); color: #fff; }
.kk-sec { background: #fff; border: 3px solid var(--sc, var(--kk)); border-radius: 22px; padding: 10px 14px 14px; min-width: 0; }
.kk-sec h2 { color: var(--sc, var(--kk)); }
.kk-sec p { margin: 4px 0 6px; color: var(--ink); line-height: 1.55; font-size: clamp(14px, 1.5vw, 16px); }
.kk-sec ul, .kk-sec ol { margin: 4px 0 6px; padding-left: 20px; color: var(--ink); line-height: 1.5; font-size: clamp(14px, 1.5vw, 16px); }
.kk-fig { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.kk-fig .kk-pic { --ps: clamp(130px, 28vh, 220px); }
.kk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.kk-card-b { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px 10px; border-radius: 18px; border: 3px solid var(--st, var(--kk-soft)); background: #fff; font: inherit; color: var(--ink); text-align: center; min-height: 44px; }
.kk-card-b b { font-size: clamp(15px, 1.7vw, 18px); line-height: 1.2; }
.kk-card-b small { font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.kk-card-b .zat { display: inline-block; background: var(--sc, var(--kk)); color: #fff; border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 800; }
.kk-pilar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.kk-pilar > div { background: #f0fdf4; border: 2px solid #86efac; border-radius: 14px; padding: 8px 12px; font-size: clamp(14px, 1.5vw, 16px); line-height: 1.45; color: var(--ink); }
.kk-pilar b { display: block; color: #166534; }
.kk-tg { display: grid; gap: 6px; }
.kk-tg > div { border-radius: 14px; padding: 8px 12px; color: var(--ink); font-size: clamp(14px, 1.5vw, 16px); line-height: 1.45; background: var(--bg, #f8fafc); border: 2px solid var(--bd, #e2e8f0); }
.kk-tg b { display: block; }

/* hasil */
.kk-score { display: flex; flex-direction: column; gap: 4px; font-size: clamp(15px, 2vw, 22px); margin-bottom: 6px; }
.kk-recap { text-align: left; max-height: 36vh; overflow: auto; margin: 6px 0; }
.kk-recap:empty { display: none; }
.kk-recap h3 { margin: 4px 0 6px; font-size: 16px; }
.kk-recap ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; color: var(--ink); font-size: 14px; line-height: 1.4; }
.kk-recap li span { display: block; color: var(--muted); }

@media (max-width: 420px) { .kk-wrap { padding: 6px; } .kk-row .kk-pic { --ps: 44px; } .kk-tc { width: 72px; } }
@media (max-height: 520px) {
  #overlay-result .trophy { display: none; } #overlay-result .winner { font-size: 30px; margin: 0; } #overlay-result .panel { padding-top: 14px; }
  .kk-wrap { gap: 4px; padding: 4px 8px; }
  .kk-prompt { min-height: 56px; border-width: 3px; padding: 4px 10px; }
  .kk-prompt .kk-pic { --ps: 64px; }
  .kk-cust > .kk-pic { --ps: 70px; }
  .kk-scene .bg { display: none; }
  .kk-plate { width: clamp(180px, 62vh, 260px); }
  .kk-pl { grid-template-columns: auto minmax(0, 1fr); }
  .kk-opt { min-height: 46px; border-width: 3px; }
  .kk-opts { grid-template-columns: repeat(2, 1fr); }
  .kk-recap { max-height: 28vh; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.kk-fine { grid-column: 1 / -1; justify-self: start; font-size: 13px; padding: 0 12px; min-height: 44px; }
.kk-tip { margin: 0 0 6px; }
