#counter-status {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: 92%;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: #fff;
  background: rgba(20,20,24,0.95);
  border: 1px solid var(--border);
  border-radius: 6px;
  z-index: 20;
  display: none;
  text-align: center;
}
#counter-status.error { border-color: #e04b4b; }

#counter-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 100%;
  width: 100%;
}
.counter-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 150px;
  height: 75px;
  padding: 6px;
  overflow: hidden;
  font-size: 2.2rem;
  line-height: 1;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #b07bff, var(--accent-secondary));
  border: none;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55), 0 0 0 3px rgba(255,255,255,0.08);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.counter-btn:hover { transform: scale(1.06); }
.counter-btn:active { transform: scale(0.94); }
.counter-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.counter-icon {
  height: 100%;
  width: auto;
  max-width: 45%;
  object-fit: contain;
  flex: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
#counter-row .counter-btn { flex: none; width: 100%; }
.counter-text { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.counter-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.9; }
.counter-line { display: flex; align-items: baseline; gap: 8px; }
.counter-value { font-size: 2.4rem; font-weight: 800; }
.counter-plus  { font-size: 1.05rem; opacity: 0.9; }

#counter-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
}
#counter-modal.open { display: flex; }
#counter-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 90%);
  padding: 18px;
  background: #18181c;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
#counter-modal-title {
  color: #fff;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}
#counter-modal-input {
  padding: 10px;
  font-size: 1.4rem;
  text-align: center;
  color: #fff;
  background: #0f0f12;
  border: 1px solid var(--border);
  border-radius: 6px;
}
#counter-modal-actions { display: flex; gap: 10px; }
#counter-modal-actions button {
  flex: 1;
  padding: 10px;
  font-size: 1rem;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#counter-modal-cancel { background: #3a3a42; }
#counter-modal-save { background: var(--accent); }

@media (max-width: 1300px) {
  #counter-row { flex-direction: row; flex-wrap: wrap; }
  #counter-row .counter-btn { flex: 1 1 calc((100% - 10px) / 3); width: auto; }
}
@media (max-width: 640px) {
  #counter-row .counter-btn { height: 60px; }
  .counter-label { font-size: 0.72rem; }
  .counter-value { font-size: 1.9rem; }
  .counter-plus  { font-size: 0.9rem; }
}
