/* Nonosynergy — task-specific styles, layered on top of bootstrap.css. */

:root {
  --ng-cell-size: 34px;
  --ng-clue-font: 13px;
  --ng-player: #2a9d8f;
  --ng-partner: #e9c46a;
  --ng-grid-border: #444;
  --ng-cell-border: #bbb;
}

body { font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; }

.text-xl { font-size: 1.4rem; }
.text-xxl { font-size: 1.7rem; }
.text-l { font-size: 1.1rem; }
.text-m { font-size: 1rem; }

.btn-primary {
  background-color: #2a9d8f;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  cursor: pointer;
}
.btn-primary:hover { background-color: #228b7d; }
.btn-primary:disabled { background-color: #ccc; cursor: not-allowed; }

/* --------------------------- grid layout -------------------------------- */

.ng-root { display: flex; justify-content: center; padding: 12px 0; }

.ng-layout { display: flex; flex-direction: column; user-select: none; }
.ng-top-row { display: flex; }
.ng-main-row { display: flex; align-items: stretch; }

.ng-corner-col {
  width: 100px;   /* matches row-clues width */
  height: 100px;  /* matches col-clues height */
}

.ng-col-clues {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(var(--ng-cols, auto), var(--ng-cell-size));
}
.ng-clue-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  font-size: var(--ng-clue-font);
  width: var(--ng-cell-size);
  height: 100px;
  border-right: 1px dashed #eee;
  padding-bottom: 2px;
}
.ng-clue-col span { line-height: 1.2; }

.ng-row-clues {
  display: flex;
  flex-direction: column;
  width: 100px;
}
.ng-clue-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  font-size: var(--ng-clue-font);
  height: var(--ng-cell-size);
  border-bottom: 1px dashed #eee;
  padding-right: 4px;
  gap: 4px;
}
.ng-clue-zero { color: #aaa; }

.ng-grid {
  display: grid;
  border-top: 2px solid var(--ng-grid-border);
  border-left: 2px solid var(--ng-grid-border);
}

.ng-cell {
  width: var(--ng-cell-size);
  height: var(--ng-cell-size);
  border-right: 1px solid var(--ng-cell-border);
  border-bottom: 1px solid var(--ng-cell-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 80ms ease;
}
.ng-cell:nth-child(5n) { border-right: 1.5px solid #888; }
.ng-grid > .ng-cell:nth-child(n+0):nth-child(-n+5) { /* future hook */ }

.ng-disabled .ng-cell { cursor: not-allowed; opacity: 0.55; }
.ng-disabled { pointer-events: none; }

.ng-cell.ng-tentative-filled {
  background: repeating-linear-gradient(45deg,
    #2a9d8f33, #2a9d8f33 5px,
    #ffffff 5px, #ffffff 10px);
}
.ng-cell.ng-tentative-empty {
  color: #888;
  background: #f7f7f7;
}
.ng-cell.ng-pending {
  outline: 3px solid #e76f51;
  outline-offset: -3px;
}
.ng-cell.ng-locked { cursor: default; }
.ng-cell.ng-filled { color: #fff; }
.ng-cell.ng-flash { animation: ng-flash 0.8s ease; }

@keyframes ng-flash {
  0%   { box-shadow: 0 0 0 0px #f4a261; }
  50%  { box-shadow: 0 0 0 4px #f4a26155; }
  100% { box-shadow: 0 0 0 0px #f4a26100; }
}

.ng-cell.ng-correct { outline: 2px solid #2a9d8f; outline-offset: -2px; }
.ng-cell.ng-incorrect { outline: 2px solid #e63946; outline-offset: -2px; }

/* --------------------------- turn UI ------------------------------------ */

.ng-turn-banner {
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  padding: 10px;
  margin-bottom: 8px;
  background: #f1faee;
  border-radius: 6px;
}

.ng-controls {
  max-width: 540px;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ng-tool-row { display: flex; gap: 8px; justify-content: center; }
.ng-tool, .ng-tool-secondary {
  border: 1px solid #999;
  background: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.ng-tool-active { background: #2a9d8f; color: #fff; border-color: #2a9d8f; }
.ng-confidence-row { display: flex; flex-direction: column; gap: 4px; }
.ng-done { width: 100%; font-size: 1.05rem; padding: 10px; }

/* Locked / non-interactive controls (round over) */
.ng-tool:disabled, .ng-tool-secondary:disabled {
  background: #eee;
  color: #aaa;
  border-color: #ddd;
  cursor: not-allowed;
}
.ng-tool-active:disabled { background: #9cc9c2; color: #f0f0f0; border-color: #9cc9c2; }
input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }
.ng-confidence-row input:disabled + label,
.ng-confidence-row:has(input:disabled) label { color: #aaa; }

.ng-tier1-notice {
  background: #f8e7e2;
  color: #9a3a25;
  border: 1px solid #e76f51;
  padding: 8px;
  border-radius: 4px;
  text-align: center;
}

.ng-step-timer {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
}

.ng-big-number {
  color: #e63946;
  font-weight: 700;
  font-size: 1.8em;
  line-height: 1;
}

.ng-round-end {
  background: #fdf6e3;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px;
  margin: 16px auto;
  max-width: 540px;
  text-align: center;
}
.ng-legend {
  font-size: 0.85rem;
  color: #555;
  margin-top: 8px;
}
.ng-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 2px;
}
.ng-legend-correct { outline: 2px solid #2a9d8f; outline-offset: -2px; background: #fff; }
.ng-legend-incorrect { outline: 2px solid #e63946; outline-offset: -2px; background: #fff; }

.spinner {
  margin: 24px auto;
  width: 36px;
  height: 36px;
  border: 4px solid #ddd;
  border-top-color: #2a9d8f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */

@media (max-width: 700px) {
  :root { --ng-cell-size: 28px; }
  .ng-corner-col, .ng-row-clues { width: 80px; }
  .ng-clue-col { height: 80px; }
}
