/* Tabel Periodik: Jelajah, Tebak Lambang, Tebak Unsur, Susun Tabel, Golongan dan Periode */
.tp { --tp: #0e7490; --tp-soft: #cffafe; }
.tp-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, #ecfeff, #fff 60%); -webkit-overflow-scrolling: touch; }
.tp-view { display: flex; flex-direction: column; gap: clamp(6px, 1.2vh, 14px); flex: 1; min-height: 0; min-width: 0; }
.tp-view[hidden] { display: none; }
.tp-hud { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.tp-hud:empty { display: none; }
.tp-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: 8px; align-items: baseline; }
.tp-chip b { font-size: 1.2em; font-variant-numeric: tabular-nums; }
.tp-chip.on { background: var(--c); color: #fff; }
.tp-qn { font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.5vw, 17px); margin-left: 6px; }
.tp-ask { text-align: center; font-weight: 800; color: var(--ink); font-size: clamp(15px, 2.2vw, 26px); --c: var(--tp); }
.tp-ask small { color: var(--muted); font-weight: 700; }

/* jelajah */
.tp-filters { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; }
.tp-filters label { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; font-size: clamp(12px, 1.4vw, 16px); color: var(--ink); }
.tp-filters select { font: 700 clamp(13px, 1.4vw, 16px) var(--font); padding: 6px 8px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); min-height: 38px; max-width: 150px; }
.tp-mini { min-width: 40px; min-height: 38px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: 800 15px var(--font); color: var(--ink); cursor: pointer; }
.tp-mini:hover { border-color: var(--tp); }
.tp-zoom { display: inline-flex; gap: 4px; }
.tp-legend { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.tp-lg { display: inline-flex; align-items: center; gap: 5px; border: 2px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 1px 9px 1px 3px; font: 700 clamp(11px, 1.15vw, 13px) var(--font); cursor: pointer; min-height: 28px; }
.tp-lg i { width: 16px; height: 16px; border-radius: 50%; background: var(--k); border: 1px solid rgba(15,23,42,.25); }
.tp-lg[aria-pressed="true"] { border-color: var(--ink); background: var(--tp-soft); }
.tp-tblwrap { flex: 0 0 auto; overflow: auto; border: 2px solid var(--line); border-radius: 14px; background: #fff; padding: 6px; max-width: 100%; min-width: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.tp-tblwrap:focus-visible { outline: 3px solid var(--amber); }
.tp-grid { --cs: 52px; display: grid; width: max-content; margin: 0 auto; grid-template-columns: calc(var(--cs) * .5) repeat(18, var(--cs)); gap: 2px; }
.tp-ax { display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); font-size: max(9px, calc(var(--cs) * .22)); line-height: 1.1; }
.tp-ax small { font-size: .7em; font-weight: 700; }
.tp-grid[data-size="s"] .tp-ax small { display: none; }
.tp-el, .tp-slot, .tp-ph { position: relative; border-radius: max(3px, calc(var(--cs) * .08)); border: 0; padding: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font); color: #0f172a; line-height: 1.05; }
.tp-el { background: var(--k); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(15,23,42,.18); }
.tp-el:hover { box-shadow: inset 0 0 0 3px #0f172a; z-index: 2; }
.tp-el.dim { opacity: .16; }
.tp-el i { position: absolute; top: 1px; left: 3px; font-style: normal; font-weight: 700; font-size: max(8px, calc(var(--cs) * .19)); }
.tp-el b { font-size: calc(var(--cs) * .42); font-weight: 800; }
.tp-el .nm { display: none; font-size: calc(var(--cs) * .155); font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.tp-el .ms { display: none; font-size: calc(var(--cs) * .15); font-weight: 600; opacity: .85; }
.tp-grid[data-size="m"] .tp-el .nm, .tp-grid[data-size="l"] .tp-el .nm { display: block; }
.tp-grid[data-size="l"] .tp-el .ms { display: block; }
.tp-grid[data-size="m"] .tp-el b, .tp-grid[data-size="l"] .tp-el b { font-size: calc(var(--cs) * .36); }
.tp-ph { background: transparent; border: 2px dashed var(--k); font-weight: 800; font-size: max(8px, calc(var(--cs) * .17)); color: var(--muted); text-align: center; }
.tp-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px 0 2px; background: #fff; border-top: 2px solid var(--line); margin: 0 calc(-1 * clamp(8px, 1.6vw, 18px)); padding-left: 8px; padding-right: 8px; }
.tp-prog { font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.5vw, 17px); }
.tp-done { margin-top: 0; min-height: 48px; padding: 0 26px; font-size: clamp(16px, 1.8vw, 20px); }

/* kuis pilihan */
.tp-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: clamp(96px, 22vh, 220px); background: #fff; border: 4px solid var(--tp); border-radius: 26px; padding: 8px 14px; text-align: center; }
.tp-sym { font-weight: 800; font-size: clamp(60px, 15vh, 150px); line-height: 1.1; color: var(--ink); }
.tp-pn { font-weight: 800; font-size: clamp(30px, 7vh, 72px); color: var(--ink); line-height: 1.15; }
.tp-pn small { display: block; font-size: .4em; color: var(--muted); font-weight: 700; }
.tp-clues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 760px; text-align: left; }
.tp-clues li { background: var(--tp-soft); border-radius: 14px; padding: 6px 12px; font-weight: 700; color: var(--ink); font-size: clamp(14px, 1.9vw, 22px); line-height: 1.3; }
.tp-clues li b { color: var(--tp); }
.tp-more { text-align: center; }
.tp-more .secondary { min-height: 40px; font-size: 15px; padding: 0 18px; margin: 0; }
.tp-more[hidden] { display: none; }
.tp-opts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.4vw, 16px); }
@media (min-width: 900px) and (min-aspect-ratio: 5/3) { .tp-opts { grid-template-columns: repeat(4, 1fr); } }
.tp-opts[hidden], .tp-type[hidden] { display: none; }
.tp-opt { position: relative; min-height: clamp(56px, 10vh, 100px); padding: 6px 12px; border-radius: 20px; border: 4px solid var(--tp-soft); background: #fff; color: var(--ink); font: 800 clamp(18px, 2.8vw, 34px)/1.2 var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; }
.tp-opt:hover:not(:disabled) { border-color: var(--tp); }
.tp-opt kbd { position: absolute; top: 4px; left: 8px; font: 800 12px var(--font); color: var(--muted); opacity: .7; }
.tp-opt:disabled { cursor: default; }
.tp-opt.good, .tp-slot.good { background: #bbf7d0; border-color: var(--ok); }
.tp-opt.bad, .tp-slot.bad { background: #fecdd3; border-color: var(--bad); }
.tp-type { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tp-type input { font: 800 clamp(20px, 3vw, 32px) var(--font); padding: 8px 18px; border: 4px solid var(--tp); border-radius: 18px; text-align: center; width: min(320px, 100%); box-sizing: border-box; color: var(--ink); }
.tp-check { margin-top: 0; min-height: 56px; padding: 0 28px; font-size: 20px; }
.tp-fb { min-height: 1.4em; text-align: center; font-weight: 800; color: var(--muted); font-size: clamp(14px, 1.8vw, 21px); line-height: 1.35; }
.tp-fb.ok { color: var(--ok); } .tp-fb.bad { color: var(--bad); }
.tp-next { align-self: center; margin-top: 0; min-height: 52px; padding: 0 34px; font-size: clamp(18px, 2vw, 24px); }
.tp-next[hidden] { display: none; }

/* susun tabel */
.tp-bar { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 20px); flex-wrap: wrap; }
.tp-card { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: clamp(86px, 14vw, 130px); padding: 4px 12px; border-radius: 18px; background: var(--tp-soft); border: 4px solid var(--tp); color: var(--ink); box-shadow: 0 5px 0 rgba(14,116,144,.3); }
.tp-card b { font-size: clamp(28px, 5vh, 52px); line-height: 1.1; }
.tp-card span { font-weight: 800; font-size: clamp(13px, 1.8vw, 20px); }
.tp-card.done { opacity: .35; cursor: default; box-shadow: none; }
.tp-btip { margin: 0; color: var(--muted); font-weight: 700; font-size: clamp(12px, 1.5vw, 17px); max-width: 300px; text-align: left; }
.tp-slot { background: #f8fafc; border: 2px dashed #94a3b8; cursor: pointer; color: #0f172a; }
.tp-slot:not(.fill):hover, .tp-slot.hot { border-color: var(--tp); background: var(--tp-soft); border-style: solid; }
.tp-slot.fill { background: var(--k); border: 0; cursor: default; box-shadow: inset 0 0 0 1px rgba(15,23,42,.18); }
.tp-slot.fill b { font-size: calc(var(--cs) * .42); font-weight: 800; }
.tp-slot.fill.miss { box-shadow: inset 0 0 0 3px var(--bad); }
.tp-slot.good { background: #bbf7d0; border: 3px solid var(--ok); }
.tp-slot.bad { background: #fecdd3; border: 3px solid var(--bad); }
.tp-slot.target { box-shadow: 0 0 0 3px var(--ok); z-index: 2; }
.tp-ghost { position: fixed; z-index: 99; pointer-events: none; transform: translate(-50%, -60%); opacity: .92; }

/* kartu detail */
.tp-detail { text-align: center; }
.tp-dtop { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 3vw, 28px); flex-wrap: wrap; padding: 0 36px; }
.tp-big { display: flex; flex-direction: column; align-items: center; justify-content: center; width: clamp(110px, 24vh, 160px); aspect-ratio: 1; border-radius: 22px; background: var(--k, #fff); color: #0f172a; box-shadow: inset 0 0 0 2px rgba(15,23,42,.2); position: relative; }
.tp-big i { position: absolute; top: 6px; left: 10px; font-style: normal; font-weight: 800; font-size: 20px; }
.tp-big b { font-size: clamp(48px, 11vh, 76px); line-height: 1; font-weight: 800; }
.tp-big span { font-weight: 700; font-size: 14px; }
.tp-dname h2 { margin: 0; font-size: clamp(26px, 5vw, 44px); }
.tp-dname p { margin: 2px 0 0; font-weight: 800; color: var(--tp); }
.tp-fact { margin: 10px 0 0 !important; text-align: left; color: var(--ink) !important; font-weight: 700; }
.tp-props { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; margin: 8px 0 0; text-align: left; }
.tp-props div { background: var(--sky-50); border: 2px solid var(--line); border-radius: 14px; padding: 4px 10px; min-width: 0; }
.tp-props dt { font-weight: 800; font-size: 12px; color: var(--muted); }
.tp-props dd { margin: 0; font-weight: 800; color: var(--ink); font-size: clamp(14px, 1.8vw, 18px); }
.tp-note { margin: 8px 0 0 !important; font-size: clamp(12px, 1.5vw, 15px) !important; text-align: left; }
.tp-detail .actions { position: static; background: none; }
.tp-detail .actions .primary, .tp-detail .actions .secondary { min-height: 50px; font-size: 18px; padding: 0 24px; }
.tp-names { display: grid; gap: 6px; }
.tp-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; }
.tp-names input[hidden] { display: none; }
.tp-recap { display: flex; flex-direction: column; gap: 4px; font-size: clamp(15px, 2vw, 22px); margin-bottom: 4px; }

@media (max-height: 520px) {
  .tp-wrap { gap: 4px; padding: 4px 8px; }
  .tp-prompt { min-height: 64px; border-width: 3px; padding: 4px 10px; }
  .tp-sym { font-size: clamp(40px, 16vh, 80px); }
  .tp-clues { gap: 3px; } .tp-clues li { padding: 2px 10px; font-size: 13px; }
  .tp-opt { min-height: 44px; border-width: 3px; font-size: 18px; }
  .tp-opts { grid-template-columns: repeat(4, 1fr); }
  .tp-card { min-width: 80px; }
  .tp-foot { position: static; padding: 4px 8px; }
  .tp-legend { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 2px; }
  .tp-lg { flex: 0 0 auto; }
  .tp-props { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
