/* Team word game page. Builds on styles.css (buttons, top bar, dialogs, chat, toast). */

body.wt { height: auto; min-height: 100vh; min-height: 100dvh; overflow: auto; }
.wt {
  --wt-red: #d6453b; --wt-blue: #3a72c9; --wt-neutral: #cbbd9c; --wt-trap: #1b1b1f;
}
.wt-main {
  flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start;
}
.wt-create { grid-column: 1 / -1; max-width: 460px; margin: 24px auto; }
.wt-create .btn { width: 100%; }

.wt-game { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.wt-score { display: flex; align-items: stretch; justify-content: center; gap: 10px; }
.wt-side {
  flex: 1; max-width: 220px; display: flex; flex-direction: column; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line);
}
.wt-side b { font-size: 15px; }
.wt-side span { color: var(--muted); font-size: 13px; }
.wt-side.red b { color: var(--wt-red); } .wt-side.blue b { color: var(--wt-blue); }
.wt-side.red.turn { border-color: var(--wt-red); } .wt-side.blue.turn { border-color: var(--wt-blue); }
.wt-side.won { box-shadow: 0 0 0 3px var(--brass); }
.wt-vs { align-self: center; color: var(--muted); font-size: 12px; }

.wt-clue {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line);
}
.wt-clue strong { font-size: 22px; text-transform: uppercase; letter-spacing: .04em; }
.wt-clue .wt-num { font-size: 20px; font-weight: 800; color: var(--brass-2); }
.wt-clue .muted { font-size: 13px; width: 100%; text-align: center; }
.wt-tag { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; color: #fff; }
.wt-tag.red { background: var(--wt-red); } .wt-tag.blue { background: var(--wt-blue); }

.wt-clue-form { display: flex; gap: 8px; justify-content: center; }
.wt-clue-form input { flex: 1; min-width: 0; max-width: 260px; }
.wt-clue-form select { width: 64px; }
.wt-clue-form input, .wt-clue-form select {
  min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: inherit; font: inherit;
}

.wt-status { margin: 0; text-align: center; font-weight: 700; min-height: 1.5em; }
.wt-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.wt-actions:empty { display: none; }
.wt-actions .btn { min-height: 44px; }
.wt-actions .red-btn { border-color: var(--wt-red); color: #ffb3ad; }
.wt-actions .blue-btn { border-color: var(--wt-blue); color: #b3cbff; }

/* The 5x5 board. Hidden words are cream; guessed ones take their owner's color. */
.wt-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wt-word {
  min-width: 0; min-height: 56px; padding: 4px 2px; border-radius: 10px; border: 2px solid transparent;
  background: #efe6d2; color: #2a2418; font: 800 14px/1.15 var(--ui); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; cursor: default; user-select: none; /* wt.js shrinks long words to fit */
}
.wt-word.guessable { cursor: pointer; }
.wt-word.guessable:hover { border-color: var(--brass); }
.wt-word.picked { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(217, 179, 106, .45); transform: translateY(-2px); }
/* Clue-givers see the key as a colored edge on words nobody has guessed yet. */
.wt-word.key.red { border-color: var(--wt-red); background: #f4d6d2; }
.wt-word.key.blue { border-color: var(--wt-blue); background: #d4e0f4; }
.wt-word.key.trap { border-color: var(--wt-trap); background: #8d8a86; color: #fff; }
.wt-word.revealed { color: #fff; text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(255, 255, 255, .5); }
.wt-word.revealed.red { background: var(--wt-red); }
.wt-word.revealed.blue { background: var(--wt-blue); }
.wt-word.revealed.neutral { background: var(--wt-neutral); color: #5a5140; text-decoration-color: rgba(0, 0, 0, .3); }
.wt-word.revealed.trap { background: var(--wt-trap); }

.wt-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt-team { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; border-top: 3px solid; }
.wt-team.red { border-top-color: var(--wt-red); } .wt-team.blue { border-top-color: var(--wt-blue); }
.wt-team h3 { margin: 0 0 4px; font-size: 14px; }
.wt-team .wt-wins { float: right; font-weight: 600; font-size: 12px; color: var(--muted); }
.wt-team ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.wt-team li.me { color: var(--brass-2); }
.wt-team li.away { opacity: .55; }
.wt-team .cg-tag { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid currentColor; border-radius: 6px; padding: 0 4px; white-space: nowrap; }

.wt-log { list-style: none; margin: 0; padding: 0; text-align: center; color: var(--muted); font-size: 13px; }

.wt-howto { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.wt-howto summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.wt-howto ol { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.wt-howto b { color: var(--text); }
.wt-howto b.red { color: var(--wt-red); } .wt-howto b.blue { color: var(--wt-blue); }
.wt .sound-btn { padding: 0 10px; min-width: 40px; font-size: 1rem; }

.wt-chat {
  display: flex; flex-direction: column; height: min(520px, 70dvh);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.wt-chat .log b { color: var(--brass-2); margin-right: 4px; }

@media (max-width: 760px) {
  .wt-main { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .wt-grid { gap: 4px; }
  .wt-word { min-height: 52px; padding: 4px 1px; font-size: 12px; letter-spacing: -.01em; border-radius: 8px; }
  .wt-howto { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.wt-howto summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.wt-howto ol { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.wt-howto b { color: var(--text); }
.wt-howto b.red { color: var(--wt-red); } .wt-howto b.blue { color: var(--wt-blue); }
.wt .sound-btn { padding: 0 10px; min-width: 40px; font-size: 1rem; }

.wt-chat { height: 300px; }
}
