/* Coop-Picross — accent: #22d3ee (cyan). */

.cp-area { max-width: 820px; }

/* Top bar with central timer. */
.cp-bar { gap: 12px; }
.cp-timer-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 12px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px;
  min-width: 88px;
}
.cp-timer-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.cp-timer {
  font-family: ui-monospace, monospace; font-size: 20px; font-weight: 700;
  color: #22d3ee; letter-spacing: 1px;
}
.cp-timer.warn { color: var(--danger); animation: cp-tick 1s infinite; }
@keyframes cp-tick { 50% { opacity: 0.55; } }

.cp-role-banner {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 8px;
  font-size: 13px; color: var(--text); line-height: 1.5;
}
.cp-role-banner strong { color: #22d3ee; }
.cp-role-banner .cp-tip { color: var(--muted); display: block; margin-top: 4px; font-size: 12px; }

/* Board ------------------------------------------------------------------ */
.cp-board-wrap {
  margin: 12px 0;
  display: flex; justify-content: center;
  overflow-x: auto;
}
.cp-board {
  display: grid;
  gap: 0;
  background: var(--panel2);
  border-radius: 8px;
  padding: 6px;
  user-select: none;
}
.cp-corner { width: 56px; height: 36px; }

/* Hint cells. */
.cp-col-hint, .cp-row-hint {
  background: transparent;
  color: var(--text);
  font-size: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 2px;
  min-height: 36px;
  font-variant-numeric: tabular-nums;
}
.cp-col-hint {
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 1px;
  min-height: 56px;
  padding-bottom: 4px;
}
.cp-row-hint {
  flex-direction: row;
  justify-content: flex-end;
  gap: 4px;
  padding-right: 6px;
  width: 56px;
  min-width: 56px;
  white-space: nowrap;
}
.cp-hnum {
  display: inline-block;
  min-width: 13px;
  text-align: center;
  color: #c8d3df;
  font-weight: 500;
}
.cp-hidden-hint { color: var(--line); font-size: 14px; }

/* Cells. */
.cp-cell {
  width: 36px; height: 36px;
  background: #20272f;
  border: 1px solid #2a313c;
  border-left-width: 0; border-top-width: 0;
  cursor: pointer;
  padding: 0; margin: 0;
  position: relative;
  transition: background 80ms, transform 80ms;
  color: var(--text);
  font: inherit;
}
.cp-cell.bl { border-left-width: 1px; }
.cp-cell.bt { border-top-width: 1px; }
.cp-cell.br { border-right-width: 2px; border-right-color: #3a4452; }
.cp-cell.bb { border-bottom-width: 2px; border-bottom-color: #3a4452; }
.cp-cell:hover { background: #2a323d; }
.cp-cell:active { transform: scale(0.93); }

.cp-cell.s-empty { background: #20272f; }
.cp-cell.s-filled {
  background: #22d3ee;
  border-color: #0e8ea0;
}
.cp-cell.s-filled.by-p1 { background: #22d3ee; }
.cp-cell.s-filled.by-p2 { background: #f59e0b; border-color: #b4730b; }
.cp-cell.s-marked { background: #20272f; }
.cp-cell.s-marked .cp-x {
  display: inline-block;
  color: #ff5d5d;
  font-size: 22px;
  line-height: 36px;
  font-weight: 700;
}
.cp-cell.pending { opacity: 0.7; }
.cp-cell.pulse { animation: cp-pulse 380ms ease-out; }
@keyframes cp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,211,238,0.7); }
  100% { box-shadow: 0 0 0 6px rgba(34,211,238,0); }
}

/* Info row --------------------------------------------------------------- */
.cp-info {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 8px 0 12px;
  padding: 8px 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.cp-info-item { color: var(--muted); }
.cp-info-item strong { color: var(--text); font-variant-numeric: tabular-nums; }
.cp-info-item.cp-hint { color: var(--muted); flex: 1; min-width: 200px; text-align: right; font-size: 12px; }

/* Chat ------------------------------------------------------------------- */
.cp-chat {
  margin: 12px 0 0;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.cp-chat-head {
  padding: 8px 12px;
  background: rgba(34,211,238,0.08);
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: #22d3ee; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
}
.cp-chat-log {
  height: 140px;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 13px;
  display: flex; flex-direction: column; gap: 4px;
}
.cp-msg {
  padding: 4px 8px;
  border-radius: 6px;
  max-width: 85%;
  word-wrap: break-word;
}
.cp-msg.mine { align-self: flex-end; background: rgba(34,211,238,0.12); }
.cp-msg.theirs { align-self: flex-start; background: var(--panel); }
.cp-msg-who { font-weight: 600; color: var(--muted); margin-right: 6px; }
.cp-chat-form {
  display: flex; gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.cp-chat-form input {
  flex: 1;
  padding: 8px 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.cp-chat-form input:focus { outline: none; border-color: #22d3ee; }

/* End card --------------------------------------------------------------- */
.cp-end h3 { color: #22d3ee; }
.cp-end-stats { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.cp-resign-bar { margin-top: 12px; text-align: center; }

/* Mobile ----------------------------------------------------------------- */
@media (max-width: 640px) {
  .cp-cell { width: 28px; height: 28px; }
  .cp-corner { width: 44px; height: 28px; }
  .cp-row-hint { width: 44px; min-width: 44px; font-size: 10px; padding-right: 4px; gap: 2px; }
  .cp-col-hint { min-height: 44px; font-size: 10px; }
  .cp-hnum { min-width: 10px; }
  .cp-cell.s-marked .cp-x { font-size: 18px; line-height: 28px; }
  .cp-timer { font-size: 16px; }
  .cp-info-item.cp-hint { text-align: left; }
  .cp-chat-log { height: 110px; }
}
@media (max-width: 380px) {
  .cp-cell { width: 24px; height: 24px; }
  .cp-corner { width: 38px; height: 24px; }
  .cp-row-hint { width: 38px; min-width: 38px; }
  .cp-col-hint { min-height: 38px; }
  .cp-cell.s-marked .cp-x { font-size: 14px; line-height: 24px; }
}
