/* Draw and guess — student and teacher screens. Builds on games-core.css. */
.dg-app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.dg-app > main { flex: 1 1 auto; min-height: 0; }
.dg-host-stage { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .6rem; }
.dg-center { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); }
.dg-center > .wg-card { min-height: 0; overflow: auto; }
.dg-main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: .75rem; padding: .75rem; }
.dg-col { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .5rem; }
.dg-side { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
.dg-side > .wg-card { min-height: 0; display: flex; flex-direction: column; padding: .75rem; }
.dg-side > .wg-card > .wg-people, .dg-side > .wg-card > .dg-feed { flex: 1; min-height: 0; overflow: auto; }

/* round header */
.dg-head { display: flex; align-items: center; gap: .75rem; min-height: 3.4rem; padding: .35rem .75rem; }
.dg-head .dg-what { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.dg-label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--wg-muted); }
.dg-label.is-practice { color: var(--wg-warn); }
.dg-word { font-size: 1.45rem; font-weight: 900; letter-spacing: .08em; color: var(--wg-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-mask { display: flex; flex-wrap: wrap; gap: .25rem; }
.dg-mask i { display: inline-grid; place-items: center; width: 1.55rem; height: 1.85rem; border-radius: .35rem; background: var(--wg-soft); border-bottom: 3px solid var(--wg-accent); font-style: normal; font-weight: 900; font-size: 1.05rem; animation: wg-pop .25s ease both; }
.dg-mask i.is-gap { background: transparent; border: 0; width: .5rem; }
.dg-worth { font-weight: 800; color: var(--wg-gold-ink); background: #fff7cc; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; font-size: .85rem; }
html[data-wg-theme="dark"] .dg-worth { background: #3a3410; color: #fde68a; }

/* board */
.dg-boardwrap { min-height: 0; display: grid; place-items: center; container-type: size; }
.dg-board { position: relative; width: min(100cqw, 100cqh); aspect-ratio: 1; border-radius: 1rem; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--wg-line), var(--wg-shadow); }
@supports not (container-type: size) { .dg-board { width: min(100%, calc(100dvh - 15rem)); } }
.dg-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dg-board .dg-over { cursor: crosshair; }
.dg-board.is-off .dg-over { cursor: default; }
.dg-board-note { position: absolute; left: 50%; top: .6rem; transform: translateX(-50%); background: rgba(0, 26, 114, .85); color: #fff; font-weight: 700; font-size: .85rem; padding: .3rem .7rem; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.dg-board-note.is-warn { background: rgba(180, 83, 9, .92); }
.dg-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #64748b; font-weight: 700; padding: 2rem; pointer-events: none; }
.dg-empty b { display: block; font-size: 2.6rem; }

/* toolbar */
.dg-tools { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; padding: .4rem .5rem; }
.dg-tools .dg-group { display: inline-flex; align-items: center; gap: .2rem; padding: .15rem; border-radius: .7rem; background: var(--wg-soft); }
.dg-tool { width: 2.3rem; height: 2.3rem; display: inline-grid; place-items: center; border: 0; border-radius: .55rem; background: transparent; cursor: pointer; color: var(--wg-ink); padding: 0; }
.dg-tool:hover { background: var(--wg-card); }
.dg-tool.is-on { background: var(--wg-card); box-shadow: inset 0 0 0 2px var(--wg-accent); }
.dg-tool[disabled] { opacity: .35; cursor: not-allowed; }
.dg-tool svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dg-size i { display: block; border-radius: 999px; background: currentColor; }
.dg-swatches { display: grid; grid-template-columns: repeat(8, 1.15rem); gap: .2rem; }
.dg-swatch { width: 1.15rem; height: 1.15rem; border-radius: .3rem; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.dg-swatch.is-on { box-shadow: 0 0 0 2px var(--wg-card), 0 0 0 4px var(--wg-accent); }
.dg-recent { display: inline-flex; gap: .2rem; }
.dg-recent .dg-swatch { width: 1.5rem; height: 1.5rem; border-radius: 999px; }
.dg-picker { position: relative; width: 2.3rem; height: 2.3rem; border-radius: .55rem; overflow: hidden; display: inline-grid; place-items: center; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); cursor: pointer; }
.dg-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dg-current { width: 1.4rem; height: 1.4rem; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.dg-save { font-size: .78rem; font-weight: 700; color: var(--wg-muted); white-space: nowrap; margin-left: auto; }
.dg-save.is-bad { color: var(--wg-bad); }

/* guessing */
.dg-guess { display: flex; gap: .5rem; padding: .5rem; align-items: center; }
.dg-guess input { flex: 1; min-width: 0; padding: .7rem .9rem; font-size: 1.15rem; border-radius: .8rem; border: 2px solid var(--wg-line); background: var(--wg-card); }
.dg-guess input:focus { border-color: var(--wg-accent); outline: none; }
.dg-guess .dg-hint { font-size: .85rem; font-weight: 700; color: var(--wg-muted); white-space: nowrap; }
.dg-guess.is-right input { border-color: var(--wg-ok); background: var(--wg-ok-bg); }
.dg-guess.is-close input { border-color: var(--wg-warn); }

/* feed */
.dg-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; font-size: .92rem; }
.dg-feed li { padding: .3rem .5rem; border-radius: .55rem; background: var(--wg-soft); animation: wg-pop .2s ease both; display: flex; gap: .35rem; align-items: baseline; flex-wrap: wrap; }
.dg-feed li b { font-weight: 800; }
.dg-feed li.is-right { background: var(--wg-ok-bg); color: var(--wg-ok); font-weight: 700; }
.dg-feed li.is-close { background: var(--wg-warn-bg); color: var(--wg-warn); }
.dg-feed li.is-hidden { opacity: .5; text-decoration: line-through; }
.dg-feed li .dg-acts { margin-left: auto; display: inline-flex; gap: .2rem; }
.dg-feed .wg-btn.is-sm { padding: .15rem .4rem; font-size: .72rem; }

/* lobby & pairs roster */
.dg-hello { text-align: center; }
.dg-hello h2 { font-size: 1.35rem; margin: .1rem 0 .3rem; }
.dg-roster { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; overflow: auto; }
.dg-roster button { width: 100%; display: flex; align-items: center; gap: .5rem; padding: .5rem .65rem; border-radius: .65rem; border: 1px solid var(--wg-line); background: var(--wg-card); cursor: pointer; font-weight: 700; text-align: left; }
.dg-roster button:hover { background: var(--wg-soft); }
.dg-roster button.is-picked { box-shadow: inset 0 0 0 2px var(--wg-accent); }
.dg-roster button.is-wants { background: var(--wg-ok-bg); }
.dg-roster button span { flex: 1; }
.dg-vs { display: flex; justify-content: space-around; text-align: center; font-weight: 800; }
.dg-vs b { display: block; font-size: 1.8rem; }

/* reveal */
.dg-reveal .dg-got { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin: .4rem 0; }
.dg-reveal .dg-got span { background: var(--wg-ok-bg); color: var(--wg-ok); border-radius: 999px; padding: .25rem .65rem; font-weight: 800; animation: wg-pop .3s ease both; }
.dg-reveal .dg-got span:nth-child(2) { animation-delay: .08s; } .dg-reveal .dg-got span:nth-child(3) { animation-delay: .16s; } .dg-reveal .dg-got span:nth-child(n+4) { animation-delay: .24s; }
.dg-funny { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .3rem; }
.dg-funny li { background: var(--wg-soft); border-radius: .6rem; padding: .35rem .6rem; font-style: italic; }
.dg-funny li small { font-style: normal; color: var(--wg-muted); }
.dg-next { margin-top: .6rem; font-weight: 700; color: var(--wg-muted); }
.dg-reveal-mini { position: absolute; inset: auto .6rem .6rem .6rem; background: rgba(0, 26, 114, .92); color: #fff; border-radius: .9rem; padding: .6rem .8rem; text-align: center; font-weight: 700; animation: wg-rise .3s ease both; }
.dg-reveal-mini b { color: #FFD700; font-size: 1.3rem; letter-spacing: .06em; }

/* results */
.dg-results { width: min(96vw, 46rem) !important; }
.dg-mine { background: var(--wg-p4) !important; }
.dg-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; margin-top: .6rem; text-align: left; }
.dg-gallery figure { margin: 0; background: var(--wg-soft); border-radius: .7rem; padding: .35rem; animation: wg-pop .3s ease both; }
.dg-gallery canvas { width: 100%; aspect-ratio: 1; border-radius: .5rem; display: block; background: #fff; }
.dg-gallery figcaption { font-size: .8rem; padding: .25rem .15rem 0; }
.dg-gallery figcaption b { display: block; font-size: .9rem; }

/* teacher */
.dg-host-main { min-height: 0; display: grid; grid-template-columns: 17.5rem minmax(0, 1fr) 19rem; gap: .75rem; padding: .75rem; }
.dg-host-left { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: .6rem; }
.dg-host-left > .wg-card { padding: .8rem; }
.dg-host-left .wg-people { max-height: 100%; }
.dg-ctrls { display: grid; gap: .45rem; }
.dg-ctrls .wg-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.dg-ctrls .wg-row > .wg-btn { flex: 1; }
.dg-pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; overflow: auto; min-height: 0; align-content: start; }
.dg-pair { padding: .55rem; display: grid; gap: .35rem; }
.dg-pair .dg-board { width: 100%; }
.dg-pair header { display: flex; justify-content: space-between; align-items: center; gap: .4rem; font-weight: 800; font-size: .9rem; }
.dg-pair footer { display: flex; justify-content: space-between; align-items: center; gap: .3rem; font-size: .85rem; }
.dg-host-stage { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .5rem; }
.dg-lobby-big { display: grid; place-items: center; text-align: center; gap: .5rem; padding: 1.2rem; }
.dg-lobby-big .wg-join-code { font-size: clamp(3rem, 8vw, 5.5rem); }
.dg-lobby-big .wg-chips { justify-content: center; max-height: 9rem; overflow: auto; }

@media (max-width: 1100px) {
    .dg-host-main { grid-template-columns: 15rem minmax(0, 1fr); }
    .dg-host-main > .dg-side { grid-column: 1 / -1; grid-template-rows: auto; }
    .dg-app { height: auto; min-height: 100dvh; overflow: visible; }
}
@media (max-width: 820px) {
    .dg-app { height: auto; min-height: 100dvh; overflow: visible; }
    .dg-main, .dg-host-main { grid-template-columns: 1fr; }
    .dg-board { width: min(100%, 72dvh); }
    .dg-boardwrap { container-type: normal; }
    .dg-side { grid-template-rows: auto; }
    .dg-side > .wg-card > .wg-people, .dg-side > .wg-card > .dg-feed { max-height: 14rem; }
    .wg-steps li:not(.is-on) { display: none; }
    .wg-brand span { max-width: 9rem; }
    .dg-host-left { grid-template-rows: auto; }
}
@media (max-height: 760px) and (min-width: 821px) {
    .wg-bar { --wg-bar: 3rem; }
    .dg-main, .dg-host-main { padding: .55rem; gap: .55rem; }
    .dg-head { min-height: 3rem; padding: .25rem .6rem; }
    .dg-tool, .dg-picker { width: 2.1rem; height: 2.1rem; }
    .dg-guess { padding: .35rem; }
    .dg-guess input { padding: .55rem .8rem; }
}
