/* ═══ Draw & Guess (نقاشی و حدس) ══════════════════════════════════════════════════════════════════════════════ */

.board-wrapper:has(.dg-wrap) { align-items: flex-start; } /* as tall as its content, so the page scrolls to the bottom of it */
.dg-wrap { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.dg-head { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 8px 12px 10px; border-radius: 14px; background: var(--nx-surface-2, rgba(255, 255, 255, 0.05)); border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.1)); min-height: 52px; }
.dg-turn { font-size: 12px; font-weight: 700; color: var(--nx-text-2, #a3aec8); white-space: nowrap; }
.dg-youdraw { font-size: 11px; font-weight: 800; color: #ffd54f; white-space: nowrap; }
.dg-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.dg-cat { font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: rgba(255, 213, 79, 0.16); color: #ffd54f; white-space: nowrap; }
.dg-cat[hidden], .dg-youdraw[hidden] { display: none; }
.dg-word { max-width: 100%; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 3px; direction: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-word-known { color: #81c784; letter-spacing: 1px; }
.dg-clock { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; min-width: 52px; justify-content: flex-end; }
.dg-clock-low { color: #ff8a80; animation: dg-blink 0.8s ease-in-out infinite; }
.dg-bar { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.08); }
.dg-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #5ee0a0, #ffd54f, #ef5350); background-size: 300% 100%; transition: width 0.25s linear; }

.dg-players { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-chip { position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 5px; border-radius: 999px; border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.12)); border-inline-start: 4px solid var(--seat-colour, #888); background: var(--nx-surface-2, rgba(10, 14, 22, 0.8)); font-size: 12.5px; }
.dg-chip-name { font-weight: 700; max-width: 84px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-chip-info { color: #ffd54f; font-weight: 800; font-variant-numeric: tabular-nums; }
.dg-chip-drawing { box-shadow: 0 0 0 2px #ffd54f; }
.dg-chip-got { box-shadow: 0 0 0 2px #66bb6a; }
.dg-badge { display: inline-grid; place-items: center; }

.dg-stage { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 8px 26px -10px rgba(0, 0, 0, 0.6), 0 0 0 3px var(--nx-border-strong, #2c3550); line-height: 0; }
.dg-canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; background: #fff; }
.dg-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px; background: rgba(10, 14, 22, 0.86); color: #fff; line-height: 1.3; text-align: center; animation: dg-in 220ms ease-out; }
.dg-overlay[hidden] { display: none; }
.dg-overlay h4 { margin: 0; font-size: 18px; direction: auto; }
.dg-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.dg-wordbtn { min-height: 56px; min-width: 112px; font-size: 20px; font-weight: 800; background: #fff; color: #151a2b; border-color: #fff; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.2; }
.dg-wordbtn-c { font-size: 11px; font-weight: 700; color: #5b6270; }
.dg-wordbtn:hover { background: #ffd54f; }
.dg-over-label { font-size: 13px; color: #c4cce0; }
.dg-over-word { font-size: 34px; font-weight: 900; color: #ffd54f; direction: auto; }
.dg-gains { display: flex; flex-direction: column; gap: 4px; min-width: 190px; max-height: 40%; overflow: auto; }
.dg-gain { display: flex; justify-content: space-between; gap: 18px; font-size: 14px; }
.dg-gain b { color: #81c784; }

.dg-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dg-tools[hidden] { display: none; }
.dg-pal { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dg-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer; padding: 0; }
.dg-sw-on { outline: 3px solid #ffd54f; outline-offset: 1px; }
.dg-pal { max-width: 390px; }
.dg-sw-custom { position: relative; display: inline-block; overflow: hidden; background: conic-gradient(#e5484d, #f5c518, #30a46c, #4cc9f0, #8e4ec6, #e5484d); }
.dg-sw-custom input { position: absolute; inset: -6px; width: 44px; height: 44px; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.dg-act.dg-act-text { gap: 6px; padding-inline: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.dg-act-text span { font-size: 13px; }
.dg-act-on { outline: 2px solid #ffd54f; background: rgba(255, 213, 79, 0.18); }
.dg-sizes { display: flex; gap: 4px; }
.dg-sz { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.2)); background: var(--nx-surface-2, rgba(255, 255, 255, 0.06)); display: grid; place-items: center; cursor: pointer; padding: 0; }
.dg-sz i { background: #fff; border-radius: 50%; display: block; }
.dg-sz-on { outline: 2px solid #ffd54f; }
.dg-acts { display: flex; gap: 4px; }
.dg-act { min-width: 40px; min-height: 36px; display: inline-grid; place-items: center; }
.dg-ink { width: 80px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.dg-ink i { display: block; height: 100%; background: linear-gradient(90deg, #5b8dee, #9d4edd); }

.dg-guess { display: flex; gap: 8px; }
.dg-guess[hidden] { display: none; }
.dg-input { flex: 1; min-width: 0; min-height: 46px; padding: 8px 14px; font-size: 18px; border-radius: 12px; border: 2px solid var(--nx-border, rgba(255, 255, 255, 0.16)); background: var(--nx-surface, rgba(255, 255, 255, 0.05)); color: inherit; }
.dg-input:focus { outline: none; border-color: #5b8dee; }
.dg-send { min-height: 46px; padding: 0 20px; }
.dg-feed { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; font-size: 14px; padding: 2px 4px; }
.dg-row { display: flex; gap: 8px; direction: auto; }
.dg-row b { color: var(--nx-text-2, #a3aec8); font-weight: 700; white-space: nowrap; }
.dg-row-got { color: #81c784; font-weight: 700; }
.dg-row-me { color: #ffd54f; font-weight: 800; }
@keyframes dg-in { from { opacity: 0; } }
@keyframes dg-blink { 50% { opacity: 0.55; } }
@media (max-width: 900px) { .dg-wrap { padding-bottom: calc(76px + var(--safe-b, 0px)); } }
@media (max-width: 560px) {
  .dg-head { gap: 8px; padding: 6px 10px 9px; }
  .dg-word { font-size: 19px; letter-spacing: 2px; }
  .dg-sw { width: 27px; height: 27px; }
  .dg-sz { width: 31px; height: 31px; }
  .dg-wordbtn { min-width: 96px; font-size: 18px; }
  .dg-over-word { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .dg-overlay, .dg-clock-low { animation: none; } .dg-bar i { transition: none; } }
