/* Codename-Duet (Coop) — accent: #5ade7a */

.cnd-area { --cnd-green: #5ade7a; --cnd-green-deep: #2f8c4f; --cnd-amber: #f2b035; --cnd-red: #ff5d5d; }

/* Top status */
.cnd-bar .cnd-status {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  flex: 1;
  padding: 0 8px;
}

/* Progress bars */
.cnd-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 16px;
}
.cnd-pmeter { display: flex; flex-direction: column; gap: 4px; }
.cnd-plabel { font-size: 12px; color: var(--muted); }
.cnd-plabel strong { color: var(--text); font-variant-numeric: tabular-nums; }
.cnd-pbar {
  height: 8px;
  background: var(--panel2);
  border-radius: 4px;
  overflow: hidden;
}
.cnd-pbar-fill {
  height: 100%;
  transition: width 320ms ease;
  border-radius: 4px;
}
.cnd-fill-found { background: var(--cnd-green); }
.cnd-fill-hints { background: var(--cnd-amber); }

/* Hint log (compact list of past hints) */
.cnd-hintlog {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  max-height: 110px;
  overflow-y: auto;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cnd-hintlog-empty { color: var(--muted); font-size: 12px; padding: 4px 0; }
.cnd-hint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, monospace;
}
.cnd-hint-item.mine .cnd-hint-who { color: var(--cnd-green); }
.cnd-hint-item.partner .cnd-hint-who { color: #66c0f4; }
.cnd-hint-round {
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  padding: 1px 5px;
  border-radius: 3px;
  min-width: 22px;
  text-align: center;
}
.cnd-hint-who { font-weight: 600; }
.cnd-hint-word { color: var(--text); font-weight: 600; }
.cnd-hint-count { color: var(--muted); }

/* 5x5 grid */
.cnd-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 0 16px;
}
.cnd-cell {
  position: relative;
  aspect-ratio: 1.6 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--panel2);
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(11px, 2.2vw, 15px);
  font-weight: 600;
  padding: 4px 6px;
  cursor: default;
  transition: background 120ms, border-color 120ms, transform 80ms, box-shadow 120ms;
  overflow: hidden;
  word-break: break-word;
  hyphens: auto;
}
.cnd-cell-word { line-height: 1.1; }
.cnd-cell.clickable { cursor: pointer; }
.cnd-cell.clickable:hover { border-color: var(--cnd-green); background: #232a35; transform: translateY(-1px); }
.cnd-cell.clickable:active { transform: translateY(0); }
.cnd-cell:disabled { cursor: default; }

/* Unrevealed mine-green: subtle dot in corner */
.cnd-mine-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cnd-green);
  box-shadow: 0 0 6px var(--cnd-green);
}
.cnd-view-mine-green {
  border-color: rgba(90, 222, 122, 0.45);
  background: rgba(90, 222, 122, 0.06);
}
.cnd-view-mine-green.clickable:hover { border-color: var(--cnd-green); }

/* Revealed states */
.cnd-cell.revealed {
  cursor: default;
  font-weight: 700;
}
.cnd-cell.revealed .cnd-cell-word { opacity: 0.92; }
.cnd-icon { position: absolute; top: 4px; left: 6px; font-size: 13px; }

.cnd-view-mine-green-revealed {
  background: rgba(90, 222, 122, 0.22);
  border-color: var(--cnd-green);
  color: var(--cnd-green);
}
.cnd-view-partner-green-revealed {
  background: rgba(102, 192, 244, 0.18);
  border-color: #66c0f4;
  color: #9fd4f5;
}
.cnd-view-both-green-revealed {
  background: rgba(90, 222, 122, 0.30);
  border-color: var(--cnd-green);
  color: #c6f5d4;
  box-shadow: inset 0 0 0 1px rgba(90, 222, 122, 0.5);
}
.cnd-view-neutral-revealed {
  background: #2c333d;
  border-color: var(--line);
  color: var(--muted);
}
.cnd-view-bomb-revealed {
  background: rgba(255, 93, 93, 0.32);
  border-color: var(--cnd-red);
  color: #ffd1d1;
  animation: cnd-bomb-flash 600ms ease 0s 3;
}
@keyframes cnd-bomb-flash {
  0%,100% { box-shadow: 0 0 0 0 rgba(255, 93, 93, 0); }
  50%     { box-shadow: 0 0 0 6px rgba(255, 93, 93, 0.45); }
}

/* Action panel */
.cnd-action { margin: 4px 0 16px; }
.cnd-hint-input {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.cnd-hint-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.cnd-hint-row { display: flex; gap: 8px; }
.cnd-hint-input input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.cnd-hint-input input[type="text"]:focus { border-color: var(--cnd-green); }
.cnd-hint-count-sel {
  padding: 10px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.cnd-hint-submit {
  background: var(--cnd-green) !important;
  color: #0c0f14 !important;
  border-color: var(--cnd-green) !important;
  font-weight: 600;
  width: auto;
  padding: 10px 16px;
}
.cnd-hint-help { font-size: 12px; color: var(--muted); margin-top: 6px; }

.cnd-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: var(--panel2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}
.cnd-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--panel);
  border-top-color: var(--cnd-green);
  border-radius: 50%;
  animation: cnd-spin 800ms linear infinite;
}
@keyframes cnd-spin { to { transform: rotate(360deg); } }

.cnd-guess-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--panel2);
  border-radius: 8px;
}
.cnd-current-hint { font-size: 14px; color: var(--text); }
.cnd-current-hint strong { color: var(--cnd-green); }
.cnd-remaining { font-size: 14px; color: var(--muted); }
.cnd-remaining strong { color: var(--cnd-amber); font-variant-numeric: tabular-nums; }
.cnd-guess-hud .mp-btn { margin-left: auto; }

/* Chat */
.cnd-chat {
  margin-top: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.cnd-chat-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.cnd-chat-log {
  max-height: 130px;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}
.cnd-chat-empty { color: var(--muted); font-size: 12px; }
.cnd-chat-msg { line-height: 1.3; }
.cnd-chat-msg.mine .cnd-chat-who { color: var(--cnd-green); font-weight: 600; }
.cnd-chat-msg.partner .cnd-chat-who { color: #66c0f4; font-weight: 600; }
.cnd-chat-text { color: var(--text); }
.cnd-chat-row { display: flex; gap: 6px; }
.cnd-chat-row input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.cnd-chat-row input[type="text"]:focus { border-color: var(--cnd-green); }

/* End panel */
.cnd-end h3 { color: var(--cnd-green); }
.cnd-end.cnd-lose h3 { color: var(--cnd-red); }

/* Responsive */
@media (max-width: 560px) {
  .cnd-progress { grid-template-columns: 1fr; }
  .cnd-cell { font-size: 10px; padding: 2px 4px; aspect-ratio: 1.3 / 1; }
  .cnd-mine-dot { top: 3px; right: 3px; width: 6px; height: 6px; }
  .cnd-icon { top: 2px; left: 3px; font-size: 11px; }
  .cnd-hint-row { flex-wrap: wrap; }
  .cnd-hint-input input[type="text"] { flex: 1 1 100%; }
  .cnd-hint-submit { width: 100%; }
}
