/* Shared game pieces and hint tools. Edition files may tune these materials. */
.cr-app {
  --piece-token-radius: 50%;
  --hint-kit-bg: color-mix(in srgb, var(--tile) 70%, var(--surface));
  --hint-paper: var(--key);
  --hint-paper-ink: var(--ink);
  --hint-paper-line: var(--line);
  --hint-tool-bg: var(--target);
  --hint-tool-ink: var(--target-ink);
  --hint-tool-edge: var(--target-edge);
  --hint-tool-radius: max(5px, var(--radius));
}

.cr-app[data-style="arcade"] { --piece-token-radius: 3px; }
.cr-app[data-style="studio"] { --piece-token-radius: 7px; }

/* A neutral tray keeps the top-face feedback distinct from selection. */
.cr-app[data-style] .cr-cube-button {
  min-height: 132px;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  outline: none;
  transition: transform .14s ease, box-shadow .14s ease;
}
.cr-app[data-style] .cr-cube-button > .cr-cube-code {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  min-height: 25px;
  margin-left: 2px;
  border: 1px solid var(--key-edge);
  border-radius: var(--piece-token-radius);
  background: var(--key);
  color: var(--ink);
  font-size: 10px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cr-app[data-style] .cr-cube-button.is-selected {
  background: var(--key);
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 2px 0 var(--key-bottom);
}
.cr-app[data-style] .cr-cube-button.is-selected > .cr-cube-code {
  background: var(--selection-badge);
  border-color: var(--selection-ring);
  color: var(--selection-label);
}
.cr-app[data-style] .cr-cube-button:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: none;
}
.cr-app[data-style] .cr-cube-button.is-selected:not(:disabled):active {
  box-shadow: 0 1px 0 var(--key-bottom);
}
.cr-app[data-style] .cr-cube-selection {
  display: block;
  position: absolute;
  top: 13px;
  right: 10px;
  left: auto;
  width: 12px;
  height: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--selection-ring);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}
.cr-app[data-style] .cr-cube-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 12px;
  color: var(--ink);
}
.cr-cube-status::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--state-edge, var(--muted));
}
.cr-app[data-style] .cr-board-cube {
  border-color: var(--key-edge);
  box-shadow: 0 3px 0 var(--key-bottom);
}
.cr-app[data-style] .cr-board-cube.is-selected { outline: none; }
.cr-board-selection {
  position: absolute;
  z-index: 3;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 8px;
  background: var(--selection-ring);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}
.cr-app[data-style] .cr-cube-button:focus-visible,
.cr-app[data-style] .cr-board-cube:focus-visible {
  outline: 2px solid var(--selection-ring);
  outline-offset: 3px;
}

/* Hint tools sit on one work surface; revealed clues read as paper strips. */
.cr-app[data-style] .cr-notes-link { gap: 6px; font-weight: 700; }
.cr-hints {
  border: 0;
  border-radius: var(--radius);
  background: var(--hint-kit-bg);
  box-shadow: 0 3px 0 var(--key-bottom);
}
.cr-hints-header {
  padding: 15px 17px 13px;
  border-bottom: 1px dashed var(--key-edge);
}
.cr-hints-heading { gap: 16px; }
.cr-hints-eyebrow { font-size: 9px; letter-spacing: .07em; }
.cr-hints-heading h2 { font-size: 23px; font-weight: 800; letter-spacing: -.035em; }
.cr-hints-count { align-self: end; gap: 5px; padding-bottom: 2px; }
.cr-hints-count strong { font-size: 12px; letter-spacing: 0; }
.cr-hints-count > span { font-size: 10px; }
.cr-hints .cr-hint-actions { width: 320px; gap: 10px; }
.cr-hints .cr-hint-actions .cr-button {
  display: grid;
  grid-template-columns: 25px 1fr auto;
  justify-content: stretch;
  align-items: center;
  min-height: 51px;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--hint-tool-edge);
  border-radius: var(--hint-tool-radius);
  background: var(--hint-tool-bg);
  color: var(--hint-tool-ink);
  box-shadow: 0 3px 0 var(--hint-tool-edge);
}
.cr-hint-tool-icon {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.cr-hints .cr-hint-actions .cr-button > .cr-hint-tool-label {
  text-align: left;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: 1;
}
.cr-hint-charges { display: flex; flex-wrap: nowrap; gap: 3px; }
.cr-hint-charge {
  display: block;
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: currentColor;
}
.cr-hint-charge.is-used { background: transparent; opacity: .45; }
.cr-hints .cr-hint-actions .cr-button:disabled { opacity: .65; box-shadow: 0 1px 0 var(--hint-tool-edge); }
.cr-hints .cr-hint-actions .cr-button:not(:disabled):hover {
  background: color-mix(in srgb, var(--hint-tool-bg) 90%, var(--key));
  border-color: var(--hint-tool-edge);
}
.cr-hints .cr-hint-actions .cr-button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--hint-tool-edge); }
.cr-hints .cr-inline-hints { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.cr-hints .cr-inline-hint-group {
  gap: 0;
  background: var(--hint-paper);
  border-bottom: 2px solid var(--hint-paper-line);
}
.cr-hints .cr-inline-hint-card {
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 0 12px;
  padding: 13px 15px 13px 10px;
  border: 0;
  border-bottom: 1px dashed var(--hint-paper-line);
  border-radius: 0;
  background: transparent;
  color: var(--hint-paper-ink);
  box-shadow: none;
}
.cr-hints .cr-inline-hint-card:last-child { border-bottom: 0; }
.cr-hints .cr-inline-hint-label,
.cr-hints [data-hint-type="cube"] .cr-inline-hint-label {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 0 9px 0 0;
  border-right: 1px solid var(--hint-paper-line);
  border-radius: 0;
  background: transparent;
  color: var(--hint-paper-ink);
  font-size: 8px;
  letter-spacing: .01em;
}
.cr-inline-hint-label strong { font-size: 21px; font-weight: 700; line-height: 1; letter-spacing: -.06em; }
.cr-hints .cr-inline-hint-text { color: var(--hint-paper-ink); }
.cr-hints .cr-hint-context { color: color-mix(in srgb, var(--hint-paper-ink) 70%, var(--hint-paper)); }
.cr-hints-empty {
  align-content: center;
  display: grid;
  grid-template-columns: 38px auto;
  gap: 0 15px;
  justify-content: center;
  align-items: center;
  text-align: left;
}
.cr-hints-empty-mark {
  grid-row: 1 / span 2;
  width: 38px;
  height: 45px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--hint-paper);
  color: var(--hint-paper-ink);
  box-shadow: 2px 2px 0 var(--key-edge);
  transform: rotate(-8deg);
  font-size: 28px;
  font-style: normal;
}
.cr-hints-empty strong { font-size: 14px; }
.cr-hints-empty p { font-size: 12px; }

@media (max-width: 700px) {
  .cr-app[data-style] .cr-cube-button { min-height: 123px; }
  .cr-app[data-style] .cr-cube-button > .cr-cube-code { width: 22px; height: 22px; min-height: 22px; font-size: 9px; }
  .cr-app[data-style] .cr-cube-selection { top: 11px; right: 8px; width: 11px; height: 9px; }
  .cr-hints-header { padding: 13px 13px 15px; gap: 11px; }
  .cr-hints-heading h2 { font-size: 22px; }
  .cr-hints .cr-hint-actions { width: auto; gap: 10px; }
  .cr-hints .cr-hint-actions .cr-button { min-height: 48px; padding: 8px 10px; }
  .cr-hints .cr-inline-hint-card { padding: 12px 10px; gap: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .cr-app[data-style] .cr-cube-button { transition: none; }
}
