/* Brand emphasis is separate from the cube's blue/yellow/red/green feedback. */
.cr-app {
  --counter-bg: #294638;
  --counter-edge: #20372c;
  --counter-label: #d9e4d7;
  --counter-number: #fff9e9;
  --counter-rolls: #ffb19a;
  --counter-shadow: #bcc5b4;
  --action-bg: #294638;
  --action-ink: #fff9e9;
  --action-soft: #e5eadd;
  --action-edge: #9fac99;
  --restart-bg: #fae6da;
  --restart-ink: #91462f;
  --restart-edge: #d8a28c;
  --disabled-bg: #ecece4;
  --disabled-ink: #92978b;
  --disabled-edge: #d3d7ca;
  --selection-ring: #264a39;
  --selection-badge: #264a39;
  --selection-label: #fff9e9;
}

.cr-app[data-style="arcade"] {
  --counter-bg: #1b3040;
  --counter-edge: #638e90;
  --counter-label: #bad1d5;
  --counter-number: #c0ded1;
  --counter-rolls: #d2c5ff;
  --counter-shadow: #0a1322;
  --action-bg: #b0d4c6;
  --action-ink: #173431;
  --action-soft: #273e50;
  --action-edge: #59788d;
  --restart-bg: #37314f;
  --restart-ink: #e2d8ff;
  --restart-edge: #8572ac;
  --disabled-bg: #243147;
  --disabled-ink: #7e8ba1;
  --disabled-edge: #3b4960;
  --selection-ring: #b0d4c6;
  --selection-badge: #152e34;
  --selection-label: #d6e9df;
}

.cr-app[data-style="studio"] {
  --counter-bg: #2e5961;
  --counter-edge: #244b52;
  --counter-label: #d4e5e5;
  --counter-number: #fff8e8;
  --counter-rolls: #ffc7a4;
  --counter-shadow: #b8cbc8;
  --action-bg: #2e5961;
  --action-ink: #fff8e8;
  --action-soft: #e0edeb;
  --action-edge: #a5bcb8;
  --restart-bg: #ffe1cc;
  --restart-ink: #82462b;
  --restart-edge: #d9ad93;
  --disabled-bg: #e4eaea;
  --disabled-ink: #93a2a4;
  --disabled-edge: #c5d2d2;
  --selection-ring: #26565e;
  --selection-badge: #26565e;
  --selection-label: #fff8e8;
}

.cr-app[data-style] .cr-metrics {
  border: 0;
  padding: 0;
  margin-bottom: 16px;
}
.cr-app[data-style] .cr-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 13px;
  min-width: 150px;
  min-height: 50px;
  padding: 10px 14px;
  background: var(--counter-bg);
  border: 1px solid var(--counter-edge);
  border-radius: var(--radius);
  box-shadow: 0 3px 0 var(--counter-shadow);
}
.cr-app[data-style] .cr-metric span {
  color: var(--counter-label);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .1em;
  line-height: 1;
}
.cr-app[data-style] .cr-metric strong {
  color: var(--counter-number);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1;
}
.cr-app[data-style] .cr-metric:last-child strong { color: var(--counter-rolls); }
.cr-app[data-style="paper"] .cr-metric { border-radius: 4px; }
.cr-app[data-style="arcade"] .cr-metric { border-radius: 3px; box-shadow: 0 3px 0 var(--counter-shadow), inset 0 2px 0 #a5f6da12; }
.cr-app[data-style="studio"] .cr-metric { border-radius: 13px; }

.cr-app[data-style] .cr-game-actions { gap: 8px; }
.cr-app[data-style] .cr-game-actions .cr-button {
  justify-content: center;
  min-width: 96px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--action-edge);
  border-radius: var(--radius);
  background: var(--action-soft);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--action-edge);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.cr-app[data-style] .cr-game-actions [data-action="undo"],
.cr-app[data-style] .cr-game-actions [data-action="open-result"] {
  background: var(--action-bg);
  border-color: var(--action-bg);
  color: var(--action-ink);
}
.cr-app[data-style] .cr-game-actions [data-action="open-restart"] {
  background: var(--restart-bg);
  border-color: var(--restart-edge);
  color: var(--restart-ink);
  box-shadow: 0 2px 0 var(--restart-edge);
}
.cr-app[data-style] .cr-game-actions .cr-button:disabled {
  opacity: 1;
  color: var(--disabled-ink);
  background: var(--disabled-bg);
  border-color: var(--disabled-edge);
  box-shadow: none;
}
.cr-app[data-style] .cr-game-actions .cr-button:not(:disabled):active {
  transform: translateY(2px);
  box-shadow: none;
}
.cr-app[data-style="studio"] .cr-game-actions .cr-button { border-radius: 11px; }
@media (min-width: 701px) {
  .cr-app[data-style="studio"] .cr-game-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cr-app[data-style="studio"] .cr-game-actions:has([data-action="open-result"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-app[data-style="studio"] .cr-game-actions .cr-button { min-width: 0; padding-inline: 4px; font-size: 11px; }
}

.cr-app[data-style] .cr-cube-list { row-gap: 14px; }
.cr-cube-button > .cr-cube-code { justify-self: start; margin-left: 3px; min-height: 16px; line-height: 16px; }
.cr-app[data-style] .cr-cube-button.is-selected {
  outline: 2px solid var(--selection-ring);
  outline-offset: 2px;
}
.cr-cube-selection {
  display: none;
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 5px;
  min-width: 58px;
  padding: 3px 7px;
  border: 1px solid var(--selection-ring);
  border-radius: 3px;
  background: var(--selection-badge);
  color: var(--selection-label);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .07em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.cr-cube-button.is-selected .cr-cube-selection { display: block; }
.cr-app[data-style] .cr-board-cube.is-selected {
  z-index: 3;
  outline: 2px solid var(--selection-ring);
  outline-offset: 0;
}

@media (max-width: 700px) {
  .cr-app[data-style] .cr-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
  .cr-app[data-style] .cr-metric { min-width: 0; min-height: 46px; padding: 10px 11px; gap: 8px; }
  .cr-app[data-style] .cr-metric span { font-size: 9px; letter-spacing: .07em; }
  .cr-app[data-style] .cr-metric strong { font-size: 23px; }
  .cr-app[data-style] .cr-game-actions { width: 100%; gap: 6px; }
  .cr-app[data-style] .cr-game-actions .cr-button { min-width: 0; width: 100%; min-height: 44px; padding: 8px 4px; font-size: 10px; }
  .cr-app[data-style] .cr-cube-list { row-gap: 14px; }
  .cr-cube-selection { min-width: 54px; padding-inline: 5px; font-size: 8px; }
}

@media (max-width: 360px) {
  .cr-app[data-style] .cr-metrics { gap: 10px; }
  .cr-app[data-style] .cr-metric { padding-inline: 9px; gap: 5px; }
  .cr-app[data-style] .cr-metric strong { font-size: 22px; }
  .cr-app[data-style] .cr-game-actions .cr-button { font-size: 9px; padding-inline: 3px; }
}
