/* TTS IPAS: kisi teka-teki silang + papan huruf + daftar petunjuk */
.tt-body { position: relative; flex: 1; min-height: 0; display: flex; gap: clamp(8px, 1.6vw, 22px); padding: clamp(8px, 1.4vw, 18px); background: linear-gradient(135deg, var(--sky-50), var(--amber-100) 85%); }
.tt-main { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.tt-clue { flex: 0 0 auto; background: #fff; border: 3px solid var(--sky); border-radius: 14px; padding: 6px 12px; font-weight: 800; color: var(--ink); font-size: clamp(13px, 1.6vw, 22px); line-height: 1.25; min-height: 2.6em; display: flex; align-items: center; }
.tt-gridwrap { flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tt-grid { display: grid; gap: 3px; padding: 4px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tc { position: relative; background: #fff; border-radius: 3px; box-shadow: 0 0 0 2px var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; min-width: 0; min-height: 0; }
.tc.off { background: transparent; box-shadow: none; cursor: default; }
.tc .n { position: absolute; top: 1px; left: 3px; font-style: normal; font-weight: 800; color: var(--muted); font-size: calc(var(--cs, 40px) * .26); line-height: 1; pointer-events: none; }
.tc .l { font-weight: 800; color: var(--sky-d); font-size: calc(var(--cs, 40px) * .6); line-height: 1; pointer-events: none; }
.tc.in { background: var(--sky-100); }
.tc.ok { background: #bbf7d0; }
.tc.ok .l { color: var(--ok); }
.tc.cur { background: var(--amber); box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 3px var(--ink); }
.tc.cur .l { color: var(--ink); }
.tc.wrong { background: var(--rose-100); }
.tc.wrong .l { color: var(--bad); }
.tc.hint .l { color: var(--violet); }

.tt-side { flex: 0 0 clamp(300px, 40%, 560px); min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.tt-tools { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tt-time { font-weight: 800; font-variant-numeric: tabular-nums; background: #fff; border: 3px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: clamp(13px, 1.5vw, 20px); }
.tt-btn { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--sky); color: #fff; font: inherit; font-weight: 800; font-size: clamp(12px, 1.3vw, 17px); cursor: pointer; box-shadow: 0 3px 0 var(--sky-d); }
.tt-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sky-d); }
.tt-btn:disabled { opacity: .45; cursor: default; }

.tt-kb { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
.tt-kb .kr { display: flex; gap: 4px; justify-content: center; }
.tt-kb .k { flex: 1 1 0; max-width: 54px; min-width: 0; height: clamp(34px, 5.2vh, 52px); border: 0; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 800; font-size: clamp(14px, 1.8vw, 24px); cursor: pointer; box-shadow: 0 3px 0 var(--line); padding: 0; }
.tt-kb .k:active { background: var(--amber); transform: translateY(2px); box-shadow: none; }
.tt-kb .k.del { flex: 1.5 1 0; max-width: 80px; background: var(--rose-100); display: flex; align-items: center; justify-content: center; }
.tt-kb .k.del svg { width: 60%; max-width: 26px; height: auto; }

.tt-lists { flex: 1 1 0; min-height: 0; display: flex; gap: 8px; }
.tt-col { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; border-radius: 12px; border: 2px solid var(--line); overflow: hidden; }
.tt-col h2 { margin: 0; padding: 4px 10px; font-size: clamp(12px, 1.3vw, 17px); background: var(--sky-100); color: var(--sky-d); }
.tt-col ol { margin: 0; padding: 4px 6px; list-style: none; overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.tt-col li { padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: clamp(12px, 1.25vw, 17px); line-height: 1.25; color: var(--ink); }
.tt-col li .cn { font-weight: 800; color: var(--sky-d); }
.tt-col li.on { background: var(--amber-100); box-shadow: inset 0 0 0 2px var(--amber); }
.tt-col li.ok .cn::after { content: ' \2713'; color: var(--ok); }
.tt-col li.full { color: var(--muted); }
.tt-col li.full .ct { text-decoration: line-through; text-decoration-color: rgba(5,150,105,.6); }

.tt-toast { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: clamp(13px, 1.5vw, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 5; }
.tt-toast.show { opacity: 1; transform: translate(-50%, 0); }

.pk-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pk { position: relative; min-height: 48px; border: 3px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px; }
.pk .no { font-weight: 800; font-size: 1.1em; }
.pk .tt { font-size: .7em; color: var(--muted); font-variant-numeric: tabular-nums; }
.pk .tt:empty { display: none; }
.pk .ok { position: absolute; top: 1px; right: 4px; color: var(--ok); font-weight: 800; font-size: .8em; }
.pk[aria-pressed="true"] { border-color: var(--sky); background: var(--sky-100); }
.pk.done { border-color: var(--emerald); }
.hint { font-weight: 600; color: var(--muted); }

@media (max-width: 700px) and (orientation: portrait) {
  .tt-body { flex-direction: column; overflow-y: auto; }
  .tt-main { flex: 0 0 auto; }
  .tt-gridwrap { flex: 0 0 auto; height: min(92vw, 52vh); }
  .tt-side { flex: 0 0 auto; }
  .tt-lists { flex: 0 0 auto; height: 220px; }
}
@media (max-height: 520px) {
  .tt-body { padding: 6px 10px; gap: 8px; }
  .tt-main { gap: 4px; }
  .tt-clue { padding: 2px 10px; border-width: 2px; min-height: 2.4em; font-size: 13px; }
  .tt-side { gap: 4px; flex-basis: clamp(280px, 42%, 460px); }
  .tt-btn { min-height: 32px; padding: 0 10px; box-shadow: 0 2px 0 var(--sky-d); }
  .tt-kb { gap: 3px; } .tt-kb .kr { gap: 3px; }
  .tt-kb .k { height: 30px; font-size: 14px; box-shadow: 0 2px 0 var(--line); }
  .tt-col h2 { padding: 2px 8px; } .tt-col li { padding: 2px 5px; }
}
@media (prefers-reduced-motion: reduce) { .tt-toast { transition: none; } }
