/* Trial Hall: page + game styles on top of tokens.css and base.css.
   The hub tiles are light reading cards; the play area (.th) is a dark "screen" via .dark-screen in base.css. */

/* ---------- hub ---------- */
.th-hub{display:flex;flex-direction:column;gap:2.6rem;margin-top:2rem}
.th-group h2{font-size:var(--step-2)}
.th-group > p{color:var(--dim);margin-top:.35rem}
.th-grid{list-style:none;margin:1.1rem 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:14px}
.th-tile{display:flex;flex-direction:column;gap:10px;height:100%;padding:18px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--panel)}
.th-tile h3{font-size:1.2rem}
.th-what{color:var(--text-2);font-size:1rem;line-height:1.5;flex:1}
.th-tags{display:flex;gap:6px;flex-wrap:wrap}
.th-best{font-size:.95rem;color:var(--dim)}
.th-diffs{display:flex;gap:8px;flex-wrap:wrap}
.th-diffs .btn{flex:1;justify-content:center;min-height:44px;min-width:80px}

/* ---------- the play area ---------- */
.th{margin-top:1.4rem;padding:0 clamp(12px,3vw,24px) clamp(18px,3vw,28px);border-radius:var(--r-lg);border:1px solid var(--line);background:var(--void);color:var(--text);font-size:1.05rem;line-height:1.5}
.th-bar{position:sticky;top:57px;z-index:5;display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;justify-content:space-between;margin:0 calc(-1 * clamp(12px,3vw,24px)) 16px;padding:12px clamp(12px,3vw,24px);border-radius:var(--r-lg) var(--r-lg) 0 0;background:color-mix(in srgb,var(--void) 92%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.th-stat{font-family:var(--mono);font-size:.95rem;color:var(--dim)}
.th-stat b{color:var(--text);font-weight:600}
.th .btn{min-height:44px}
.th .btn:disabled{opacity:.4;cursor:not-allowed}
.th .btn:disabled:hover{border-color:var(--line)}
.th .eyebrow{display:block}
.th-panel{background:var(--deck);border:1px solid var(--line);border-radius:var(--r-md);padding:16px;min-width:0}
.th-col{display:flex;flex-direction:column;gap:12px;align-items:center;text-align:center}
.th-col:empty{display:none}
.th-side{display:flex;flex-direction:column;gap:12px;min-width:0}
.th-cols{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:14px;align-items:start}
@media (max-width:760px){.th-cols{grid-template-columns:minmax(0,1fr)}}
.th-center{justify-content:center}
.th-ask{font-family:var(--display);font-weight:600;font-size:1.2rem;line-height:1.35}
.th-hint{font-size:1rem;color:var(--dim);max-width:54ch}
.th-hint b{color:var(--text)}
.th-in{font-family:var(--mono);font-size:1.6rem;width:7ch;padding:.3rem .6rem;border-radius:12px;border:1px solid var(--line);background:var(--panel);color:var(--text);text-align:center}
.th-in:focus{outline:2px solid var(--teal);outline-offset:2px}
.th-in:disabled{opacity:.5}
.th-fb{min-height:1.5em;font-family:var(--display);font-weight:600;font-size:1.1rem}
.th-fb:empty{min-height:1.5em}
.th-fb.ok,.th-okc{color:var(--ok)}
.th-fb.bad,.th-warn{color:var(--rose)}
.th-target{font-family:var(--mono);color:var(--teal);font-size:1.4rem}
.th-line{font-family:var(--mono);font-size:.95rem;color:var(--text-2)}
.th-tbl{border-collapse:collapse;margin:0 auto;font-family:var(--mono)}
.th-tbl td{border:1px solid var(--line);padding:4px 10px;text-align:center}

/* rules drop-downs (same feel as the lessons' "Go deeper") */
.th-rules{border:1px solid var(--line);border-radius:var(--r-md);background:var(--deck);padding:0 16px;margin-top:14px;font-size:1rem;color:var(--text-2)}
.th-side > .th-rules{margin-top:0}
.th-rules > summary{cursor:pointer;list-style:none;padding:14px 0;font-family:var(--display);font-weight:600;color:var(--text);display:flex;align-items:center;gap:10px}
.th-rules > summary::-webkit-details-marker{display:none}
.th-rules > summary::after{content:"+";margin-left:auto;font:500 1.3rem/1 var(--mono);color:var(--teal);transition:rotate var(--t-tap) var(--e-out)}
.th-rules[open] > summary::after{rotate:45deg}
.th-rules ul,.th-rules ol{margin:0 0 14px;padding-left:1.3rem;display:flex;flex-direction:column;gap:4px}
.th-rules p{margin:0 0 14px}

/* end-of-stage card */
.th-result{text-align:center;padding:30px 10px 12px;display:flex;flex-direction:column;gap:12px;align-items:center}
.th-big{font-family:var(--display);font-weight:800;font-size:3rem;line-height:1;color:var(--teal)}
.th-result p{max-width:52ch;color:var(--text-2)}
.th-yard-end{max-width:420px;margin:16px auto 0}

/* Block Count */
.th-cv{width:min(420px,100%);height:320px;display:block}

/* Box Sums */
.th-boxes{display:grid;gap:5px;justify-content:center;width:100%}
.th-box{aspect-ratio:1;display:flex;align-items:center;justify-content:center;border-radius:10px;font-family:var(--mono);font-weight:700;font-size:1.2rem;border:1px solid var(--line);background:var(--panel);color:var(--text)}
.th-box.neg{color:var(--rose)}
.th-box.on{background:var(--teal);border-color:var(--teal);color:var(--void)}

/* Garden Plots */
.th-yard{display:grid;gap:2px;touch-action:manipulation}
.th-plot{aspect-ratio:1;border-radius:3px;background:var(--raise);cursor:pointer}
.th-yard-end .th-plot{cursor:default}
.th-plot.used{box-shadow:inset 0 0 0 1px rgba(0,0,0,.25)}
.th-plot.fit{background:var(--ok)}
.th-plot.nofit{background:var(--rose)}
.th-offer{display:flex;flex-direction:column;align-items:center;gap:2px;width:112px;padding:10px 6px;border-radius:var(--r-sm);border:1px solid var(--line);background:var(--panel);color:var(--text);font:inherit;cursor:pointer}
.th-offer:hover{border-color:var(--teal)}
.th-offer.sel{border-color:var(--teal);box-shadow:0 0 0 1px var(--teal) inset}
.th-offer-pic{width:64px;height:64px}
.th-offer b{font-family:var(--mono);font-size:1rem}
.th-offer span:last-child{font-size:.95rem;color:var(--dim)}
.th-cell{fill:var(--teal-glow);stroke:var(--void);stroke-width:.06}

/* Card Recall */
.th-cgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.th-pslot{padding:4px;aspect-ratio:5/7;background:transparent;border:2px solid transparent;border-radius:12px;cursor:pointer}
.th-pslot.sel{border-color:var(--teal);background:color-mix(in srgb,var(--teal) 14%,transparent)}
.th-pslot.best{border-color:var(--ok)}
.th-pslot.sel.best{border-color:var(--teal);box-shadow:0 0 0 3px var(--ok)}
.th-pcard{width:100%;height:100%;min-width:44px;min-height:62px;border-radius:9px;background:var(--text);color:var(--void);font-family:var(--mono);font-weight:700;font-size:1.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1}
.th-pcard.red{color:var(--dusk)}
.row > .th-pcard{width:56px;height:78px;flex:none}
.th-pback{width:100%;height:100%;border-radius:9px;background:repeating-linear-gradient(45deg,var(--teal-deep) 0 6px,var(--raise) 6px 12px);border:1px solid var(--line)}

/* Stone Stack: three stands in teal, mint and rose */
.c-R{--sc:var(--teal)} .c-G{--sc:var(--ok)} .c-B{--sc:var(--rose)} .c-A{--sc:var(--silver)}
.th-stands{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.th-stand{border-radius:var(--r-md);border:1px solid var(--line);background:var(--deck);padding:10px;display:flex;flex-direction:column;gap:8px;min-height:250px;min-width:0}
.th-stand.boom{animation:th-boom var(--t-reveal)}
@keyframes th-boom{from{background:color-mix(in srgb,var(--rose) 40%,var(--deck))}to{background:var(--deck)}}
.th-stand-hd{display:flex;justify-content:space-between;align-items:baseline;gap:6px}
.th-stand-nm{font-family:var(--display);font-weight:700;color:var(--sc)}
.th-stand-tt{font-family:var(--mono);font-size:1.6rem;font-weight:700}
.th-stand-sub{font-size:.95rem;color:var(--dim)}
.th-stand-prev{font-family:var(--mono);font-size:.95rem;text-align:center;min-height:1.4em}
.th-stand .btn{width:100%;justify-content:center;padding-inline:8px}
.th-gauge{height:8px;border-radius:9px;background:var(--void);overflow:hidden}
.th-gauge i{display:block;height:100%;border-radius:9px;background:var(--sc);transition:width .3s}
.th-pile{flex:1;display:flex;flex-direction:column-reverse;gap:4px;align-items:center}
.th-rock{width:min(78px,90%);height:26px;border-radius:13px;background:var(--text);color:var(--void);font-family:var(--mono);font-weight:700;display:flex;align-items:center;justify-content:center;font-size:.95rem}
.th-queue{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end}
.th-stone{width:44px;height:58px;border-radius:10px;background:var(--text);color:var(--void);font-family:var(--mono);font-weight:700;font-size:1.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1;border-bottom:6px solid var(--sc,var(--silver))}
.th-stone small{font-size:.6rem;font-weight:600;letter-spacing:.03em}
.th-stone.cur{width:62px;height:82px;font-size:1.9rem;outline:3px solid var(--teal);outline-offset:2px}
.th-stone.done{opacity:.25}
.th-stone.hid{background:var(--panel);color:var(--dim);border-bottom-color:var(--line)}
.th-log{max-height:220px;overflow:auto;font-family:var(--mono);font-size:.95rem;color:var(--dim);display:flex;flex-direction:column-reverse;gap:3px;margin-top:6px}
.th-log .bad{color:var(--rose)}
@media (max-width:760px){.th-bar{position:static}}
@media (max-width:600px){.th-stand{min-height:200px;padding:8px}.th-stand-tt{font-size:1.3rem}}

/* Cipher Cards */
.th-clues{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.th-clues button{width:100%;text-align:left;padding:9px 12px;border-radius:var(--r-sm);background:var(--panel);border:1px solid var(--line);color:var(--text);font-family:var(--mono);font-size:1rem;cursor:pointer}
.th-clues button.done{opacity:.4;text-decoration:line-through}
.th-ngrid{overflow-x:auto}
.th-ngrid table{border-collapse:separate;border-spacing:4px;margin:0 auto}
.th-ngrid th{font-family:var(--mono);color:var(--dim);font-weight:500;padding:0 4px}
.th-ngrid td button{width:40px;height:40px;padding:0;border-radius:8px;border:1px solid var(--line);background:var(--panel);color:var(--text);font-family:var(--mono);font-weight:700;font-size:1rem;cursor:pointer}
.th-ngrid td button.x{color:var(--rose);background:color-mix(in srgb,var(--rose) 12%,var(--panel))}
.th-ngrid td button.o{background:var(--teal);color:var(--void);border-color:var(--teal)}
@media (max-width:420px){.th-ngrid td button{width:32px;height:36px}}

/* Drills */
.th-flash{font-family:var(--mono);font-size:clamp(3.6rem,16vw,6.5rem);font-weight:700;min-height:1.3em;line-height:1.3}
.th-flash.th-seq{font-size:clamp(1.5rem,6.5vw,2.4rem)}
.th-lvl{display:flex;gap:3px}
.th-lvl i{width:10px;height:10px;border-radius:2px;background:var(--line)}
.th-lvl i.on{background:var(--teal)}
.th-rgrid{display:grid;gap:6px;width:min(360px,100%)}
.th-rgrid button{aspect-ratio:1;padding:0;border-radius:10px;border:1px solid var(--line);background:var(--panel);cursor:pointer}
.th-rgrid button.lit{background:var(--teal);border-color:var(--teal)}
.th-rgrid button.hit{background:var(--ok);border-color:var(--ok)}
.th-rgrid button.miss{background:var(--rose);border-color:var(--rose)}
.th-rgrid button.ans{box-shadow:0 0 0 3px var(--teal) inset}
.th-target-shape{width:150px;height:150px;padding:10px;border-radius:var(--r-md);background:var(--panel);border:1px solid var(--teal)}
.th-shapes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;width:100%}
@media (max-width:520px){.th-shapes{grid-template-columns:repeat(2,minmax(0,1fr))}}
.th-shapes button{padding:8px;aspect-ratio:1;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-sm);cursor:pointer}
.th-shapes button:hover{border-color:var(--teal)}
.th-shapes button.right{border-color:var(--ok);box-shadow:0 0 0 3px var(--ok) inset}
.th-shapes button.wrong{border-color:var(--rose);box-shadow:0 0 0 3px var(--rose) inset}
.th-cont:empty{display:none}
