.auth-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eee;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.auth-container h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #1a1a1a;
}

.auth-container form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-container input {
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.auth-container input:focus {
  outline: none;
  border-color: #0066FF;
  box-shadow: 0 0 0 2px rgba(0,102,255,0.15);
}

.auth-container button[type="submit"] {
  padding: 12px 24px;
  background: #0066FF;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-container button[type="submit"]:hover {
  background: #0052cc;
}

.auth-container .auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

.auth-container .auth-footer a {
  color: #0066FF;
  text-decoration: none;
}

.auth-container .auth-footer a:hover {
  text-decoration: underline;
}

.auth-container .error {
  color: #c00;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: #999;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.auth-divider span {
  padding: 0 15px;
  font-size: 14px;
}

.vk-container {
  margin: 20px 0;
  min-height: 60px;
}

.vk-alt-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #0077FF;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  font-family: inherit;
  box-sizing: border-box;
}

.vk-alt-login:hover {
  background: #0066CC;
  color: white;
}

.vk-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #333;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s;
  margin: 10px 0;
  font-family: inherit;
  box-sizing: border-box;
}

.vk-button:hover {
  background: #f5f5f5;
  border-color: #0077FF;
  color: #333;
}

.vk-button svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.vk-show-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #333;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
  font-family: inherit;
}

.vk-show-button:hover {
  background: #f5f5f5;
  border-color: #0077FF;
}

.profile-layout {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #e0e0e0;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #0066FF;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
}

.profile-diamonds {
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0066FF;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-topup-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #f0f0f0;
  color: #888;
  cursor: not-allowed;
  transition: none;
}

.profile-topup-btn:not(:disabled) {
  background: #0066FF;
  color: #fff;
  border-color: #0066FF;
  cursor: pointer;
}

.profile-topup-btn:not(:disabled):hover {
  background: #0052cc;
  border-color: #0052cc;
}

.profile-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.profile-stat {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  min-width: 100px;
}

.profile-stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0066FF;
}

.profile-stat .label {
  font-size: 0.85rem;
  color: #666;
}

.profile-stat .profile-stat-diamonds {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.25rem;
}

.profile-history h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.history-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
  background: #fafafa;
}

.history-item-images {
  display: grid;
  gap: 2px;
}

.history-item-images--1 { grid-template-columns: 1fr; }
.history-item-images--2 { grid-template-columns: repeat(2, 1fr); }
.history-item-images--3 { grid-template-columns: repeat(3, 1fr); }
.history-item-images--4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.history-item-images--5,
.history-item-images--6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }

.history-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.history-item .prompt {
  padding: 8px;
  font-size: 0.8rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-empty {
  color: #888;
  padding: 2rem;
  text-align: center;
}

.logout-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  color: #666;
}

.logout-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
  color: #1a1a1a;
}

/* ========== MOBILE ========== */
@media (max-width: 600px) {
  .auth-container {
    margin: 2rem 1rem;
    padding: 1.5rem 1.25rem;
    max-width: none;
  }
  .auth-container h1 {
    font-size: 1.35rem;
  }
  .auth-container input,
  .auth-container button[type="submit"] {
    min-height: 48px;
    padding: 14px 16px;
  }
  .profile-layout {
    padding: 1.25rem 1rem;
  }
  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding-bottom: 1.25rem;
  }
  .profile-avatar,
  .profile-avatar-placeholder {
    width: 72px;
    height: 72px;
    font-size: 1.75rem;
  }
  .profile-stats {
    gap: 1rem;
    justify-content: center;
  }
  .profile-stat {
    min-width: 80px;
    padding: 0.875rem 1rem;
  }
  .history-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .history-item .prompt {
    font-size: 0.75rem;
  }
}

@media (max-width: 380px) {
  .history-grid {
    grid-template-columns: 1fr;
  }
}
