/* ─── Aura Hash Game UI ──────────────────────────────────────────────────────── */

/* Сайдбар */
.ahs-sidebar-balance {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 8px;
  gap: 2px;
}
.ahs-sb-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.ahs-sb-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.ahs-collect-btn {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s ease;
}
.ahs-collect-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.ahs-quick-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.ahs-quick-btn {
  flex: 1;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.ahs-quick-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.ahs-btn-hack { color: rgba(252,129,74,0.8) !important; border-color: rgba(252,129,74,0.2) !important; }
.ahs-btn-hack:hover { background: rgba(252,129,74,0.08) !important; }

.ahs-log { padding: 0 12px 12px; flex: 1; overflow: hidden; }
.ahs-log-title { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; opacity: 0.6; }

/* Главный экран */
#game-screen {
  background: var(--bg);
}

.ahs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.ahs-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text);
}
.ahs-level-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 12px;
}

.ahs-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.ahs-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ahs-card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Главная карточка */
.ahs-main-card {
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 24px;
}

/* Машина Эха */
.ahs-machine-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ahs-machine {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ahs-machine-core {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}
.ahs-machine-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
}
.ahs-machine-ring.ring1 { width: 60px; height: 60px; }
.ahs-machine-ring.ring2 { width: 72px; height: 72px; }
.ahs-machine-ring.ring3 { width: 84px; height: 84px; }

/* Активная машина — пульсация */
.ahs-machine-active .ahs-machine-core {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
  color: var(--text);
  box-shadow: 0 0 20px rgba(255,255,255,0.08);
}
.ahs-machine-active .ahs-machine-ring {
  animation: ahsRingPulse 2.5s ease-out infinite;
}
.ahs-machine-active .ring2 { animation-delay: 0.6s; }
.ahs-machine-active .ring3 { animation-delay: 1.2s; }

@keyframes ahsRingPulse {
  0%   { opacity: 0.4; transform: scale(0.9); }
  60%  { opacity: 0.1; transform: scale(1.1); }
  100% { opacity: 0;   transform: scale(1.2); }
}

.ahs-machine-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  opacity: 0.6;
}

/* Баланс */
.ahs-balance-block { flex: 1; }
.ahs-balance-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.ahs-balance-num {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ahs-balance-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.ahs-balance-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.ahs-backpack-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.ahs-backpack-fill {
  height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Буфер */
.ahs-buffer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ahs-buffer-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ahs-buffer-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.ahs-buffer-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.ahs-buffer-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.4));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.ahs-collect-btn-main {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.ahs-collect-btn-main:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

/* Действия */
.ahs-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ahs-action-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
}
.ahs-action-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}
.ahs-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ahs-action-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ahs-action-sub {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
}

/* Статистика */
.ahs-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.ahs-stat {
  background: var(--bg2);
  padding: 12px;
  text-align: center;
}
.ahs-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ahs-stat-key {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Лог */
.ahs-log-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.ahs-log-empty {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 16px;
  opacity: 0.5;
}
.ahs-log-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(255,255,255,0.02);
}
.ahs-log-text { flex: 1; color: var(--text-dim); }
.ahs-log-time { font-size: 10px; color: var(--text-dim); opacity: 0.5; flex-shrink: 0; }
.ahs-log-earn    .ahs-log-text { color: rgba(104,211,145,0.9); }
.ahs-log-send    .ahs-log-text { color: rgba(99,179,237,0.9); }
.ahs-log-hack-ok .ahs-log-text { color: rgba(252,129,74,0.9); }
.ahs-log-hack-fail .ahs-log-text { color: var(--danger); }
.ahs-log-shield  .ahs-log-text { color: rgba(104,211,145,0.9); }
.ahs-log-upgrade .ahs-log-text { color: rgba(183,148,246,0.9); }

/* AHS pay fee */
.ahs-pay-fee {
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 0;
}

/* Light theme */
[data-theme="light"] .ahs-machine-core { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .ahs-collect-btn { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .ahs-collect-btn-main { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .ahs-action-card { background: rgba(0,0,0,0.02); }
[data-theme="light"] .ahs-action-card:hover { background: rgba(0,0,0,0.05); }
[data-theme="light"] .ahs-log-entry { background: rgba(0,0,0,0.02); }

/* Responsive */
@media (max-width: 700px) {
  .ahs-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .ahs-stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .ahs-main-card    { flex-direction: column; align-items: flex-start; }
}
