/* Letter tray — student and teacher screens. Builds on games-core.css. */
.lt-app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.lt-app > main { flex: 1 1 auto; min-height: 0; }
.wg-rank { width: 1.4rem; text-align: center; font-weight: 800; color: var(--wg-muted); font-size: .85rem; }

/* student layout */
.lt-main { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: .75rem; padding: .75rem; }
.lt-stage { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .6rem; }
.lt-stage > .lt-hello { grid-row: 2 / span 2; }
.lt-side { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
.lt-side > .wg-card { min-height: 0; display: flex; flex-direction: column; padding: .75rem; }
.lt-side > .wg-card > .wg-people, .lt-side > .wg-card > .lt-feed { flex: 1; min-height: 0; overflow: auto; }
.lt-side h3, .lt-host-left h3 { margin: 0 0 .45rem; font-size: .95rem; }
.lt-mine { max-height: 6.2rem; overflow: auto; }
.lt-note { margin: -.2rem 0 .4rem; font-size: .8rem; }

/* header */
.lt-head { display: flex; align-items: center; gap: .75rem; min-height: 3.4rem; padding: .35rem .75rem; }
.lt-what { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.lt-label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--wg-muted); }
.lt-prompt { font-size: 1.15rem; font-weight: 800; color: var(--wg-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-count { font-weight: 800; background: var(--wg-soft); padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; font-size: .85rem; }
.lt-rush { font-weight: 800; color: var(--wg-gold-ink); background: #fff7cc; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; font-size: .85rem; animation: lt-glow 1.6s ease-in-out infinite; }
html[data-wg-theme="dark"] .lt-rush { background: #3a3410; color: #fde68a; }

/* word slots */
.lt-slots-card { min-height: 0; overflow: auto; padding: .6rem .75rem; }
.lt-slots { display: grid; gap: .55rem; }
.lt-slot-group { display: grid; gap: .3rem; }
.lt-slot-len { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--wg-muted); }
.lt-slot-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.lt-slot { display: grid; gap: .15rem; padding: .3rem .4rem; border-radius: .7rem; background: var(--wg-soft); min-width: 0; max-width: 100%; }
.lt-slot small { font-size: .72rem; font-weight: 700; color: var(--wg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
.lt-slot small.lt-clue { color: var(--wg-ink); font-weight: 600; white-space: normal; }
.lt-boxes { display: flex; gap: .18rem; }
.lt-boxes i { display: inline-grid; place-items: center; width: 1.6rem; height: 1.85rem; border-radius: .35rem; background: var(--wg-card); border-bottom: 3px solid var(--wg-line); font-style: normal; font-weight: 900; font-size: 1.05rem; }
.lt-slot.is-got { background: var(--wg-ok-bg); }
.lt-slot.is-got .lt-boxes i { border-bottom-color: var(--wg-ok); animation: lt-flip .45s ease both; }
.lt-slot.is-got .lt-boxes i:nth-child(2) { animation-delay: .05s; } .lt-slot.is-got .lt-boxes i:nth-child(3) { animation-delay: .1s; }
.lt-slot.is-got .lt-boxes i:nth-child(4) { animation-delay: .15s; } .lt-slot.is-got .lt-boxes i:nth-child(n+5) { animation-delay: .2s; }
.lt-slot.is-me { box-shadow: inset 0 0 0 2px var(--wg-gold); }
.lt-slot.is-missed { background: var(--wg-warn-bg); }
.lt-slot.is-missed .lt-boxes i { color: var(--wg-warn); }
.wg-tag.is-me { box-shadow: inset 0 0 0 2px var(--wg-gold); }

/* tray + build */
.lt-play-card { display: grid; gap: .55rem; padding: .7rem .8rem; justify-items: center; }
.lt-build { position: relative; display: flex; justify-content: center; align-items: center; gap: .3rem; min-height: 3.3rem; width: 100%; padding: .3rem; border-radius: .9rem; background: var(--wg-soft); cursor: pointer; }
.lt-build span { display: inline-grid; place-items: center; width: 2.6rem; height: 2.8rem; border-radius: .55rem; background: var(--wg-card); box-shadow: 0 2px 0 var(--wg-line); font-weight: 900; font-size: 1.5rem; animation: wg-pop .18s ease both; }
.lt-build span.is-wild { background: #ede9fe; color: #5b21b6; }
html[data-wg-theme="dark"] .lt-build span.is-wild { background: #2a2058; color: #c4b5fd; }
.lt-build em { font-style: normal; font-weight: 600; }
.lt-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.wg-page .lt-tile, .lt-tile { width: 3.3rem; height: 3.5rem; display: inline-grid; place-items: center; border: 0; border-radius: .75rem; font-weight: 900; font-size: 1.7rem; cursor: pointer; padding: 0;
    background: linear-gradient(180deg, #fffdf2, #fff3b0); color: #3b2f00; box-shadow: 0 4px 0 #d4b200, 0 6px 14px rgba(0, 26, 114, .12); transition: transform .12s ease, box-shadow .12s ease, opacity .15s ease; }
.lt-tile:hover:not([disabled]) { transform: translateY(-2px); }
.lt-tile:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 2px 0 #d4b200; }
.lt-tile[disabled] { cursor: default; }
.lt-tile.is-used { opacity: .25; transform: scale(.9); }
.lt-tile.is-hidden { background: linear-gradient(180deg, #ede9fe, #c4b5fd); color: #3b0764; box-shadow: 0 4px 0 #7c3aed, 0 6px 14px rgba(0, 26, 114, .12); }
.lt-tile.is-fake { outline: 3px dashed var(--wg-bad); outline-offset: -3px; }
html[data-wg-theme="dark"] .lt-tile { background: linear-gradient(180deg, #fff7c2, #f5d742); color: #2a2100; }
html[data-wg-theme="dark"] .lt-tile.is-hidden { background: linear-gradient(180deg, #ddd6fe, #a78bfa); color: #2e1065; box-shadow: 0 4px 0 #6d28d9, 0 6px 14px rgba(0, 0, 0, .3); }
.lt-tiles.lt-deal .lt-tile { animation: lt-deal .35s cubic-bezier(.2,.9,.3,1.2) both; }
.lt-tiles.lt-deal .lt-tile:nth-child(2) { animation-delay: .03s; } .lt-tiles.lt-deal .lt-tile:nth-child(3) { animation-delay: .06s; }
.lt-tiles.lt-deal .lt-tile:nth-child(4) { animation-delay: .09s; } .lt-tiles.lt-deal .lt-tile:nth-child(5) { animation-delay: .12s; }
.lt-tiles.lt-deal .lt-tile:nth-child(6) { animation-delay: .15s; } .lt-tiles.lt-deal .lt-tile:nth-child(n+7) { animation-delay: .18s; }
.lt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.lt-tip { margin: 0; font-size: .8rem; text-align: center; }
.lt-float { position: absolute; right: 1rem; top: -.4rem; font-weight: 900; font-size: 1.3rem; color: var(--wg-ok); background: none !important; box-shadow: none !important; width: auto !important; animation: lt-float 1s ease-out both !important; pointer-events: none; }
.lt-pop { animation: lt-pop .4s ease; }

/* lobby hello */
.lt-hello { display: grid; align-content: center; justify-items: center; text-align: center; gap: .4rem; padding: 1.4rem; }
.lt-hello h2 { margin: 0; font-size: 1.8rem; color: var(--wg-accent); }
.lt-how { text-align: left; display: grid; gap: .45rem; margin: .6rem 0 0; padding-left: 1.3rem; max-width: 36rem; }
.lt-how li::marker { color: var(--wg-accent); font-weight: 900; }

/* feed */
.lt-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; align-content: start; }
.lt-feed li { display: flex; align-items: center; gap: .45rem; padding: .35rem .5rem; border-radius: .6rem; background: var(--wg-soft); font-size: .88rem; min-width: 0; }
.lt-feed li.wg-muted { background: none; }
.lt-feed li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7rem; }
.lt-feed li em { margin-left: auto; font-style: normal; font-weight: 800; color: var(--wg-ok); white-space: nowrap; }
.lt-feed li.is-me { box-shadow: inset 0 0 0 2px var(--wg-gold); }
.lt-feed li.is-new { animation: wg-pop .35s ease both; }
.lt-feed li.is-off { opacity: .6; }
.lt-feed li.is-off .lt-word { text-decoration: line-through; }
.lt-feed li.is-off em { color: var(--wg-bad); }
.lt-feed .wg-btn { padding: .15rem .45rem; font-size: .75rem; }
.lt-word { font-weight: 800; letter-spacing: .04em; }

/* reveal / results overlay */
.lt-line { font-size: 1.05rem; font-style: italic; margin: .3rem 0 .6rem; color: var(--wg-ink); }
.lt-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .45rem; }
.lt-facts div { display: grid; gap: .05rem; padding: .5rem; border-radius: .8rem; background: var(--wg-soft); }
.lt-facts div:nth-child(1) { background: var(--wg-p1); } .lt-facts div:nth-child(2) { background: var(--wg-p3); } .lt-facts div:nth-child(3) { background: var(--wg-p4); }
.lt-facts small { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--wg-muted); }
.lt-facts b { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; }
.lt-facts span { font-size: .85rem; }
.lt-missed { display: grid; gap: .3rem; text-align: left; max-height: 11rem; overflow: auto; }
.lt-missed div { display: flex; gap: .5rem; align-items: baseline; padding: .3rem .5rem; border-radius: .5rem; background: var(--wg-warn-bg); }
.lt-missed b { letter-spacing: .06em; }
.lt-missed span { font-size: .85rem; color: var(--wg-muted); }
.lt-table-wrap { max-height: 14rem; overflow: auto; }
.lt-mine-row td { background: rgba(255, 215, 0, .18); font-weight: 700; }

/* teacher layout */
.lt-host-main { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr) 19rem; gap: .75rem; padding: .75rem; }
.lt-host-left { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: .6rem; }
.lt-host-left > .wg-card { padding: .8rem; }
.lt-host-left .wg-join-code { font-size: 2.2rem; margin: .1rem 0 .4rem; }
.lt-people-card { min-height: 0; display: flex; flex-direction: column; }
.lt-people-card .wg-people { flex: 1; min-height: 0; }
.lt-ctrls { display: grid; gap: .5rem; }
.lt-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.lt-row:empty { display: none; }
.lt-row > .wg-btn { flex: 1; }
.lt-check { font-size: .85rem; font-weight: 600; cursor: pointer; flex-wrap: nowrap; }
.lt-check input { width: 1.05rem; height: 1.05rem; margin: 0; flex: none; accent-color: var(--wg-accent); }
.lt-host-left .wg-join-url { font-size: .9rem; overflow-wrap: anywhere; margin: .1rem 0; }
.lt-host-side { grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr); }
.lt-host-stage { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .6rem; }
.lt-center { min-height: 0; display: flex; flex-direction: column; gap: .6rem; overflow: auto; }
.lt-host-tray { display: grid; justify-items: center; gap: .3rem; padding: .9rem; }
.wg-page .lt-tiles.is-big .lt-tile, .lt-tiles.is-big .lt-tile { width: 3.8rem; height: 4rem; font-size: 2rem; cursor: default; }
.lt-legend { margin: .2rem 0 0; font-size: .8rem; display: flex; align-items: center; gap: .35rem; }
.lt-key { width: .9rem; height: .9rem; border-radius: .25rem; display: inline-block; }
.lt-key.is-hidden { background: #c4b5fd; } .lt-key.is-fake { border: 2px dashed var(--wg-bad); margin-left: .6rem; }
.lt-hslots-card { padding: .7rem; flex: 1 1 auto; min-height: 0; overflow: auto; }
.lt-hslots { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .4rem; }
.lt-hslot { display: grid; padding: .35rem .55rem; border-radius: .6rem; background: var(--wg-soft); min-width: 0; }
.lt-hslot b { letter-spacing: .06em; }
.lt-hslot span { font-size: .78rem; color: var(--wg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-hslot.is-got { background: var(--wg-ok-bg); }
.lt-hslot.is-got b { color: var(--wg-ok); }
.lt-extras { margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .85rem; }
.lt-reveal-card { text-align: center; padding: .7rem; background: var(--wg-p4); }
.lt-reveal-card p { margin: .2rem 0; }
.lt-lobby-big { display: grid; place-items: center; align-content: center; text-align: center; gap: .5rem; padding: 1.2rem; flex: 1; }
.lt-lobby-big .wg-join-code { font-size: clamp(3rem, 8vw, 5.5rem); }
.lt-lobby-big .wg-chips { justify-content: center; max-height: 9rem; overflow: auto; }
.lt-results { padding: .9rem; }

@keyframes lt-deal { from { opacity: 0; transform: translateY(14px) rotate(-6deg) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes lt-flip { 0% { transform: rotateX(90deg); } 100% { transform: none; } }
@keyframes lt-float { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-2.2rem); } }
@keyframes lt-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes lt-glow { 50% { box-shadow: 0 0 0 4px rgba(255, 215, 0, .35); } }

@media (max-width: 1100px) {
    .lt-host-main { grid-template-columns: 15rem minmax(0, 1fr); }
    .lt-host-main > .lt-side { grid-column: 1 / -1; grid-template-rows: auto; grid-template-columns: 1fr 1fr; }
    .lt-app.lt-host-scroll, #lt-host { height: auto; min-height: 100dvh; overflow: visible; }
}
@media (max-width: 820px) {
    .lt-app { height: auto; min-height: 100dvh; overflow: visible; }
    .lt-main, .lt-host-main { grid-template-columns: 1fr; }
    .lt-host-main > .lt-side { grid-template-columns: 1fr; }
    .lt-side { grid-template-rows: auto; }
    .lt-side > .wg-card > .wg-people, .lt-side > .wg-card > .lt-feed { max-height: 14rem; }
    .lt-host-left { grid-template-rows: auto; }
    .wg-page .lt-tile { width: 2.9rem; height: 3.1rem; font-size: 1.45rem; }
    .lt-build span { width: 2.2rem; height: 2.4rem; font-size: 1.25rem; }
    .wg-steps { display: none; }
}
@media (max-height: 760px) and (min-width: 821px) {
    .lt-main, .lt-host-main { padding: .55rem; gap: .55rem; }
    .lt-stage, .lt-side, .lt-host-left, .lt-host-stage { gap: .45rem; }
    .lt-tip { display: none; }
    .lt-tile { width: 3rem; height: 3.2rem; font-size: 1.55rem; }
    .lt-tiles.is-big .wg-page .lt-tile, .lt-tile { width: 3.3rem; height: 3.5rem; font-size: 1.7rem; }
    .lt-play-card { gap: .4rem; padding: .5rem .7rem; }
    .lt-build { min-height: 2.9rem; }
    .lt-build span { width: 2.3rem; height: 2.5rem; font-size: 1.3rem; }
    .lt-host-left > .wg-card { padding: .6rem; }
    .lt-host-left .wg-join-code { font-size: 1.8rem; margin: 0 0 .3rem; }
}
@media (prefers-reduced-motion: reduce) {
    .lt-app *, .wg-overlay * { animation: none !important; transition: none !important; }
}
.lt-app .wg-people { align-content: start; }

/* teacher reveal: missed words show their letters */
.lt-hslot.is-missed { background: var(--wg-warn-bg); }
.lt-hslot.is-missed > span:last-child { color: var(--wg-warn); font-weight: 700; }
.lt-mini { display: flex; gap: 2px; flex-wrap: wrap; }
.lt-mini i { font-style: normal; font-weight: 800; display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.3rem; padding: 0 .1rem; border-radius: .25rem; background: var(--wg-card); color: var(--wg-ink); font-size: .85rem; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.lt-missed-line { font-size: .9rem; }
.lt-missed-line b { color: var(--wg-warn); letter-spacing: .04em; }
.lt-feed li.lt-feed-head { background: none; padding: .35rem .2rem .1rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--wg-muted); }
